From 2af59463544591a409a5cf16f26dcd69adfd9f32 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Mon, 28 Feb 2011 16:53:43 +0100 Subject: [PATCH] regress: more work on remote-fd test --- regress/scripts/functions.pm | 5 ++++- regress/tests/remote-fd-test | 23 ++++++++++++++++------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/regress/scripts/functions.pm b/regress/scripts/functions.pm index 28e01215ef..a9774a5af1 100644 --- a/regress/scripts/functions.pm +++ b/regress/scripts/functions.pm @@ -33,7 +33,6 @@ use strict; =cut package scripts::functions; -use File::Copy; # Export all functions needed to be used by a simple # perl -Mscripts::functions -e '' script use Exporter; @@ -625,6 +624,10 @@ Messages { # create a hardlink link("test.sh", "link-test.sh"); + # create long filename + mkdir("b" x 255) or print "can't create long dir $!\n"; + copy("test.sh", ("b" x 255) . '/' . ("a" x 255)) or print "can't create long dir $!\n"; + # play with some symlinks symlink("test.sh", "sym-test.sh"); symlink("$REMOTE_FILE/save/test.sh", "sym-abs-test.sh"); diff --git a/regress/tests/remote-fd-test b/regress/tests/remote-fd-test index 31b3033431..f99703c59a 100755 --- a/regress/tests/remote-fd-test +++ b/regress/tests/remote-fd-test @@ -40,18 +40,19 @@ fi $bperl -e remote_stop $bperl -e remote_init $bperl -e remote_config - -$bperl -e "add_attribute('$conf/bacula-dir.conf', 'clientrunbeforejob', '$REMOTE_FILE/save/test.sh', 'Job', 'CompressedTest')" -$bperl -e "add_attribute('$conf/bacula-dir.conf', 'accurate', 'yes', 'Job', 'AccurateTest')" -$bperl -e "add_attribute('$conf/bacula-dir.conf', 'address', '$REMOTE_ADDR', 'Client')" -$bperl -e "add_attribute('$conf/bacula-dir.conf', 'password', '$REMOTE_PASSWORD', 'Client')" -$bperl -e "add_attribute('$conf/bacula-dir.conf', 'address', '$REMOTE_STORE_ADDR', 'Storage')" +cfg=$conf/bacula-dir.conf +$bperl -e "add_attribute('$cfg', 'clientrunbeforejob', '$REMOTE_FILE/save/test.sh', 'Job', 'CompressedTest')" +$bperl -e "add_attribute('$cfg', 'accurate', 'yes', 'Job', 'AccurateTest')" +$bperl -e "add_attribute('$cfg', 'address', '$REMOTE_ADDR', 'Client')" +$bperl -e "add_attribute('$cfg', 'password', '$REMOTE_PASSWORD', 'Client')" +$bperl -e "add_attribute('$cfg', 'address', '$REMOTE_STORE_ADDR', 'Storage')" cat <${cwd}/tmp/bconcmds @output messages -@$out ${cwd}/tmp/log1.out +@$out ${cwd}/tmp/log4.out status client +@$out ${cwd}/tmp/log1.out label storage=File volume=TestVolume001 run job=$JobName storage=File yes wait @@ -91,6 +92,14 @@ stop_bacula check_two_logs +version=`$bin/bacula-dir -? | awk '/Version:/ { print $2 }'` +version_fd=`awk '/Version:/ { print $3 }' $tmp/log4.out` + +if [ "$version" != "$version_fd" ]; then + print_debug "ERROR: client version doesn't match $version ($version_fd)" + estat=1 +fi + grep 'this is a script' $tmp/log3.out > /dev/null if [ $? != 0 ]; then print_debug "ERROR: Can't find runscript output" -- 2.39.5