Commit bc19f22d authored by Per Buer's avatar Per Buer
parents 880b0f85 1c9bf690
......@@ -5,6 +5,8 @@ server s1 {
txresp -hdr "Foo: bar" -body "abcdef\n"
rxreq
txresp -hdr "Panic: please" -body "012345\n"
close
sema r1 sync 2
accept
rxreq
......@@ -25,25 +27,23 @@ varnish v1 -cliok "param.set diag_bitmap 0x00001000"
# Force the (random) port selected to be used again after restart.
varnish v1 -cliok "param.set listen_address ${v1_addr}:${v1_port}"
# varnishtest defaults to auto_restart off, to avoid masking bugs.
varnish v1 -cliok "param.set auto_restart on"
client c1 {
txreq -url "/"
rxresp
txreq -url "/foo"
# Don't expect answer, the server crashed.
sema r1 sync 2
} -run
delay 2.5
varnish v1 -wait-stopped
varnish v1 -cliok "panic.show"
varnish v1 -cliok "panic.clear"
varnish v1 -clierr 300 "panic.clear"
varnish v1 -cliok "start"
varnish v1 -wait-running
sema r1 sync 2
client c1 {
txreq -url "/"
rxresp
expect resp.http.foo == "foo"
} -run
varnish v1 -cliok "panic.show"
varnish v1 -cliok "panic.clear"
varnish v1 -clierr 300 "panic.clear"
......@@ -119,6 +119,55 @@ varnish_ask_cli(const struct varnish *v, const char *cmd, char **repl)
return ((enum VCLI_status_e)retval);
}
/**********************************************************************
*
*/
static void
wait_stopped(const struct varnish *v)
{
char *r;
enum VCLI_status_e st;
while (1) {
vtc_log(v->vl, 3, "wait-stopped");
st = varnish_ask_cli(v, "status", &r);
if (st != CLIS_OK)
vtc_log(v->vl, 0,
"CLI status command failed: %u %s", st, r);
if (!strcmp(r, "Child in state stopped")) {
free(r);
break;
}
free(r);
(void)usleep(200000);
}
}
/**********************************************************************
*
*/
static void
wait_running(const struct varnish *v)
{
char *r;
enum VCLI_status_e st;
while (1) {
vtc_log(v->vl, 3, "wait-running");
st = varnish_ask_cli(v, "status", &r);
if (st != CLIS_OK)
vtc_log(v->vl, 0,
"CLI status command failed: %u %s", st, r);
if (!strcmp(r, "Child in state running")) {
free(r);
break;
}
free(r);
(void)usleep(200000);
}
}
/**********************************************************************
* Varnishlog gatherer + thread
*/
......@@ -439,6 +488,7 @@ varnish_start(struct varnish *v)
return;
if (u != CLIS_OK)
vtc_log(v->vl, 0, "CLI start command failed: %u %s", u, resp);
wait_running(v);
free(resp);
u = varnish_ask_cli(v, "debug.xid 1000", &resp);
if (vtc_error)
......@@ -823,6 +873,14 @@ cmd_varnish(CMD_ARGS)
varnish_stop(v);
continue;
}
if (!strcmp(*av, "-wait-stopped")) {
wait_stopped(v);
continue;
}
if (!strcmp(*av, "-wait-running")) {
wait_running(v);
continue;
}
if (!strcmp(*av, "-wait")) {
varnish_wait(v);
continue;
......
......@@ -215,7 +215,6 @@ VSL_NextLog(const struct VSM_data *vd, uint32_t **pp, uint64_t *bits)
struct vsl *vsl;
uint32_t *p;
unsigned char t;
unsigned u;
int i;
CHECK_OBJ_NOTNULL(vd, VSM_MAGIC);
......@@ -226,7 +225,6 @@ VSL_NextLog(const struct VSM_data *vd, uint32_t **pp, uint64_t *bits)
i = vsl_nextlog(vsl, &p);
if (i != 1)
return (i);
u = VSL_ID(p);
t = VSL_TAG(p);
if (vsl->skip) {
--vsl->skip;
......
#
if HAVE_RST2MAN
noinst_PROGRAMS = vsc2rst
endif
vsc2rst_SOURCES = vsc2rst.c \
$(top_srcdir)/include/vsc_fields.h
......@@ -30,10 +32,11 @@ else
@false
endif
varnish-counters.7: vsc2rst
if HAVE_RST2MAN
varnish-counters.7: vsc2rst
./vsc2rst | ${RST2MAN} - $@
else
varnish-counters.7: $(top_srcdir)/include/vsc_fields.h
@echo "========================================"
@echo "You need rst2man installed to make dist"
@echo "========================================"
......
%define v_rc
%define vd_rc %{?v_rc:-%{?v_rc}}
Summary: High-performance HTTP accelerator
Name: varnish
Version: 3.0.0
Release: 0.20110715%{?dist}
Version: 3.1.0
Release: 0.20111006%{?v_rc}%{?dist}
License: BSD
Group: System Environment/Daemons
URL: http://www.varnish-cache.org/
#Source0: http://repo.varnish-cache.org/source/%{name}-%{version}.tar.gz
#Source0: %{name}-%{version}%{?vd_rc}.tar.gz
Source0: %{name}-trunk.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
# To build from git, start with a make dist, see redhat/README.redhat
......@@ -71,7 +75,7 @@ Documentation files for %name
#Varnish Cache is a high-performance HTTP accelerator
%prep
#%setup -q
#%setup -q -n varnish-%{version}%{?vd_rc}
%setup -q -n varnish-trunk
mkdir examples
......
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