12 /* Start up the VLserver, using the configuration in dirname, and putting our
17 afstest_StartVLServer(char *dirname, pid_t *serverPid)
25 } else if (pid == 0) {
26 char *binPath, *logPath, *dbPath, *build;
29 build = getenv("BUILD");
34 asprintf(&binPath, "%s/../src/tvlserver/vlserver", build);
35 asprintf(&logPath, "%s/VLLog", dirname);
36 asprintf(&dbPath, "%s/vldb", dirname);
37 execl(binPath, "vlserver",
38 "-logfile", logPath, "-database", dbPath, "-config", dirname, NULL);
39 fprintf(stderr, "Running %s failed\n", binPath);
48 afstest_StopVLServer(pid_t serverPid)
52 kill(serverPid, SIGTERM);
54 waitpid(serverPid, &status, 0);
56 if (WIFSIGNALED(status) && WTERMSIG(status) != SIGTERM) {
57 fprintf(stderr, "Server died exited on signal %d\n", WTERMSIG(status));
60 if (WIFEXITED(status) && WEXITSTATUS(status) != 0) {
61 fprintf(stderr, "Server exited with code %d\n", WEXITSTATUS(status));