From 23057fd5ed94f8733e43a32510853d5ba7648d8e Mon Sep 17 00:00:00 2001 From: Dmitry Konishchev Date: Mon, 27 Oct 2025 19:23:51 +0300 Subject: [PATCH] Rename misleading assertion name Signed-off-by: Dmitry Konishchev --- test/e2e/quadlet/device-bind.volume | 8 ++++---- test/e2e/quadlet/device-copy.volume | 8 ++++---- test/e2e/quadlet/device.volume | 8 ++++---- test/e2e/quadlet/ipv6.network | 2 +- test/e2e/quadlet/label.volume | 6 +++--- test/e2e/quadlet/startwithpod.pod | 8 ++++---- test/e2e/quadlet/startwithpod_no.container | 4 ++-- test/e2e/quadlet/startwithpod_yes.container | 4 ++-- test/e2e/quadlet/uid.volume | 4 ++-- test/e2e/quadlet_test.go | 14 +++++++------- 10 files changed, 33 insertions(+), 33 deletions(-) diff --git a/test/e2e/quadlet/device-bind.volume b/test/e2e/quadlet/device-bind.volume index 9b68ee9cd6..2b4c6bb70e 100644 --- a/test/e2e/quadlet/device-bind.volume +++ b/test/e2e/quadlet/device-bind.volume @@ -1,7 +1,7 @@ -## assert-key-contains Service ExecStart " --opt type=bind " -## assert-key-contains Service ExecStart " --opt device=/var/lib/data " -## assert-key-contains Service ExecStart " --opt nocopy " -## assert-key-contains Unit RequiresMountsFor "/var/lib/data" +## assert-last-key-contains Service ExecStart " --opt type=bind " +## assert-last-key-contains Service ExecStart " --opt device=/var/lib/data " +## assert-last-key-contains Service ExecStart " --opt nocopy " +## assert-last-key-contains Unit RequiresMountsFor "/var/lib/data" [Volume] Device=/var/lib/data diff --git a/test/e2e/quadlet/device-copy.volume b/test/e2e/quadlet/device-copy.volume index 0e7405e222..05cc6315b4 100644 --- a/test/e2e/quadlet/device-copy.volume +++ b/test/e2e/quadlet/device-copy.volume @@ -1,7 +1,7 @@ -## assert-key-contains Service ExecStart " --opt o=uid=0,gid=11,rw,compress=zstd " -## assert-key-contains Service ExecStart " --opt type=btrfs " -## assert-key-contains Service ExecStart " --opt device=/dev/vda1 " -## assert-key-contains Service ExecStart " --opt copy " +## assert-last-key-contains Service ExecStart " --opt o=uid=0,gid=11,rw,compress=zstd " +## assert-last-key-contains Service ExecStart " --opt type=btrfs " +## assert-last-key-contains Service ExecStart " --opt device=/dev/vda1 " +## assert-last-key-contains Service ExecStart " --opt copy " [Volume] # Test usernames too diff --git a/test/e2e/quadlet/device.volume b/test/e2e/quadlet/device.volume index 4e742a38c4..9b19987fe5 100644 --- a/test/e2e/quadlet/device.volume +++ b/test/e2e/quadlet/device.volume @@ -1,7 +1,7 @@ -## assert-key-contains Service ExecStart " --opt o=uid=0,gid=11,rw,compress=zstd " -## assert-key-contains Service ExecStart " --opt type=btrfs " -## assert-key-contains Service ExecStart " --opt device=/dev/vda1 " -## assert-key-contains Service ExecStart " --opt nocopy " +## assert-last-key-contains Service ExecStart " --opt o=uid=0,gid=11,rw,compress=zstd " +## assert-last-key-contains Service ExecStart " --opt type=btrfs " +## assert-last-key-contains Service ExecStart " --opt device=/dev/vda1 " +## assert-last-key-contains Service ExecStart " --opt nocopy " [Volume] # Test usernames too diff --git a/test/e2e/quadlet/ipv6.network b/test/e2e/quadlet/ipv6.network index 8a6d5d62cc..fc97591ba4 100644 --- a/test/e2e/quadlet/ipv6.network +++ b/test/e2e/quadlet/ipv6.network @@ -2,7 +2,7 @@ ## assert-podman-args "--ipv6" ## assert-key-is Service Type exec ## assert-key-is Service RemainAfterExit no -## assert-key-contains Service SyslogIdentifier "Modify %N" +## assert-last-key-contains Service SyslogIdentifier "Modify %N" [Network] IPv6=yes diff --git a/test/e2e/quadlet/label.volume b/test/e2e/quadlet/label.volume index da6ee25209..53c7eb9270 100644 --- a/test/e2e/quadlet/label.volume +++ b/test/e2e/quadlet/label.volume @@ -1,6 +1,6 @@ -## assert-key-contains Service ExecStart " --label org.foo.Arg1=arg1 " -## assert-key-contains Service ExecStart " --label org.foo.Arg2=arg2 " -## assert-key-contains Service ExecStart " --label org.foo.Arg3=arg3 " +## assert-last-key-contains Service ExecStart " --label org.foo.Arg1=arg1 " +## assert-last-key-contains Service ExecStart " --label org.foo.Arg2=arg2 " +## assert-last-key-contains Service ExecStart " --label org.foo.Arg3=arg3 " [Volume] Label=org.foo.Arg1=arg1 diff --git a/test/e2e/quadlet/startwithpod.pod b/test/e2e/quadlet/startwithpod.pod index 75505f9e55..d5a4ab042c 100644 --- a/test/e2e/quadlet/startwithpod.pod +++ b/test/e2e/quadlet/startwithpod.pod @@ -1,7 +1,7 @@ -## assert-key-contains "Unit" "Wants" "startwithpod_yes.service" -## assert-key-contains "Unit" "Before" "startwithpod_yes.service" +## assert-last-key-contains "Unit" "Wants" "startwithpod_yes.service" +## assert-last-key-contains "Unit" "Before" "startwithpod_yes.service" -## assert-key-not-contains "Unit" "Wants" "startwithpod_no.service" -## assert-key-not-contains "Unit" "Before" "startwithpod_no.service" +## assert-last-key-not-contains "Unit" "Wants" "startwithpod_no.service" +## assert-last-key-not-contains "Unit" "Before" "startwithpod_no.service" [Pod] diff --git a/test/e2e/quadlet/startwithpod_no.container b/test/e2e/quadlet/startwithpod_no.container index 0c07cfdb03..37b5c17afe 100644 --- a/test/e2e/quadlet/startwithpod_no.container +++ b/test/e2e/quadlet/startwithpod_no.container @@ -1,5 +1,5 @@ -# assert-key-contains "Unit" "After" "startwithpod-pod.service" -# assert-key-contains "Unit" "BindsTo" "startwithpod-pod.service" +# assert-last-key-contains "Unit" "After" "startwithpod-pod.service" +# assert-last-key-contains "Unit" "BindsTo" "startwithpod-pod.service" [Container] Image=localhost/image diff --git a/test/e2e/quadlet/startwithpod_yes.container b/test/e2e/quadlet/startwithpod_yes.container index d5c608f266..5b95ad0e11 100644 --- a/test/e2e/quadlet/startwithpod_yes.container +++ b/test/e2e/quadlet/startwithpod_yes.container @@ -1,5 +1,5 @@ -# assert-key-contains "Unit" "After" "startwithpod-pod.service" -# assert-key-contains "Unit" "BindsTo" "startwithpod-pod.service" +# assert-last-key-contains "Unit" "After" "startwithpod-pod.service" +# assert-last-key-contains "Unit" "BindsTo" "startwithpod-pod.service" [Container] Image=localhost/image diff --git a/test/e2e/quadlet/uid.volume b/test/e2e/quadlet/uid.volume index aa6d8171c5..8097c88620 100644 --- a/test/e2e/quadlet/uid.volume +++ b/test/e2e/quadlet/uid.volume @@ -1,7 +1,7 @@ -## assert-key-contains Service ExecStart " --opt o=uid=0,gid=11 " +## assert-last-key-contains Service ExecStart " --opt o=uid=0,gid=11 " ## assert-key-is Service Type oneshot ## assert-key-is Service RemainAfterExit no -## assert-key-contains Service SyslogIdentifier "Modify %N" +## assert-last-key-contains Service SyslogIdentifier "Modify %N" [Volume] # Test usernames too diff --git a/test/e2e/quadlet_test.go b/test/e2e/quadlet_test.go index 77e331fd00..0ca40028a5 100644 --- a/test/e2e/quadlet_test.go +++ b/test/e2e/quadlet_test.go @@ -219,7 +219,7 @@ func (t *quadletTestcase) assertLastKeyIsRegex(args []string, unit *parser.UnitF return true } -func (t *quadletTestcase) assertKeyContains(args []string, unit *parser.UnitFile) bool { +func (t *quadletTestcase) assertLastKeyContains(args []string, unit *parser.UnitFile) bool { Expect(args).To(HaveLen(3)) group := args[0] key := args[1] @@ -229,8 +229,8 @@ func (t *quadletTestcase) assertKeyContains(args []string, unit *parser.UnitFile return ok && strings.Contains(realValue, value) } -func (t *quadletTestcase) assertKeyNotContains(args []string, unit *parser.UnitFile) bool { - return !t.assertKeyContains(args, unit) +func (t *quadletTestcase) assertLastKeyNotContains(args []string, unit *parser.UnitFile) bool { + return !t.assertLastKeyContains(args, unit) } func (t *quadletTestcase) assertPodmanArgs(args []string, unit *parser.UnitFile, key string, allowRegex, globalOnly bool) bool { @@ -544,10 +544,10 @@ func (t *quadletTestcase) doAssert(check []string, unit *parser.UnitFile, sessio ok = t.assertKeyIsEmpty(args, unit) case "assert-key-is-regex": ok = t.assertKeyIsRegex(args, unit) - case "assert-key-contains": - ok = t.assertKeyContains(args, unit) - case "assert-key-not-contains": - ok = t.assertKeyNotContains(args, unit) + case "assert-last-key-contains": + ok = t.assertLastKeyContains(args, unit) + case "assert-last-key-not-contains": + ok = t.assertLastKeyNotContains(args, unit) case "assert-last-key-is-regex": ok = t.assertLastKeyIsRegex(args, unit) case "assert-podman-args":