diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Clean up the whole tree
Diffstat (limited to 'tests/t0004-docs.sh')
| -rwxr-xr-x | tests/t0004-docs.sh | 18 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 file changed, 6 insertions, 12 deletions
diff --git a/tests/t0004-docs.sh b/tests/t0004-docs.sh index 85a4d8e..65c8275 100755 --- a/tests/t0004-docs.sh +++ b/tests/t0004-docs.sh @@ -12,16 +12,13 @@ test_description='Check the configuration documents' ROOT="$TEST_OUTPUT_DIRECTORY/.." test_expect_success 'extract the key lists' ' - sed -n "/^Global settings$/,/^Repository-specific cgitrc file$/p" \ - "$ROOT/MANUAL.txt" | + sed -n "/^Global settings$/,/^Repository-specific cgitrc file$/p" "$ROOT/MANUAL.txt" | sed -n "s/^\([a-z][a-zA-Z0-9.<>-]*\)::$/\1/p" | sort >manual-keys && - sed -n "s/^#\{0,1\}\([a-z][a-zA-Z0-9.<>-]*\)=.*/\1/p" \ - "$ROOT/custom/cgitrc" | + sed -n "s/^#\{0,1\}\([a-z][a-zA-Z0-9.<>-]*\)=.*/\1/p" "$ROOT/custom/cgitrc" | sed -e "s/^mimetype\..*/mimetype.<ext>/" | sort -u >example-keys && - sed -n "s/^#\{0,1\}\(repo\.module-link\)\..*=.*/\1.<path>/p" \ - "$ROOT/custom/cgitrc" >>example-keys && + sed -n "s/^#\{0,1\}\(repo\.module-link\)\..*=.*/\1.<path>/p" "$ROOT/custom/cgitrc" >>example-keys && sort -o example-keys example-keys && test -s manual-keys && test -s example-keys ' @@ -37,15 +34,13 @@ test_expect_success 'every key the reference config sets is documented' ' ' test_expect_success 'the manual lists its global settings in order' ' - sed -n "/^Global settings$/,/^Repository settings$/p" \ - "$ROOT/MANUAL.txt" | + sed -n "/^Global settings$/,/^Repository settings$/p" "$ROOT/MANUAL.txt" | sed -n "s/^\([a-z][a-zA-Z0-9.<>-]*\)::$/\1/p" >global-order && LC_ALL=C sort -c global-order ' test_expect_success 'the manual lists its repository settings in order' ' - sed -n "/^Repository settings$/,/^Repository-specific cgitrc file$/p" \ - "$ROOT/MANUAL.txt" | + sed -n "/^Repository settings$/,/^Repository-specific cgitrc file$/p" "$ROOT/MANUAL.txt" | sed -n "s/^\(repo\.[a-zA-Z0-9.<>-]*\)::$/\1/p" >repo-order && LC_ALL=C sort -c repo-order ' @@ -54,8 +49,7 @@ test_expect_success 'the manual lists its repository settings in order' ' # keeps the three copies from drifting apart. test_expect_success 'the server configs agree on one content security policy' ' for server in apache lighttpd nginx; do - grep "Content-Security-Policy" \ - "$ROOT/custom/servers/$server.conf" | + grep "Content-Security-Policy" "$ROOT/custom/servers/$server.conf" | grep "default-src" | sed "s/.*\"\(default-src[^\"]*\)\".*/\1/" || return 1 done >policies && |
