From 7e7a4ff328d279330e0c3f3e4c6fc07b43c4d9eb Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Sun, 22 Apr 2012 18:19:07 +0100 Subject: [PATCH] tests: More fixes for the vos test The vos test wasn't running correctly from runtests, as it contained a relative path which assumed that the CWD was tests/volser, rather than tests/ Modify this to use the BUILD environment variable when invoked from runtests, and also add an exit after the exec(), so that if we do fail to launch the binary we don't have two processes both running the same code. Change-Id: I7b2d7e6a517e9e9f74f15803da7507037671226a Reviewed-on: http://gerrit.openafs.org/7265 Tested-by: BuildBot Reviewed-by: Chas Williams - CONTRACTOR Reviewed-by: Derrick Brashear --- tests/volser/vos-t.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/volser/vos-t.c b/tests/volser/vos-t.c index eb58547..8eb32ea 100644 --- a/tests/volser/vos-t.c +++ b/tests/volser/vos-t.c @@ -60,12 +60,20 @@ TestListAddrs(struct ubik_client *client, char *dirname) pipe(outpipe); pid = fork(); if (pid == 0) { + char *build, *binPath; + dup2(outpipe[1], STDOUT_FILENO); /* Redirect stdout into pipe */ close(outpipe[0]); close(outpipe[1]); - execl("../../src/volser/vos", "vos", + build = getenv("BUILD"); + if (build == NULL) + build = ".."; + + asprintf(&binPath, "%s/../src/volser/vos", build); + execl(binPath, "vos", "listaddrs", "-config", dirname, "-noauth", NULL); + exit(1); } close(outpipe[1]); buffer = malloc(4096); -- 1.9.4