tests: skip vos tests when a vlserver is already running
[openafs.git] / tests / volser / vos-t.c
index ee9581d..758535e 100644 (file)
@@ -78,7 +78,7 @@ TestListAddrs(struct ubik_client *client, char *dirname)
            exit(1);
        }
        execl(binPath, "vos",
-             "listaddrs", "-config", dirname, "-noauth", NULL);
+             "listaddrs", "-config", dirname, "-noauth", "-noresolve", NULL);
        exit(1);
     }
     close(outpipe[1]);
@@ -96,7 +96,7 @@ main(int argc, char **argv)
     char *dirname;
     struct afsconf_dir *dir;
     int code, secIndex;
-    pid_t serverPid;
+    pid_t serverPid = 0;
     struct rx_securityClass *secClass;
     struct ubik_client *ubikClient = NULL;
     int ret = 0;
@@ -106,6 +106,8 @@ main(int argc, char **argv)
     afstest_SkipTestsIfBadHostname();
     /* Skip all tests if the current hostname is on the loopback network */
     afstest_SkipTestsIfLoopbackNetIsDefault();
+    /* Skip all tests if a vlserver is already running on this system. */
+    afstest_SkipTestsIfServerRunning("afs3-vlserver");
 
     plan(6);
 
@@ -148,10 +150,12 @@ main(int argc, char **argv)
 
     TestListAddrs(ubikClient, dirname);
 
-    code = afstest_StopServer(serverPid);
-    is_int(0, code, "Server exited cleanly");
-
 out:
+    if (serverPid != 0) {
+       code = afstest_StopServer(serverPid);
+       is_int(0, code, "Server exited cleanly");
+    }
+
     afstest_UnlinkTestConfig(dirname);
     return ret;
 }