162
if (getenv("YATL_VALGRIND_SERVER"))
164
if (getenv("YATL_PTRCHECK_SERVER"))
168
else if (getenv("YATL_VALGRIND_SERVER"))
164
170
_app.use_valgrind();
166
else if (args(_app) == false)
173
if (args(_app) == false)
168
175
Error << "Could not build command()";
185
if (pid_file().empty() == false)
187
Wait wait(pid_file(), 8);
189
if (wait.successful() == false)
196
if (pid_file().empty() == false)
191
throw libtest::fatal(LIBYATL_DEFAULT_PARAM,
192
"Unable to open pidfile for: %s",
198
Wait wait(pid_file(), 8);
200
if (wait.successful() == false)
208
getcwd(buf, sizeof(buf));
209
throw libtest::fatal(LIBYATL_DEFAULT_PARAM,
210
"Unable to open pidfile in %s for: %s stderr:%s",
213
_app.stderr_c_str());
220
241
if (pinged == false)
222
243
// If we happen to have a pid file, lets try to kill it
223
if (pid_file().empty() == false)
244
if ((pid_file().empty() == false) and (access(pid_file().c_str(), R_OK) == 0))
225
247
if (kill_file(pid_file()) == false)
227
throw libtest::fatal(LIBYATL_DEFAULT_PARAM, "Failed to kill off server after startup occurred, when pinging failed: %s", pid_file().c_str());
249
throw libtest::fatal(LIBYATL_DEFAULT_PARAM,
250
"Failed to kill off server after startup occurred, when pinging failed: %s stderr:%s",
252
_app.stderr_c_str());
229
Error << "Failed to ping(), waited:" << this_wait
230
<< " server started, having pid_file. exec:" << _running
231
<< " error:" << _app.stderr_result();
255
throw libtest::fatal(LIBYATL_DEFAULT_PARAM,
256
"Failed to ping(), waited: %u server started, having pid_file. exec: %s stderr:%s",
257
this_wait, _running.c_str(),
258
_app.stderr_c_str());
235
Error << "Failed to ping() server started. exec:" << _running;
262
throw libtest::fatal(LIBYATL_DEFAULT_PARAM,
263
"Failed to ping() server started. exec: %s stderr:%s",
265
_app.stderr_c_str());
237
267
_running.clear();