#!/bin/sh
#
# Install packages for integration tests.
#
# This script is normally run via sudo in a test container or VM, such as via
# GitHub Actions.
#
# Copyright 2016, 2018-2021 Russ Allbery <eagle@eyrie.org>
#
# SPDX-License-Identifier: MIT

set -eux

# Normally, KERBEROS is set based on the CI matrix, but provide a default in
# case someone runs this test by hand.
KERBEROS="${KERBEROS:-mit}"

# Install apt packages.
apt-get update
apt-get install $(grep -v '^#' ci/apt-packages)

# If not running as a GitHub workflow, also install Perl packages.  Under the
# GitHub workflow, this will be done (and cached) by actions.
if [ -z "${GITHUB_WORKFLOW:-}" ]; then
    cpanm --notest --cpanfile ci/cpanfile --installdeps --with-suggests .
fi
