Commit c461a0b6 authored by Martín Ferrari's avatar Martín Ferrari

Some improvements to the sample script.

parent 35577d04
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
# vim:ts=4:sw=4:et:ai:sts=4 # vim:ts=4:sw=4:et:ai:sts=4
import os, nemu, subprocess, time import os, nemu, subprocess, time
# Uncomment for verbose operation.
#nemu.environ.set_log_level(nemu.environ.LOG_DEBUG)
xterm = nemu.environ.find_bin("xterm") xterm = nemu.environ.find_bin("xterm")
X = "DISPLAY" in os.environ and xterm X = "DISPLAY" in os.environ and xterm
...@@ -54,7 +57,9 @@ ret = app1.wait() ...@@ -54,7 +57,9 @@ ret = app1.wait()
assert ret == 0 assert ret == 0
print "Connectivity IPv4 OK!" print "Connectivity IPv4 OK!"
# Some nice visual demo.
if X: if X:
print "Running ping and tcpdump in different nodes."
app1 = node1.Popen("%s -geometry -0+0 -e %s -ni %s" % app1 = node1.Popen("%s -geometry -0+0 -e %s -ni %s" %
(xterm, nemu.environ.TCPDUMP_PATH, if1b.name), shell = True) (xterm, nemu.environ.TCPDUMP_PATH, if1b.name), shell = True)
time.sleep(3) time.sleep(3)
...@@ -64,9 +69,9 @@ if X: ...@@ -64,9 +69,9 @@ if X:
app1.signal() app1.signal()
app1.wait() app1.wait()
# Now test the network conditions print "Running network conditions test."
# When using a args list, the shell is not needed # When using a args list, the shell is not needed
app2 = node2.Popen(["ping", "-q", "-c100000", "-f", "10.0.1.2"], app2 = node0.Popen(["ping", "-q", "-c1000", "-f", "10.0.1.2"],
stdout = subprocess.PIPE) stdout = subprocess.PIPE)
out, err = app2.communicate() out, err = app2.communicate()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment