Whamcloud - gitweb
wait queue primitives implementation using pthread API
[fs/lustre-release.git] / libsysio / tests / test_all.pl
index 25586ba..b5f7b86 100755 (executable)
@@ -40,7 +40,7 @@ my $home = $ENV{"HOME"};
 my $auto_mount = $ENV{"SYSIO_AUTOMOUNT"};
 my $root_flags = "0";
 my $extras = "";
-if ((defined($auto_mount)) && ($auto_mount == "xyes")) {
+if ((defined($auto_mount)) && ($auto_mount eq "xyes")) {
        $root_flags = "2";
 
        #
@@ -62,14 +62,26 @@ $ENV{$namespace_env} = "\
        {creat, ft=chr,nm=\"/dev/stderr\",pm=0200,mm=0+2} \
        {creat, ft=dir,nm=\"/dev/fd\",pm=0755,ow=0,gr=0} \
        {creat, ft=chr,nm=\"/dev/fd/0\",pm=0400,mm=0+0} \
+       {open,  nm=\"/dev/fd/0\",fd=0,m=0} \
        {creat, ft=chr,nm=\"/dev/fd/1\",pm=0200,mm=0+1} \
+       {open,  nm=\"/dev/fd/1\",fd=1,m=1} \
        {creat, ft=chr,nm=\"/dev/fd/2\",pm=0200,mm=0+2} \
+       {open,  nm=\"/dev/fd/2\",fd=2,m=1} \
        {cd,    dir=\"$home\"} \
        $extras ";
 
 my $res;
 
 if ($use_system == 1) {
+       # Test for tmp_dir.  If it exists, fail 
+       # The tmp_dir should be removed after a successful
+       # test run, but is kept if anything fails
+       if (-e "$cwd/tmp_dir") {
+               print STDERR "ERROR! tmp_dir already exists.\n";
+               print STDERR "Need to remove tmp_dir for test to run properly\n";
+               exit 1;
+       } 
+
   # Will use this directory...
   system("mkdir -p $cwd/tmp_dir");