1SYNCHRONISATION.SH(1) User Contributed Perl DocumentationSYNCHRONISATION.SH(1)
2
3
4
6 BeakerLib - synchronisation - Process synchronisation routines
7
9 This is a library of helpers for process synchronisation of
10 applications.
11
12 NOTE: none of this commands will cause the test proper to fail, even in
13 case of critical errors during their invocation. If you want your test
14 to fail if those test fail, use their return codes and rlFail().
15
17 Process Synchronisation
18 rlWaitForCmd
19
20 Pauses script execution until command exit status is the expeced value.
21 Logs a WARNING and returns 1 if the command didn't exit successfully
22 before timeout elapsed or a maximum number of invocations has been
23 reached.
24
25 rlWaitForCmd command [-p PID] [-t time] [-m count] [-d delay] [-r retval]
26
27 command
28 Command that will be executed until its return code is equal 0 or
29 value speciefied as option to '-r'.
30
31 -t time
32 Timeout in seconds, default=120. If the command doesn't return 0
33 before time elapses, the command will be killed.
34
35 -p PID
36 PID of the process to check before running command. If the process
37 exits before the socket is opened, the command will log a WARNING.
38
39 -m count
40 Maximum number of 'command' executions before continuing anyway.
41 Default is infite. Returns 1 if the maximum was reached.
42
43 -d delay
44 Delay between 'command' invocations. Default 1.
45
46 -r retval
47 Expected return value of command. Default 0.
48
49 rlWaitForFile
50
51 Pauses script execution until specified file or directory starts
52 existing. Returns 0 if file started existing, 1 if timeout was reached
53 or PID exited. Return code is greater than 1 in case of error.
54
55 rlWaitForFile path [-p PID] [-t time] [-d delay]
56
57 path
58 Path to file that should start existing.
59
60 -t time
61 Timeout in seconds (optional, default=120). If the file isn't
62 opened before the time elapses the command returns 1.
63
64 -p PID
65 PID of the process that should also be running. If the process
66 exits before the file is created, the command returns with status
67 code of 1.
68
69 -d delay
70 Delay between subsequent checks for existence of file. Default 1.
71
72 rlWaitForSocket
73
74 Pauses script execution until local socket starts listening. Returns 0
75 if socket started listening, 1 if timeout was reached or PID exited.
76 Return code is greater than 1 in case of error.
77
78 rlWaitForSocket {port|path} [-p PID] [-t time] [-d delay] [--close] [--remote]
79
80 port|path
81 Network port to wait for opening or a path to UNIX socket. Regular
82 expressions are also supported.
83
84 -t time
85 Timeout in seconds (optional, default=120). If the socket isn't
86 opened before the time elapses the command returns 1.
87
88 -p PID
89 PID of the process that should also be running. If the process
90 exits before the socket is opened, the command returns with status
91 code of 1.
92
93 -d delay
94 Delay between subsequent checks for availability of socket. Default
95 1.
96
97 --close
98 Wait for the socket to stop listening.
99
100 --remote
101 Wait for the remote socket to start listening instead of local one.
102
103 rlWait
104
105 Wrapper around bash builtin 'wait' command. See bash_builtins(1) man
106 page. Kills the process and all its children if the timeout elapses.
107
108 rlWaitFor [n ...] [-s SIGNAL] [-t time]
109
110 n List of PIDs to wait for. They need to be background tasks of
111 current shell. See bash_builtins(1) section for 'wait' command.
112
113 -t time
114 Timeout in seconds (optional, default=30). If the wait isn't
115 successful before the time elapses then all specified tasks are
116 killed.
117
118 -s SIGNAL
119 Signal used to kill the process, optional SIGTERM by default.
120
122 ยท Hubert Kario <hkario@redhat.com>
123
124
125
126perl v5.32.1 2021-03-25 SYNCHRONISATION.SH(1)