Merge ~kzapalowicz/snappy-hwe-snaps/+git/tpm:fix/tests-grep-regexp into ~snappy-hwe-team/snappy-hwe-snaps/+git/tpm:master

Proposed by Konrad Zapałowicz
Status: Merged
Approved by: Jim Hodapp
Approved revision: 59e15c515e3728a202c950bb8df6e0d13512d3d3
Merged at revision: 870d9b8406869cef80853c9ffa70b189a21dafa7
Proposed branch: ~kzapalowicz/snappy-hwe-snaps/+git/tpm:fix/tests-grep-regexp
Merge into: ~snappy-hwe-team/snappy-hwe-snaps/+git/tpm:master
Diff against target: 15 lines (+2/-2)
1 file modified
tests/main/installation/task.yaml (+2/-2)
Reviewer Review Type Date Requested Status
Jim Hodapp (community) Approve
System Enablement Bot continuous-integration Approve
Review via email: mp+323102@code.launchpad.net

Description of the change

tests: fix regexp for main/installation test

The updated regex should work for a situation where we check for a plug/slot connection of a snap that is not first on the connection
list - it is listed alphabetically.

E.g.:

:network-bind core,tpm2

The old version would return a failure as it started matching with spaces at the beginning. The new version understands that there might be a snap name too.

To post a comment you must log in.
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Jim Hodapp (jhodapp) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/tests/main/installation/task.yaml b/tests/main/installation/task.yaml
2index b414ae7..b5a8a31 100644
3--- a/tests/main/installation/task.yaml
4+++ b/tests/main/installation/task.yaml
5@@ -3,8 +3,8 @@ summary: Test tpm snap installation was successful
6 execute: |
7 # Ensure all necessary plugs/slots are connected
8 snap interfaces | grep -Pzq ":tpm +tpm"
9- snap interfaces | grep -Pzq ":network +tpm"
10- snap interfaces | grep -Pzq ":network-bind +tpm"
11+ snap interfaces | grep -Pzq ":network +[a-z,-]*tpm"
12+ snap interfaces | grep -Pzq ":network-bind +[a-z,-]*tpm"
13
14 # Verify aliases are set up
15 test -x /snap/bin/tpm_version

Subscribers

People subscribed via source and target branches