diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 0b06c9c416f..9b5b3cda3c9 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -71,7 +71,7 @@ jobs: matrix: gochannel: - 1.9 - - latest/edge + - latest/stable steps: - name: Checkout code uses: actions/checkout@v2 diff --git a/cmd/snapd-generator/main.c b/cmd/snapd-generator/main.c index fad126af31e..006ea84e922 100644 --- a/cmd/snapd-generator/main.c +++ b/cmd/snapd-generator/main.c @@ -99,13 +99,20 @@ static bool file_exists(const char *path) { return stat(path, &buf) == 0 && (buf.st_mode & S_IFMT) == S_IFREG; } +// PATH may not be set (the case on 16.04), in which case this is the fallback +// for looking up squashfuse / snapfuse executable. +// Based on what systemd uses when compiled for systems with "unmerged /usr" +// (see man systemd.exec). +static const char * const path_fallback = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"; + static bool executable_exists(const char *name) { char *path = getenv("PATH"); + char *path_copy SC_CLEANUP(sc_cleanup_string) = NULL; if (path == NULL) { - return false; + path_copy = sc_strdup(path_fallback); + } else { + path_copy = sc_strdup(path); } - char *path_copy SC_CLEANUP(sc_cleanup_string) = NULL; - path_copy = sc_strdup(path); char *ptr = NULL; char *token = strtok_r(path_copy, ":", &ptr); diff --git a/secboot/encrypt_tpm.go b/secboot/encrypt_tpm.go index a1e918e88d5..08d360aacb1 100644 --- a/secboot/encrypt_tpm.go +++ b/secboot/encrypt_tpm.go @@ -29,12 +29,16 @@ var ( sbAddRecoveryKeyToLUKS2Container = sb.AddRecoveryKeyToLUKS2Container ) -// FormatEncryptedDevice +// FormatEncryptedDevice initializes an encrypted volume on the block device +// given by node, setting the specified label. The key used to unlock the +// volume is provided using the key argument. func FormatEncryptedDevice(key EncryptionKey, label, node string) error { return sbInitializeLUKS2Container(node, label, key[:]) } -// AddRecoveryKey +// AddRecoveryKey adds a fallback recovery key rkey to the existing encrypted +// volume created with FormatEncryptedDevice on the block device given by node. +// The existing key to the encrypted volume is provided in the key argument. func AddRecoveryKey(key EncryptionKey, rkey RecoveryKey, node string) error { return sbAddRecoveryKeyToLUKS2Container(node, key[:], rkey) } diff --git a/tests/lib/nested.sh b/tests/lib/nested.sh index 41c936e8207..38fb24e54f6 100644 --- a/tests/lib/nested.sh +++ b/tests/lib/nested.sh @@ -94,9 +94,6 @@ get_google_image_url_for_nested_vm(){ ubuntu-18.04-64) echo "https://storage.googleapis.com/spread-snapd-tests/images/cloudimg/bionic-server-cloudimg-amd64.img" ;; - ubuntu-19.10-64) - echo "https://storage.googleapis.com/spread-snapd-tests/images/cloudimg/eoan-server-cloudimg-amd64.img" - ;; ubuntu-20.04-64) echo "https://storage.googleapis.com/spread-snapd-tests/images/cloudimg/focal-server-cloudimg-amd64.img" ;; @@ -118,9 +115,6 @@ get_ubuntu_image_url_for_nested_vm(){ ubuntu-18.04-64*) echo "https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img" ;; - ubuntu-19.10-64*) - echo "https://cloud-images.ubuntu.com/eoan/current/eoan-server-cloudimg-amd64.img" - ;; ubuntu-20.04-64*) echo "https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64.img" ;; diff --git a/tests/lib/pkgdb.sh b/tests/lib/pkgdb.sh index fe977488187..e59fe1dfcbf 100755 --- a/tests/lib/pkgdb.sh +++ b/tests/lib/pkgdb.sh @@ -639,14 +639,6 @@ pkg_dependencies_ubuntu_classic(){ qemu-utils " ;; - ubuntu-19.10-64) - echo " - evolution-data-server - fwupd - packagekit - qemu-utils - " - ;; ubuntu-20.04-64) echo " evolution-data-server diff --git a/tests/main/apt-hooks/task.yaml b/tests/main/apt-hooks/task.yaml index 5b6834f29d0..85a9151fe65 100644 --- a/tests/main/apt-hooks/task.yaml +++ b/tests/main/apt-hooks/task.yaml @@ -1,7 +1,7 @@ summary: Ensure apt hooks work # apt hook only available on 18.04+ and aws-cli only for amd64 -systems: [ubuntu-18.04-64, ubuntu-19.10-64, ubuntu-2*-64] +systems: [ubuntu-18.04-64, ubuntu-2*-64] manual: true diff --git a/tests/main/cgroup-tracking-failure/task.yaml b/tests/main/cgroup-tracking-failure/task.yaml index 9174914c1cc..d78695a441d 100644 --- a/tests/main/cgroup-tracking-failure/task.yaml +++ b/tests/main/cgroup-tracking-failure/task.yaml @@ -33,7 +33,7 @@ execute: | # package pre-installed. To exercise the case that is similar to real # systems, where snapd does not depend on this package and it is not # pre-installed on standard images, we mask the dbus.socket for the user - # session. This is done for Ubuntu 16.04 and 18.04, because only 19.10 + # session. This is done for Ubuntu 16.04 and 18.04, because only 20.04 # started shipping dbus-user-session in all the images. echo "run a snap app as a root user, without session bus" >scenario.txt find /run/user/0 >run.txt diff --git a/tests/main/desktop-portal-filechooser/task.yaml b/tests/main/desktop-portal-filechooser/task.yaml index 75521a3ad44..3beff918418 100644 --- a/tests/main/desktop-portal-filechooser/task.yaml +++ b/tests/main/desktop-portal-filechooser/task.yaml @@ -16,8 +16,7 @@ description: | # Only enable the test on systems we know portals to function on. # Expand as needed. # ubuntu-18.04-*: Ships xdg-desktop-portal 0.11 -# ubuntu-19.10-*: Ships xdg-desktop-portal 1.2.0 -systems: [ubuntu-18.04-*, ubuntu-19.10-*, ubuntu-2*] +systems: [ubuntu-18.04-*, ubuntu-2*] prepare: | #shellcheck source=tests/lib/desktop-portal.sh diff --git a/tests/main/desktop-portal-open-file/task.yaml b/tests/main/desktop-portal-open-file/task.yaml index 065f1dfef7f..9ab4d68a81d 100644 --- a/tests/main/desktop-portal-open-file/task.yaml +++ b/tests/main/desktop-portal-open-file/task.yaml @@ -9,7 +9,7 @@ description: | # Only enable the test on systems we know portals to function on. # Expand as needed. -systems: [ubuntu-18.04-*, ubuntu-19.10-*, ubuntu-2*] +systems: [ubuntu-18.04-*, ubuntu-2*] environment: EDITOR_HISTORY: /tmp/editor-history.txt diff --git a/tests/main/desktop-portal-open-uri/task.yaml b/tests/main/desktop-portal-open-uri/task.yaml index ee7a623b1ec..83f86aeae61 100644 --- a/tests/main/desktop-portal-open-uri/task.yaml +++ b/tests/main/desktop-portal-open-uri/task.yaml @@ -6,7 +6,7 @@ description: | # Only enable the test on systems we know portals to function on. # Expand as needed. -systems: [ubuntu-18.04-*, ubuntu-19.10-*, ubuntu-2*] +systems: [ubuntu-18.04-*, ubuntu-2*] environment: BROWSER_HISTORY: /tmp/browser-history.txt diff --git a/tests/main/desktop-portal-screenshot/task.yaml b/tests/main/desktop-portal-screenshot/task.yaml index a04aed2c946..6308397ba38 100644 --- a/tests/main/desktop-portal-screenshot/task.yaml +++ b/tests/main/desktop-portal-screenshot/task.yaml @@ -20,7 +20,7 @@ description: | # Only enable the test on systems we know portals to function on. # Expand as needed. -systems: [ubuntu-18.04-*, ubuntu-19.10-*, ubuntu-2*] +systems: [ubuntu-18.04-*, ubuntu-2*] prepare: | #shellcheck source=tests/lib/desktop-portal.sh diff --git a/tests/main/interfaces-audio-playback-record/task.yaml b/tests/main/interfaces-audio-playback-record/task.yaml index fe949b575f8..c206dc2b6ff 100644 --- a/tests/main/interfaces-audio-playback-record/task.yaml +++ b/tests/main/interfaces-audio-playback-record/task.yaml @@ -2,7 +2,7 @@ summary: Ensure that the audio-playback/record interface works # Only classic Ubuntu has the pulseaudio mediation patches. Ubuntu 14.04 is unsupported on the desktop. # TODO: extend tests.session and run this test on 14.04 as well. -systems: [ubuntu-16.04-*, ubuntu-18.04-*, ubuntu-19.10-*, ubuntu-2*] +systems: [ubuntu-16.04-*, ubuntu-18.04-*, ubuntu-2*] environment: PLAY_FILE: "/snap/test-snapd-audio-record/current/usr/share/sounds/alsa/Noise.wav" diff --git a/tests/main/interfaces-calendar-service/task.yaml b/tests/main/interfaces-calendar-service/task.yaml index 178aa650fb3..61afb27e387 100644 --- a/tests/main/interfaces-calendar-service/task.yaml +++ b/tests/main/interfaces-calendar-service/task.yaml @@ -5,7 +5,7 @@ summary: Ensure that the calendar-service interface works # # FIXME: disable opensuse-tumbleweed until # https://github.com/snapcore/snapd/pull/7230 is landed -# ubuntu-19.10+: test-snapd-eds is incompatible with eds version shipped with the distro +# ubuntu-20.04+: test-snapd-eds is incompatible with eds version shipped with the distro # arch-linux: test-snapd-eds is incompatible with eds version shipped with the distro # fedora-31: test-snapd-eds is incompatible with eds version shipped with the distro # fedora-32: test-snapd-eds is incompatible with eds version shipped with the distro @@ -18,8 +18,7 @@ systems: - -fedora-32-* # test-snapd-eds is incompatible with eds version shipped with the distro - -opensuse-tumbleweed-* # test-snapd-eds is incompatible with eds version shipped with the distro - -ubuntu-14.04-* # no tests.session support, eds is too old - - -ubuntu-19.10-* # test-snapd-eds is incompatible with eds shipped with the distro - - -ubuntu-2* + - -ubuntu-2* # test-snapd-eds is incompatible with eds shipped with the distro - -ubuntu-core-* # EDS is unsupported on core systems # fails in the autopkgtest env with: diff --git a/tests/main/interfaces-contacts-service/task.yaml b/tests/main/interfaces-contacts-service/task.yaml index 732a624c676..4e2259b50bc 100644 --- a/tests/main/interfaces-contacts-service/task.yaml +++ b/tests/main/interfaces-contacts-service/task.yaml @@ -11,8 +11,7 @@ systems: - -fedora-32-* # test-snapd-eds is incompatible with eds version shipped with the distro - -opensuse-tumbleweed-* # test-snapd-eds is incompatible with eds version shipped with the distro - -ubuntu-14.04-* # no tests.session support, eds is too old - - -ubuntu-19.10-* # test-snapd-eds is incompatible with eds shipped with the distro - - -ubuntu-2* + - -ubuntu-2* # test-snapd-eds is incompatible with eds shipped with the distro - -ubuntu-core-* # EDS is unsupported on core systems # fails in autopkgtest environment with: diff --git a/tests/main/interfaces-pulseaudio/task.yaml b/tests/main/interfaces-pulseaudio/task.yaml index 2e3651bc7ee..fdd483e31aa 100644 --- a/tests/main/interfaces-pulseaudio/task.yaml +++ b/tests/main/interfaces-pulseaudio/task.yaml @@ -2,7 +2,7 @@ summary: Ensure that the pulseaudio interface works # Only classic Ubuntu has the pulseaudio mediation patches. Ubuntu 14.04 is unsupported on the desktop. # TODO: extend tests.session and run this test on 14.04 as well. -systems: [ubuntu-16.04-*, ubuntu-18.04-*, ubuntu-19.10-*, ubuntu-2*] +systems: [ubuntu-16.04-*, ubuntu-18.04-*, ubuntu-2*] environment: PLAY_FILE: "/snap/test-snapd-pulseaudio/current/usr/share/sounds/alsa/Noise.wav" diff --git a/tests/main/interfaces-timeserver-control/task.yaml b/tests/main/interfaces-timeserver-control/task.yaml index f0c7cae6046..b9139cb97f2 100644 --- a/tests/main/interfaces-timeserver-control/task.yaml +++ b/tests/main/interfaces-timeserver-control/task.yaml @@ -25,10 +25,6 @@ prepare: | apt-get remove -y ntp tests.cleanup defer apt-get install -y ntp ;; - ubuntu-19.10-*) - apt-get remove -y chrony - tests.cleanup defer apt-get install -y chrony - ;; *) case "$(busctl get-property org.freedesktop.timedate1 /org/freedesktop/timedate1 org.freedesktop.timedate1 NTP)" in "b true") diff --git a/tests/main/interfaces-udisks2/task.yaml b/tests/main/interfaces-udisks2/task.yaml index c7ba2b405e9..48b8e14f55d 100644 --- a/tests/main/interfaces-udisks2/task.yaml +++ b/tests/main/interfaces-udisks2/task.yaml @@ -4,8 +4,9 @@ details: | The udisks2 interface allows operating as or interacting with the UDisks2 service # Interfaces not defined for ubuntu core systems -# FIXME: fails in debian-sid for unknown reasons -systems: [-ubuntu-core-*, -debian-sid-*] +# FIXME: `udisksctl mount -b "$device"` fails on arch with: +# Object /org/freedesktop/UDisks2/block_devices/loop200 is not a mountable filesystem. +systems: [-ubuntu-core-*, -arch-linux-*] prepare: | snap install test-snapd-udisks2 diff --git a/tests/main/lxd/task.yaml b/tests/main/lxd/task.yaml index 19922cf66ed..a3d8df0cfab 100644 --- a/tests/main/lxd/task.yaml +++ b/tests/main/lxd/task.yaml @@ -92,8 +92,9 @@ execute: | # prep two containers, the my-ubuntu normal container and the # my-nesting-ubuntu nesting container - lxd.lxc launch --quiet "ubuntu:${VERSION_ID:-}" my-ubuntu - lxd.lxc launch --quiet "ubuntu:${VERSION_ID:-}" my-nesting-ubuntu -c security.nesting=true + VERSION_ID="$(. /etc/os-release && echo "$VERSION_ID" )" + lxd.lxc launch --quiet "ubuntu:$VERSION_ID" my-ubuntu + lxd.lxc launch --quiet "ubuntu:$VERSION_ID" my-nesting-ubuntu -c security.nesting=true if [ "$(uname -m)" = x86_64 ] && lxd.lxc info my-ubuntu | grep "Architecture: i686"; then echo "LXD spawned 32bit userspace container on a 64bit host, WAT?" snap info lxd @@ -143,6 +144,7 @@ execute: | echo "Sanity check that mount overrides were generated inside the container" lxd.lxc exec my-ubuntu -- find /var/run/systemd/generator/ -name container.conf | MATCH "/var/run/systemd/generator/snap-core-.*mount.d/container.conf" + lxd.lxc exec my-ubuntu -- test -f /var/run/systemd/generator/snap.mount # Ensure that we can run lxd as a snap inside a nested container diff --git a/tests/main/preseed-reset/task.yaml b/tests/main/preseed-reset/task.yaml index 578fc211a94..400ea5602a2 100644 --- a/tests/main/preseed-reset/task.yaml +++ b/tests/main/preseed-reset/task.yaml @@ -3,7 +3,7 @@ description: | This test checks that preseeding of Ubuntu cloud images with snap-preseed can be undone with --reset flag. -systems: [ubuntu-19.10-*, ubuntu-2*] +systems: [ubuntu-2*] environment: IMAGE_MOUNTPOINT: /mnt/cloudimg @@ -34,13 +34,7 @@ restore: | execute: | find_files() { - # ubuntu-19.10 doesn't have new snapd deb yet, so exclude applications dir for now - # TODO: remove after 2.44 is there. - if [[ "$SPREAD_SYSTEM" = ubuntu-19.10-64 ]]; then - find "$IMAGE_MOUNTPOINT/etc/" "$IMAGE_MOUNTPOINT/usr/" "$IMAGE_MOUNTPOINT/var/" | grep -v "/var/lib/snapd/desktop/applications" - else - find "$IMAGE_MOUNTPOINT/etc/" "$IMAGE_MOUNTPOINT/usr/" "$IMAGE_MOUNTPOINT/var/" - fi + find "$IMAGE_MOUNTPOINT/etc/" "$IMAGE_MOUNTPOINT/usr/" "$IMAGE_MOUNTPOINT/var/" } find_files > before-preseeding.txt diff --git a/tests/main/preseed/task.yaml b/tests/main/preseed/task.yaml index 0ed804e4936..56486d0dd88 100644 --- a/tests/main/preseed/task.yaml +++ b/tests/main/preseed/task.yaml @@ -4,7 +4,7 @@ description: | command works, up to the point where the image is ready to be booted. The test assumes cloud image with a core and lxd snaps in its seeds/. -systems: [ubuntu-19.10-*, ubuntu-2*] +systems: [ubuntu-2*] environment: IMAGE_MOUNTPOINT: /mnt/cloudimg diff --git a/tests/main/seccomp-statx/task.yaml b/tests/main/seccomp-statx/task.yaml index c0c6d8a1768..c444d20471c 100644 --- a/tests/main/seccomp-statx/task.yaml +++ b/tests/main/seccomp-statx/task.yaml @@ -7,7 +7,7 @@ details: | # This test will only pass on systems with seccomp 2.3.3 or newer which # is available on all Ubuntu LTS releases. -systems: [ubuntu-16.04-*, ubuntu-18.04-*, ubuntu-19.10-*, ubuntu-2*] +systems: [ubuntu-16.04-*, ubuntu-18.04-*, ubuntu-2*] prepare: | #shellcheck source=tests/lib/snaps.sh diff --git a/tests/main/snapd-slow-startup/task.yaml b/tests/main/snapd-slow-startup/task.yaml index 3f7bc825605..40e2538686b 100644 --- a/tests/main/snapd-slow-startup/task.yaml +++ b/tests/main/snapd-slow-startup/task.yaml @@ -1,6 +1,6 @@ summary: Test that snapd is not terminated by systemd on a slow startup -systems: [ubuntu-18.04-64, ubuntu-19.10-64] +systems: [ubuntu-18.04-64] restore: | # extra cleanup in case something in this test went wrong diff --git a/tests/main/xdg-open-portal/task.yaml b/tests/main/xdg-open-portal/task.yaml index c8c481726cf..f55adec856d 100644 --- a/tests/main/xdg-open-portal/task.yaml +++ b/tests/main/xdg-open-portal/task.yaml @@ -13,7 +13,6 @@ systems: # be problematic. OpenSUSE 15.2 will hopefully be fine. - opensuse-tumbleweed-* - ubuntu-18.04-* - - ubuntu-19.10-* - ubuntu-2* environment: diff --git a/tests/nested/manual/preseed/task.yaml b/tests/nested/manual/preseed/task.yaml index 1ed8ff1d2c9..f981ef54b27 100644 --- a/tests/nested/manual/preseed/task.yaml +++ b/tests/nested/manual/preseed/task.yaml @@ -5,7 +5,7 @@ description: | command works, and the resulting image boots and finalizes seeding. The test assumes cloud image with a core and lxd snaps in its seeds/. -systems: [ubuntu-19.10-*, ubuntu-2*] +systems: [ubuntu-2*] environment: IMAGE_MOUNTPOINT: /mnt/cloudimg