add -fPIC option to the C compiler, required in f31
[vsys.git] / tests / vsys_launch.pl
1 #!/usr/bin/perl
2
3 # Subtest #1 Create new vsys entry
4
5 print "Creating entries...\t";
6
7 $vsys_entry="#!/bin/bash\n\ncat /etc/passwd";
8 $vsys_entry_acl = "/vservers/pl_netflow pl_netflow";
9
10 open ACL,">/vsys/test.acl" || die ("Could not create acl for test entry.");
11 print ACL $vsys_entry_acl;
12 close ACL;
13
14 open FIL,">/vsys/test" || die ("Could not create test entry.");
15 print FIL $vsys_entry;
16 close $vsys_entry;
17
18 chmod 0755,"/vsys/test";
19
20 # Check if it has shown up
21
22 (-f "/vservers/pl_netflow/test.in") || die ("in file didn't show up in the slice");
23 (-f "/vservers/pl_netflow/test.out") || die ("out file didn't show up in the slice");
24
25 # OK, SUBTEST #1 SUCCEEDED
26 print "(success)\n";
27
28 # Subtest #2 
29
30 print "Multiple-connection test...\t";
31 system("su -c ./vsys_conctest pl_netflow -");
32 ($? && die ("Multiple-connection test failed\n"));
33
34
35 # OK, SUBTEST #2 SUCCEEDED
36 print "(success)\n";
37
38 # Subtest #3
39 unlink "/vsys/test.acl";
40 unlink "/vsys/test";
41
42 (-f "/vservers/pl_netflow/test.in" || -f "/vservers/pl_netflow/test.out") && die ("cleanup failed");
43