is_int(0, code, "Second address registration succeeds");
/* Now we need to run vos ListAddrs and see what happens ... */
- pipe(outpipe);
+ if (pipe(outpipe) < 0) {
+ perror("pipe");
+ exit(1);
+ }
pid = fork();
if (pid == 0) {
char *build, *binPath;
if (build == NULL)
build = "..";
- asprintf(&binPath, "%s/../src/volser/vos", build);
+ if (asprintf(&binPath, "%s/../src/volser/vos", build) < 0) {
+ fprintf(stderr, "Out of memory building vos arguments\n");
+ exit(1);
+ }
execl(binPath, "vos",
"listaddrs", "-config", dirname, "-noauth", NULL);
exit(1);
pid_t serverPid;
struct rx_securityClass *secClass;
struct ubik_client *ubikClient = NULL;
+ int ret = 0;
- plan(6);
-
+ /* 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 = rx_Init(0);
dirname = afstest_BuildTestConfig();
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;
}