From c26dded49c04f26a3237a4c4be9f48434b6bb316 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sun, 5 Feb 2023 14:26:26 +0100 Subject: [PATCH] Further box-in testserv so it doesn't conflict with other serv tests Signed-off-by: Joachim Wiberg --- plugins/testserv.c | 4 ++-- test/testserv.sh | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/plugins/testserv.c b/plugins/testserv.c index bdaee6f7..cca3a342 100644 --- a/plugins/testserv.c +++ b/plugins/testserv.c @@ -36,7 +36,7 @@ #include "conf.h" #define SERV_DAEMON "serv" -#define SERV_ARGS "-n -p" +#define SERV_ARGS "-n -p -i testserv" #define SERV_DESC "Test serv daemon" static void setup(void *arg) @@ -66,7 +66,7 @@ static void setup(void *arg) mksubsys("/tmp/serv", 0755, "root", "root"); umask(prev); - snprintf(line, sizeof(line), "[S123456789] pid:!/run/serv.pid cgroup.system %s %s -- %s", + snprintf(line, sizeof(line), "[S123456789] name:testserv pid:!/run/testserv.pid cgroup.system %s %s -- %s", cmd, SERV_ARGS, SERV_DESC); if (service_register(SVC_TYPE_SERVICE, line, global_rlimit, NULL)) diff --git a/test/testserv.sh b/test/testserv.sh index 608aed84..07b967d8 100755 --- a/test/testserv.sh +++ b/test/testserv.sh @@ -1,15 +1,21 @@ #!/bin/sh # Verify service readiness notification +# shellcheck disable=SC2034 set -eu #set -x -TEST_DIR=$(dirname "$0") + #DEBUG=true +FINIT_ARGS="finit.cond=testserv" +TEST_DIR=$(dirname "$0") # shellcheck source=/dev/null . "$TEST_DIR/tenv/lib.sh" +run "initctl" +run "initctl status testserv" +run "initctl cond dump" sleep 1 -retry 'assert_norestart serv' 1 1 +retry 'assert_norestart testserv' 1 1 return 0