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 (36 lines) | stat: -rw-r--r-- 1,235 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
summary: Check that `snap set {system,core} network.disable-ipv6` works

details: |
    In Ubuntu Core systems network.disable-ipv6 core/system config can be used
    to enable and disable the ip v6 protocol.

    This test verifies that when network.disable-ipv6 core/system config is set
    to true, then the ipv6 is disable in the system. Also it is verified that when
    the config is set to false, then the ipv6 is enabled in the system.

environment:
    snap_nick/system: system
    snap_nick/core: core

execute: |
    echo "Ensure we have inet6"
    ip addr | MATCH inet6

    echo "Disable ipv6"
    # shellcheck disable=SC2154
    snap set "$snap_nick" network.disable-ipv6=true
    MATCH "net.ipv6.conf.all.disable_ipv6=1" < /etc/sysctl.d/10-snapd-network.conf
    if ip addr | grep -q inet6; then
        echo "Disable of ipv6 did not work"
        ip addr
        exit 1
    fi

    echo "Enable ipv6"
    snap set "$snap_nick" network.disable-ipv6=false
    not test -f /etc/sysctl.d/10-snapd-network.conf
    sysctl net.ipv6.conf.all.disable_ipv6 | MATCH "net.ipv6.conf.all.disable_ipv6 = 0"

    echo "Reset ipv6"
    snap set "$snap_nick" network.disable-ipv6=""
    not test -f /etc/sysctl.d/10-snapd-network.conf