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 (38 lines) | stat: -rw-r--r-- 1,192 bytes parent folder | download | duplicates (3)
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
34
35
36
37
38
summary: Reproduce a known issue of snap try failure with hooks

details: |
  This regression test shows an existing issue, that has not been fixed, with
  the meaning of pre-refresh hooks when used in a "snap try" installed snap
  package, where the difference between old and new revisions is lost due to the
  nature of the technical implementation of try.

prepare: |
  cp -a "$TESTSLIB"/snaps/basic ./
  # in case the snap is modified to have the hook
  rm -f basic/meta/hooks/pre-refresh

execute: |
    echo "Snap try a snap without pre-refresh hook"
    snap try basic

    echo "Snap try again"
    snap try basic

    echo "Remove the snap and snap try again"
    snap remove --purge basic

    snap try basic

    echo "Snap try, now with pre-refresh hook"
    mkdir -p basic/meta/hooks
    echo "#!/bin/sh" > basic/meta/hooks/pre-refresh
    chmod +x basic/meta/hooks/pre-refresh

    # TODO: This should not fail, but it does. Update the test once the issue of second snap try with a new hook is fixed.
    echo "Expecting snap try to fail"
    if snap try basic; then
        echo "Expected snap try with a new hook to fail"
        exit 1
    fi

    snap remove --purge basic