git://git.onelab.eu
/
nepi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c4fb8e9
)
Fixing nasty ugly bug in DCE ccndc RM. Fix: Adding missing HOME environment set to...
author
Alina Quereilhac
<alina.quereilhac@inria.fr>
Wed, 3 Sep 2014 09:35:58 +0000
(11:35 +0200)
committer
Alina Quereilhac
<alina.quereilhac@inria.fr>
Wed, 3 Sep 2014 09:35:58 +0000
(11:35 +0200)
examples/ccn_emu_live/dce.py
patch
|
blob
|
history
examples/linux/ns3/wifi_ping.py
patch
|
blob
|
history
src/nepi/resources/linux/ns3/ccn/ns3ccnddceapplication.py
patch
|
blob
|
history
src/nepi/resources/linux/ns3/ccn/ns3fibentrydceapplication.py
patch
|
blob
|
history
src/nepi/resources/linux/ns3/ns3simulation.py
patch
|
blob
|
history
src/nepi/resources/ns3/ns3base.py
patch
|
blob
|
history
test/resources/linux/ns3/ccn/ns3dceccn.py
patch
|
blob
|
history
diff --git
a/examples/ccn_emu_live/dce.py
b/examples/ccn_emu_live/dce.py
index
06c3405
..
693293a
100644
(file)
--- a/
examples/ccn_emu_live/dce.py
+++ b/
examples/ccn_emu_live/dce.py
@@
-45,6
+45,8
@@
def get_simulator(ec):
ec.set(node, "hostname", "localhost")
simu = ec.register_resource("LinuxNS3Simulation")
ec.set(node, "hostname", "localhost")
simu = ec.register_resource("LinuxNS3Simulation")
+ ec.set(simu, "enableDump", True)
+ ec.set(simu, "StopTime", STOP_TIME)
ec.register_connection(simu, node)
return simu
ec.register_connection(simu, node)
return simu
@@
-79,7
+81,6
@@
def add_dce_ccnd(ec, nid):
ec.set (ccnd, "debug", 7)
ec.set (ccnd, "capacity", 50000)
ec.set (ccnd, "StartTime", "1s")
ec.set (ccnd, "debug", 7)
ec.set (ccnd, "capacity", 50000)
ec.set (ccnd, "StartTime", "1s")
- ec.set (ccnd, "StopTime", STOP_TIME)
ec.register_connection(ccnd, host)
# Collector to retrieve ccnd log
ec.register_connection(ccnd, host)
# Collector to retrieve ccnd log
@@
-98,7
+99,6
@@
def add_dce_ccnr(ec, nid):
ec.set (ccnr, "repoFile1", repofile)
ec.set (ccnr, "stackSize", 1<<20)
ec.set (ccnr, "StartTime", "2s")
ec.set (ccnr, "repoFile1", repofile)
ec.set (ccnr, "stackSize", 1<<20)
ec.set (ccnr, "StartTime", "2s")
- ec.set (ccnr, "StopTime", STOP_TIME)
ec.register_connection(ccnr, host)
def add_dce_ccncat(ec, nid):
ec.register_connection(ccnr, host)
def add_dce_ccncat(ec, nid):
@@
-110,7
+110,6
@@
def add_dce_ccncat(ec, nid):
ec.set (ccncat, "contentName", content_name)
ec.set (ccncat, "stackSize", 1<<20)
ec.set (ccncat, "StartTime", "8s")
ec.set (ccncat, "contentName", content_name)
ec.set (ccncat, "stackSize", 1<<20)
ec.set (ccncat, "StartTime", "8s")
- ec.set (ccncat, "StopTime", STOP_TIME)
ec.register_connection(ccncat, host)
def add_dce_fib_entry(ec, nid1, nid2):
ec.register_connection(ccncat, host)
def add_dce_fib_entry(ec, nid1, nid2):
@@
-125,8
+124,7
@@
def add_dce_fib_entry(ec, nid1, nid2):
ec.set (ccndc, "uri", "ccnx:/")
ec.set (ccndc, "host", ip2)
ec.set (ccndc, "stackSize", 1<<20)
ec.set (ccndc, "uri", "ccnx:/")
ec.set (ccndc, "host", ip2)
ec.set (ccndc, "stackSize", 1<<20)
- ec.set (ccndc, "StartTime", "2s")
- ec.set (ccndc, "StopTime", STOP_TIME)
+ ec.set (ccndc, "StartTime", "4s")
ec.register_connection(ccndc, host1)
def add_dce_net_iface(ec, nid1, nid2):
ec.register_connection(ccndc, host1)
def add_dce_net_iface(ec, nid1, nid2):
@@
-172,7
+170,7
@@
def avg_interests(ec, run):
# TODO: DUMP RESULTS TO FILE
# TODO: DUMP GRAPH DELAYS!
# TODO: DUMP RESULTS TO FILE
# TODO: DUMP GRAPH DELAYS!
- f = open("/tmp/metric", "
w
+")
+ f = open("/tmp/metric", "
a
+")
f.write("%.2f\n" % metric)
f.close()
print " METRIC", metric
f.write("%.2f\n" % metric)
f.close()
print " METRIC", metric
@@
-211,7
+209,7
@@
if __name__ == '__main__':
#### Create NEPI Experiment Description with LINEAR topology
ec = ExperimentController("dce_ccn",
topo_type = TopologyType.LINEAR,
#### Create NEPI Experiment Description with LINEAR topology
ec = ExperimentController("dce_ccn",
topo_type = TopologyType.LINEAR,
- node_count =
4
,
+ node_count =
2
,
assign_st = True,
assign_ips = True,
add_node_callback = add_dce_node,
assign_st = True,
assign_ips = True,
add_node_callback = add_dce_node,
diff --git
a/examples/linux/ns3/wifi_ping.py
b/examples/linux/ns3/wifi_ping.py
index
47bc335
..
f0be548
100644
(file)
--- a/
examples/linux/ns3/wifi_ping.py
+++ b/
examples/linux/ns3/wifi_ping.py
@@
-126,7
+126,7
@@
ec.set(node, "hostname", "localhost")
simu = ec.register_resource("LinuxNS3Simulation")
ec.set(simu, "verbose", True)
ec.set(simu, "enableDump", True)
simu = ec.register_resource("LinuxNS3Simulation")
ec.set(simu, "verbose", True)
ec.set(simu, "enableDump", True)
-ec.set (simu, "
s
topTime", "22s")
+ec.set (simu, "
S
topTime", "22s")
ec.register_connection(simu, node)
x = 30
ec.register_connection(simu, node)
x = 30
diff --git
a/src/nepi/resources/linux/ns3/ccn/ns3ccnddceapplication.py
b/src/nepi/resources/linux/ns3/ccn/ns3ccnddceapplication.py
index
8bf4ab1
..
226acf0
100644
(file)
--- a/
src/nepi/resources/linux/ns3/ccn/ns3ccnddceapplication.py
+++ b/
src/nepi/resources/linux/ns3/ccn/ns3ccnddceapplication.py
@@
-145,15
+145,15
@@
class LinuxNS3DceCCND(LinuxNS3CCNDceApplication):
" ecryptfs-utils-devel libxml2-devel automake gawk "
" gcc gcc-c++ git pcre-devel make ")
elif self.simulation.node.use_deb:
" ecryptfs-utils-devel libxml2-devel automake gawk "
" gcc gcc-c++ git pcre-devel make ")
elif self.simulation.node.use_deb:
- return ( " autoconf libssl-dev libexpat-dev libpcap-dev "
+ return ( " autoconf libssl-dev libexpat
1
-dev libpcap-dev "
" libecryptfs0 libxml2-utils automake gawk gcc g++ "
" git-core pkg-config libpcre3-dev make ")
return ""
" libecryptfs0 libxml2-utils automake gawk gcc g++ "
" git-core pkg-config libpcre3-dev make ")
return ""
-
@property
def _sources(self):
@property
def _sources(self):
- return "http://www.ccnx.org/releases/ccnx-0.8.1.tar.gz"
+ #return "http://www.ccnx.org/releases/ccnx-0.8.1.tar.gz"
+ return "http://www.ccnx.org/releases/ccnx-0.8.2.tar.gz"
@property
def _build(self):
@property
def _build(self):
diff --git
a/src/nepi/resources/linux/ns3/ccn/ns3fibentrydceapplication.py
b/src/nepi/resources/linux/ns3/ccn/ns3fibentrydceapplication.py
index
63e5d19
..
6137825
100644
(file)
--- a/
src/nepi/resources/linux/ns3/ccn/ns3fibentrydceapplication.py
+++ b/
src/nepi/resources/linux/ns3/ccn/ns3fibentrydceapplication.py
@@
-53,11
+53,16
@@
class LinuxNS3DceFIBEntry(LinuxNS3CCNDceApplication):
"Peer host public IP used in network connection for this FIB entry. ",
flags = Flags.Design)
"Peer host public IP used in network connection for this FIB entry. ",
flags = Flags.Design)
+ home = Attribute("home", "Sets HOME environmental variable. ",
+ default = "/root",
+ flags = Flags.Design)
+
cls._register_attribute(uri)
cls._register_attribute(protocol)
cls._register_attribute(host)
cls._register_attribute(port)
cls._register_attribute(ip)
cls._register_attribute(uri)
cls._register_attribute(protocol)
cls._register_attribute(host)
cls._register_attribute(port)
cls._register_attribute(ip)
+ cls._register_attribute(home)
def _instantiate_object(self):
if not self.get("binary"):
def _instantiate_object(self):
if not self.get("binary"):
@@
-66,8
+71,22
@@
class LinuxNS3DceFIBEntry(LinuxNS3CCNDceApplication):
if not self.get("arguments"):
self.set("arguments", self._arguments)
if not self.get("arguments"):
self.set("arguments", self._arguments)
+ if not self.get("environment"):
+ self.set("environment", self._environment)
+
super(LinuxNS3DceFIBEntry, self)._instantiate_object()
super(LinuxNS3DceFIBEntry, self)._instantiate_object()
+ @property
+ def _environment(self):
+ envs = dict({
+ "home": "HOME",
+ })
+
+ env = ";".join(map(lambda k: "%s=%s" % (envs.get(k), str(self.get(k))),
+ [k for k in envs.keys() if self.get(k)]))
+
+ return env
+
@property
def _arguments(self):
args = ["-v", "add"]
@property
def _arguments(self):
args = ["-v", "add"]
diff --git
a/src/nepi/resources/linux/ns3/ns3simulation.py
b/src/nepi/resources/linux/ns3/ns3simulation.py
index
dae024f
..
63d8d37
100644
(file)
--- a/
src/nepi/resources/linux/ns3/ns3simulation.py
+++ b/
src/nepi/resources/linux/ns3/ns3simulation.py
@@
-114,7
+114,7
@@
class LinuxNS3Simulation(LinuxApplication, NS3Simulation):
type = Types.Bool,
flags = Flags.Design)
type = Types.Bool,
flags = Flags.Design)
- stoptime = Attribute("
s
topTime",
+ stoptime = Attribute("
S
topTime",
"Time at which the simulation will stop",
flags = Flags.Design)
"Time at which the simulation will stop",
flags = Flags.Design)
@@
-306,6
+306,10
@@
class LinuxNS3Simulation(LinuxApplication, NS3Simulation):
if self.get("populateRoutingTables") == True:
self.invoke(IPV4_GLOBAL_ROUTING_HELPER_UUID, "PopulateRoutingTables")
if self.get("populateRoutingTables") == True:
self.invoke(IPV4_GLOBAL_ROUTING_HELPER_UUID, "PopulateRoutingTables")
+ time = self.get("StopTime")
+ if time:
+ self._client.stop(time=time)
+
self._client.start()
self.set_started()
self._client.start()
self.set_started()
@@
-319,11
+323,8
@@
class LinuxNS3Simulation(LinuxApplication, NS3Simulation):
"""
if self.state == ResourceState.STARTED:
"""
if self.state == ResourceState.STARTED:
- time = None
- if self.get("stopTime"):
- time = self.get("stopTime")
-
- self._client.stop(time=time)
+ if not self.get("StopTime"):
+ self._client.stop()
self.set_stopped()
def do_release(self):
self.set_stopped()
def do_release(self):
diff --git
a/src/nepi/resources/ns3/ns3base.py
b/src/nepi/resources/ns3/ns3base.py
index
455e546
..
ef345ff
100644
(file)
--- a/
src/nepi/resources/ns3/ns3base.py
+++ b/
src/nepi/resources/ns3/ns3base.py
@@
-51,7
+51,7
@@
class NS3Base(ResourceManager):
if not self._node:
from nepi.resources.ns3.ns3node import NS3BaseNode
nodes = self.get_connected(NS3BaseNode.get_rtype())
if not self._node:
from nepi.resources.ns3.ns3node import NS3BaseNode
nodes = self.get_connected(NS3BaseNode.get_rtype())
- if nodes: self._nodes[0]
+ if nodes: self._node
= node
s[0]
return self._node
return self._node
diff --git
a/test/resources/linux/ns3/ccn/ns3dceccn.py
b/test/resources/linux/ns3/ccn/ns3dceccn.py
index
f215fa3
..
78d517e
100755
(executable)
--- a/
test/resources/linux/ns3/ccn/ns3dceccn.py
+++ b/
test/resources/linux/ns3/ccn/ns3dceccn.py
@@
-81,9
+81,9
@@
class LinuxNS3CCNDceApplicationTest(unittest.TestCase):
#ec.set(node, "cleanHome", True)
simu = ec.register_resource("LinuxNS3Simulation")
#ec.set(node, "cleanHome", True)
simu = ec.register_resource("LinuxNS3Simulation")
- ec.set(simu, "verbose", True)
- ec.set(simu, "buildMode", "debug")
- ec.set(simu, "nsLog", "DceApplication")
+
#
ec.set(simu, "verbose", True)
+
#
ec.set(simu, "buildMode", "debug")
+
#
ec.set(simu, "nsLog", "DceApplication")
ec.register_connection(simu, node)
nsnode1 = add_ns3_node(ec, simu)
ec.register_connection(simu, node)
nsnode1 = add_ns3_node(ec, simu)