Skip to content

Commit 23057fd

Browse files
Rename misleading assertion name
Signed-off-by: Dmitry Konishchev <[email protected]>
1 parent 5a0b74b commit 23057fd

File tree

10 files changed

+33
-33
lines changed

10 files changed

+33
-33
lines changed

test/e2e/quadlet/device-bind.volume

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
## assert-key-contains Service ExecStart " --opt type=bind "
2-
## assert-key-contains Service ExecStart " --opt device=/var/lib/data "
3-
## assert-key-contains Service ExecStart " --opt nocopy "
4-
## assert-key-contains Unit RequiresMountsFor "/var/lib/data"
1+
## assert-last-key-contains Service ExecStart " --opt type=bind "
2+
## assert-last-key-contains Service ExecStart " --opt device=/var/lib/data "
3+
## assert-last-key-contains Service ExecStart " --opt nocopy "
4+
## assert-last-key-contains Unit RequiresMountsFor "/var/lib/data"
55

66
[Volume]
77
Device=/var/lib/data

test/e2e/quadlet/device-copy.volume

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
## assert-key-contains Service ExecStart " --opt o=uid=0,gid=11,rw,compress=zstd "
2-
## assert-key-contains Service ExecStart " --opt type=btrfs "
3-
## assert-key-contains Service ExecStart " --opt device=/dev/vda1 "
4-
## assert-key-contains Service ExecStart " --opt copy "
1+
## assert-last-key-contains Service ExecStart " --opt o=uid=0,gid=11,rw,compress=zstd "
2+
## assert-last-key-contains Service ExecStart " --opt type=btrfs "
3+
## assert-last-key-contains Service ExecStart " --opt device=/dev/vda1 "
4+
## assert-last-key-contains Service ExecStart " --opt copy "
55

66
[Volume]
77
# Test usernames too

test/e2e/quadlet/device.volume

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
## assert-key-contains Service ExecStart " --opt o=uid=0,gid=11,rw,compress=zstd "
2-
## assert-key-contains Service ExecStart " --opt type=btrfs "
3-
## assert-key-contains Service ExecStart " --opt device=/dev/vda1 "
4-
## assert-key-contains Service ExecStart " --opt nocopy "
1+
## assert-last-key-contains Service ExecStart " --opt o=uid=0,gid=11,rw,compress=zstd "
2+
## assert-last-key-contains Service ExecStart " --opt type=btrfs "
3+
## assert-last-key-contains Service ExecStart " --opt device=/dev/vda1 "
4+
## assert-last-key-contains Service ExecStart " --opt nocopy "
55

66
[Volume]
77
# Test usernames too

test/e2e/quadlet/ipv6.network

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
## assert-podman-args "--ipv6"
33
## assert-key-is Service Type exec
44
## assert-key-is Service RemainAfterExit no
5-
## assert-key-contains Service SyslogIdentifier "Modify %N"
5+
## assert-last-key-contains Service SyslogIdentifier "Modify %N"
66

77
[Network]
88
IPv6=yes

test/e2e/quadlet/label.volume

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
## assert-key-contains Service ExecStart " --label org.foo.Arg1=arg1 "
2-
## assert-key-contains Service ExecStart " --label org.foo.Arg2=arg2 "
3-
## assert-key-contains Service ExecStart " --label org.foo.Arg3=arg3 "
1+
## assert-last-key-contains Service ExecStart " --label org.foo.Arg1=arg1 "
2+
## assert-last-key-contains Service ExecStart " --label org.foo.Arg2=arg2 "
3+
## assert-last-key-contains Service ExecStart " --label org.foo.Arg3=arg3 "
44

55
[Volume]
66
Label=org.foo.Arg1=arg1

