diff options
author | Radostin Stoyanov <rstoyanov@fedoraproject.org> | 2021-06-09 10:13:00 +0300 |
---|---|---|
committer | Andrei Vagin <avagin@gmail.com> | 2021-09-03 20:31:00 +0300 |
commit | 2aa4185a6c3e2a699a76696fb1737e0303a29de0 (patch) | |
tree | 6b4f45a4b8567b5126b13e297d858caec0e09e07 /test/others/Makefile | |
parent | 2b78d95e6b3861a1051c960d462d00cad6f7f091 (diff) |
test/others: refactor loop process
There are several problems with the loop.sh script. First, the code is
duplicated across tests in the so-called 'othres' category. Second, we
need to run it with the 'setsid' utility to make sure that it runs in
a new session. Third, we have to redirect the standard file descriptors
and use the '&' operator to make it run in the background. Finally,
obtaining the PID of the 'loop.sh' process resulted in race condition.
In this patch we replace the loop.sh script with a program that would
address all problems mentioned above. The requirements for this program
are as follows.
- It must be reusable across tests
- It must start a process that is detached from the current shell
- It must wait for the process to start and output its PID
Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
Diffstat (limited to 'test/others/Makefile')
-rw-r--r-- | test/others/Makefile | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/others/Makefile b/test/others/Makefile new file mode 100644 index 000000000..b84894bfa --- /dev/null +++ b/test/others/Makefile @@ -0,0 +1,2 @@ +loop: + gcc -Wall loop.c -o loop |