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 (65 lines) | stat: -rw-r--r-- 2,205 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
53
54
55
56
57
58
59
60
61
62
63
64
65
summary: Check that the docker snap works basically

details: |
  Verify the docker snap can be installed and run a hello-world.
  Also check it can be installed with --devmode.

systems: [ubuntu-*]

environment:
  # downloading docker snap occasionally triggers OOM
  SNAPD_NO_MEMORY_LIMIT: 1
  CHANNEL: "latest/stable"
  IMAGE_URL_X86: https://storage.googleapis.com/snapd-spread-tests/images/docker/hello-world.tar
  IMAGE_URL_ARM: https://storage.googleapis.com/snapd-spread-tests/images/docker/hello-world-arm64.tar

prepare: |
  if ! snap install --channel="$CHANNEL" docker; then
      echo "failed to install the docker snap!"
      exit 1
  fi

  if [ "${SNAPD_USE_PROXY:-}" = true ]; then
    if ! command -v curl; then
        snap install --devmode --edge test-snapd-curl
        snap alias test-snapd-curl.curl curl
    fi
    if os.query is-arm; then
      IMAGE_URL=$IMAGE_URL_ARM
    else
      IMAGE_URL=$IMAGE_URL_X86
    fi
    # Save to the home directory to get around apparmor denials
    curl -sL "$IMAGE_URL" -o "$HOME"/hello-world.tar
    mv "$HOME"/hello-world.tar .
    # retry until docker is ready lo load images
    retry -n 30 --wait 1 docker load -i hello-world.tar  
  fi

debug: |
  "$TESTSTOOLS"/journal-state get-log -u snap.docker.dockerd

execute: |
  if [ "$SPREAD_REBOOT" = 0 ]; then
    # ubuntu trusty is not supported anymore
    if os.query is-trusty; then
        exit
    fi    

    # the retry here is because there's a race between installing the docker snap
    # and dockerd to be "ready" enough such that docker can talk to it properly
    retry -n 30 --wait 1 docker run hello-world | MATCH "installation appears to be working correctly"

    # also check that the docker snap can be installed in devmode for some 
    # specific customer use cases related to microk8s
    snap remove docker --purge
    snap install --channel="$CHANNEL" docker --devmode

    # Interface docker0 is not removed when docker is uninstalled
    # This problem is reproduced with docker snap and deb packages
    # Rules added in iptables also are not working properly after
    # docker is removed. A reboot is recommended.
    snap remove docker --purge

    REBOOT
  fi