# 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
#
# Author: Alina Quereilhac <alina.quereilhac@inria.fr>
+from __future__ import print_function
+
from nepi.execution.ec import ExperimentController
from nepi.execution.trace import TraceAttr
def t_p2p_ping(self, host, user = None, identity = None):
ec = ExperimentController(exp_id = "test-ns3-p2p-ping")
- node = ec.register_resource("LinuxNode")
+ node = ec.register_resource("linux::Node")
if host == "localhost":
ec.set(node, "hostname", "localhost")
else:
ec.set(node, "cleanProcesses", True)
#ec.set(node, "cleanHome", True)
- simu = ec.register_resource("LinuxNS3Simulation")
+ simu = ec.register_resource("linux::ns3::Simulation")
ec.set(simu, "verbose", True)
ec.register_connection(simu, node)
def t_csma_ping(self, host, user = None, identity = None):
ec = ExperimentController(exp_id = "test-ns3-csma-ping")
- node = ec.register_resource("LinuxNode")
+ node = ec.register_resource("linux::Node")
if host == "localhost":
ec.set(node, "hostname", "localhost")
else:
ec.set(node, "cleanProcesses", True)
#ec.set(node, "cleanHome", True)
- simu = ec.register_resource("LinuxNS3Simulation")
+ simu = ec.register_resource("linux::ns3::Simulation")
ec.set(simu, "verbose", True)
ec.register_connection(simu, node)
def t_user_sources(self, host, user = None, identity = None):
ec = ExperimentController(exp_id = "test-ns3-user-sources")
- node = ec.register_resource("LinuxNode")
+ node = ec.register_resource("linux::Node")
if host == "localhost":
ec.set(node, "hostname", "localhost")
else:
ec.set(node, "cleanProcesses", True)
#ec.set(node, "cleanHome", True)
- simu = ec.register_resource("LinuxNS3Simulation")
+ simu = ec.register_resource("linux::ns3::Simulation")
ec.set(simu, "verbose", True)
sources = os.path.join(os.path.dirname(os.path.realpath(__file__)),
"ns-3.18-user.tar.gz")
def t_compile_debug_mode(self, host, user = None, identity = None):
ec = ExperimentController(exp_id = "test-ns3-debug-mode")
- node = ec.register_resource("LinuxNode")
+ node = ec.register_resource("linux::Node")
if host == "localhost":
ec.set(node, "hostname", host)
else:
ec.set(node, "cleanProcesses", True)
#ec.set(node, "cleanHome", True)
- simu = ec.register_resource("LinuxNS3Simulation")
+ simu = ec.register_resource("linux::ns3::Simulation")
ec.set(simu, "verbose", True)
ec.set(simu, "nsLog", "V4Ping:Node")
ec.set(simu, "buildMode", "debug")
def t_real_time(self, host, user = None, identity = None):
ec = ExperimentController(exp_id = "test-ns3-real-time")
- node = ec.register_resource("LinuxNode")
+ node = ec.register_resource("linux::Node")
if host == "localhost":
ec.set(node, "hostname", "localhost")
else:
#ec.set(node, "cleanHome", True)
- simu = ec.register_resource("LinuxNS3Simulation")
+ simu = ec.register_resource("linux::ns3::Simulation")
ec.set(simu, "simulatorImplementationType", "ns3::RealtimeSimulatorImpl")
ec.set(simu, "checksumEnabled", True)
ec.set(simu, "verbose", True)
def t_traces(self, host, user = None, identity = None):
ec = ExperimentController(exp_id = "test-ns3-traces")
- node = ec.register_resource("LinuxNode")
+ node = ec.register_resource("linux::Node")
if host == "localhost":
ec.set(node, "hostname", "localhost")
else:
ec.set(node, "cleanProcesses", True)
#ec.set(node, "cleanHome", True)
- simu = ec.register_resource("LinuxNS3Simulation")
+ simu = ec.register_resource("linux::ns3::Simulation")
ec.set(simu, "verbose", True)
ec.register_connection(simu, node)
ec = ExperimentController(exp_id = "test-ns3-wifi-ping")
- node = ec.register_resource("LinuxNode")
+ node = ec.register_resource("linux::Node")
if host == "localhost":
ec.set(node, "hostname", "localhost")
else:
ec.set(node, "cleanProcesses", True)
#ec.set(node, "cleanHome", True)
- simu = ec.register_resource("LinuxNS3Simulation")
+ simu = ec.register_resource("linux::ns3::Simulation")
ec.set(simu, "verbose", True)
ec.register_connection(simu, node)
"""
ec = ExperimentController(exp_id = "test-ns3-routes")
- node = ec.register_resource("LinuxNode")
+ node = ec.register_resource("linux::Node")
if host == "localhost":
ec.set(node, "hostname", host)
else:
ec.set(node, "cleanProcesses", True)
#ec.set(node, "cleanHome", True)
- simu = ec.register_resource("LinuxNS3Simulation")
+ simu = ec.register_resource("linux::ns3::Simulation")
ec.set(simu, "verbose", True)
ec.register_connection(simu, node)
"""
ec = ExperimentController(exp_id = "test-ns3-routing")
- node = ec.register_resource("LinuxNode")
+ node = ec.register_resource("linux::Node")
if host == "localhost":
ec.set(node, "hostname", "localhost")
else:
ec.set(node, "cleanProcesses", True)
#ec.set(node, "cleanHome", True)
- simu = ec.register_resource("LinuxNS3Simulation")
+ simu = ec.register_resource("linux::ns3::Simulation")
ec.set(simu, "verbose", True)
ec.set(simu, "populateRoutingTables", True)
ec.register_connection(simu, node)
stdout = ec.trace(simu, "stdout")
- print stdout
+ print(stdout)
expected = "20 packets transmitted, 20 received, 0% packet loss"
self.assertTrue(stdout.find(expected) > -1)
def t_dce(self, host, user = None, identity = None):
ec = ExperimentController(exp_id = "test-ns3-dce")
- node = ec.register_resource("LinuxNode")
+ node = ec.register_resource("linux::Node")
if host == "localhost":
ec.set(node, "hostname", host)
else:
ec.set(node, "cleanProcesses", True)
#ec.set(node, "cleanHome", True)
- simu = ec.register_resource("LinuxNS3Simulation")
+ simu = ec.register_resource("linux::ns3::Simulation")
ec.set(simu, "verbose", True)
ec.set(simu, "buildMode", "debug")
ec.set(simu, "nsLog", "DceApplication")
ec.register_connection(chan, p2p2)
### create applications
- udp_perf = ec.register_resource("ns3::DceApplication")
+ udp_perf = ec.register_resource("linux::ns3::dce::Application")
ec.set (udp_perf, "binary", "udp-perf")
ec.set (udp_perf, "stackSize", 1<<20)
ec.set (udp_perf, "arguments", "--duration=10;--nodes=2")
ec.set (udp_perf, "StopTime", "20s")
ec.register_connection(udp_perf, nsnode1)
- udp_perf_client = ec.register_resource("ns3::DceApplication")
+ udp_perf_client = ec.register_resource("linux::ns3::dce::Application")
ec.set (udp_perf_client, "binary", "udp-perf")
ec.set (udp_perf_client, "stackSize", 1<<20)
ec.set (udp_perf_client, "arguments", "--client;--nodes=2;--host=10.0.0.1;--duration=10")