5 # default to Debian testing
6 DISTRO
=${DISTRO:-debian}
7 RELEASE
=${RELEASE:-buster}
9 CONTAINER
=${RELEASE}-${ARCH}
11 # remove semaphore repos, some of them don't work and cause error messages
12 sudo
rm -f /etc
/apt
/sources.list.d
/*
14 # enable backports for latest LXC
15 echo 'deb http://archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse' | sudo
tee -a /etc
/apt
/sources.list.d
/backports.list
16 sudo apt-get
-q update
17 sudo apt-get
install -y -t xenial-backports lxc
18 sudo apt-get
install -y python3-debian git dpkg-dev fakeroot
20 AUTOPKGTESTDIR
=${SEMAPHORE_CACHE_DIR:-/tmp}/autopkgtest
21 [ -d $AUTOPKGTESTDIR ] || git clone
--quiet --depth=1 https
://salsa.debian.org
/ci-team
/autopkgtest.git
"$AUTOPKGTESTDIR"
23 # TODO: cache container image (though downloading/building it takes < 1 min)
24 # create autopkgtest LXC image
25 sudo lxc-create
-n $CONTAINER -t download
-- -d $DISTRO -r $RELEASE -a $ARCH
27 # unconfine the container, otherwise some tests fail
28 echo 'lxc.apparmor.profile = unconfined' | sudo
tee -a /var
/lib
/lxc
/$CONTAINER/config
30 sudo lxc-start
-n $CONTAINER
32 # enable source repositories so that apt-get build-dep works
33 sudo lxc-attach
-n $CONTAINER -- sh
-ex <<EOF
34 sed 's/^deb/deb-src/' /etc/apt/sources.list >> /etc/apt/sources.list.d/sources.list
36 while [ -z "\$(ip route list 0/0)" ]; do sleep 1; done
38 apt-get -y dist-upgrade
39 apt-get install -y eatmydata
41 sudo lxc-stop
-n $CONTAINER