8 print "Setting prefix = $prefix\n";
11 # Setting temporarily for Thierry's test environment
17 until ((-f "/var/run/vservers/pl_netflow" && -d "/home/pl_netflow") || ($timeout==0)) {sleep (15);print "Waiting for pl_netflow to show up...\n";$timeout-=15;}
20 die ("Timed out waiting for pl_netflow to appear\n");
23 my $slice="$prefix"."_netflow";
24 my $slicedir="/vservers/$slice";
26 # Subtest #1 Create new vsys entry
27 print "Creating entries...\t";
29 my $vsys_entry="#!/bin/bash\n\ncat /etc/passwd";
30 my $vsys_entry_acl = "$slice";
32 open ACL,">/vsys/test.acl" || die ("Could not create acl for test entry.");
33 print ACL $vsys_entry_acl;
36 open FIL,">/vsys/test" || die ("Could not create test entry.");
37 print FIL $vsys_entry;
40 chmod 0755,"/vsys/test";
42 # Check if it has shown up
45 (-p "/vservers/$slice/vsys/test.in") || die ("in file didn't show up in the slice");
46 (-p "/vservers/$slice/vsys/test.out") || die ("out file didn't show up in the slice");
48 # OK, SUBTEST #1 SUCCEEDED
49 print "[SUCCESS] The new entried appeared OK\n";
53 print "Multiple-connection test...\t";
54 mkdir ("/vservers/$slice/support");
55 system("cp vsys_conctest /vservers/$slice/support");
56 system("su -c '/support/vsys_conctest $slice' $slice -");
57 ($? && die ("[FAILED] Multiple-connection test failed\n"));
60 # OK, SUBTEST #2 SUCCEEDED
64 unlink "/vsys/test.acl";
67 (-f "$slicedir/test.in" || -f "$slicedir/test.out") && die ("cleanup failed");