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 (89 lines) | stat: -rw-r--r-- 3,038 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
summary: Test that downloads time-out on very slow connection.

details: |
  Test that snap download times out on a very slow connection. Download bandwidth
  is reduced with 'tc', and in addition the download parameters for snapd are
  tweaked for the test.

  ens3 is the interface for the external network and owns the Additional IP address
  in the subnet base with VLAN 0. ens4 is the interface for the internal network in
  the subnet infra with VLAN 1

systems: [ubuntu-18.04*, ubuntu-2*]

environment:
  # set minimum download speed that is a bit higher than the rate-limited speed set with tc.
  # also force a 15s window, so the test doesn't have to run for full 5 minutes (the default
  # window).
  SNAPD_MIN_DOWNLOAD_SPEED: 99000
  SNAPD_DOWNLOAD_MEAS_WINDOW: 15s
  OVERRIDES_FILE: /etc/systemd/system/snapd.service.d/local.conf

prepare: |
  if [ "${SNAPD_USE_PROXY:-}" = true ]; then
      # TODO: Fix the issue
      tests.exec skip-test "This test fails when proxy is set for snapd" && exit 0
  fi

  device=ens4
  if [[ "$SPREAD_BACKEND" =~ openstack ]]; then
    device=ens3
  fi

  if not os.query is-pc-amd64; then
      echo "tc fail to add a device in arm architecture with error: \"Cannot find device $device\""
      exit
  fi

  cp "$OVERRIDES_FILE" "$OVERRIDES_FILE".bak
  sed "s/Environment=/Environment=SNAPD_MIN_DOWNLOAD_SPEED=${SNAPD_MIN_DOWNLOAD_SPEED} SNAPD_DOWNLOAD_MEAS_WINDOW=${SNAPD_DOWNLOAD_MEAS_WINDOW} /" -i "$OVERRIDES_FILE"

  systemctl daemon-reload
  systemctl restart snapd.{socket,service}

restore: |
  tests.exec is-skipped && exit 0

  device=ens4
  if [[ "$SPREAD_BACKEND" =~ openstack ]]; then
    device=ens3
  fi

  if not os.query is-pc-amd64; then
      echo "tc fail to add a device in arm architecture with error: \"Cannot find device $device\""
      exit
  fi
  # We need to skip this step in 23+ because it fails with error:
  # Error: Qdisc not classful. We have an error talking to the kernel
  # The test works well even after skipping this
  if os.query is-ubuntu-le 22.04; then
      tc filter del dev "$device"
  fi
  tc qdisc del dev "$device" ingress

  mv "$OVERRIDES_FILE".bak "$OVERRIDES_FILE"
  systemctl daemon-reload
  systemctl restart snapd.{socket,service}

execute: |
  tests.exec is-skipped && exit 0

  device=ens4
  if [[ "$SPREAD_BACKEND" =~ openstack ]]; then
    device=ens3
  fi

  if not os.query is-pc-amd64; then
      echo "tc fail to add a device in arm architecture with error: \"Cannot find device $device\""
      exit
  fi

  tc qdisc add dev "$device" ingress
  tc filter add dev "$device" root protocol ip u32 match u32 0 0 police rate 32kbit burst 16k drop flowid :1
  tc filter add dev "$device" parent ffff: protocol ip u32 match u32 0 0 police rate 32kbit burst 16k drop flowid :1

  echo "Installing a large snap fails if connection is very slow"
  snap install --edge test-snapd-huge 2>&1 | MATCH "download too slow:"

  echo "Downloading a large snap fails too"
  snap download --edge test-snapd-huge 2>&1 | MATCH "download too slow:"