File: task.yaml

package info (click to toggle)
snapd 2.72-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 80,412 kB
  • sloc: sh: 16,506; ansic: 16,211; python: 11,213; makefile: 1,919; exp: 190; awk: 58; xml: 22
file content (24 lines) | stat: -rw-r--r-- 766 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
summary: Test disconnect hook failure

details: |
  Test that failures of disconnect hook are handled gracefully and plug
  remains connected.

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

restore: |
  rm -f /var/snap/test-disconnect/common/do-not-fail

execute: |
  # precondition check, network is connected automatically
  snap connections | MATCH "test-disconnect:network .*:network"

  echo "Disconnect fails due to failing disconnect hook"
  snap disconnect test-disconnect:network 2>&1 | MATCH "failure of disconnect hook"

  echo "And network plug remains connected"
  snap connections | MATCH "test-disconnect:network .*:network"

  echo "Snap removal succeeds despite failing disconnect hook"
  snap remove --purge test-disconnect