@@ -20,20 +20,15 @@ var _ = Describe("Podman attach", func() {
20
20
})
21
21
22
22
It ("podman attach to non-running container" , func () {
23
- session := podmanTest .Podman ([]string {"create" , "--name" , "test1" , "-i" , CITEST_IMAGE , "ls" })
24
- session .WaitWithDefaultTimeout ()
25
- Expect (session ).Should (ExitCleanly ())
23
+ podmanTest .PodmanExitCleanly ("create" , "--name" , "test1" , "-i" , CITEST_IMAGE , "ls" )
26
24
27
25
results := podmanTest .Podman ([]string {"attach" , "test1" })
28
26
results .WaitWithDefaultTimeout ()
29
27
Expect (results ).Should (ExitWithError (125 , "you can only attach to running containers" ))
30
28
})
31
29
32
30
It ("podman container attach to non-running container" , func () {
33
- session := podmanTest .Podman ([]string {"container" , "create" , "--name" , "test1" , "-i" , CITEST_IMAGE , "ls" })
34
-
35
- session .WaitWithDefaultTimeout ()
36
- Expect (session ).Should (ExitCleanly ())
31
+ podmanTest .PodmanExitCleanly ("container" , "create" , "--name" , "test1" , "-i" , CITEST_IMAGE , "ls" )
37
32
38
33
results := podmanTest .Podman ([]string {"container" , "attach" , "test1" })
39
34
results .WaitWithDefaultTimeout ()
@@ -55,9 +50,7 @@ var _ = Describe("Podman attach", func() {
55
50
})
56
51
57
52
It ("podman attach to a running container" , func () {
58
- session := podmanTest .Podman ([]string {"run" , "-d" , "--name" , "test" , CITEST_IMAGE , "/bin/sh" , "-c" , "while true; do echo test; sleep 1; done" })
59
- session .WaitWithDefaultTimeout ()
60
- Expect (session ).Should (ExitCleanly ())
53
+ podmanTest .PodmanExitCleanly ("run" , "-d" , "--name" , "test" , CITEST_IMAGE , "/bin/sh" , "-c" , "while true; do echo test; sleep 1; done" )
61
54
62
55
results := podmanTest .Podman ([]string {"attach" , "test" })
63
56
time .Sleep (2 * time .Second )
@@ -67,13 +60,8 @@ var _ = Describe("Podman attach", func() {
67
60
})
68
61
69
62
It ("podman attach to the latest container" , func () {
70
- session := podmanTest .Podman ([]string {"run" , "-d" , "--name" , "test1" , CITEST_IMAGE , "/bin/sh" , "-c" , "while true; do echo test1; sleep 1; done" })
71
- session .WaitWithDefaultTimeout ()
72
- Expect (session ).Should (ExitCleanly ())
73
-
74
- session = podmanTest .Podman ([]string {"run" , "-d" , "--name" , "test2" , CITEST_IMAGE , "/bin/sh" , "-c" , "while true; do echo test2; sleep 1; done" })
75
- session .WaitWithDefaultTimeout ()
76
- Expect (session ).Should (ExitCleanly ())
63
+ podmanTest .PodmanExitCleanly ("run" , "-d" , "--name" , "test1" , CITEST_IMAGE , "/bin/sh" , "-c" , "while true; do echo test1; sleep 1; done" )
64
+ podmanTest .PodmanExitCleanly ("run" , "-d" , "--name" , "test2" , CITEST_IMAGE , "/bin/sh" , "-c" , "while true; do echo test2; sleep 1; done" )
77
65
78
66
cid := "-l"
79
67
if IsRemote () {
@@ -87,9 +75,7 @@ var _ = Describe("Podman attach", func() {
87
75
})
88
76
89
77
It ("podman attach to a container with --sig-proxy set to false" , func () {
90
- session := podmanTest .Podman ([]string {"run" , "-d" , "--name" , "test" , CITEST_IMAGE , "/bin/sh" , "-c" , "while true; do echo test; sleep 1; done" })
91
- session .WaitWithDefaultTimeout ()
92
- Expect (session ).Should (ExitCleanly ())
78
+ podmanTest .PodmanExitCleanly ("run" , "-d" , "--name" , "test" , CITEST_IMAGE , "/bin/sh" , "-c" , "while true; do echo test; sleep 1; done" )
93
79
94
80
results := podmanTest .Podman ([]string {"attach" , "--sig-proxy=false" , "test" })
95
81
time .Sleep (2 * time .Second )
0 commit comments