3 # NEPI, a framework to manage network experiments
4 # Copyright (C) 2013 INRIA
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 # Author: Lucia Guevgeozian <lucia.guevgeozian_odizzio@inria.fr>
21 from nepi.execution.ec import ExperimentController
26 ec = ExperimentController(exp_id)
28 #username = os.environ.get('SFA_SLICE')
29 username = 'inria_lguevgeo'
30 sfauser = os.environ.get('SFA_USER')
31 sfaPrivateKey = os.environ.get('SFA_PK')
34 node1 = ec.register_resource("PlanetlabSfaNode")
35 ec.set(node1, "hostname", 'planetlab1.cs.vu.nl')
36 ec.set(node1, "username", username)
37 ec.set(node1, "sfauser", sfauser)
38 ec.set(node1, "sfaPrivateKey", sfaPrivateKey)
39 ec.set(node1, "cleanHome", True)
40 ec.set(node1, "cleanProcesses", True)
42 node2 = ec.register_resource("PlanetlabSfaNode")
43 ec.set(node2, "hostname", 'onelab1.info.ucl.ac.be')
44 ec.set(node2, "username", username)
45 ec.set(node2, "sfauser", sfauser)
46 ec.set(node2, "sfaPrivateKey", sfaPrivateKey)
47 ec.set(node2, "cleanHome", True)
48 ec.set(node2, "cleanProcesses", True)
50 app1 = ec.register_resource("LinuxApplication")
51 command = "ping -c5 google.com"
52 ec.set(app1, "command", command)
53 ec.register_connection(app1, node1)
55 app2 = ec.register_resource("LinuxApplication")
56 command = "ping -c5 google.com"
57 ec.set(app2, "command", command)
58 ec.register_connection(app2, node2)
64 ec.wait_finished([app1, app2])