1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

added a blackbox test for masktest

This commit is contained in:
Andrew Tridgell 2008-02-15 15:33:10 +11:00
parent c37133fd95
commit 05a110123d
3 changed files with 52 additions and 5 deletions

View File

@ -254,6 +254,7 @@ plantest "blackbox.cifsdd" dc $bbdir/test_cifsdd.sh "\$SERVER" "\$USERNAME" "\$P
plantest "blackbox.nmblookup" dc $samba4srcdir/utils/tests/test_nmblookup.sh "\$NETBIOSNAME" "\$NETBIOSALIAS" "\$SERVER" "\$SERVER_IP"
plantest "blackbox.nmblookup" member $samba4srcdir/utils/tests/test_nmblookup.sh "\$NETBIOSNAME" "\$NETBIOSALIAS" "\$SERVER" "\$SERVER_IP"
plantest "blackbox.locktest" dc $bbdir/test_locktest.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$DOMAIN" "$PREFIX"
plantest "blackbox.masktest" dc $bbdir/test_masktest.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$DOMAIN" "$PREFIX"
# Tests using the "Simple" NTVFS backend

View File

@ -396,7 +396,7 @@ static int retest(struct smbcli_state *cli[NSERVERS][NCONNECTIONS],
we then do random locking ops in tamdem on the 4 fnums from each
server and ensure that the results match
*/
static void test_locks(struct loadparm_context *lp_ctx, char *share[NSERVERS])
static int test_locks(struct loadparm_context *lp_ctx, char *share[NSERVERS])
{
struct smbcli_state *cli[NSERVERS][NCONNECTIONS];
int fnum[NSERVERS][NCONNECTIONS][NFILES];
@ -451,7 +451,12 @@ static void test_locks(struct loadparm_context *lp_ctx, char *share[NSERVERS])
open_files(cli, fnum);
n = retest(cli, fnum, numops);
if (n == numops || !analyze) return;
if (n == numops || !analyze) {
if (n != numops) {
return 1;
}
return 0;
}
n++;
skip = n/2;
@ -517,6 +522,8 @@ static void test_locks(struct loadparm_context *lp_ctx, char *share[NSERVERS])
(double)recorded[i].len,
recorded[i].needed);
}
return 1;
}
@ -632,8 +639,6 @@ _NORETURN_ static void usage(poptContext pc)
seed, lock_base, lock_range, min_length));
srandom(seed);
test_locks(lp_ctx, share);
return(0);
return test_locks(lp_ctx, share);
}

View File

@ -0,0 +1,41 @@
#!/bin/sh
# Blackbox tests for masktest
# Copyright (C) 2008 Andrew Tridgell
# based on test_smbclient.sh
if [ $# -lt 5 ]; then
cat <<EOF
Usage: test_masktest.sh SERVER USERNAME PASSWORD DOMAIN PREFIX
EOF
exit 1;
fi
SERVER=$1
USERNAME=$2
PASSWORD=$3
DOMAIN=$4
PREFIX=$5
shift 5
failed=0
samba4bindir=`dirname $0`/../../source/bin
masktest=$samba4bindir/masktest
testit() {
name="$1"
shift
cmdline="$*"
echo "test: $name"
$cmdline
status=$?
if [ x$status = x0 ]; then
echo "success: $name"
else
echo "failure: $name"
fi
return $status
}
testit "masktest" $VALGRIND $masktest //$SERVER/tmp --num-ops=200 --dieonerror -W "$DOMAIN" -U"$USERNAME%$PASSWORD" $@ || failed=`expr $failed + 1`
exit $failed