diff --git a/setup/system.sh b/setup/system.sh index 4d33deb6..db399e12 100755 --- a/setup/system.sh +++ b/setup/system.sh @@ -99,15 +99,17 @@ hide_output add-apt-repository -y ppa:certbot/certbot # of things from Ubuntu, as well as the directory of packages provide by the # PPAs so we can install those packages later. -echo Updating system packages... -hide_output apt-get update -apt_get_quiet upgrade +if [ "$SKIP_SYSTEM_UPDATE" != "1" ]; then + echo Updating system packages... + hide_output apt-get update + apt_get_quiet upgrade # Old kernels pile up over time and take up a lot of disk space, and because of Mail-in-a-Box # changes there may be other packages that are no longer needed. Clear out anything apt knows # is safe to delete. -apt_get_quiet autoremove + apt_get_quiet autoremove +fi # ### Install System Packages diff --git a/tests/system-setup/setup-defaults.sh b/tests/system-setup/setup-defaults.sh index d36612e9..f9a4330e 100755 --- a/tests/system-setup/setup-defaults.sh +++ b/tests/system-setup/setup-defaults.sh @@ -4,6 +4,7 @@ export PRIMARY_HOSTNAME=${PRIMARY_HOSTNAME:-$(hostname --fqdn || hostname)} export NONINTERACTIVE=${NONINTERACTIVE:-1} export SKIP_NETWORK_CHECKS=${SKIP_NETWORK_CHECKS:-1} +export SKIP_SYSTEM_UPDATE=${SKIP_SYSTEM_UPDATE:-1} export STORAGE_USER="${STORAGE_USER:-user-data}" export STORAGE_ROOT="${STORAGE_ROOT:-/home/$STORAGE_USER}" export EMAIL_ADDR="${EMAIL_ADDR:-qa@abc.com}" diff --git a/tests/system-setup/setup-funcs.sh b/tests/system-setup/setup-funcs.sh index 3e053450..ca13abfb 100755 --- a/tests/system-setup/setup-funcs.sh +++ b/tests/system-setup/setup-funcs.sh @@ -84,7 +84,7 @@ init_test_system() { # is upgraded through automatic upgrades (because maybe MiaB was # previously installed), it may cause problems with the rest of # the setup, such as with name resolution failures - if is_false "$TRAVIS"; then + if is_false "$TRAVIS" && [ "$SKIP_SYSTEM_UPDATE" != "1" ]; then H2 "apt-get upgrade" wait_for_apt apt-get upgrade -qq || die "apt-get upgrade failed!"