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 (39 lines) | stat: -rw-r--r-- 1,402 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
39
summary: Ensure catalog update works

details: |
    Verify that catalog refresh happens on snapd startup. Also check
    unnecessary catalog body data is not logged.

environment:
    # on core systems, the catalog update is not performed when memory limit is
    # in place
    SNAPD_NO_MEMORY_LIMIT: 1

prepare: |
    echo "Remove cached catalog files from disk"
    rm -f /var/cache/snapd/names
    rm -f /var/cache/snapd/sections

execute: |
    echo "We count how many catalog refreshes are logged before starting snapd"
    refreshes_before="$("$TESTSTOOLS"/journal-state get-log -u snapd | grep -c 'Catalog refresh' || true)"

    systemctl restart snapd.{socket,service}

    echo "Ensure that catalog refresh happens on startup"
    for _ in $(seq 60); do
        refreshes_after="$("$TESTSTOOLS"/journal-state get-log -u snapd | grep -c 'Catalog refresh' || true)"
        if [ "$refreshes_after" -gt "$refreshes_before" ]; then
            break
        fi
        sleep 1
    done

    echo "Ensure the current number of refreshes is greater than before restarting snapd"
    [ "$refreshes_after" -gt "$refreshes_before" ]

    echo "Ensure that we don't log all catalog body data"
    if "$TESTSTOOLS"/journal-state get-log -u snapd | MATCH "Tools for testing the snapd application"; then
        echo "Catalog update is doing verbose http logging (it should not)."
        exit 1
    fi