mirror of
https://github.com/containers/podman.git
synced 2025-10-17 11:14:40 +08:00
Quadlet - print warning when fail to parse
Fixes: #26542 Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
This commit is contained in:
5
test/e2e/quadlet/exec-unsupported-escape.container
Normal file
5
test/e2e/quadlet/exec-unsupported-escape.container
Normal file
@ -0,0 +1,5 @@
|
||||
## assert-podman-final-args localhost/imagename
|
||||
|
||||
[Container]
|
||||
Image=localhost/imagename
|
||||
Exec='test\.com'
|
5
test/e2e/quadlet/reloadcmd-unsupported-escape.container
Normal file
5
test/e2e/quadlet/reloadcmd-unsupported-escape.container
Normal file
@ -0,0 +1,5 @@
|
||||
## assert-podman-final-args localhost/imagename
|
||||
|
||||
[Container]
|
||||
Image=localhost/imagename
|
||||
ReloadCmd='test\.sh'
|
@ -232,7 +232,7 @@ func (t *quadletTestcase) assertKeyNotContains(args []string, unit *parser.UnitF
|
||||
}
|
||||
|
||||
func (t *quadletTestcase) assertPodmanArgs(args []string, unit *parser.UnitFile, key string, allowRegex, globalOnly bool) bool {
|
||||
podmanArgs, _ := unit.LookupLastArgs("Service", key)
|
||||
podmanArgs, _, _ := unit.LookupLastArgs("Service", key)
|
||||
if globalOnly {
|
||||
podmanCmdLocation := findSublist(podmanArgs, []string{args[0]})
|
||||
if podmanCmdLocation == -1 {
|
||||
@ -287,7 +287,7 @@ func keyValMapEqualRegex(expectedKeyValMap, actualKeyValMap map[string]string) b
|
||||
}
|
||||
|
||||
func (t *quadletTestcase) assertPodmanArgsKeyVal(args []string, unit *parser.UnitFile, key string, allowRegex, globalOnly bool) bool {
|
||||
podmanArgs, _ := unit.LookupLastArgs("Service", key)
|
||||
podmanArgs, _, _ := unit.LookupLastArgs("Service", key)
|
||||
|
||||
if globalOnly {
|
||||
podmanCmdLocation := findSublist(podmanArgs, []string{args[0]})
|
||||
@ -334,7 +334,7 @@ func (t *quadletTestcase) assertPodmanArgsKeyVal(args []string, unit *parser.Uni
|
||||
}
|
||||
|
||||
func (t *quadletTestcase) assertPodmanFinalArgs(args []string, unit *parser.UnitFile, key string) bool {
|
||||
podmanArgs, _ := unit.LookupLastArgs("Service", key)
|
||||
podmanArgs, _, _ := unit.LookupLastArgs("Service", key)
|
||||
if len(podmanArgs) < len(args) {
|
||||
return false
|
||||
}
|
||||
@ -342,7 +342,7 @@ func (t *quadletTestcase) assertPodmanFinalArgs(args []string, unit *parser.Unit
|
||||
}
|
||||
|
||||
func (t *quadletTestcase) assertPodmanFinalArgsRegex(args []string, unit *parser.UnitFile, key string) bool {
|
||||
podmanArgs, _ := unit.LookupLastArgs("Service", key)
|
||||
podmanArgs, _, _ := unit.LookupLastArgs("Service", key)
|
||||
if len(podmanArgs) < len(args) {
|
||||
return false
|
||||
}
|
||||
@ -1106,6 +1106,9 @@ BOGUS=foo
|
||||
Entry("Unsupported Service Key - DynamicUser.network", "service-dynamicuser.network", "Warning: using key DynamicUser in the Service group is not supported"),
|
||||
Entry("Unsupported Service Key - DynamicUser.pod", "service-dynamicuser.pod", "Warning: using key DynamicUser in the Service group is not supported"),
|
||||
Entry("Unsupported Service Key - DynamicUser.volume", "service-dynamicuser.volume", "Warning: using key DynamicUser in the Service group is not supported"),
|
||||
|
||||
Entry("exec-unsupported-escape.container", "exec-unsupported-escape.container", "unsupported escape char"),
|
||||
Entry("reloadcmd-unsupported-escape.container", "reloadcmd-unsupported-escape.container", "unsupported escape char"),
|
||||
)
|
||||
|
||||
DescribeTable("Running expected error quadlet test case",
|
||||
|
Reference in New Issue
Block a user