]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
testprogs:blackbox: create temporary files under $PREFIX/SELFTEST_TMPDIR
authorStefan Metzmacher <metze@samba.org>
Sun, 22 Nov 2020 19:20:56 +0000 (20:20 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 13 Apr 2021 08:23:35 +0000 (08:23 +0000)
Tests should not create files in the build nor the source directory!

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
testprogs/blackbox/test_pdbtest.sh
testprogs/blackbox/test_pkinit_pac_heimdal.sh

index 95e3493c7e74fe6ed3bcb0769b8774af47aea3c7..28bb02b4d1eb8aa742a17efa5d5c955ff4ba9c10 100755 (executable)
@@ -63,14 +63,14 @@ testit "pdbtest" $VALGRIND $BINDIR/pdbtest -u $USER $@ || failed=`expr $failed +
 NEWUSERPASS=testPaSS@01%
 
 echo "set password with pdbedit"
-cat > ./tmpsmbpasswdscript <<EOF
+cat > $PREFIX/tmpsmbpasswdscript <<EOF
 expect new password:
 send ${NEWUSERPASS}\n
 expect retype new password:
 send ${NEWUSERPASS}\n
 EOF
 
-testit "create user with pdbedit" $texpect ./tmpsmbpasswdscript $VALGRIND $pdbedit -s $SMB_CONF -a $USER --account-desc="pdbedit-test-user" $@ || failed=`expr $failed + 1`
+testit "create user with pdbedit" $texpect $PREFIX/tmpsmbpasswdscript $VALGRIND $pdbedit -s $SMB_CONF -a $USER --account-desc="pdbedit-test-user" $@ || failed=`expr $failed + 1`
 USERPASS=$NEWUSERPASS
 
 test_smbclient "Test login with user (ntlm)" 'ls' "$unc"  -U$USER%$NEWUSERPASS $@ || failed=`expr $failed + 1`
@@ -114,6 +114,6 @@ test_smbclient "Test login with new password (from hash)" 'ls' "$unc"  -U$USER%$
 
 testit "del user"  $VALGRIND $pdbedit -s $SMB_CONF -x $USER $@ || failed=`expr $failed + 1`
 
-rm ./tmpsmbpasswdscript
+rm $PREFIX/tmpsmbpasswdscript
 
 exit $failed
index 5f6947422ab79757341dab40e81ea7a352c96309..122053983658661952c95b62c13950248432dd1b 100755 (executable)
@@ -26,7 +26,7 @@ if test -x $BINDIR/samba4kinit; then
        samba4kinit=$BINDIR/samba4kinit
 fi
 
-smbtorture4="$samba4bindir/smbtorture"
+smbtorture4="$samba4bindir/smbtorture --basedir=$SELFTEST_TMPDIR"
 
 . `dirname $0`/subunit.sh
 . `dirname $0`/common_test_fns.inc