3 $netflow_slice="pl_netflow";
5 print "Warning! This test runs only once. I.e., it will usually not run twice in succession till syslog sees some new activitt\n";
9 system("cp /var/log/messages /tmp/pf2_test");
12 # Wait for pl_netflow to come up
16 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;}
19 # ping magic IP address
20 print "Sending out packet...\n";
21 system("su -c \"ping -I eth0 -c 1 10.0.0.8\" $netflow_slice -");
23 print "Waiting for flow to appear...\n";
26 open PIP,"|/usr/bin/diff -u /tmp/pf2_test /var/log/messages";
29 if (/Received test flow to corewars.org from slice ([0-9]+)/) {
31 print "Slice id: $xid\n";
33 ($xid==0 || $xid==-1) && die("Slice id incorrect");
45 die("[FAILED] Timed out.. pl_netflow didn't come up for 10 minutes...\n");