Revert vtest: Add "option timeout"

veto'ed by phk.

It was my intention to make a helpful improvement along the way, but I have
no capacity at the moment for a longer process.

This reverts commit d6aef69a.
This reverts commit 9b76b9a4.
This reverts commit 8fc1b2c3.
parent d6aef69a
......@@ -45,7 +45,6 @@ CMD_GLOBAL(include)
#endif
CMD_TOP(client)
CMD_TOP(feature)
CMD_TOP(option)
CMD_TOP(filewrite)
CMD_TOP(haproxy)
#ifdef VTEST_WITH_VTC_LOGEXPECT
......
varnishtest "Test varnishtest itself"
option timeout 60s
option timeout x1.1
shell -exit 1 -expect {varnishtest [options]} {varnishtest -h}
shell -exit 1 -match {-D.*Define macro} {varnishtest -h}
......
varnishtest "Test VCL failures"
option timeout x2
server s1 {
rxreq
expect req.url == /hit
......
......@@ -660,48 +660,3 @@ cmd_feature(CMD_ARGS)
return;
}
}
static void
set_timeout(struct vtclog *vl, const char *val)
{
double num;
char *s = NULL;
if (val == NULL || *val == '\0')
vtc_fatal(vl, "FAIL test, missing \"option timeout\" value");
if (*val == 'x') {
num = strtod(val + 1, &s);
num *= vtc_maxdur;
} else
num = VNUM_duration(val);
if (isnan(num) || (s != NULL && *s != '\0'))
vtc_fatal(vl, "FAIL test, invalid \"option timeout\": %s", val);
vtc_maxdur = num;
vtc_log(vl, 4, "new timeout %.2f", vtc_maxdur);
}
/* SECTION: option <option> <value>
*
* Set varnishtest options
*
* timeout <duration>
* Override -t argument
* timeout x<factor>
* Scale timeout by a <factor>
*/
void v_matchproto_(cmd_f)
cmd_option(CMD_ARGS)
{
(void)priv;
if (av == NULL)
return;
av++;
if (!strcmp(av[0], "timeout"))
set_timeout(vl, av[1]);
else
vtc_fatal(vl, "FAIL test, unknown option: %s", av[0]);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment