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 (52 lines) | stat: -rw-r--r-- 2,030 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
summary: Check that install and refresh work with private snaps.

details: |
    These tests rely on the existence of a snap in the remote store set to private.

    In order to do the full checks, it also needs the credentials of the owner of that
    snap set in the environment variables SPREAD_STORE_USER and SPREAD_STORE_PASSWORD, if
    they are not present then only the negative check is performed.

# we don't have expect available on ubuntu-core, so the authenticated check need to be skipped on those systems
systems: [-ubuntu-core-*]

restore: |
    snap logout || true

execute: |
    echo "Cannot install a private snap without login"
    not snap install test-snapd-private

    echo "Given account store credentials are available"
    # we don't have expect available on ubuntu-core, so the authenticated check need to be skipped on those systems
    if [ -n "$SPREAD_STORE_USER" ] && [ -n "$SPREAD_STORE_PASSWORD" ]; then
        echo "And the user has logged in"
        expect -f "$TESTSLIB"/successful_login.exp

        echo "Check that after login it can be installed"
        snap install test-snapd-private
        snap list|MATCH 'test-snapd-private +1\.0.*private'

        echo "Check that refreshing also works"
        snap refresh --edge test-snapd-private
        snap list|MATCH 'test-snapd-private +2\.0.*private'

        echo "After removing it"
        snap remove --purge test-snapd-private

        echo "Install it together with a public snap"
        snap install test-snapd-private test-snapd-public

        echo "Switch both to edge"
        snap switch --edge test-snapd-private
        snap switch --edge test-snapd-public
        snap list|MATCH 'test-snapd-private +1\.0.*private'
        snap list|MATCH 'test-snapd-public +1\.0'

        echo "Proceed to refresh all, in particular both of them"
        snap refresh

        echo "Check they were both refreshed"
        snap list|MATCH 'test-snapd-private +2\.0.*private'
        snap list|MATCH 'test-snapd-public +2\.0'
    fi