Add failNode and recoverNode methods to Experiment class
refs: #3085
Change-Id: Ib99edc1c7a201f16c993aa0e0c4791c2eea15a35
diff --git a/ndn/experiments/experiment.py b/ndn/experiments/experiment.py
index bf08c7f..d6d5df7 100644
--- a/ndn/experiments/experiment.py
+++ b/ndn/experiments/experiment.py
@@ -94,6 +94,17 @@
if host.name != other.name:
self.ping(host, other, self.nPings)
+ def failNode(self, host):
+ print("Bringing %s down" % host.name)
+ host.nfd.stop()
+
+ def recoverNode(self, host):
+ print("Bringing %s up" % host.name)
+ host.nfd.start()
+ host.nlsr.start()
+ host.nfd.setStrategy("/ndn/edu", self.strategy)
+ host.cmd("ndnpingserver /ndn/edu/" + str(host) + " > ping-server &")
+
@staticmethod
def register(name, experimentClass):
ExperimentManager.register(name, experimentClass)