# 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
# $ cd <path-to-nepi>
# python examples/planetlab/ping.py -s <pl-slice> -u <pl-user> -p <pl-password> -k <pl-ssh-key>
+from __future__ import print_function
from nepi.execution.ec import ExperimentController
ec = ExperimentController(exp_id = "pl_ping")
# Register a Planetlab Node with no restrictions, it can be any node
-node = ec.register_resource("PlanetlabNode")
+node = ec.register_resource("planetlab::Node")
# The username in this case is the slice name, the one to use for login in
# via ssh into PlanetLab nodes. Replace with your own slice name.
ec.set(node, "plpassword", pl_password)
# Remove previous results
-ec.set(node, "cleanHome", True)
+ec.set(node, "cleanExperiment", True)
ec.set(node, "cleanProcesses", True)
# Define a ping application
-app = ec.register_resource("LinuxApplication")
+app = ec.register_resource("linux::Application")
ec.set(app, "command", "ping -c3 nepi.inria.fr")
# Connect the application to the node
trace = ec.trace(app, "stdout")
-print "PING outout ", trace
+print("PING outout ", trace)
-# Do the experiment controller shutdown:
+# Do the experiment controller shutdown
ec.shutdown()
# END