File: task.yaml

package info (click to toggle)
snapd 2.74.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 81,428 kB
  • sloc: sh: 16,966; ansic: 16,788; python: 11,332; makefile: 1,897; exp: 190; awk: 58; xml: 22
file content (52 lines) | stat: -rw-r--r-- 1,868 bytes parent folder | download
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 the refresh command works.

details: |
    These tests exercise the refresh command using different store backends.
    The concrete store to be used is controlled with the STORE_TYPE variant,
    the defined values are fake, for a local store, or remote, for the currently
    configured remote store.
    When executing against the remote stores the tests rely in the existence of
    a given snap with an updatable version (version string like 2.0+fake1) in the
    edge channel.

# ubuntu-14.04: systemd-run not supported
systems: [-ubuntu-14.04*]

environment:
    SNAP_NAME: test-snapd-tools
    SNAP_VERSION_PATTERN: \d+\.\d+\+fake1
    BLOB_DIR: $(pwd)/fake-store-blobdir
    STORE_TYPE/fake: fake
    STORE_TYPE/remote: ${REMOTE_STORE}

skip:
    - reason: This test needs test keys to be trusted using fakestore
      if: |
        [ "$STORE_TYPE" = "fake" ] && ( os.query is-core || [ "$TRUST_TEST_KEYS" = "false" ] )

prepare: |
    echo "Given a snap is installed"
    snap install --devmode test-snapd-tools

    if [ "$STORE_TYPE" = "fake" ]; then
        "$TESTSTOOLS"/store-state setup-fake-store "$BLOB_DIR"

        echo "And a new version of that snap put in the controlled store"
        "$TESTSTOOLS"/store-state init-fake-refreshes "$BLOB_DIR" test-snapd-tools
    fi

restore: |
    "$TESTSTOOLS"/store-state teardown-fake-store "$BLOB_DIR"

execute: |
    # FIXME: currently the --list from channel doesn't work
    # echo "Then the new version is available for the snap to be refreshed"
    # expected="$SNAP_NAME +$SNAP_VERSION_PATTERN"
    # snap refresh --list | grep -Pzq "$expected"

    echo "When the snap is refreshed"
    snap refresh --devmode --channel=edge "$SNAP_NAME"

    echo "Then the new version is listed"
    expected="$SNAP_NAME +$SNAP_VERSION_PATTERN .*devmode"
    snap list | grep -Pzq "$expected"