Skip to content

Commit

Permalink
tests: fix shellcheck warning in test
Browse files Browse the repository at this point in the history
  • Loading branch information
jhenstridge committed Oct 7, 2020
1 parent 12f6264 commit d90122e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/main/snapctl-is-connected-pid/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
test-snap2.snapctl is-connected --apparmor-label "$svc_label" foo-slot
snap disconnect 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
Expand Down

0 comments on commit d90122e

Please sign in to comment.