mirror of
https://github.com/samba-team/samba.git
synced 2025-08-26 01:49:31 +03:00
s3:tests: Reformat test_net_tdb.sh
shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
committed by
Andreas Schneider
parent
6170f97bb1
commit
4c00642e72
@ -10,10 +10,10 @@
|
||||
# Copyright (C) 2017 Christof Schmitt
|
||||
|
||||
if [ $# -lt 7 ]; then
|
||||
cat <<EOF
|
||||
cat <<EOF
|
||||
Usage: $0 SMBCLIENT SERVER SHARE USER PASS CONFIGURATION LOCALPATH LOCKDIR
|
||||
EOF
|
||||
exit 1;
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SMBCLIENT=$1
|
||||
@ -34,12 +34,12 @@ fi
|
||||
|
||||
failed=0
|
||||
|
||||
incdir=`dirname $0`/../../../testprogs/blackbox
|
||||
incdir=$(dirname $0)/../../../testprogs/blackbox
|
||||
. $incdir/subunit.sh
|
||||
|
||||
touch $LOCALPATH/$FILENAME
|
||||
|
||||
printf "open %s\n"'!sleep 10'"\n" ${FILENAME} | \
|
||||
printf "open %s\n"'!sleep 10'"\n" ${FILENAME} |
|
||||
$SMBCLIENT //$SERVER/$SHARE -U$USER%$PASS &
|
||||
SMBCLIENTPID=$!
|
||||
|
||||
@ -47,7 +47,7 @@ SMBCLIENTPID=$!
|
||||
sleep 1
|
||||
|
||||
testit "Looking for record key of open file" \
|
||||
$samba_tdbtool $LOCKDIR/locking.tdb hexkeys || \
|
||||
$samba_tdbtool $LOCKDIR/locking.tdb hexkeys ||
|
||||
failed=$(expr $failed + 1)
|
||||
|
||||
# The assumption here is that only one file is open, so only one
|
||||
@ -57,46 +57,46 @@ testit "Looking for record key of open file" \
|
||||
#[000] 01 FD 00 00 00 00 00 00 56 02 5C 00 00 00 00 00 ....... V.\....
|
||||
#[010] 00 00 00 00 00 00 00 00 .......
|
||||
# Select only the hex data, remove space and join every thing together
|
||||
key=0x$($samba_tdbtool $LOCKDIR/locking.tdb hexkeys | \
|
||||
key=0x$($samba_tdbtool $LOCKDIR/locking.tdb hexkeys |
|
||||
grep '\[' | cut -c 7-56 | sed -e 's/ //g' | tr -d '\n')
|
||||
|
||||
testit "Looking for open file in locking.tdb" \
|
||||
$BINDIR/net $CONFIGURATION tdb locking $key || \
|
||||
failed=$(expr $failed + 1)
|
||||
$BINDIR/net $CONFIGURATION tdb locking $key ||
|
||||
failed=$(expr $failed + 1)
|
||||
out=$($BINDIR/net $CONFIGURATION tdb locking $key)
|
||||
|
||||
out=$($BINDIR/net $CONFIGURATION tdb locking $key | \
|
||||
grep 'Share path: ' | sed -e 's/Share path: \+//')
|
||||
out=$($BINDIR/net $CONFIGURATION tdb locking $key |
|
||||
grep 'Share path: ' | sed -e 's/Share path: \+//')
|
||||
testit "Verify pathname in output" \
|
||||
test "$out" = "$LOCALPATH" || \
|
||||
test "$out" = "$LOCALPATH" ||
|
||||
failed=$(expr $failed + 1)
|
||||
|
||||
out=$($BINDIR/net $CONFIGURATION tdb locking $key | \
|
||||
grep 'Name:' | sed -e 's/Name: \+//')
|
||||
out=$($BINDIR/net $CONFIGURATION tdb locking $key |
|
||||
grep 'Name:' | sed -e 's/Name: \+//')
|
||||
testit "Verify filename in output" \
|
||||
test "$out" = "$FILENAME" || \
|
||||
test "$out" = "$FILENAME" ||
|
||||
failed=$(expr $failed + 1)
|
||||
|
||||
out=$($BINDIR/net $CONFIGURATION tdb locking $key | \
|
||||
grep 'Number of share modes:' | \
|
||||
sed -e 's/Number of share modes: \+//')
|
||||
out=$($BINDIR/net $CONFIGURATION tdb locking $key |
|
||||
grep 'Number of share modes:' |
|
||||
sed -e 's/Number of share modes: \+//')
|
||||
testit "Verify number of share modes in output" \
|
||||
test "$out" = "1" || \
|
||||
test "$out" = "1" ||
|
||||
failed=$(expr $failed + 1)
|
||||
|
||||
testit "Complete record dump" \
|
||||
$BINDIR/net $CONFIGURATION tdb locking $key dump || \
|
||||
$BINDIR/net $CONFIGURATION tdb locking $key dump ||
|
||||
failed=$(expr $failed + 1)
|
||||
|
||||
$BINDIR/net $CONFIGURATION tdb locking $key dump | grep -q $FILENAME
|
||||
RC=$?
|
||||
testit "Verify filename in dump output" \
|
||||
test $RC = 0 || \
|
||||
test $RC = 0 ||
|
||||
failed=$(expr $failed + 1)
|
||||
$BINDIR/net $CONFIGURATION tdb locking $key dump | grep -q $LOCALPATH
|
||||
RC=$?
|
||||
testit "Verify share path in dump output" \
|
||||
test $RC = 0 || \
|
||||
test $RC = 0 ||
|
||||
failed=$(expr $failed + 1)
|
||||
|
||||
kill $SMBCLIENTPID
|
||||
|
Reference in New Issue
Block a user