various formatting, including mixes of tab and spaces detected in py3
[nepi.git] / test / resources / planetlab / tap.py
index 2d90707..f399007 100755 (executable)
@@ -4,9 +4,8 @@
 #    Copyright (C) 2013 INRIA
 #
 #    This program is free software: you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published by
-#    the Free Software Foundation, either version 3 of the License, or
-#    (at your option) any later version.
+#    it under the terms of the GNU General Public License version 2 as
+#    published by the Free Software Foundation;
 #
 #    This program is distributed in the hope that it will be useful,
 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -28,7 +27,7 @@ import unittest
 
 class PlanetlabTapTestCase(unittest.TestCase):
     def setUp(self):
-        self.host = "planetlab1.informatik.uni-erlangen.de"
+        self.host = "planetlab2.upc.es"
         self.user = "inria_nepi"
         self.identity = "%s/.ssh/id_rsa_planetlab" % (os.environ['HOME'])
         self.netblock = "192.168.3"
@@ -39,22 +38,21 @@ class PlanetlabTapTestCase(unittest.TestCase):
 
     @skipIfNotAlive
     def t_tap_create(self, host, user, identity):
-
-        ec = ExperimentController(exp_id = "test-tap-create")
+        ec = ExperimentController(exp_id="test-tap-create")
         
-        node = ec.register_resource("PlanetlabNode")
+        node = ec.register_resource("planetlab::Node")
         ec.set(node, "hostname", host)
         ec.set(node, "username", user)
         ec.set(node, "identity", identity)
-        ec.set(node, "cleanHome", True)
+        ec.set(node, "cleanExperiment", True)
         ec.set(node, "cleanProcesses", True)
 
-        tap = ec.register_resource("PlanetlabTap")
-        ec.set(tap, "ip4", "%s.1" % self.netblock)
-        ec.set(tap, "prefix4", 24)
+        tap = ec.register_resource("planetlab::Tap")
+        ec.set(tap, "ip", "%s.1" % self.netblock)
+        ec.set(tap, "prefix", "24")
         ec.register_connection(tap, node)
 
-        app = ec.register_resource("LinuxApplication")
+        app = ec.register_resource("linux::Application")
         cmd = "ping -c3 %s.1" % self.netblock
         ec.set(app, "command", cmd)
         ec.register_connection(app, node)
@@ -63,7 +61,7 @@ class PlanetlabTapTestCase(unittest.TestCase):
 
         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)