[generic-experiment] allow passing state directory via environment
This commit is contained in:
committed by
Horst Schirmeier
parent
f92b930acb
commit
2ecdba92a5
@ -249,7 +249,16 @@ bool GenericExperiment::cb_start_experiment() {
|
|||||||
if (cmd[STATE_DIR]) {
|
if (cmd[STATE_DIR]) {
|
||||||
std::string value(cmd[STATE_DIR].first()->arg);
|
std::string value(cmd[STATE_DIR].first()->arg);
|
||||||
m_state_dir = value;
|
m_state_dir = value;
|
||||||
m_log << "Set state dir to " << value << endl;
|
m_log << "Set state dir (from cmdline) to " << value << endl;
|
||||||
|
} else {
|
||||||
|
char *state_dir = getenv("FAIL_STATE_DIR");
|
||||||
|
if (state_dir == NULL) {
|
||||||
|
m_log << "ERROR: no FAIL_STATE_DIR set or --state-dir given. exiting!" << std::endl;
|
||||||
|
exit(1);
|
||||||
|
} else {
|
||||||
|
m_state_dir = std::string(state_dir);
|
||||||
|
m_log << "Set state dir (from enviroment) to " << m_state_dir << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cmd[TIMEOUT]) {
|
if (cmd[TIMEOUT]) {
|
||||||
|
|||||||
Reference in New Issue
Block a user