system-test: shm metadata cache

This commit is contained in:
Jeff Kaufman
2013-04-11 17:01:54 -04:00
parent 65b659ce14
commit 54572307c2
2 changed files with 21 additions and 0 deletions
+9
View File
@@ -77,6 +77,8 @@ FILE_CACHE="$TEST_TMP/file-cache/"
check_simple mkdir "$FILE_CACHE"
SECONDARY_CACHE="$TEST_TMP/file-cache/secondary/"
check_simple mkdir "$SECONDARY_CACHE"
SHM_CACHE="$TEST_TMP/file-cache/with_shm/"
check_simple mkdir "$SHM_CACHE"
VALGRIND_OPTIONS=""
@@ -104,6 +106,7 @@ cat $PAGESPEED_CONF_TEMPLATE \
| sed 's#@@TEST_TMP@@#'"$TEST_TMP/"'#' \
| sed 's#@@FILE_CACHE@@#'"$FILE_CACHE/"'#' \
| sed 's#@@SECONDARY_CACHE@@#'"$SECONDARY_CACHE/"'#' \
| sed 's#@@SHM_CACHE@@#'"$SHM_CACHE/"'#' \
| sed 's#@@SERVER_ROOT@@#'"$SERVER_ROOT"'#' \
| sed 's#@@PRIMARY_PORT@@#'"$PRIMARY_PORT"'#' \
| sed 's#@@SECONDARY_PORT@@#'"$SECONDARY_PORT"'#' \
@@ -1125,4 +1128,10 @@ HEADER="--header=ModPagespeedFilters:"
HEADER="${HEADER}+remove_quotes,+remove_comments,+collapse_whitespace"
test_forbid_all_disabled "" $HEADER
# Test that we work fine with SHM metadata cache.
start_test Using SHM metadata cache
HOST_NAME="http://shmcache.example.com"
URL="$HOST_NAME/mod_pagespeed_example/rewrite_images.html"
http_proxy=$SECONDARY_HOSTNAME fetch_until $URL 'grep -c .pagespeed.ic' 2
check_failures_and_exit
+12
View File
@@ -21,6 +21,8 @@ http {
root "@@SERVER_ROOT@@";
pagespeed UsePerVHostStatistics on;
pagespeed CreateSharedMemoryMetadataCache "@@SHM_CACHE@@" 8192;
server {
listen @@SECONDARY_PORT@@;
server_name mpd.example.com;
@@ -89,6 +91,16 @@ http {
pagespeed RetainComment " google_ad_section*";
}
server {
# Test host for shared memory cache.
listen @@SECONDARY_PORT@@;
server_name shmcache.example.com;
pagespeed FileCachePath "@@SHM_CACHE@@";
pagespeed RewriteLevel PassThrough;
pagespeed EnableFilters rewrite_images;
}
server {
listen @@SECONDARY_PORT@@;
server_name xfp.example.com;