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 (32 lines) | stat: -rw-r--r-- 1,511 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
summary: verify that the /systems/<label> api works

details: |
  Verify the basic functionality for the /systems/<label> API

systems:
  # TODO: also test classic/core hybrid systems once they are ready
  - ubuntu-core-2*

execute: |
  echo "Find what systems are available"
  snap debug api /v2/systems > systems
  current_label=$(gojq -r '.result.systems[0]["label"]' < systems)

  echo "Get details for a specific system"
  snap debug api "/v2/systems/$current_label" > current-system
  echo "Ensure the result contains a model assertion"
  gojq -r '.result.model.type' < current-system | MATCH model
  gojq -r '.result.model.series' < current-system | MATCH 16
  gojq -r '.result.model.base' < current-system | MATCH "core[0-9][0-9]"
  echo "Ensure the result looks like a systems reply"
  gojq -r '.result.brand.id' < current-system | MATCH "$(snap model --verbose|awk '/brand-id:/ {print $2}')"
  gojq -r '.result.brand.validation' < current-system | MATCH '(verified|unproven|starred)'
  gojq -r '.result.label' < current-system | MATCH "$current_label"
  gojq -r '.result.current' < current-system | MATCH '(true|false)'
  # we expect at least one current action to be available and
  # each action always has a mode
  gojq -r '.result.actions[0]' < current-system | MATCH 'mode'
  echo "Ensure the result contains the gadget volumes"
  gojq -r '.result.volumes' < current-system | MATCH bootloader
  # internal fields are not exported
  gojq -r '.result.volumes' < current-system | NOMATCH VolumeName