summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2018-11-28 12:46:39 +0100
committerGiuseppe Scrivano <gscrivan@redhat.com>2018-11-28 16:33:51 +0100
commit180d0c6f62af8fb18da2ddb0e929392ae3d389e6 (patch)
treef20488133a300448d53a5ea97cbf416448eb3ca9 /test/e2e
parentfe919e4914657d197adfb1be9e6885dbac82d310 (diff)
downloadpodman-180d0c6f62af8fb18da2ddb0e929392ae3d389e6.tar.gz
podman-180d0c6f62af8fb18da2ddb0e929392ae3d389e6.tar.bz2
podman-180d0c6f62af8fb18da2ddb0e929392ae3d389e6.zip
tests: fix NOTIFY_SOCKET test
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/run_test.go19
1 files changed, 17 insertions, 2 deletions
diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go
index 85f8df246..38504828b 100644
--- a/test/e2e/run_test.go
+++ b/test/e2e/run_test.go
@@ -3,6 +3,7 @@ package integration
import (
"fmt"
"io/ioutil"
+ "net"
"os"
"path/filepath"
"strings"
@@ -287,13 +288,27 @@ var _ = Describe("Podman run", func() {
})
It("podman run notify_socket", func() {
- sock := "/run/notify"
+ host := GetHostDistributionInfo()
+ if host.Distribution != "rhel" && host.Distribution != "centos" && host.Distribution != "fedora" {
+ Skip("this test requires a working runc")
+ }
+ sock := filepath.Join(podmanTest.TempDir, "notify")
+ addr := net.UnixAddr{
+ Name: sock,
+ Net: "unixgram",
+ }
+ socket, err := net.ListenUnixgram("unixgram", &addr)
+ Expect(err).To(BeNil())
+ defer os.Remove(sock)
+ defer socket.Close()
+
os.Setenv("NOTIFY_SOCKET", sock)
+ defer os.Unsetenv("NOTIFY_SOCKET")
+
session := podmanTest.Podman([]string{"run", "--rm", ALPINE, "printenv", "NOTIFY_SOCKET"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expect(len(session.OutputToStringArray())).To(BeNumerically(">", 0))
- os.Unsetenv("NOTIFY_SOCKET")
})
It("podman run log-opt", func() {