Author: brad Date: 2006-06-24 23:54:07 +0000 (Sat, 24 Jun 2006) New Revision: 16509
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=16509 Log: Scripts to test the copy_file function. These scripts connect over telnet to a windows host defined in wintest.conf, copy a file, and disconnect from the telnet session. Added: branches/SOC/bnh/expect/test_copy.exp branches/SOC/bnh/expect/test_copy.sh Changeset: Added: branches/SOC/bnh/expect/test_copy.exp =================================================================== --- branches/SOC/bnh/expect/test_copy.exp 2006-06-24 23:51:08 UTC (rev 16508) +++ branches/SOC/bnh/expect/test_copy.exp 2006-06-24 23:54:07 UTC (rev 16509) @@ -0,0 +1,38 @@ +# An expect script to test connecting to a windows host over telnet, +# copying a previously existing text file, +# and closing the telnet session. + +# Read parameters. +set remote_host $env(SMBTORTURE_REMOTE_HOST) +set remote_prompt $env(SMBTORTURE_REMOTE_PROMPT) +set username $env(SMBTORTURE_USERNAME) +set password $env(SMBTORTURE_PASSWORD) +set timeout $env(SMBTORTURE_EXPECT_TIMEOUT) +set local_filename $env(LOCAL_FILENAME) +set remote_filename $env(REMOTE_FILENAME) + +set err_val [spawn $env(SHELL)] +if {$err_val == 0} { + puts stderr "Expect failed while spawning a shell process." + exit $err_val +} + +# Connect to telnet. +set err_str [telnet_login $remote_prompt $remote_host $username $password] +if {$err_str != "OK"} { + puts stderr "\nFunction telnet_login failed during test setup." + puts stderr "Error was: $err_str." + exit 1 +} + +# Copy ./testfile. +set err_str [copy_file $remote_prompt $local_filename $remote_filename] +if {$err_str != "OK"} { + puts stderr "\nFunction copy_file failed." + puts stderr "Error was: $err_str." + exit 1 +} + +# Disconnect from telnet. +send "exit\r" +exit 0 Added: branches/SOC/bnh/expect/test_copy.sh =================================================================== --- branches/SOC/bnh/expect/test_copy.sh 2006-06-24 23:51:08 UTC (rev 16508) +++ branches/SOC/bnh/expect/test_copy.sh 2006-06-24 23:54:07 UTC (rev 16509) @@ -0,0 +1,19 @@ +#!/bin/sh + +# A shell script to test connecting to a windows host over telnet, +# copying a previously existing text file, +# and closing the telnet session. + +. wintest.conf + +export LOCAL_FILENAME="tmp.txt" +export REMOTE_FILENAME="c:\tmp.txt" + +cat common.exp > ./copy.exp +cat test_copy.exp >> ./copy.exp +expect ./copy.exp +err_rtn=$? +rm -f ./copy.exp + +echo "Returned: $err_rtn" +exit $err_rtn Property changes on: branches/SOC/bnh/expect/test_copy.sh ___________________________________________________________________ Name: svn:executable + *