During system-tests, don't write into the source-controlled htdocs area. (#1197)
Instead, use a new (not-yet-committed) target in Makefile.tests to build a mirror htdocs in test/tmp/root that sym-links the large readonly section and deep copies the test areas for purge and flush tests.
This commit is contained in:
@@ -47,9 +47,23 @@ POSITION_AUX="${POSITION_AUX:-unset}"
|
||||
PRIMARY_HOSTNAME="localhost:$PRIMARY_PORT"
|
||||
SECONDARY_HOSTNAME="localhost:$SECONDARY_PORT"
|
||||
|
||||
SERVER_ROOT="$MOD_PAGESPEED_DIR/src/install/"
|
||||
this_dir="$( cd $(dirname "$0") && pwd)"
|
||||
echo this_dir=$this_dir
|
||||
TEST_TMP="$this_dir/tmp"
|
||||
rm -rf "$TEST_TMP"
|
||||
mkdir -p "$TEST_TMP"
|
||||
echo TEST_TMP=$TEST_TMP
|
||||
|
||||
APACHE_DOC_SRC="$MOD_PAGESPEED_DIR/src/install/"
|
||||
SERVER_ROOT="$TEST_TMP/root"
|
||||
echo SERVER_ROOT=$SERVER_ROOT
|
||||
rm -rf "$SERVER_ROOT"
|
||||
mkdir -p "$SERVER_ROOT"
|
||||
export APACHE_DOC_ROOT="$SERVER_ROOT"
|
||||
|
||||
mkdir -p $APACHE_DOC_ROOT
|
||||
cd "$MOD_PAGESPEED_DIR/src/install/" && make -f Makefile.tests setup_doc_root
|
||||
|
||||
# We need check and check_not before we source SYSTEM_TEST_FILE that provides
|
||||
# them.
|
||||
function handle_failure_simple() {
|
||||
@@ -138,8 +152,6 @@ function fire_ab_load() {
|
||||
sleep 2
|
||||
}
|
||||
|
||||
this_dir="$( cd $(dirname "$0") && pwd)"
|
||||
|
||||
# stop nginx/valgrind
|
||||
killall -s KILL nginx
|
||||
# TODO(oschaaf): Fix waiting for valgrind on 32 bits systems.
|
||||
@@ -147,8 +159,6 @@ killall -s KILL memcheck-amd64-
|
||||
while pgrep nginx > /dev/null; do sleep 1; done
|
||||
while pgrep memcheck > /dev/null; do sleep 1; done
|
||||
|
||||
TEST_TMP="$this_dir/tmp"
|
||||
rm -r "$TEST_TMP"
|
||||
check_simple mkdir -p "$TEST_TMP"
|
||||
PROXY_CACHE="$TEST_TMP/proxycache"
|
||||
TMP_PROXY_CACHE="$TEST_TMP/tmpproxycache"
|
||||
@@ -673,14 +683,14 @@ check touch "$SECONDARY_CACHE/cache.flush"
|
||||
check touch "$IPRO_CACHE/cache.flush"
|
||||
sleep 1
|
||||
|
||||
CACHE_TESTING_DIR="$SERVER_ROOT/mod_pagespeed_test/cache_flush/"
|
||||
CACHE_TESTING_DIR="$SERVER_ROOT/cache_flush/"
|
||||
CACHE_TESTING_TMPDIR="$CACHE_TESTING_DIR/$$"
|
||||
mkdir "$CACHE_TESTING_TMPDIR"
|
||||
cp "$CACHE_TESTING_DIR/cache_flush_test.html" "$CACHE_TESTING_TMPDIR/"
|
||||
CSS_FILE="$CACHE_TESTING_TMPDIR/update.css"
|
||||
echo ".class myclass { color: $COLOR0; }" > "$CSS_FILE"
|
||||
|
||||
URL_PATH="mod_pagespeed_test/cache_flush/$$/cache_flush_test.html"
|
||||
URL_PATH="cache_flush/$$/cache_flush_test.html"
|
||||
|
||||
URL="$SECONDARY_HOSTNAME/$URL_PATH"
|
||||
CACHE_A="--header=Host:cache_a.example.com"
|
||||
|
||||
@@ -810,7 +810,7 @@ http {
|
||||
server_name www.example.com;
|
||||
pagespeed FileCachePath "@@FILE_CACHE@@";
|
||||
|
||||
pagespeed LoadFromFile http://cdn.example.com @@SERVER_ROOT@@;
|
||||
pagespeed LoadFromFile http://cdn.example.com @@SERVER_ROOT@@/;
|
||||
pagespeed MapRewriteDomain cdn.example.com origin.example.com;
|
||||
pagespeed RewriteLevel PassThrough;
|
||||
pagespeed EnableFilters rewrite_css,rewrite_images;
|
||||
@@ -824,7 +824,7 @@ http {
|
||||
server_name origin.example.com;
|
||||
pagespeed FileCachePath "@@FILE_CACHE@@";
|
||||
|
||||
pagespeed LoadFromFile http://cdn.example.com @@SERVER_ROOT@@;
|
||||
pagespeed LoadFromFile http://cdn.example.com @@SERVER_ROOT@@/;
|
||||
pagespeed MapRewriteDomain cdn.example.com origin.example.com;
|
||||
pagespeed RewriteLevel PassThrough;
|
||||
pagespeed EnableFilters rewrite_css,rewrite_images;
|
||||
@@ -838,7 +838,7 @@ http {
|
||||
server_name cdn.example.com;
|
||||
pagespeed FileCachePath "@@FILE_CACHE@@";
|
||||
|
||||
pagespeed LoadFromFile http://cdn.example.com @@SERVER_ROOT@@;
|
||||
pagespeed LoadFromFile http://cdn.example.com @@SERVER_ROOT@@/;
|
||||
pagespeed MapRewriteDomain cdn.example.com origin.example.com;
|
||||
pagespeed RewriteLevel PassThrough;
|
||||
pagespeed EnableFilters rewrite_css,rewrite_images;
|
||||
@@ -1330,7 +1330,7 @@ http {
|
||||
listen [::]:@@SECONDARY_PORT@@;
|
||||
server_name proxy-post-origin.example.com;
|
||||
pagespeed FileCachePath "@@FILE_CACHE@@";
|
||||
root "@@SERVER_ROOT@@";
|
||||
root "@@SERVER_ROOT@@/";
|
||||
}
|
||||
|
||||
server {
|
||||
@@ -1348,7 +1348,7 @@ http {
|
||||
listen [::]:@@SECONDARY_PORT@@;
|
||||
server_name script-filters.example.com;
|
||||
pagespeed FileCachePath "@@FILE_CACHE@@";
|
||||
root "@@SERVER_ROOT@@";
|
||||
root "@@SERVER_ROOT@@/";
|
||||
set $filters "";
|
||||
set $domain_shards "cdn1.example.com,cdn2.example.com";
|
||||
if ($http_X_Script) {
|
||||
@@ -1370,7 +1370,7 @@ http {
|
||||
pagespeed EnableCachePurge on;
|
||||
|
||||
pagespeed PurgeMethod PURGE;
|
||||
root "@@SERVER_ROOT@@/mod_pagespeed_test/purge";
|
||||
root "@@SERVER_ROOT@@/purge";
|
||||
pagespeed FileCachePath "@@FILE_CACHE@@_purge";
|
||||
pagespeed DisableFilters add_instrumentation;
|
||||
pagespeed RewriteLevel PassThrough;
|
||||
@@ -1386,7 +1386,7 @@ http {
|
||||
pagespeed EnableCachePurge on;
|
||||
|
||||
pagespeed PurgeMethod PURGE;
|
||||
root "@@SERVER_ROOT@@/mod_pagespeed_test/purge";
|
||||
root "@@SERVER_ROOT@@/purge";
|
||||
pagespeed FileCachePath "@@FILE_CACHE@@_dir_on";
|
||||
pagespeed DisableFilters add_instrumentation;
|
||||
pagespeed RewriteLevel PassThrough;
|
||||
@@ -1404,7 +1404,7 @@ http {
|
||||
pagespeed InPlaceResourceOptimization off;
|
||||
pagespeed off;
|
||||
pagespeed FileCachePath "@@FILE_CACHE@@";
|
||||
root "@@SERVER_ROOT@@";
|
||||
root "@@SERVER_ROOT@@/";
|
||||
location /mod_pagespeed_test/nostore {
|
||||
add_header "Cache-Control" "max-age=12345";
|
||||
add_header "Cache-Control" "public, no-store";
|
||||
@@ -1419,7 +1419,7 @@ http {
|
||||
pagespeed InPlaceResourceOptimization off;
|
||||
pagespeed off;
|
||||
pagespeed FileCachePath "@@FILE_CACHE@@";
|
||||
root "@@SERVER_ROOT@@";
|
||||
root "@@SERVER_ROOT@@/";
|
||||
location / {
|
||||
add_header "PageSpeedFilters" "add_instrumentation";
|
||||
}
|
||||
@@ -1432,7 +1432,7 @@ http {
|
||||
pagespeed InPlaceResourceOptimization off;
|
||||
pagespeed off;
|
||||
pagespeed FileCachePath "@@FILE_CACHE@@";
|
||||
root "@@SERVER_ROOT@@";
|
||||
root "@@SERVER_ROOT@@/";
|
||||
location / {
|
||||
add_header "PageSpeed" "off";
|
||||
}
|
||||
@@ -1808,7 +1808,7 @@ http {
|
||||
# optimized.
|
||||
location /mod_pagespeed_test/auth/ {
|
||||
auth_basic "Restricted";
|
||||
auth_basic_user_file "@@SERVER_ROOT@@mod_pagespeed_test/auth/passwd.conf";
|
||||
auth_basic_user_file "@@SERVER_ROOT@@/mod_pagespeed_test/auth/passwd.conf";
|
||||
}
|
||||
|
||||
location /mod_pagespeed_test/ipro/cookie/ {
|
||||
|
||||
Reference in New Issue
Block a user