From: Sapan Bhatia Date: Fri, 14 Mar 2008 19:14:27 +0000 (+0000) Subject: vsys tests to send to Tony X-Git-Tag: vsys-0.7-4~14 X-Git-Url: http://git.onelab.eu/?p=vsys.git;a=commitdiff_plain;h=4c43898dcff829ec4790e62bc1f2af5c97ffadda vsys tests to send to Tony --- diff --git a/tests/runtest.pl b/tests/runtest.pl new file mode 100644 index 0000000..a9dade8 --- /dev/null +++ b/tests/runtest.pl @@ -0,0 +1,41 @@ +#!/usr/bin/perl + +# Subtest #1 Create new vsys entry + +print "Creating entries...\t"; + +$vsys_entry="#!/bin/bash\n\ncat /etc/passwd"; +$vsys_entry_acl = "/vservers/pl_netflow pl_netflow"; + +open ACL,">/vsys/test.acl" || die ("Could not create acl for test entry."); +print ACL $vsys_entry_acl; +close ACL; + +open FIL,">/vsys/test" || die ("Could not create test entry."); +print FIL $vsys_entry; +close $vsys_entry; + +# Check if it has shown up + +(-f "/vservers/pl_netflow/test.in") || die ("in file didn't show up in the slice"); +(-f "/vservers/pl_netflow/test.out") || die ("out file didn't show up in the slice"); + +# OK, SUBTEST #1 SUCCEEDED +print "(success)\n"; + +# Subtest #2 + +print "Multiple-connection test...\t"; +system("su -c ./conctest pl_netflow -"); +($? && die ("Multiple-connection test failed\n")); + + +# OK, SUBTEST #2 SUCCEEDED +print "(success)\n"; + +# Subtest #3 +unlink "/vsys/test.acl"; +unlink "/vsys/test"; + +(-f "/vservers/pl_netflow/test.in" || -f "/vservers/pl_netflow/test.out") && die ("cleanup failed"); + diff --git a/tests/vsys-test.txt b/tests/vsys-test.txt new file mode 100644 index 0000000..4ea9933 --- /dev/null +++ b/tests/vsys-test.txt @@ -0,0 +1,14 @@ +Description: + +Subtest #1 - + +Create a new vsys entry, expect it to show up in a slice + +Subtest #2 - + +Run subtest #2 100 times and expect each execution to run. + +Subtest #3 - + +Clean up the entry and expect it to disappear from within the slice. +