Skip to content

Commit

Permalink
Merge pull request #12110 from cevich/fix_systemd_pid1
Browse files Browse the repository at this point in the history
Fix systemd PID1 test
  • Loading branch information
openshift-merge-robot authored Oct 27, 2021
2 parents 979b631 + d537890 commit b29dc1b
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions test/e2e/systemd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"io/ioutil"
"os"
"strings"
"time"

. "github.com/containers/podman/v3/test/utils"
. "github.com/onsi/ginkgo"
Expand Down Expand Up @@ -82,27 +81,13 @@ WantedBy=multi-user.target
run := podmanTest.Podman([]string{"run", "--name", ctrName, "-t", "-i", "-d", ubi_init, "/sbin/init"})
run.WaitWithDefaultTimeout()
Expect(run).Should(Exit(0))
ctrID := run.OutputToString()

logs := podmanTest.Podman([]string{"logs", ctrName})
logs.WaitWithDefaultTimeout()
Expect(logs).Should(Exit(0))

// Give container 10 seconds to start
started := false
for i := 0; i < 10; i++ {
runningCtrs := podmanTest.Podman([]string{"ps", "-q", "--no-trunc"})
runningCtrs.WaitWithDefaultTimeout()
Expect(runningCtrs).Should(Exit(0))

if strings.Contains(runningCtrs.OutputToString(), ctrID) {
started = true
break
}

time.Sleep(1 * time.Second)
}

started := podmanTest.WaitContainerReady(ctrName, "Reached target Multi-User System.", 30, 1)
Expect(started).To(BeTrue())

systemctl := podmanTest.Podman([]string{"exec", "-t", "-i", ctrName, "systemctl", "status", "--no-pager"})
Expand Down

0 comments on commit b29dc1b

Please sign in to comment.