]> git.sur5r.net Git - bacula/bacula/blobdiff - regress/scripts/functions.pm
regress: Add fix for ubuntu dash that adds quotes to "set" output
[bacula/bacula] / regress / scripts / functions.pm
index dd8d7c502d05e43c4a6a7b2c02b4696c8f215527..0d7d5717a2f240be89fb777df284b5d9d5d6f26d 100644 (file)
@@ -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;
@@ -74,7 +73,7 @@ BEGIN {
     open(IN, ". ./config; set |") or die "Could not run shell: $!\n";
     while ( my $l = <IN> ) {
         chomp ($l);
-        if ($l =~ /^([\w\d]+)=(.+)/) {
+        if ($l =~ /^([\w\d]+)='?([^']+)'?/) {
             next if ($1 eq 'SHELLOPTS'); # is in read-only
             ($envar,$enval) = ($1, $2);
             $ENV{$envar} = $enval;
@@ -572,7 +571,7 @@ sub debug
 sub remote_config
 {
     open(FP, ">$REMOTE_FILE/bacula-fd.conf") or 
-        die "ERROR: Can't open $REMOTE_FILE/bacula-fd.conf $?";
+        die "ERROR: Can't open $REMOTE_FILE/bacula-fd.conf $!";
     print FP "
 Director {
   Name = $HOST-dir
@@ -622,6 +621,17 @@ Messages {
     close(FP);
     chmod 0755, "test.sh";
 
+    # 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");
+
     if ($pid) {
         system("ps $pid");
         $estat = ($? != 0);