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:
Ed Santiago
2023-07-05 06:47:38 -06:00
parent 93447e292d
commit 99f93d55c4
2 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -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()