diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2018-11-16 08:51:42 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-16 08:51:42 -0800 |
commit | cd5742ff47f2650e1f33dd485485cd5027500955 (patch) | |
tree | 7d24f45eb0f5287de9d059af9e9b1c214e8565a3 /test/e2e/run_signal_test.go | |
parent | 4abf439e4bda8836cd68101d1f1cb09bc9105b17 (diff) | |
parent | c1bc0a71920fa3f8884cd5066b026570982c66e9 (diff) | |
download | podman-cd5742ff47f2650e1f33dd485485cd5027500955.tar.gz podman-cd5742ff47f2650e1f33dd485485cd5027500955.tar.bz2 podman-cd5742ff47f2650e1f33dd485485cd5027500955.zip |
Merge pull request #1385 from ypu/systemtest
Add system test with ginkgo
Diffstat (limited to 'test/e2e/run_signal_test.go')
-rw-r--r-- | test/e2e/run_signal_test.go | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/test/e2e/run_signal_test.go b/test/e2e/run_signal_test.go index 5de17108c..8f7894db8 100644 --- a/test/e2e/run_signal_test.go +++ b/test/e2e/run_signal_test.go @@ -4,39 +4,24 @@ import ( "fmt" "io" "os" - "os/exec" "path/filepath" "strings" "syscall" "time" + . "github.com/containers/libpod/test/utils" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - "github.com/onsi/gomega/gexec" "golang.org/x/sys/unix" ) -// PodmanPID execs podman and returns its PID -func (p *PodmanTest) PodmanPID(args []string) (*PodmanSession, int) { - podmanOptions := p.MakeOptions() - podmanOptions = append(podmanOptions, strings.Split(p.StorageOptions, " ")...) - podmanOptions = append(podmanOptions, args...) - fmt.Printf("Running: %s %s\n", p.PodmanBinary, strings.Join(podmanOptions, " ")) - command := exec.Command(p.PodmanBinary, podmanOptions...) - session, err := gexec.Start(command, GinkgoWriter, GinkgoWriter) - if err != nil { - Fail(fmt.Sprintf("unable to run podman command: %s", strings.Join(podmanOptions, " "))) - } - return &PodmanSession{session}, command.Process.Pid -} - const sigCatch = "trap \"echo FOO >> /h/fifo \" 8; echo READY >> /h/fifo; while :; do sleep 0.25; done" var _ = Describe("Podman run with --sig-proxy", func() { var ( tmpdir string err error - podmanTest PodmanTest + podmanTest *PodmanTestIntegration ) BeforeEach(func() { @@ -44,7 +29,7 @@ var _ = Describe("Podman run with --sig-proxy", func() { if err != nil { os.Exit(1) } - podmanTest = PodmanCreate(tmpdir) + podmanTest = PodmanTestCreate(tmpdir) podmanTest.RestoreArtifact(fedoraMinimal) }) @@ -122,7 +107,7 @@ var _ = Describe("Podman run with --sig-proxy", func() { signal := syscall.SIGPOLL session, pid := podmanTest.PodmanPID([]string{"run", "--name", "test2", "--sig-proxy=false", fedoraMinimal, "bash", "-c", sigCatch}) - ok := WaitForContainer(&podmanTest) + ok := WaitForContainer(podmanTest) Expect(ok).To(BeTrue()) // Kill with given signal |