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 <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
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);