#!/bin/bash

set -e

source debian/tests/utils/add-debusine-log-files-to-artifacts.sh

# work around debos/fakemachine needed systemd-resolved
# but installing it breaks network connection for salsa-ci
if [ ! -f /lib/systemd/systemd-resolved ]; then
	cp /etc/resolv.conf /etc/resolv.conf.backup
	systemctl mask systemd-resolved.service
	apt-get install -y systemd-resolved
	mv /etc/resolv.conf.backup /etc/resolv.conf
fi

[ -w /dev/kvm ] || apt-get install -y libslirp-helper user-mode-linux

debian/tests/utils/integration-tests-setup-debusine-all.sh

debian/tests/integration-tests-task-simplesystemimagebuild.py -v
