Skip to content
Commit 911317ea authored by Vitaly Ostrosablin's avatar Vitaly Ostrosablin Committed by Pavel Emelyanov
Browse files

test: replace cat in Makefiles with awk



cat *.pid works when we have only one running process at any moment.
That's because pidfiles contain no newlines and cat will just
concatenate content of all files present in directory. So, e.g., if we
have pidfiles:

31338
31359
31880
31884
31889

cat will build following string from those pidfiles:

3133831359318803188431889

Obviously, kill would fail to send signals to processes, because it's
now a single big number, which cannot be unambigously split back in
general case.

That's where awk comes in. We don't need to modify C part of tests to
print newlines at end of file. We just order awk to print content of
each file, which adds a newline at end - problem solved, kill can once
again parse, which PIDs it get and send proper signals to them. Also,
should be completely safe for zdtm.py, because it doesn't use Makefiles
and sends signals on it's own.

travis-ci: success for series starting with [v2,1/2] test: replace cat in Makefiles with awk
Signed-off-by: default avatarVitaly Ostrosablin <vostrosablin@virtuozzo.com>
Reviewed-by: default avatarCyrill Gorcunov <gorcunov@openvz.org>
Reviewed-by: default avatarDmitry Safonov <dsafonov@virtuozzo.com>
Acked-by: default avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: default avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 4496bdff
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment