From 45d693e103f6ee9dbd89342182502777623dfc9c Mon Sep 17 00:00:00 2001 From: Sapan Bhatia Date: Fri, 23 Jan 2009 15:42:39 +0000 Subject: [PATCH] Fixed planetflow test for Thierry's test environment. --- qaapi/qa/tests/node/pf2test.pl | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/qaapi/qa/tests/node/pf2test.pl b/qaapi/qa/tests/node/pf2test.pl index 4a8df91..ae992dd 100755 --- a/qaapi/qa/tests/node/pf2test.pl +++ b/qaapi/qa/tests/node/pf2test.pl @@ -1,13 +1,16 @@ #!/usr/bin/perl +$netflow_slice="ple_netflow"; + print "Warning! This test runs only once. I.e., it will usually not run twice in succession till syslog sees some new activitt\n"; print "Preparing..."; + system("cp /var/log/messages /tmp/pf2_test"); # ping magic IP address print "Sending out packet...\n"; -system("su -c \"ping -c 1 64.34.177.39\" pl_netflow -"); # hm. Sapan doesn't own this IP anymore. We should change it at some point. +system("su -c \"ping -I eth0 -c 1 10.0.0.8\" $netflow_slice -"); print "Waiting for flow to appear...\n"; sleep(10); @@ -17,12 +20,19 @@ open PIP,"|/usr/bin/diff -u /tmp/pf2_test /var/log/messages"; while () { if (/Received test flow to corewars.org from slice ([0-9]+)/) { $xid = int($1); - print "Slice id: $xid"; + print "Slice id: $xid\n"; + $success=1; ($xid==0 || $xid==-1) && die("Slice id incorrect"); } } -close PIP; +if ($success) { + print "[SUCCESS]"; +} +else { + print "[FAILED]"; +} + -print "Test successful."; +close PIP; -- 2.43.0