Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Commit

Permalink
Add spread regression test for LP:1595444
Browse files Browse the repository at this point in the history
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
  • Loading branch information
zyga committed Jun 23, 2016
1 parent a39fb3f commit 93c9ff2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
15 changes: 15 additions & 0 deletions spread-tests/regression/lp-1595444/task.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
summary: Regression check for https://bugs.launchpad.net/snap-confine/+bug/1595444
# This is blacklisted on debian because we first have to get the dpkg-vendor patches
systems: [-debian-8]
execute: |
echo "Having installed the snapd-hacker-toolbelt snap"
snap list | grep -q snapd-hacker-toolbelt || snap install snapd-hacker-toolbelt
echo "We can go to a location that is available in all snaps (/tmp)"
echo "We can run the 'cwd' tool from busybox and it reports /tmp"
[ "$(cd /tmp && /snap/bin/snapd-hacker-toolbelt.busybox pwd)" = "/tmp" ]
echo "But if we go to a location that is not available to snaps (e.g. $HOME/.cache)"
echo "Then the same 'cwd' tool reports the root directory instead"
mkdir -p $HOME/.cache/
[ "$(cd $HOME/.cache && /snap/bin/snapd-hacker-toolbelt.busybox pwd)" = "/" ]
11 changes: 9 additions & 2 deletions spread.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,37 @@ prepare: |
echo "Spread is running as $(id)"
[ "$REUSE_PROJECT" != 1 ] || exit 0
release_ID="$( . /etc/os-release && echo "${ID:-linux}" )"
case $release_ID in
ubuntu)
# apt update is hanging on security.ubuntu.com with IPv6.
sysctl -w net.ipv6.conf.all.disable_ipv6=1
trap "sysctl -w net.ipv6.conf.all.disable_ipv6=0" EXIT
;;
debian)
echo "deb http://ftp.de.debian.org/debian sid main" > /etc/apt/sources.list.d/snappy.list
;;
esac
case $release_ID in
ubuntu|debian)
apt-get purge -y snap-confine || true
apt-get update
apt-get install --quiet -y fakeroot
# Build a local copy of snap-confine
apt-get install --quiet -y autoconf automake autotools-dev debhelper dh-apparmor dh-autoreconf indent libapparmor-dev libseccomp-dev libudev-dev pkg-config shellcheck udev
test -d /home/test || adduser --quiet --disabled-password --gecos '' test
chown test.test -R ..
sudo -i -u test /bin/sh -c "cd $PWD && DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -tc -b -Zgzip"
dpkg -i ../snap-confine_*.deb || apt-get -f install -y
dpkg -i ../ubuntu-core-launcher_*.deb || apt-get -f install -y
rm -f ../snap-confine_*.deb ../ubuntu-core-launcher_*.deb
# Install snapd (testes require it)
apt-get install -y snapd
;;
esac
# Install the core snap
snap list | grep -q ubuntu-core || snap install ubuntu-core
suites:
spread-tests/:
summary: Full-system tests for snap-confine
spread-tests/regression/:
summary: Regression tests for past bug-fixes

0 comments on commit 93c9ff2

Please sign in to comment.