summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2019-05-03 13:28:40 -0400
committerMatthew Heon <matthew.heon@pm.me>2019-05-03 14:38:41 -0400
commitd3286952e6f99b3c1f8ba177d8caddc9544adea4 (patch)
treee46db3c2a3bc8dc90fec3f60d5c7c35ce7e2e3e6
parentceaaed7810dd1fa723cd8e8619f8af00204dac9c (diff)
downloadpodman-d3286952e6f99b3c1f8ba177d8caddc9544adea4.tar.gz
podman-d3286952e6f99b3c1f8ba177d8caddc9544adea4.tar.bz2
podman-d3286952e6f99b3c1f8ba177d8caddc9544adea4.zip
Try and fix restart-policy tests
Theory: it's SELinux blowing up and preventing us from creating files as the container. Try and use a fresh dir and :Z to fix. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
-rw-r--r--test/e2e/run_test.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go
index 0c1cda0a2..030722b47 100644
--- a/test/e2e/run_test.go
+++ b/test/e2e/run_test.go
@@ -725,15 +725,19 @@ USER mail`
It("podman run with restart-policy always restarts containers", func() {
podmanTest.RestoreArtifact(fedoraMinimal)
- aliveFile := filepath.Join(podmanTest.RunRoot, "running")
+ testDir := filepath.Join(podmanTest.RunRoot, "restart-test")
+ err := os.Mkdir(testDir, 0755)
+ Expect(err).To(BeNil())
+
+ aliveFile := filepath.Join(testDir, "running")
file, err := os.Create(aliveFile)
Expect(err).To(BeNil())
file.Close()
- session := podmanTest.Podman([]string{"run", "-dt", "--restart", "always", "-v", fmt.Sprintf("%s:/tmp/runroot", podmanTest.RunRoot), fedoraMinimal, "bash", "-c", "date +%N > /tmp/runroot/ran && while test -r /tmp/runroot/running; do sleep 0.1s; done"})
+ session := podmanTest.Podman([]string{"run", "-dt", "--restart", "always", "-v", fmt.Sprintf("%s:/tmp/runroot:Z", testDir), fedoraMinimal, "bash", "-c", "date +%N > /tmp/runroot/ran && while test -r /tmp/runroot/running; do sleep 0.1s; done"})
found := false
- testFile := filepath.Join(podmanTest.RunRoot, "ran")
+ testFile := filepath.Join(testDir, "ran")
for i := 0; i < 10; i++ {
time.Sleep(1 * time.Second)
if _, err := os.Stat(testFile); err == nil {