#include <afs/cellconfig.h>
+#include <tests/tap/basic.h>
+
#include "common.h"
/* Start up the VLserver, using the configuration in dirname, and putting our
afstest_StartVLServer(char *dirname, pid_t *serverPid)
{
pid_t pid;
+ int status;
pid = fork();
if (pid == -1) {
fprintf(stderr, "Running %s failed\n", binPath);
exit(1);
}
+
+ if (waitpid(pid, &status, WNOHANG) != 0) {
+ fprintf(stderr, "Error starting vlserver\n");
+ return -1;
+ }
+
+ diag("Sleeping for a few seconds to let the vlserver startup");
+ sleep(5);
+
+ if (waitpid(pid, &status, WNOHANG) != 0) {
+ fprintf(stderr, "vlserver died during startup\n");
+ return -1;
+ }
+
*serverPid = pid;
return 0;
goto out;
}
- /* Let it figure itself out ... */
- sleep(5);
code = afsconf_ClientAuthSecure(dir, &secClass, &secIndex);
is_int(code, 0, "Successfully got security class");
if (code) {