+ def upload_start_command(self):
+ command = self.get("command")
+ env = self.get("env")
+
+ # We want to make sure the FIB entries are created
+ # before the experiment starts.
+ # Run the command as a bash script in the background,
+ # in the host ( but wait until the command has
+ # finished to continue )
+ env = env and self.replace_paths(env)
+ command = self.replace_paths(command)
+
+ # ccndc seems to return exitcode OK even if a (dns) error
+ # occurred, so we need to account for this case here.
+ (out, err), proc = self.execute_command(command,
+ env, blocking = True)
+
+ if proc.poll():
+ msg = "Failed to execute command"
+ self.error(msg, out, err)
+ raise RuntimeError, msg
+
+ def configure(self):
+ if self.trace_enabled("ping"):
+ self.info("Configuring PING trace")
+ self._ping = self.ec.register_resource("LinuxPing")
+ self.ec.set(self._ping, "printTimestamp", True)
+ self.ec.set(self._ping, "target", self.get("host"))
+ self.ec.register_connection(self._ping, self.node.guid)
+ # schedule ping deploy
+ self.ec.deploy(guids=[self._ping], group = self.deployment_group)
+
+ if self.trace_enabled("mtr"):
+ self.info("Configuring MTR trace")
+ self._mtr = self.ec.register_resource("LinuxMtr")
+ self.ec.set(self._mtr, "noDns", True)
+ self.ec.set(self._mtr, "printTimestamp", True)
+ self.ec.set(self._mtr, "continuous", True)
+ self.ec.set(self._mtr, "target", self.get("host"))
+ self.ec.register_connection(self._mtr, self.node.guid)
+ # schedule mtr deploy
+ self.ec.deploy(guids=[self._mtr], group = self.deployment_group)
+
+ if self.trace_enabled("traceroute"):
+ self.info("Configuring TRACEROUTE trace")
+ self._traceroute = self.ec.register_resource("LinuxTraceroute")
+ self.ec.set(self._traceroute, "printTimestamp", True)
+ self.ec.set(self._traceroute, "continuous", True)
+ self.ec.set(self._traceroute, "target", self.get("host"))
+ self.ec.register_connection(self._traceroute, self.node.guid)
+ # schedule mtr deploy
+ self.ec.deploy(guids=[self._traceroute], group = self.deployment_group)
+
+ def do_start(self):
+ if self.state == ResourceState.READY: