File: task.yaml

package info (click to toggle)
snapd 2.71-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 79,536 kB
  • sloc: ansic: 16,114; sh: 16,105; python: 9,941; makefile: 1,890; exp: 190; awk: 40; xml: 22
file content (33 lines) | stat: -rw-r--r-- 1,344 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
summary: Ensure that removing a layout works as expected

details: |
  This test installs a test snap that uses layout declarations and
  then refreshes it with a new version that removes one of the
  layouts.

prepare: |
  "$TESTSTOOLS"/snaps-state install-local test-snapd-layout

execute: |
  snap pack test-layout-v1
  snap pack test-layout-v2
  snap install --dangerous test-layout_1.0_all.snap
  # Check layouts. Note that the mount namespace is created in the first run.
  test-layout.test -c "test -d /var/test_tmpfs"
  test-layout.test -c "test -d /var/lib/test_common"
  test-layout.test -c "test -d /var/lib/test_data"
  # Layouts have been configured
  MATCH test_tmpfs < /run/snapd/ns/snap.test-layout.fstab
  MATCH test_common < /run/snapd/ns/snap.test-layout.fstab
  MATCH test_data < /run/snapd/ns/snap.test-layout.fstab

  # Refreshing will update the mount namespace
  snap install --dangerous test-layout_1.1_all.snap
  # Should run fine
  test-layout.test -c "test -d /var/test_tmpfs"
  not test-layout.test -c "test -d /var/lib/test_common"
  not test-layout.test -c "test -d /var/lib/test_data"
  # There is no trace of the removed layouts
  MATCH test_tmpfs < /run/snapd/ns/snap.test-layout.fstab
  not MATCH test_common < /run/snapd/ns/snap.test-layout.fstab
  not MATCH test_data < /run/snapd/ns/snap.test-layout.fstab