Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Commit

Permalink
Add test_package.sh for running system tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
hillsp committed Nov 15, 2016
1 parent c75a5da commit 4ba690b
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 41 deletions.
6 changes: 5 additions & 1 deletion install/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 :
Expand Down
9 changes: 3 additions & 6 deletions install/build_release_platform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}*
Expand Down Expand Up @@ -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


Expand All @@ -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
Expand Down
17 changes: 0 additions & 17 deletions install/centos.sh

This file was deleted.

17 changes: 17 additions & 0 deletions install/centos/install_mps_package.sh
Original file line number Diff line number Diff line change
@@ -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 change: 1 addition & 0 deletions install/install_mps_package.sh
31 changes: 31 additions & 0 deletions install/test_package.sh
Original file line number Diff line number Diff line change
@@ -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 changes: 0 additions & 17 deletions install/ubuntu.sh

This file was deleted.

13 changes: 13 additions & 0 deletions install/ubuntu/install_mps_package.sh
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 4ba690b

Please sign in to comment.