2021-04-23 04:53:32 +00:00
|
|
|
#!/bin/sh
|
2020-08-07 05:11:42 +00:00
|
|
|
|
2021-04-22 12:26:08 +00:00
|
|
|
. .github/configs $1
|
2020-08-07 05:11:42 +00:00
|
|
|
|
2021-01-08 04:50:41 +00:00
|
|
|
[ -z "${SUDO}" ] || ${SUDO} mkdir -p /var/empty
|
|
|
|
|
2020-08-07 05:11:42 +00:00
|
|
|
set -ex
|
|
|
|
|
2022-08-10 07:35:52 +00:00
|
|
|
# If we want to test hostbased auth, set up the host for it.
|
|
|
|
if [ ! -z "$SUDO" ] && [ ! -x "$TEST_SSH_HOSTBASED_AUTH" ]; then
|
|
|
|
sshconf=/usr/local/etc
|
|
|
|
hostname | $SUDO tee $sshconf/shosts.equiv >/dev/null
|
|
|
|
echo "EnableSSHKeysign yes" | $SUDO tee $sshconf/ssh_config >/dev/null
|
|
|
|
$SUDO mkdir -p $sshconf
|
|
|
|
$SUDO cp -p /etc/ssh/ssh_host*key* $sshconf
|
|
|
|
$SUDO make install
|
|
|
|
for key in $sshconf/ssh_host*key*.pub; do
|
|
|
|
echo `hostname` `cat $key` | \
|
|
|
|
$SUDO tee -a $sshconf/ssh_known_hosts >/dev/null
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
2021-08-16 04:13:02 +00:00
|
|
|
output_failed_logs() {
|
|
|
|
for i in regress/failed*; do
|
|
|
|
if [ -f "$i" ]; then
|
|
|
|
echo -------------------------------------------------------------------------
|
|
|
|
echo LOGFILE $i
|
|
|
|
cat $i
|
|
|
|
echo -------------------------------------------------------------------------
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
|
|
|
trap output_failed_logs 0
|
|
|
|
|
2021-02-21 21:09:27 +00:00
|
|
|
if [ -z "${LTESTS}" ]; then
|
|
|
|
make ${TEST_TARGET} SKIP_LTESTS="${SKIP_LTESTS}"
|
2020-08-07 05:11:42 +00:00
|
|
|
else
|
2021-02-21 21:09:27 +00:00
|
|
|
make ${TEST_TARGET} SKIP_LTESTS="${SKIP_LTESTS}" LTESTS="${LTESTS}"
|
2020-08-07 05:37:37 +00:00
|
|
|
fi
|
|
|
|
|
2021-02-17 22:59:09 +00:00
|
|
|
if [ ! -z "${SSHD_CONFOPTS}" ]; then
|
2021-08-16 04:13:02 +00:00
|
|
|
echo "rerunning t-exec with TEST_SSH_SSHD_CONFOPTS='${SSHD_CONFOPTS}'"
|
|
|
|
if [ -z "${LTESTS}" ]; then
|
|
|
|
make t-exec SKIP_LTESTS="${SKIP_LTESTS}" TEST_SSH_SSHD_CONFOPTS="${SSHD_CONFOPTS}"
|
|
|
|
else
|
|
|
|
make t-exec SKIP_LTESTS="${SKIP_LTESTS}" LTESTS="${LTESTS}" TEST_SSH_SSHD_CONFOPTS="${SSHD_CONFOPTS}"
|
Add self-hosted runners for VMs of other platforms.
Github only hosts a limited number of platforms, and the runner code
is only supported on slightly wider range of platforms. To increase
our test coverage beyond that, we run the runner natively on a VM host,
where it runs a jobs that boot VMs of other platforms, waits for them
to come up then runs the build and test by ssh'ing into the guest.
This means that the minimum dependencies for the guests are quite low
(basically just sshd, a compiler and make).
The interface to the VM host is fairly simple (basically 3 scripts:
vmstartup, vmrun and vmshutdown), but those are specific to the VM host
so are not in the public repo. We also mount the working directory on the
host via sshfs, so things like artifact upload by the runner also work.
As part of this we are moving the per-test-target configs into a single
place (.github/configs) where there will be referenced by a single short
"config" key. I plan to make the github-hosted runners use this too.
The self-hosted runners are run off a private repo on github since that
prevents third parties from accessing them[0], and since runner quota is
limited on private repos, we avoid running the tests we run on the public
repo.
[0] https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners#self-hosted-runner-security-with-public-repositories
2021-01-15 03:11:43 +00:00
|
|
|
fi
|
|
|
|
fi
|