diff --git a/scripts/autotest_common.sh b/scripts/autotest_common.sh index 14eeda642..abe37f787 100755 --- a/scripts/autotest_common.sh +++ b/scripts/autotest_common.sh @@ -231,15 +231,15 @@ function start_stub() { $rootdir/test/app/stub/stub $1 & stubpid=$! echo Waiting for stub to ready for secondary processes... - while ! [ -e /var/run/.spdk0_config ]; do - sleep 0.1s + while ! [ -e /var/run/spdk_stub0 ]; do + sleep 1s done echo done. } function kill_stub() { kill $stubpid - rm -rf /var/run/.spdk0_config + rm -rf /var/run/spdk_stub0 } function run_test() { diff --git a/test/app/stub/stub.c b/test/app/stub/stub.c index 09c124b16..bdae3e140 100644 --- a/test/app/stub/stub.c +++ b/test/app/stub/stub.c @@ -36,6 +36,8 @@ #include "spdk/env.h" #include "spdk/nvme.h" +static char g_path[256]; + static void usage(char *executable_name) { @@ -105,6 +107,12 @@ main(int argc, char **argv) exit(1); } + snprintf(g_path, sizeof(g_path), "/var/run/spdk_stub%d", opts.shm_id); + if (mknod(g_path, S_IFREG, 0) != 0) { + fprintf(stderr, "could not create sentinel file %s\n", g_path); + exit(1); + } + while (1) { sleep(1); }