From 81dfe735a72683b7dc87f329d9a25a1868fe74f1 Mon Sep 17 00:00:00 2001 From: Marco Capitani Date: Mon, 26 Mar 2018 15:48:13 +0200 Subject: storyboard: add callback parameter to run_client(_of) method --- examples/script-example.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'examples') diff --git a/examples/script-example.py b/examples/script-example.py index 5e14823..6cfaf42 100755 --- a/examples/script-example.py +++ b/examples/script-example.py @@ -1,6 +1,7 @@ #!/usr/bin/env python # An example script leveraging the storyboard scripting functionality +from functools import partial from rumba.storyboard import * from rumba.model import * @@ -83,6 +84,11 @@ server_c = Server( s_id='server_c' ) +typewriter = Client( + "touch test_file", + shutdown="" +) + if __name__ == '__main__': story = StoryBoard(30) @@ -98,6 +104,11 @@ if __name__ == '__main__': 'example-script.rsb' ) story.parse_script_file(script_file) + cb = partial(story.run_command, node_a, "ls -l test_file") + # This will return a file, because it will run after + # Triggering_event + action = partial(story.run_client, typewriter, 0.2, node=node_a, callback=cb) + story.add_event(Event(action, ev_time=12, ev_id='Triggering_event')) log.flush_log() with ExperimentManager(exp): exp.swap_in() -- cgit v1.2.3