mirror of
https://github.com/token2/snapd.git
synced 2026-03-13 11:15:47 -07:00
In Debian and Ubuntu, sshd.service is an alias for ssh.service and always has been. Reload the service by its proper name in our test suite. This is necessary because ssh is switching to socket activation in later Ubuntu releases, which means the ssh.service is no longer enabled (in favor of ssh.socket) and therefore the sshd.service alias is not registered.
52 lines
1.5 KiB
Bash
52 lines
1.5 KiB
Bash
#!/bin/sh
|
|
|
|
set -ex
|
|
|
|
# required for the debian adt host
|
|
mkdir -p /etc/systemd/system/snapd.service.d/
|
|
if [ "${http_proxy:-}" != "" ]; then
|
|
cat <<EOF | tee /etc/systemd/system/snapd.service.d/proxy.conf
|
|
[Service]
|
|
Environment=http_proxy=$http_proxy
|
|
Environment=https_proxy=$http_proxy
|
|
EOF
|
|
|
|
# ensure environment is updated
|
|
echo "http_proxy=$http_proxy" >> /etc/environment
|
|
echo "https_proxy=$http_proxy" >> /etc/environment
|
|
fi
|
|
systemctl daemon-reload
|
|
|
|
# ensure we are not get killed too easily
|
|
printf '%s\n' "-950" > /proc/$$/oom_score_adj
|
|
|
|
# see what mem we have (for debugging)
|
|
cat /proc/meminfo
|
|
|
|
# ensure we can do a connect to localhost
|
|
echo ubuntu:ubuntu|chpasswd
|
|
sed -i 's/\(PermitRootLogin\|PasswordAuthentication\)\>.*/\1 yes/' /etc/ssh/sshd_config
|
|
systemctl reload ssh.service
|
|
|
|
# Map snapd deb package pockets to core snap channels. This is intended to cope
|
|
# with the autopkgtest execution when testing packages from the different pockets
|
|
if apt -qq list snapd | grep -q -- -proposed; then
|
|
export SPREAD_CORE_CHANNEL=candidate
|
|
elif apt -qq list snapd | grep -q -- -updates; then
|
|
export SPREAD_CORE_CHANNEL=stable
|
|
fi
|
|
|
|
# Spread will only buid with recent go
|
|
snap install --classic go
|
|
|
|
# and now run spread against localhost
|
|
# shellcheck disable=SC1091
|
|
. /etc/os-release
|
|
export GOPATH=/tmp/go
|
|
/snap/bin/go get -u github.com/snapcore/spread/cmd/spread
|
|
/tmp/go/bin/spread -v "autopkgtest:${ID}-${VERSION_ID}-$(dpkg --print-architecture)":tests/smoke/
|
|
|
|
# store journal info for inspectsion
|
|
journalctl --sync
|
|
journalctl -ab > "$ADT_ARTIFACTS"/journal.txt
|