#include <afs/vldbint.h>
#include <afs/cellconfig.h>
-#include <tap/basic.h>
+#include <tests/tap/basic.h>
#include "common.h"
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);
pid_t serverPid;
struct rx_securityClass *secClass;
struct ubik_client *ubikClient = NULL;
+ int ret = 0;
+
+ /* Skip all tests if the current hostname can't be resolved */
+ afstest_SkipTestsIfBadHostname();
+ /* Skip all tests if the current hostname is on the loopback network */
+ afstest_SkipTestsIfLoopbackNetIsDefault();
plan(6);
code = afstest_AddDESKeyFile(dir);
if (code) {
afs_com_err("vos-t", code, "while adding test DES keyfile");
- exit(1);
+ ret = 1;
+ goto out;
}
code = afstest_StartVLServer(dirname, &serverPid);
if (code) {
afs_com_err("vos-t", code, "while starting the vlserver");
- exit(1);
+ ret = 1;
+ goto out;
}
/* Let it figure itself out ... */
is_int(code, 0, "Successfully got security class");
if (code) {
afs_com_err("authname-t", code, "while getting anonymous secClass");
- exit(1);
+ ret = 1;
+ goto out;
}
code = afstest_GetUbikClient(dir, AFSCONF_VLDBSERVICE, USER_SERVICE_ID,
is_int(code, 0, "Successfully built ubik client structure");
if (code) {
afs_com_err("vos-t", code, "while building ubik client");
- exit(1);
+ ret = 1;
+ goto out;
}
TestListAddrs(ubikClient, dirname);
code = afstest_StopServer(serverPid);
is_int(0, code, "Server exited cleanly");
- return 0;
+out:
+ afstest_UnlinkTestConfig(dirname);
+ return ret;
}