From d9f68cbe652133579094d5eb5d695ec9300be711 Mon Sep 17 00:00:00 2001 From: James Henstridge Date: Tue, 6 Oct 2020 18:55:25 +0800 Subject: [PATCH] tests: fix shellcheck warning in test --- tests/main/snapctl-is-connected-pid/task.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/main/snapctl-is-connected-pid/task.yaml b/tests/main/snapctl-is-connected-pid/task.yaml index da8b6a746a91..6f718ab4b281 100644 --- a/tests/main/snapctl-is-connected-pid/task.yaml +++ b/tests/main/snapctl-is-connected-pid/task.yaml @@ -54,12 +54,15 @@ execute: | expect_status 10 test-snap2.snapctl is-connected --pid 1 foo-slot if [[ "$(snap debug confinement)" = strict ]]; then - svc_label=$(cat "/proc/$svc_pid/attr/current" | sed 's/ (.*)$//') + svc_label=$(sed 's/ (.*)$//' < "/proc/$svc_pid/attr/current") echo "We can detect connected interfaces by AppArmor label too" test-snapd2.snapctl is-connected --apparmor-label "$svc_label" foo-slot snap connect test-snap1:foo-plug test-snap2:foo-slot expect_status 1 test-snap2.snapctl is-connected --apparmor-label "$svc_label" foo-slot + + echo "Non-snap AppArmor labels return a special exit code" + expect_status 10 test-snap2.snapctl is-connected --apparmor-label /usr/bin/evince foo-slot fi # The remaining tests rely on classic confinement, so skip Ubuntu Core