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 (44 lines) | stat: -rw-r--r-- 1,218 bytes parent folder | download | duplicates (2)
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
summary: Check that alias symlinks work correctly

details: |
    Verify that an alias symlink can be created manually
    and works properly


systems: [-ubuntu-core-*]

environment:
    APP/testsnapdtoolsecho: test-snapd-tools.echo
    APP/testsnapdtoolscat: test-snapd-tools.cat
    ALIAS/testsnapdtoolsecho: test_echo
    ALIAS/testsnapdtoolscat: test_cat

prepare: |
    "$TESTSTOOLS"/snaps-state install-local test-snapd-tools

restore: |
    SNAP_MOUNT_DIR="$(os.paths snap-mount-dir)"
    rm -f "$SNAP_MOUNT_DIR/bin/test_echo"
    rm -f "$SNAP_MOUNT_DIR/bin/test_cat"

execute: |
    SNAP_MOUNT_DIR="$(os.paths snap-mount-dir)"
    SNAP="$SNAP_MOUNT_DIR/test-snapd-tools/current"

    echo Testing that creating an alias symlinks works
    $APP "$SNAP/bin/cat"
    $APP "$SNAP/bin/cat" > orig.txt 2>&1

    ln -s "$APP" "$SNAP_MOUNT_DIR/bin/$ALIAS"

    $ALIAS "$SNAP/bin/cat"
    $ALIAS "$SNAP/bin/cat" > new.txt 2>&1

    if [ -n "$SNAPD_TRACE" ] && [ -n "$SNAPD_JSON_LOGGING" ]; then
        # When structured trace logging is active, the output
        # files will contain debug logs with timestamps that
        # will cause diff to fail so exit early
        exit 0
    fi

    diff -u orig.txt new.txt