-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
process_management.robot
59 lines (47 loc) · 2.25 KB
/
process_management.robot
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
*** Keywords ***
# public:
No Other Robot Should Run
Log Start Message No Other Robot Should Run
${pids_string} ${rc} = Run command pgrep -f "/usr/bin/python .*robot"
${pids_list} = Split String ${pids_string} ${SPACE}
${pid_count} = Get Length ${pids_list}
Should Be Equal As Integers ${pid_count} 1
Log End Message
# private:
Kill Processes On Remote Hosts
[Arguments] ${process} @{hosts}
Log Start Message Kill Processes On Remote Hosts ${process} @{hosts}
:FOR ${host} IN @{hosts}
\ # Ignore Errors because we aren't always guaranteed to kill something.
\ Run Command Ignore Errors On Remote Host killall ${process} ${host}
Log End Message
Kill Processes By Regular Expression Pattern On Remote Hosts
[Arguments] ${regexp} @{hosts}
Log Start Message Kill Processes By Regular Expression Pattern On Remote Hosts ${regexp} @{hosts}
:FOR ${host} IN @{hosts}
\ # Ignore Errors because we aren't always guaranteed to kill something.
\ Run Command Ignore Errors On Remote Host pkill -f ${regexp} ${host}
Log End Message
Kill Processes
[Arguments] ${process}
Log Start Message Kill Processes ${process}
# Ignore Errors because we aren't always guaranteed to kill something.
Run Command Ignore Errors killall ${process}
Log End Message
Kill Processes By Regular Expression Pattern
[Arguments] ${regexp}
Log Start Message Kill Processes By Regular Expression Pattern ${regexp}
# Ignore Errors because we aren't always guaranteed to kill something.
Run Command Ignore Errors pkill -f ${regexp}
Log End Message
Wait For Process On Remote Hosts
[Arguments] ${process} @{hosts}
:FOR ${host} IN @{hosts}
\ Log Start Message Wait For Process On Remote Hosts ${process} ${host}
\ Wait Until Keyword Succeeds ${WAIT_FOR_SERVICE_RETRIES} ${WAIT_FOR_SERVICE_TIME} Process Should Run On Remote Hosts ${process} ${host}
\ Log End Message
Process Should Run On Remote Hosts
[Arguments] ${process} @{hosts}
:FOR ${host} IN @{hosts}
\ # Ignore Errors because we aren't always guaranteed to kill something.
\ Run Command On Remote Host pgrep -f ${process} ${host}