summaryrefslogtreecommitdiffstats
path: root/debian/tests/cifs-share-access-uring
blob: fb4b9c5925d76e0afdda13909041fa6bb5fa6ac4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh

set -x
set -e

. debian/tests/util

ensure_uring_available

username="smbtest$$"
password="$$"
add_user "${username}" "${password}"

myshare="myshare$$"
add_share "${myshare}" io_uring

echo "Creating file with random data and computing its md5"
populate_share "${myshare}" "${username}"

echo "Mounting //localhost/${myshare} via CIFS"
temp_mount=$(mktemp -d)
mount -t cifs //localhost/"${myshare}" "$temp_mount" -o user="${username}",username="${username}",password="${password}"

echo "Verifying MD5 via cifs"
cd "$temp_mount"
md5sum -c data.md5
result=$?
cd -
umount "$temp_mount"
rmdir "$temp_mount"
exit "$result"