[PR #7340/323a1dcf backport][stable-7] snap: detect change by checking final state (#7366)

snap: detect change by checking final state (#7340)

* snap: detect change by checking final state

* detect change in snap_status variable

* add changelog frag

(cherry picked from commit 323a1dcff8)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2023-10-08 12:46:27 +02:00 committed by GitHub
commit 113764215d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 47 additions and 19 deletions

View file

@ -402,6 +402,19 @@ TEST_CASES = [
out="hello-world (12345/stable) v12345 from Canonical** installed\n",
err="",
),
RunCmdCall(
command=['/testbin/snap', 'list'],
environ={'environ_update': {'LANGUAGE': 'C', 'LC_ALL': 'C'}, 'check_rc': False},
rc=0,
out=(
"Name Version Rev Tracking Publisher Notes"
"core20 20220826 1623 latest/stable canonical** base"
"lxd 5.6-794016a 23680 latest/stable/… canonical** -"
"hello-world 5.6-794016a 23680 latest/stable/… canonical** -"
"snapd 2.57.4 17336 latest/stable canonical** snapd"
""),
err="",
),
]
),
ModuleTestCase(
@ -438,6 +451,20 @@ TEST_CASES = [
out=issue_6803_kubectl_out,
err="",
),
RunCmdCall(
command=['/testbin/snap', 'list'],
environ={'environ_update': {'LANGUAGE': 'C', 'LC_ALL': 'C'}, 'check_rc': False},
rc=0,
out=(
"Name Version Rev Tracking Publisher Notes"
"core20 20220826 1623 latest/stable canonical** base"
"lxd 5.6-794016a 23680 latest/stable/… canonical** -"
"microk8s 5.6-794016a 23680 latest/stable/… canonical** -"
"kubectl 5.6-794016a 23680 latest/stable/… canonical** -"
"snapd 2.57.4 17336 latest/stable canonical** snapd"
""),
err="",
),
]
),
]