test/e2e/quadlet/startwithpod.pod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
## assert-key-contains "Unit" "Wants" "startwithpod_yes.service"
2-
## assert-key-contains "Unit" "Before" "startwithpod_yes.service"
1+
## assert-last-key-contains "Unit" "Wants" "startwithpod_yes.service"
2+
## assert-last-key-contains "Unit" "Before" "startwithpod_yes.service"
33

4-
## assert-key-not-contains "Unit" "Wants" "startwithpod_no.service"
5-
## assert-key-not-contains "Unit" "Before" "startwithpod_no.service"
4+
## assert-last-key-not-contains "Unit" "Wants" "startwithpod_no.service"
5+
## assert-last-key-not-contains "Unit" "Before" "startwithpod_no.service"
66

77
[Pod]

test/e2e/quadlet/startwithpod_no.container

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# assert-key-contains "Unit" "After" "startwithpod-pod.service"
2-
# assert-key-contains "Unit" "BindsTo" "startwithpod-pod.service"
1+
# assert-last-key-contains "Unit" "After" "startwithpod-pod.service"
2+
# assert-last-key-contains "Unit" "BindsTo" "startwithpod-pod.service"
33

44
[Container]
55
Image=localhost/image

test/e2e/quadlet/startwithpod_yes.container

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# assert-key-contains "Unit" "After" "startwithpod-pod.service"
2-
# assert-key-contains "Unit" "BindsTo" "startwithpod-pod.service"
1+
# assert-last-key-contains "Unit" "After" "startwithpod-pod.service"
2+
# assert-last-key-contains "Unit" "BindsTo" "startwithpod-pod.service"
33

44
[Container]
55
Image=localhost/image

test/e2e/quadlet/uid.volume

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
## assert-key-contains Service ExecStart " --opt o=uid=0,gid=11 "
1+
## assert-last-key-contains Service ExecStart " --opt o=uid=0,gid=11 "
22
## assert-key-is Service Type oneshot
33
## assert-key-is Service RemainAfterExit no
4-
## assert-key-contains Service SyslogIdentifier "Modify %N"
4+
## assert-last-key-contains Service SyslogIdentifier "Modify %N"
55

66
[Volume]
77
# Test usernames too

test/e2e/quadlet_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ func (t *quadletTestcase) assertLastKeyIsRegex(args []string, unit *parser.UnitF
219219
return true
220220
}
221221

222-
func (t *quadletTestcase) assertKeyContains(args []string, unit *parser.UnitFile) bool {
222+
func (t *quadletTestcase) assertLastKeyContains(args []string, unit *parser.UnitFile) bool {
223223
Expect(args).To(HaveLen(3))
224224
group := args[0]
225225
key := args[1]
@@ -229,8 +229,8 @@ func (t *quadletTestcase) assertKeyContains(args []string, unit *parser.UnitFile
229229
return ok && strings.Contains(realValue, value)
230230
}
231231

232-
func (t *quadletTestcase) assertKeyNotContains(args []string, unit *parser.UnitFile) bool {
233-
return !t.assertKeyContains(args, unit)
232+
func (t *quadletTestcase) assertLastKeyNotContains(args []string, unit *parser.UnitFile) bool {
233+
return !t.assertLastKeyContains(args, unit)
234234
}
235235

236236
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
544544
ok = t.assertKeyIsEmpty(args, unit)
545545
case "assert-key-is-regex":
546546
ok = t.assertKeyIsRegex(args, unit)
547-
case "assert-key-contains":
548-
ok = t.assertKeyContains(args, unit)
549-
case "assert-key-not-contains":
550-
ok = t.assertKeyNotContains(args, unit)
547+
case "assert-last-key-contains":
548+
ok = t.assertLastKeyContains(args, unit)
549+
case "assert-last-key-not-contains":
550+
ok = t.assertLastKeyNotContains(args, unit)
551551
case "assert-last-key-is-regex":
552552
ok = t.assertLastKeyIsRegex(args, unit)
553553
case "assert-podman-args":

0 commit comments

Comments
 (0)