=cut
package scripts::functions;
-use File::Copy;
# Export all functions needed to be used by a simple
# perl -Mscripts::functions -e '' script
use Exporter;
# 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");
$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 <<END_OF_DATA >${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
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"