varnishtest "varnishtop coverage"

server s1 {
	rxreq
	txresp
} -start

varnish v1 -vcl+backend { } -start

client c1 {
	txreq
	rxresp
} -run

shell -expect "fetch" "varnishtop -n ${v1_name} -1"

process p1 "varnishtop -n ${v1_name} -d" -start
delay 1
process p1 -screen_dump -expect-text 0 0 fetch
process p1 -write q -wait

# without -f
shell -match "1\\.00 RespHeader Date: [^\\n]+\\n" {
	varnishtop -n ${v1_name} -1 -i RespHeader
}

# with -f
shell -match "1\\.00 RespHeader Date\\n" {
	varnishtop -n ${v1_name} -1 -f -i RespHeader
}

shell -match "Usage: .*varnishtop <options>" \
	"varnishtop -h"

shell -err -match "Usage: .*varnishtop <options>" \
	"varnishtop -K"

shell -expect "Copyright (c) 2006 Verdens Gang AS" \
	"varnishtop -V"

shell -err -match "Usage: .*varnishtop <options>" \
	"varnishtop extra"

shell -err -match "is not a number" \
	"varnishtop -p 60 -p 12ABC"
