Add test_package.sh for running system tests.

This commit is contained in:
Steve Hill
2016-11-15 15:57:28 -05:00
parent c75a5da266
commit 4ba690b8c9
8 changed files with 70 additions and 41 deletions
+5 -1
View File
@@ -31,7 +31,6 @@
# as Makefile variables which can be overridden on the command line.
# They have defaults, which will often need to be changed.
# The location of the Apache root installation directory. This helps form
# defaults for other variables, but each of those can be overridden.
APACHE_ROOT = /etc/httpd
@@ -115,6 +114,11 @@ APACHE_USER = www-data
# Set this to 1 to enable mod_proxy and mod_rewrite
ENABLE_PROXY = 0
# Load system-specific make variables. Do this after all the defaults have been
# set above.
DISTRO_NAME = $(shell lsb_release -is | tr A-Z a-z)
include $(MOD_PAGESPEED_ROOT)/install/$(DISTRO_NAME)/make_vars.mk
.PHONY : config_file echo_vars
echo_vars :
+3 -6
View File
@@ -244,13 +244,12 @@ fi
find $build_dir/src -name "*.sh" | xargs chmod +x
cd $build_dir/src
echo build/gyp_chromium -Dchannel=$CHANNEL
export AR_host=$build_dir/src/build/wrappers/ar.sh
check gyp_chromium.log python build/gyp_chromium -Dchannel=$CHANNEL
# It would be better to have AR.target overridden at gyp time, but
# that functionality seems broken.
MODPAGESPEED_ENABLE_UPDATES=1 check build.log \
make BUILDTYPE=Release AR.host=${AR_host} AR.target=${AR_host} V=1 \
make BUILDTYPE=Release V=1 \
linux_package_$EXT mod_pagespeed_test pagespeed_automatic_test
ls -l $PWD/out/Release/mod-pagespeed-${CHANNEL}*
@@ -309,8 +308,7 @@ if [ "$EXT" = "rpm" -a "$CHANNEL" = "beta" ]; then
for buildtype in Release Debug; do
cd $build_dir/src
check psol_build.log make BUILDTYPE=$buildtype \
AR.host=${AR_host} AR.target=${AR_host} V=1 \
check psol_build.log make BUILDTYPE=$buildtype V=1 \
mod_pagespeed_test pagespeed_automatic_test
@@ -327,8 +325,7 @@ if [ "$EXT" = "rpm" -a "$CHANNEL" = "beta" ]; then
# TODO(sligocki): Fix and use
# check psol_automatic_build.log
set +e
make MOD_PAGESPEED_ROOT=$build_dir/src BUILDTYPE=$buildtype \
AR.host=${AR_host} AR.target=${AR_host} V=1 \
make MOD_PAGESPEED_ROOT=$build_dir/src BUILDTYPE=$buildtype V=1 \
CXXFLAGS="-DSERF_HTTPS_FETCHING=1" \
all \
>> psol_automatic_build.log 2>&1
-17
View File
@@ -1,17 +0,0 @@
#!/bin/sh
set -x
exec make \
APACHE_CONTROL_PROGRAM=/etc/init.d/httpd \
APACHE_LOG=/var/log/httpd/error_log \
APACHE_MODULES=/etc/httpd/modules \
APACHE_CONF_FILE=/etc/httpd/conf/httpd.conf \
APACHE_PIDFILE=/var/run/httpd.pid \
APACHE_PROGRAM=/usr/sbin/httpd \
APACHE_ROOT=/etc/httpd \
APACHE_STOP_COMMAND=stop \
APACHE_USER=apache \
BINDIR=/usr/local/bin \
SSL_CERT_DIR=/etc/pki/tls/certs \
SSL_CERT_FILE_COMMAND="ModPagespeedSslCertFile /etc/pki/tls/cert.pem" \
$*
+17
View File
@@ -0,0 +1,17 @@
#!/bin/bash
# Copyright 2016 Google Inc. All Rights Reserved.
# Author: cheesy@google.com (Steve Hill)
#
# Remove old mod_pagespeed debs and install a new one.
pkg="$1"
echo Purging old releases...
# rpm --erase only succeeds if all packages listed are installed, so we need
# to find which one is installed and only erase that.
rpm --query mod-pagespeed-stable mod-pagespeed-beta | \
grep -v "is not installed" | \
xargs --no-run-if-empty sudo rpm --erase
echo "Installing $pkg..."
rpm --install "$pkg"
+1
View File
@@ -0,0 +1 @@
os_redirector.sh
+31
View File
@@ -0,0 +1,31 @@
#!/bin/bash
# Copyright 2016 Google Inc. All Rights Reserved.
# Author: cheesy@google.com (Steve Hill)
#
# Install a mod_pagespeed package and run tests on it.
source "$(dirname "$BASH_SOURCE")/shell_utils.sh" || exit 1
if [ $# -ne 1 ]; then
echo "Usage: $(basename $0) <pagespeed_package>" >&2
exit 1
fi
if [ $UID -ne 0 ]; then
echo "This script requires root. Re-execing myself with sudo"
exec sudo "$0" "$@"
exit 1 # NOTREACHED
fi
pkg="$1"
mkdir -p log
echo "Installing $pkg..."
run_with_log log/install.log $(dirname "$0")/install_mps_package.sh "$pkg"
echo Test restart to make sure config file is valid ...
run_with_log log/install.log make -C install apache_debug_restart
echo Testing release ...
run_with_log log/system_test.log make -C install apache_vm_system_tests
-17
View File
@@ -1,17 +0,0 @@
#!/bin/sh
echo make $*
exec make \
APACHE_CONTROL_PROGRAM=/etc/init.d/apache2 \
APACHE_LOG=/var/log/apache2/error.log \
APACHE_MODULES=/usr/lib/apache2/modules \
APACHE_CONF_FILE=/etc/apache2/apache2.conf \
APACHE_PIDFILE=/var/run/apache2.pid \
APACHE_PROGRAM=/usr/sbin/apache2 \
APACHE_ROOT=/etc/apache2 \
APACHE_STOP_COMMAND=stop \
BINDIR=/usr/local/bin \
SSL_CERT_DIR=/etc/ssl/certs \
SSL_CERT_FILE_COMMAND= \
$*
+13
View File
@@ -0,0 +1,13 @@
#!/bin/bash
# Copyright 2016 Google Inc. All Rights Reserved.
# Author: cheesy@google.com (Steve Hill)
#
# Remove old mod_pagespeed debs and install a new one.
pkg="$1"
echo Purging old releases...
dpkg --purge mod-pagespeed-beta mod-pagespeed-stable
echo "Installing $pkg..."
dpkg --install "$pkg"