Windows: remove unused and leaked uniRootFileNameClone
[openafs.git] / tests / volser / vos-t.c
index 8eb32ea..3919c0b 100644 (file)
@@ -12,7 +12,7 @@
 #include <afs/vldbint.h>
 #include <afs/cellconfig.h>
 
-#include <tap/basic.h>
+#include <tests/tap/basic.h>
 
 #include "common.h"
 
@@ -93,6 +93,12 @@ main(int argc, char **argv)
     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);
 
@@ -105,13 +111,15 @@ main(int argc, char **argv)
     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 ... */
@@ -120,7 +128,8 @@ main(int argc, char **argv)
     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,
@@ -128,7 +137,8 @@ main(int argc, char **argv)
     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);
@@ -136,5 +146,7 @@ main(int argc, char **argv)
     code = afstest_StopServer(serverPid);
     is_int(0, code, "Server exited cleanly");
 
-    return 0;
+out:
+    afstest_UnlinkTestConfig(dirname);
+    return ret;
 }