Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnishevent
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
varnishevent
Commits
0d5262a9
Commit
0d5262a9
authored
Apr 17, 2015
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add test for equivalence to varnishncsa
parent
b1a07c6c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
1 deletion
+64
-1
Makefile.am
src/test/Makefile.am
+1
-1
ncsa.sh
src/test/ncsa.sh
+63
-0
varnish-doc.log
src/test/varnish-doc.log
+0
-0
No files found.
src/test/Makefile.am
View file @
0d5262a9
AM_CPPFLAGS
=
@VARNISH_CFLAGS@
-I
${
ac_varnish_pkgdataincludedir
}
TESTS
=
test_data test_strfTIM test_format test_writer
regress.sh
# ncsa.sh
vslarg.sh
TESTS
=
test_data test_strfTIM test_format test_writer
ncsa.sh regress.sh
#
vslarg.sh
check_PROGRAMS
=
test_data test_strfTIM test_format test_writer
...
...
src/test/ncsa.sh
0 → 100755
View file @
0d5262a9
#!/bin/bash
# Outputs of varnishevent and varnishncsa for client formats are
# identical, except that varnishevent emits empty strings for data
# from headers that are empty, and varnishnca emits a '-'.
echo
echo
"TEST:
$0
"
echo
"... testing equivalence of output with varnishncsa"
# automake skip
SKIP
=
77
TMP
=
${
TMPDIR
:-
/tmp
}
EVENT
=
"../varnishevent"
NCSA
=
$(
which varnishncsa
)
if
[
-x
"
$NSCA
"
]
;
then
echo
"varnishncsa not found or not executable (
$NCSA
), skipping"
exit
$SKIP
fi
EVENT_LOG
=
$TMP
/event.log
NCSA_LOG
=
$TMP
/ncsa.log
INPUT
=
varnish-doc.log
DIFF_CMD
=
"diff
$EVENT_LOG
$NCSA_LOG
"
echo
"... default format"
$EVENT
-r
$INPUT
|
sed
's/-//g'
>
$EVENT_LOG
$NCSA
-r
$INPUT
|
sed
's/-//g'
>
$NCSA_LOG
$DIFF_CMD
RC
=
$?
rm
$EVENT_LOG
rm
$NCSA_LOG
if
[
"
$RC
"
-ne
"0"
]
;
then
echo
"ERROR: outputs of no-arg varnishevent and varnishncsa differ"
exit
1
fi
# Cannot test the %D formatter, because varnishevent gets it more accurately
# (varnishncsa has floating point errors).
FORMAT
=
'%b %H %h %I %{Host}i %{Connection}i %{User-Agent}i %{X-Forwarded-For}i %{Accept-Ranges}o %{Age}o %{Connection}o %{Content-Encoding}o %{Content-Length}o %{Content-Type}o %{Date}o %{Last-Modified}o %{Server}o %{Transfer-Encoding}o %{Via}o %{X-Varnish}o %l %m %O %q %r %s %t %{%F-%T}t %U %u %{Varnish:time_firstbyte}x %{Varnish:hitmiss}x %{Varnish:handling}x'
echo
"... custom -F format"
$EVENT
-r
$INPUT
-F
"
$FORMAT
"
|
sed
's/-//g'
>
$EVENT_LOG
$NCSA
-r
$INPUT
-F
"
$FORMAT
"
|
sed
's/-//g'
>
$NCSA_LOG
exit
0
$DIFF_CMD
RC
=
$?
rm
$EVENT_LOG
rm
$NCSA_LOG
if
[
"
$RC
"
-ne
"0"
]
;
then
echo
"ERROR: outputs of varnishevent/varnishncsa -F differ"
exit
1
fi
exit
0
src/test/varnish-doc.log
0 → 100644
View file @
0d5262a9
File added
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment