From 26e9194e3a3ff9b065fec43ad5f3b63187eb533b Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 26 Jun 2008 10:56:59 +0200 Subject: Move blackbox tests closer to what they're testing. (This used to be commit c9b2e2aa861ccc01e5d92cfe468be1f6324ed294) --- source4/client/tests/test_cifsdd.sh | 73 +++++++++++++ source4/client/tests/test_smbclient.sh | 166 +++++++++++++++++++++++++++++ source4/nsswitch/tests/test_wbinfo.sh | 187 +++++++++++++++++++++++++++++++++ source4/selftest/samba4_tests.sh | 8 +- testprogs/blackbox/test_cifsdd.sh | 73 ------------- testprogs/blackbox/test_smbclient.sh | 166 ----------------------------- testprogs/blackbox/test_wbinfo.sh | 187 --------------------------------- 7 files changed, 430 insertions(+), 430 deletions(-) create mode 100755 source4/client/tests/test_cifsdd.sh create mode 100755 source4/client/tests/test_smbclient.sh create mode 100755 source4/nsswitch/tests/test_wbinfo.sh delete mode 100755 testprogs/blackbox/test_cifsdd.sh delete mode 100755 testprogs/blackbox/test_smbclient.sh delete mode 100755 testprogs/blackbox/test_wbinfo.sh diff --git a/source4/client/tests/test_cifsdd.sh b/source4/client/tests/test_cifsdd.sh new file mode 100755 index 00000000000..08bfb25e808 --- /dev/null +++ b/source4/client/tests/test_cifsdd.sh @@ -0,0 +1,73 @@ +#!/bin/sh + +# Basic script to make sure that cifsdd can do both local and remote I/O. + +if [ $# -lt 4 ]; then +cat < /dev/null + +ls -l $sourcepath + +for bs in 512 4k 48k ; do + +echo "Testing $bs block size ..." + +# Check whether we can do local IO +runcopy "Testing local -> local copy" if=$sourcepath of=$destpath bs=$bs +compare "Checking local differences" $sourcepath $destpath + +# Check whether we can do a round trip +runcopy "Testing local -> remote copy" \ + if=$sourcepath of=//$SERVER/$SHARE/$sourcepath bs=$bs +runcopy "Testing remote -> local copy" \ + if=//$SERVER/$SHARE/$sourcepath of=$destpath bs=$bs +compare "Checking differences" $sourcepath $destpath + +# Check that copying within the remote server works +runcopy "Testing local -> remote copy" \ + if=//$SERVER/$SHARE/$sourcepath of=//$SERVER/$SHARE/$sourcepath bs=$bs +runcopy "Testing remote -> remote copy" \ + if=//$SERVER/$SHARE/$sourcepath of=//$SERVER/$SHARE/$destpath bs=$bs +runcopy "Testing remote -> local copy" \ + if=//$SERVER/$SHARE/$destpath of=$destpath bs=$bs +compare "Checking differences" $sourcepath $destpath + +done + +rm -f $sourcepath $destpath + +exit $failed diff --git a/source4/client/tests/test_smbclient.sh b/source4/client/tests/test_smbclient.sh new file mode 100755 index 00000000000..27a3488c88a --- /dev/null +++ b/source4/client/tests/test_smbclient.sh @@ -0,0 +1,166 @@ +#!/bin/sh +# Blackbox tests for smbclient +# Copyright (C) 2006-2007 Jelmer Vernooij +# Copyright (C) 2006-2007 Andrew Bartlett + +if [ $# -lt 5 ]; then +cat <tmpfile< tmpauthfile + +testit "Test login with --authentication-file" $VALGRIND $smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp --authentication-file=tmpauthfile || failed=`expr $failed + 1` + +PASSWD_FILE="tmppassfile" +echo "$PASSWORD" > $PASSWD_FILE +export PASSWD_FILE +testit "Test login with PASSWD_FILE" $VALGRIND $smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp -W "$DOMAIN" -U"$USERNAME" || failed=`expr $failed + 1` +PASSWD_FILE="" +export PASSWD_FILE +unset PASSWD_FILE + +PASSWD="$PASSWORD" +export PASSWD +testit "Test login with PASSWD" $VALGRIND $smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp -W "$DOMAIN" -U"$USERNAME" || failed=`expr $failed + 1` + +oldUSER=$USER +USER="$USERNAME" +export USER +testit "Test login with USER and PASSWD" $VALGRIND $smbclient -k no -c 'ls' $CONFIGURATION //$SERVER/tmp -W "$DOMAIN" || failed=`expr $failed + 1` +PASSWD= +export PASSWD +unset PASSWD +USER=$oldUSER +export USER + +rm -f tmpfile tmpfile-old tmpfilex tmpauthfile tmppassfile +exit $failed diff --git a/source4/nsswitch/tests/test_wbinfo.sh b/source4/nsswitch/tests/test_wbinfo.sh new file mode 100755 index 00000000000..dfd633b656c --- /dev/null +++ b/source4/nsswitch/tests/test_wbinfo.sh @@ -0,0 +1,187 @@ +#!/bin/sh +# Blackbox test for wbinfo +if [ $# -lt 4 ]; then +cat < /dev/null - -ls -l $sourcepath - -for bs in 512 4k 48k ; do - -echo "Testing $bs block size ..." - -# Check whether we can do local IO -runcopy "Testing local -> local copy" if=$sourcepath of=$destpath bs=$bs -compare "Checking local differences" $sourcepath $destpath - -# Check whether we can do a round trip -runcopy "Testing local -> remote copy" \ - if=$sourcepath of=//$SERVER/$SHARE/$sourcepath bs=$bs -runcopy "Testing remote -> local copy" \ - if=//$SERVER/$SHARE/$sourcepath of=$destpath bs=$bs -compare "Checking differences" $sourcepath $destpath - -# Check that copying within the remote server works -runcopy "Testing local -> remote copy" \ - if=//$SERVER/$SHARE/$sourcepath of=//$SERVER/$SHARE/$sourcepath bs=$bs -runcopy "Testing remote -> remote copy" \ - if=//$SERVER/$SHARE/$sourcepath of=//$SERVER/$SHARE/$destpath bs=$bs -runcopy "Testing remote -> local copy" \ - if=//$SERVER/$SHARE/$destpath of=$destpath bs=$bs -compare "Checking differences" $sourcepath $destpath - -done - -rm -f $sourcepath $destpath - -exit $failed diff --git a/testprogs/blackbox/test_smbclient.sh b/testprogs/blackbox/test_smbclient.sh deleted file mode 100755 index d2c5c675e2e..00000000000 --- a/testprogs/blackbox/test_smbclient.sh +++ /dev/null @@ -1,166 +0,0 @@ -#!/bin/sh -# Blackbox tests for smbclient -# Copyright (C) 2006-2007 Jelmer Vernooij -# Copyright (C) 2006-2007 Andrew Bartlett - -if [ $# -lt 5 ]; then -cat <tmpfile< tmpauthfile - -testit "Test login with --authentication-file" $VALGRIND $smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp --authentication-file=tmpauthfile || failed=`expr $failed + 1` - -PASSWD_FILE="tmppassfile" -echo "$PASSWORD" > $PASSWD_FILE -export PASSWD_FILE -testit "Test login with PASSWD_FILE" $VALGRIND $smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp -W "$DOMAIN" -U"$USERNAME" || failed=`expr $failed + 1` -PASSWD_FILE="" -export PASSWD_FILE -unset PASSWD_FILE - -PASSWD="$PASSWORD" -export PASSWD -testit "Test login with PASSWD" $VALGRIND $smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp -W "$DOMAIN" -U"$USERNAME" || failed=`expr $failed + 1` - -oldUSER=$USER -USER="$USERNAME" -export USER -testit "Test login with USER and PASSWD" $VALGRIND $smbclient -k no -c 'ls' $CONFIGURATION //$SERVER/tmp -W "$DOMAIN" || failed=`expr $failed + 1` -PASSWD= -export PASSWD -unset PASSWD -USER=$oldUSER -export USER - -rm -f tmpfile tmpfile-old tmpfilex tmpauthfile tmppassfile -exit $failed diff --git a/testprogs/blackbox/test_wbinfo.sh b/testprogs/blackbox/test_wbinfo.sh deleted file mode 100755 index ec8b9ebd443..00000000000 --- a/testprogs/blackbox/test_wbinfo.sh +++ /dev/null @@ -1,187 +0,0 @@ -#!/bin/sh -# Blackbox test for wbinfo -if [ $# -lt 4 ]; then -cat <