From cb2f5df6dde544280ff61bcbb279f80a23ef75ad Mon Sep 17 00:00:00 2001 From: alfonsosanchezbeato Date: Wed, 23 Feb 2022 18:59:48 +0100 Subject: [PATCH 1/3] t/m/interfaces-network-manager: use different channel depending on system (#11422) * t/m/interfaces-network-manager: use different channel depending on system Install network-manager from different channels depending on system under test. Due to tight integration with UC, each UC version requires a different NM snap. * using os.query instead of checking $SPREAD_SYSTEM Co-authored-by: Sergio Cazzolato --- tests/main/interfaces-network-manager/task.yaml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/main/interfaces-network-manager/task.yaml b/tests/main/interfaces-network-manager/task.yaml index 962f9576ecf..a872f888812 100644 --- a/tests/main/interfaces-network-manager/task.yaml +++ b/tests/main/interfaces-network-manager/task.yaml @@ -20,7 +20,15 @@ systems: - ubuntu-core-20-64 prepare: | - echo "Give a network-manager snap is installed" + echo "Given a network-manager snap is installed" + if os.query is-core16; then + snap install --channel=latest network-manager + elif os.query is-core18; then + snap install --channel=1.10 network-manager + else + snap install --channel=20 network-manager + fi + snap install network-manager execute: | @@ -34,7 +42,7 @@ execute: | done echo "The interface is connected by default" - snap interfaces -i network-manager | MATCH "network-manager:service .*network-manager:nmcli" + snap connections network-manager | MATCH "network-manager:nmcli *network-manager:service" echo "And allows to add a new connection" conn_name=nmtest From 16a71cd8403ce8713a3d4897980a45298171dd06 Mon Sep 17 00:00:00 2001 From: Sergio Cazzolato Date: Wed, 23 Feb 2022 20:44:43 -0300 Subject: [PATCH 2/3] tests: skip boot loader check during testing preparation on s390x (#11423) * Skip bootloader check during testing preparation on classic As snapd does not care about the bootloader in classic systems, the idea is to avoid this check to make the tests work on s390x architecture where the bootloader is zipl. * Skip bootloader check on s390x --- tests/lib/prepare.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/tests/lib/prepare.sh b/tests/lib/prepare.sh index f693d104678..e9d65bd000d 100755 --- a/tests/lib/prepare.sh +++ b/tests/lib/prepare.sh @@ -365,13 +365,16 @@ prepare_classic() { disable_refreshes - echo "Ensure that the bootloader environment output does not contain any of the snap_* variables on classic" - # shellcheck disable=SC2119 - output=$("$TESTSTOOLS"/boot-state bootenv show) - if echo "$output" | MATCH snap_ ; then - echo "Expected bootloader environment without snap_*, got:" - echo "$output" - exit 1 + # Check bootloader environment output in architectures different to s390x which uses zIPL + if ! [ "$(uname -m)" = "s390x" ]; then + echo "Ensure that the bootloader environment output does not contain any of the snap_* variables on classic" + # shellcheck disable=SC2119 + output=$("$TESTSTOOLS"/boot-state bootenv show) + if echo "$output" | MATCH snap_ ; then + echo "Expected bootloader environment without snap_*, got:" + echo "$output" + exit 1 + fi fi setup_experimental_features From 9f1a953713d3f1e7aed46149658f5f233a7c49b0 Mon Sep 17 00:00:00 2001 From: Sergio Cazzolato Date: Wed, 23 Feb 2022 22:24:34 -0300 Subject: [PATCH 3/3] Fix smoke/install test for other architectures than pc (#11424) This test is failing in other architectures than pc because all the core22 based snaps are not available yet. I reproduced that in armhf, arm64 and s390x --- tests/smoke/install/task.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/smoke/install/task.yaml b/tests/smoke/install/task.yaml index 54840f03946..9f730ae094b 100644 --- a/tests/smoke/install/task.yaml +++ b/tests/smoke/install/task.yaml @@ -45,8 +45,14 @@ execute: | echo "Ensure different bases work" for base in core18 core20 core22; do - # no core20 or core22 snap for i386 - if { [ "$base" = "core20" ] || [ "$base" = "core22" ]; } && [ "$(uname -m)" = i686 ]; then + # TODO remove this logic once core22 base snaps are uploaded in + # all the supported architectures + if [ "$base" = "core22" ] && not os.query is-pc-amd64; then + continue + fi + + # no core20 snap for i386 architecture + if [ "$base" = "core20" ] && os.query is-pc-i386; then continue fi