git://git.onelab.eu
/
nepi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Changed the endpoint_ip and endpoint_prefix attributes of TAP/TUN endpoints for ip...
[nepi.git]
/
test
/
resources
/
linux
/
tun.py
diff --git
a/test/resources/linux/tun.py
b/test/resources/linux/tun.py
index
5a02be7
..
8164db3
100755
(executable)
--- a/
test/resources/linux/tun.py
+++ b/
test/resources/linux/tun.py
@@
-34,23
+34,26
@@
class LinuxTunTestCase(unittest.TestCase):
self.netblock = "192.168.1"
@skipIfNotAlive
self.netblock = "192.168.1"
@skipIfNotAlive
- def t_tun_create(self, host, user
, identity
):
+ def t_tun_create(self, host, user
=None, identity=None
):
- ec = ExperimentController(exp_id
=
"test-tun-create")
+ ec = ExperimentController(exp_id
=
"test-tun-create")
- node = ec.register_resource("
Linux
Node")
+ node = ec.register_resource("
linux::
Node")
ec.set(node, "hostname", host)
ec.set(node, "hostname", host)
- ec.set(node, "username", user)
- ec.set(node, "identity", identity)
- ec.set(node, "cleanHome", True)
+
+ if host != "localhost":
+ ec.set(node, "username", user)
+ ec.set(node, "identity", identity)
+
+ ec.set(node, "cleanExperiment", True)
ec.set(node, "cleanProcesses", True)
ec.set(node, "cleanProcesses", True)
- tun = ec.register_resource("
Linux
Tun")
- ec.set(tun, "ip
4
", "%s.1" % self.netblock)
- ec.set(tun, "prefix
4", 24
)
+ tun = ec.register_resource("
linux::
Tun")
+ ec.set(tun, "ip", "%s.1" % self.netblock)
+ ec.set(tun, "prefix
", "24"
)
ec.register_connection(tun, node)
ec.register_connection(tun, node)
- app = ec.register_resource("
Linux
Application")
+ app = ec.register_resource("
linux::
Application")
cmd = "ping -c3 %s.1" % self.netblock
ec.set(app, "command", cmd)
ec.register_connection(app, node)
cmd = "ping -c3 %s.1" % self.netblock
ec.set(app, "command", cmd)
ec.register_connection(app, node)
@@
-59,7
+62,7
@@
class LinuxTunTestCase(unittest.TestCase):
ec.wait_finished(app)
ec.wait_finished(app)
- ping = ec.trace(app,
'stdout'
)
+ ping = ec.trace(app,
"stdout"
)
expected = """3 packets transmitted, 3 received, 0% packet loss"""
self.assertTrue(ping.find(expected) > -1)
expected = """3 packets transmitted, 3 received, 0% packet loss"""
self.assertTrue(ping.find(expected) > -1)
@@
-71,6
+74,10
@@
class LinuxTunTestCase(unittest.TestCase):
def test_tun_create(self):
self.t_tun_create(self.host, self.user, self.identity)
def test_tun_create(self):
self.t_tun_create(self.host, self.user, self.identity)
+ def test_tun_create_local(self):
+ self.t_tun_create("localhost")
+
+
if __name__ == '__main__':
unittest.main()
if __name__ == '__main__':
unittest.main()