diff options
| author | Thijs Paelman <thijs@ouroboros.rocks> | 2026-01-18 21:07:29 +0100 |
|---|---|---|
| committer | Thijs Paelman <thijs@ouroboros.rocks> | 2026-01-18 21:07:29 +0100 |
| commit | 4e35c6b445d0cfbad9cf15a48f2d341e29dbd806 (patch) | |
| tree | 7fbde89db68374b4fe6be47a97fec9f106139e4c | |
| parent | ec20869ae48c80fb62f2db2135f167763ad21f67 (diff) | |
| download | rumba-4e35c6b445d0cfbad9cf15a48f2d341e29dbd806.tar.gz rumba-4e35c6b445d0cfbad9cf15a48f2d341e29dbd806.zip | |
Record if the body of the ExperimentManager ran without any errors.
| -rwxr-xr-x | examples/scalingtime.py | 4 | ||||
| -rw-r--r-- | rumba/utils.py | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/examples/scalingtime.py b/examples/scalingtime.py index 547622f..920553c 100755 --- a/examples/scalingtime.py +++ b/examples/scalingtime.py @@ -243,10 +243,12 @@ exp = exp_class(testbed, nodes=nodes) if __name__ == "__main__": draw_experiment(exp) - with ExperimentManager(exp, swap_out_strategy=args.swapout): + with ExperimentManager(exp, swap_out_strategy=args.swapout) as expM: exp.swap_in() if not isinstance(testbed, docker.Testbed) \ and not isinstance(testbed, qemu.Testbed) \ and not isinstance(testbed, local.Testbed): exp.install_prototype() exp.bootstrap_prototype() + + exit(expM.exit_status) diff --git a/rumba/utils.py b/rumba/utils.py index aa06415..3a3b837 100644 --- a/rumba/utils.py +++ b/rumba/utils.py @@ -129,9 +129,10 @@ class ExperimentManager(object): self.syslogs_strategy = syslogs_strategy self.syslogs = [syslogs] if isinstance(syslogs, str) else syslogs self.use_sudo = self.experiment.testbed.username != 'root' + self.exit_status = 1 # Default: failed def __enter__(self): - pass + return self def fetch_dmesg_syslog(self, node, node_dir): node.execute_command('dmesg > /tmp/dmesg') @@ -225,6 +226,8 @@ class ExperimentManager(object): 'Got %s: %s', type(exc_val).__name__, str(exc_val)) logger.debug('Exception details:', exc_info=exc_val) + else: + self.exit_status = 0 finally: log.flush_and_kill_logging() # Make sure to print all logs before execution terminates, |
