mirror of
https://github.com/containers/podman.git
synced 2025-06-23 18:59:30 +08:00
e2e: fix two toolbox flakes
1. toolbox UID/GID allocation: pick numbers < 1500. Otherwise we run the risk of colliding with the Cirrus rootless user. 2. WaitContainerReady(): check the results of the last "podman logs" before timing out. Otherwise, the user will see "READY" followed immediately by "Container is not ready". (global bug, not just toolbox, but that's where I discovered it). Signed-off-by: Ed Santiago <santiago@redhat.com>
This commit is contained in:
@ -257,9 +257,9 @@ var _ = Describe("Toolbox-specific testing", func() {
|
||||
var username string = "testuser"
|
||||
var homeDir string = "/home/testuser"
|
||||
var shell string = "/bin/bash"
|
||||
var uid string = "2000"
|
||||
var uid string = "1411"
|
||||
var groupName string = "testgroup"
|
||||
var gid string = "2000"
|
||||
var gid string = "1422"
|
||||
|
||||
// The use of bad* in the name of variables does not imply the invocation
|
||||
// of useradd should fail The user is supposed to be created successfully
|
||||
|
@ -225,14 +225,14 @@ func (p *PodmanTest) WaitContainerReady(id string, expStr string, timeout int, s
|
||||
s.WaitWithDefaultTimeout()
|
||||
|
||||
for {
|
||||
if strings.Contains(s.OutputToString(), expStr) || strings.Contains(s.ErrorToString(), expStr) {
|
||||
return true
|
||||
}
|
||||
|
||||
if time.Since(startTime) >= time.Duration(timeout)*time.Second {
|
||||
GinkgoWriter.Printf("Container %s is not ready in %ds", id, timeout)
|
||||
return false
|
||||
}
|
||||
|
||||
if strings.Contains(s.OutputToString(), expStr) || strings.Contains(s.ErrorToString(), expStr) {
|
||||
return true
|
||||
}
|
||||
time.Sleep(time.Duration(step) * time.Second)
|
||||
s = p.PodmanBase([]string{"logs", id}, false, true)
|
||||
s.WaitWithDefaultTimeout()
|
||||
|
Reference in New Issue
Block a user