#! /bin/bash cat <<--- This test checks that local footers are correctly included in the presence of directives in nested locations: awesomeindex_footer local; location /sub { awesomeindex_footer local; } -- use pup echo '
yes
' > "${TESTDIR}/top-footer" echo '
yes
' > "${TESTDIR}/sub-footer" nginx_start "awesomeindex_footer \"${TESTDIR}/top-footer\" local; location /child-directory { awesomeindex_footer \"${TESTDIR}/sub-footer\" local; }" T=$(fetch /) echo "$T" > "$TESTDIR/top.html" [[ $(pup -p body 'div#topfooter' text{} <<< "$T") = yes ]] || fail 'Custom header missing at /' [[ -z $(pup -p body 'div#subfooter' text{} <<< "$T") ]] || fail 'Wrong header at /' T=$(fetch /child-directory/) [[ $(pup -p body 'div#subfooter' text{} <<< "$T") = yes ]] || fail 'Custom header missing at /sub/' [[ -z $(pup -p body 'div#topfooter' text{} <<< "$T") ]] || fail 'Wrong header at /sub/' nginx_is_running || fail 'Nginx died'