diff options
author | Sander Vrijders <sander.vrijders@ugent.be> | 2018-03-15 11:19:46 +0100 |
---|---|---|
committer | Sander Vrijders <sander.vrijders@ugent.be> | 2018-03-15 11:23:33 +0100 |
commit | ade6bd4cda44c88b555f521641c6e01326ab0060 (patch) | |
tree | 143f0257b0370a4f28756bd41914758614c6af4d | |
parent | 9e38155d654e012879a03e784f03a95de4aef64e (diff) | |
download | rumba-ade6bd4cda44c88b555f521641c6e01326ab0060.tar.gz rumba-ade6bd4cda44c88b555f521641c6e01326ab0060.zip |
prototypes: Improve ouroboros support for fake testbed
This ameliorates the code by incorporating Marco's comments. It is now
possible to run the Ouroboros plugin with the fake testbed plugin as
non root. sudo is executed in case it was not done the last 15
minutes. The cleanup is also done properly.
-rw-r--r-- | rumba/prototypes/ouroboros.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/rumba/prototypes/ouroboros.py b/rumba/prototypes/ouroboros.py index c588405..a3c6c6c 100644 --- a/rumba/prototypes/ouroboros.py +++ b/rumba/prototypes/ouroboros.py @@ -69,7 +69,8 @@ class Experiment(mod.Experiment): def setup_ouroboros(self): if isinstance(self.testbed, fake.Testbed): - self.irmd = subprocess.Popen(["irmd"]) + subprocess.check_call('sudo -v'.split()) + self.irmd = subprocess.Popen(["sudo", "irmd"]) logger.info("Started IRMd, sleeping 2 seconds...") time.sleep(2) else: @@ -230,4 +231,5 @@ class Experiment(mod.Experiment): def _terminate_prototype(self): if isinstance(self.testbed, fake.Testbed): - self.irmd.terminate() + logger.info("Killing IRMd...") + subprocess.check_call('sudo killall -15 irmd'.split()) |