Commit 735fa07c authored by Lasse Karstensen's avatar Lasse Karstensen

add first simple tests

parent a7aa3ba4
varnishtest "Test varnish-devicedetect"
server s1 {
rxreq
txresp
} -start
varnish v1 -vcl+backend {
include "${projectdir}/../devicedetect.vcl";
sub vcl_recv { call devicedetect; }
sub vcl_deliver { set resp.http.X-UA-Device = req.http.X-UA-Device; }
} -start
client c1 {
txreq -hdr "User-Agent: Mozilla/5.0 (Linux; U; Android 2.2; nb-no; HTC Desire Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1"
rxresp
expect resp.status == 200
}
client c1 -run
varnishtest "Test varnish-devicedetect"
server s1 {
rxreq
txresp
} -start
varnish v1 -vcl+backend {
include "${projectdir}/../devicedetect.vcl";
sub vcl_recv { call devicedetect; }
sub vcl_deliver { set resp.http.X-UA-Device = req.http.X-UA-Device; }
} -start
client c1 {
txreq -hdr "User-Agent: Mozilla/5.0 (Linux; U; Android 2.2; nb-no; HTC Desire Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1"
rxresp
expect resp.http.X-UA-Device == "mobile-android"
# known to fail.. TODO
#txreq -hdr "User-Agent: SonyEricssonST18i Build/4.0.2.A.0.62 stagefright/1.1 (Linux;Android 2.3.4)"
#rxresp
#expect resp.http.X-UA-Device == "mobile-android"
}
client c1 -run
varnishtest "Test varnish-devicedetect"
server s1 {
rxreq
txresp
} -start
varnish v1 -vcl+backend {
include "${projectdir}/../devicedetect.vcl";
sub vcl_recv { call devicedetect; }
sub vcl_deliver { set resp.http.X-UA-Device = req.http.X-UA-Device; }
} -start
client c1 {
txreq -hdr "User-Agent: Mozilla/5.0 (Linux; U; Android 2.2; nb-no; HTC Desire Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1"
rxresp
expect resp.http.X-UA-Device == "mobile-android"
}
client c1 -run
TESTS=*vtc
.PHONY: $(TESTS)
*.vtc:
/usr/bin/varnishtest -Dvarnishd=/usr/sbin/varnishd -Dprojectdir=$(pwd) $@
all: $(TESTS)
.PHONY: all $(TESTS)
*.vtc:
/usr/bin/varnishtest -Dvarnishd=/usr/sbin/varnishd -Dprojectdir=$(PWD) $@
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