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: Alina Quereilhac <alina.quereilhac@inria.fr>
21 from nepi.execution.ec import ExperimentController
22 from test_utils import skipIfNotAlive, skipInteractive
29 class LinuxNPingTestCase(unittest.TestCase):
31 self.fedora_host = "nepi2.pl.sophia.inria.fr"
32 self.fedora_user = "inria_nepi"
34 self.ubuntu_host = "roseval.pl.sophia.inria.fr"
35 self.ubuntu_user = "alina"
37 self.target = "nepi5.pl.sophia.inria.fr"
40 def t_nping(self, host, user):
42 ec = ExperimentController(exp_id = "test-nping")
44 node = ec.register_resource("LinuxNode")
45 ec.set(node, "hostname", host)
46 ec.set(node, "username", user)
47 ec.set(node, "cleanHome", True)
48 ec.set(node, "cleanProcesses", True)
50 app = ec.register_resource("LinuxNPing")
52 ec.set(app, "tcp", True)
54 ec.set(app, "target", self.target)
55 ec.register_connection(app, node)
61 stdout = ec.trace(app, "stdout")
62 self.assertTrue(stdout.find("1 IP address pinged in") > -1)
66 def test_nping_fedora(self):
67 self.t_nping(self.fedora_host, self.fedora_user)
69 def test_nping_ubuntu(self):
70 self.t_nping(self.ubuntu_host, self.ubuntu_user)
72 if __name__ == '__main__':