mirror of
https://github.com/containers/podman.git
synced 2025-11-30 18:18:18 +08:00
Rename misleading assertion name
Signed-off-by: Dmitry Konishchev <konishchev@gmail.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
## assert-key-contains Service ExecStart " --opt type=bind "
|
## assert-last-key-contains Service ExecStart " --opt type=bind "
|
||||||
## assert-key-contains Service ExecStart " --opt device=/var/lib/data "
|
## assert-last-key-contains Service ExecStart " --opt device=/var/lib/data "
|
||||||
## assert-key-contains Service ExecStart " --opt nocopy "
|
## assert-last-key-contains Service ExecStart " --opt nocopy "
|
||||||
## assert-key-contains Unit RequiresMountsFor "/var/lib/data"
|
## assert-last-key-contains Unit RequiresMountsFor "/var/lib/data"
|
||||||
|
|
||||||
[Volume]
|
[Volume]
|
||||||
Device=/var/lib/data
|
Device=/var/lib/data
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
## assert-key-contains Service ExecStart " --opt o=uid=0,gid=11,rw,compress=zstd "
|
## assert-last-key-contains Service ExecStart " --opt o=uid=0,gid=11,rw,compress=zstd "
|
||||||
## assert-key-contains Service ExecStart " --opt type=btrfs "
|
## assert-last-key-contains Service ExecStart " --opt type=btrfs "
|
||||||
## assert-key-contains Service ExecStart " --opt device=/dev/vda1 "
|
## assert-last-key-contains Service ExecStart " --opt device=/dev/vda1 "
|
||||||
## assert-key-contains Service ExecStart " --opt copy "
|
## assert-last-key-contains Service ExecStart " --opt copy "
|
||||||
|
|
||||||
[Volume]
|
[Volume]
|
||||||
# Test usernames too
|
# Test usernames too
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
## assert-key-contains Service ExecStart " --opt o=uid=0,gid=11,rw,compress=zstd "
|
## assert-last-key-contains Service ExecStart " --opt o=uid=0,gid=11,rw,compress=zstd "
|
||||||
## assert-key-contains Service ExecStart " --opt type=btrfs "
|
## assert-last-key-contains Service ExecStart " --opt type=btrfs "
|
||||||
## assert-key-contains Service ExecStart " --opt device=/dev/vda1 "
|
## assert-last-key-contains Service ExecStart " --opt device=/dev/vda1 "
|
||||||
## assert-key-contains Service ExecStart " --opt nocopy "
|
## assert-last-key-contains Service ExecStart " --opt nocopy "
|
||||||
|
|
||||||
[Volume]
|
[Volume]
|
||||||
# Test usernames too
|
# Test usernames too
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
## assert-podman-args "--ipv6"
|
## assert-podman-args "--ipv6"
|
||||||
## assert-key-is Service Type exec
|
## assert-key-is Service Type exec
|
||||||
## assert-key-is Service RemainAfterExit no
|
## assert-key-is Service RemainAfterExit no
|
||||||
## assert-key-contains Service SyslogIdentifier "Modify %N"
|
## assert-last-key-contains Service SyslogIdentifier "Modify %N"
|
||||||
|
|
||||||
[Network]
|
[Network]
|
||||||
IPv6=yes
|
IPv6=yes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## assert-key-contains Service ExecStart " --label org.foo.Arg1=arg1 "
|
## assert-last-key-contains Service ExecStart " --label org.foo.Arg1=arg1 "
|
||||||
## assert-key-contains Service ExecStart " --label org.foo.Arg2=arg2 "
|
## assert-last-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.Arg3=arg3 "
|
||||||
|
|
||||||
[Volume]
|
[Volume]
|
||||||
Label=org.foo.Arg1=arg1
|
Label=org.foo.Arg1=arg1
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
## assert-key-contains "Unit" "Wants" "startwithpod_yes.service"
|
## assert-last-key-contains "Unit" "Wants" "startwithpod_yes.service"
|
||||||
## assert-key-contains "Unit" "Before" "startwithpod_yes.service"
|
## assert-last-key-contains "Unit" "Before" "startwithpod_yes.service"
|
||||||
|
|
||||||
## assert-key-not-contains "Unit" "Wants" "startwithpod_no.service"
|
## assert-last-key-not-contains "Unit" "Wants" "startwithpod_no.service"
|
||||||
## assert-key-not-contains "Unit" "Before" "startwithpod_no.service"
|
## assert-last-key-not-contains "Unit" "Before" "startwithpod_no.service"
|
||||||
|
|
||||||
[Pod]
|
[Pod]
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# assert-key-contains "Unit" "After" "startwithpod-pod.service"
|
# assert-last-key-contains "Unit" "After" "startwithpod-pod.service"
|
||||||
# assert-key-contains "Unit" "BindsTo" "startwithpod-pod.service"
|
# assert-last-key-contains "Unit" "BindsTo" "startwithpod-pod.service"
|
||||||
|
|
||||||
[Container]
|
[Container]
|
||||||
Image=localhost/image
|
Image=localhost/image
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# assert-key-contains "Unit" "After" "startwithpod-pod.service"
|
# assert-last-key-contains "Unit" "After" "startwithpod-pod.service"
|
||||||
# assert-key-contains "Unit" "BindsTo" "startwithpod-pod.service"
|
# assert-last-key-contains "Unit" "BindsTo" "startwithpod-pod.service"
|
||||||
|
|
||||||
[Container]
|
[Container]
|
||||||
Image=localhost/image
|
Image=localhost/image
|
||||||
|
|||||||
@@ -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 Type oneshot
|
||||||
## assert-key-is Service RemainAfterExit no
|
## assert-key-is Service RemainAfterExit no
|
||||||
## assert-key-contains Service SyslogIdentifier "Modify %N"
|
## assert-last-key-contains Service SyslogIdentifier "Modify %N"
|
||||||
|
|
||||||
[Volume]
|
[Volume]
|
||||||
# Test usernames too
|
# Test usernames too
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ func (t *quadletTestcase) assertLastKeyIsRegex(args []string, unit *parser.UnitF
|
|||||||
return true
|
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))
|
Expect(args).To(HaveLen(3))
|
||||||
group := args[0]
|
group := args[0]
|
||||||
key := args[1]
|
key := args[1]
|
||||||
@@ -229,8 +229,8 @@ func (t *quadletTestcase) assertKeyContains(args []string, unit *parser.UnitFile
|
|||||||
return ok && strings.Contains(realValue, value)
|
return ok && strings.Contains(realValue, value)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *quadletTestcase) assertKeyNotContains(args []string, unit *parser.UnitFile) bool {
|
func (t *quadletTestcase) assertLastKeyNotContains(args []string, unit *parser.UnitFile) bool {
|
||||||
return !t.assertKeyContains(args, unit)
|
return !t.assertLastKeyContains(args, unit)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *quadletTestcase) assertPodmanArgs(args []string, unit *parser.UnitFile, key string, allowRegex, globalOnly bool) bool {
|
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)
|
ok = t.assertKeyIsEmpty(args, unit)
|
||||||
case "assert-key-is-regex":
|
case "assert-key-is-regex":
|
||||||
ok = t.assertKeyIsRegex(args, unit)
|
ok = t.assertKeyIsRegex(args, unit)
|
||||||
case "assert-key-contains":
|
case "assert-last-key-contains":
|
||||||
ok = t.assertKeyContains(args, unit)
|
ok = t.assertLastKeyContains(args, unit)
|
||||||
case "assert-key-not-contains":
|
case "assert-last-key-not-contains":
|
||||||
ok = t.assertKeyNotContains(args, unit)
|
ok = t.assertLastKeyNotContains(args, unit)
|
||||||
case "assert-last-key-is-regex":
|
case "assert-last-key-is-regex":
|
||||||
ok = t.assertLastKeyIsRegex(args, unit)
|
ok = t.assertLastKeyIsRegex(args, unit)
|
||||||
case "assert-podman-args":
|
case "assert-podman-args":
|
||||||
|
|||||||
Reference in New Issue
Block a user