mirror of
https://github.com/containers/podman.git
synced 2025-10-18 03:33:32 +08:00
e2e: fix e2e tests in proxy environment
- podman generate kube inheritents the proxy environment valiable by default. Therefore, Env field is not empty if it is set. - systemd-socket-acrivate needs to pass an proxy environment variable. - busybox wget with an proxy doesn't work. Network tests should use not wget but curl. https://gitlab.alpinelinux.org/alpine/aports/-/issues/10446 Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
This commit is contained in:
@ -434,7 +434,8 @@ func (p *PodmanTestIntegration) RunTopContainer(name string) *PodmanSessionInteg
|
||||
// RunTopContainerWithArgs runs a simple container in the background that
|
||||
// runs top. If the name passed != "", it will have a name, command args can also be passed in
|
||||
func (p *PodmanTestIntegration) RunTopContainerWithArgs(name string, args []string) *PodmanSessionIntegration {
|
||||
var podmanArgs = []string{"run"}
|
||||
// In proxy environment, some tests need to the --http-proxy=false option (#16684)
|
||||
var podmanArgs = []string{"run", "--http-proxy=false"}
|
||||
if name != "" {
|
||||
podmanArgs = append(podmanArgs, "--name", name)
|
||||
}
|
||||
@ -476,6 +477,17 @@ func (p *PodmanTestIntegration) RunNginxWithHealthCheck(name string) (*PodmanSes
|
||||
return session, session.OutputToString()
|
||||
}
|
||||
|
||||
// RunContainerWithNetworkTest runs the fedoraMinimal curl with the specified network mode.
|
||||
func (p *PodmanTestIntegration) RunContainerWithNetworkTest(mode string) *PodmanSessionIntegration {
|
||||
var podmanArgs = []string{"run"}
|
||||
if mode != "" {
|
||||
podmanArgs = append(podmanArgs, "--network", mode)
|
||||
}
|
||||
podmanArgs = append(podmanArgs, fedoraMinimal, "curl", "-k", "-o", "/dev/null", "http://www.podman.io:80")
|
||||
session := p.Podman(podmanArgs)
|
||||
return session
|
||||
}
|
||||
|
||||
func (p *PodmanTestIntegration) RunLsContainerInPod(name, pod string) (*PodmanSessionIntegration, int, string) {
|
||||
var podmanArgs = []string{"run", "--pod", pod}
|
||||
if name != "" {
|
||||
|
Reference in New Issue
Block a user