aboutsummaryrefslogtreecommitdiff
path: root/examples/example-script.rsb
blob: f00ff42b94fa47f781b4baae646d992f803807d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# This is a comment (no in-line comments)

5.0 &ev1| $sb run_client_of 'server_a'
# 5.0 is the time trigger (after 5 seconds). Its a float
# $sb is the storyboard object
# run_client_of is the method to invoke

10.3 &echo_cmd|$sb run_command 'node_a' 'echo "test"'
# methods can have multiple space-delimited arguments.
# single-quoted strings are used to enclose a single (string) argument
# which must be preceded and followed by a space.
# &echo_cmd is a label, it can be used to reference this
# event from other events

10.5 &ev2|$sb run_client_of 'server_b' 12 'node_a'
# And optional arguments (same syntax as the method)
# also, whitespace tolerant around the | token

# NOTE: in the absence of optional arguments, they will be randomly
# generated, so you might not get the exact same experiment every time

13 &ev3| $Node.node_a execute_command 'echo "test"'
# $Node.<node_id> is a Node object.
# This command is actually equivalent to echo_cmd

echo_cmd &echo2 | $sb run_command $Node.node_b 'echo "test2"'
# events can be triggered by the completion of other events

echo2, 18 &ev4| $sb run_client_of $Server.server_b
# or both time AND other events
# Moreover, one can use entity syntax in arguments too

1.2 &ev5| run_client_of $Server.server_c
# Events need _not_ be in temporal order
# if no object ($ handle) is provided, the storyboard
# is assumed as the object

14 | $Node.node_a set_link_state $ShimEthDIF.e1 'up'