Currently, if we encounter an error and 'goto out' after starting the
test vlserver, we'll exit without stopping the test vlserver. This can
confuse the test harness, causing 'runtests' to hang forever.
To avoid this, move the afstest_StopServer() call to also run when
we're bailing out, but only if the server has actally started of
course.
Change-Id: Ice5a56c20bc8d2eac85b3e760850c4d85e4601a8
Reviewed-on: https://gerrit.openafs.org/13992
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
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;
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;
}