mirror of
https://github.com/containers/podman.git
synced 2025-06-23 02:18:13 +08:00
Merge pull request #6936 from mheon/matt_cant_count
Correctly print STDOUT on non-terminal remote exec
This commit is contained in:
@ -457,15 +457,15 @@ func ExecStartAndAttach(ctx context.Context, sessionID string, streams *define.A
|
|||||||
|
|
||||||
switch {
|
switch {
|
||||||
case fd == 0:
|
case fd == 0:
|
||||||
if streams.AttachOutput {
|
if streams.AttachInput {
|
||||||
|
// Write STDIN to STDOUT (echoing characters
|
||||||
|
// typed by another attach session)
|
||||||
if _, err := streams.OutputStream.Write(frame[0:l]); err != nil {
|
if _, err := streams.OutputStream.Write(frame[0:l]); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case fd == 1:
|
case fd == 1:
|
||||||
if streams.AttachInput {
|
if streams.AttachOutput {
|
||||||
// Write STDIN to STDOUT (echoing characters
|
|
||||||
// typed by another attach session)
|
|
||||||
if _, err := streams.OutputStream.Write(frame[0:l]); err != nil {
|
if _, err := streams.OutputStream.Write(frame[0:l]); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,6 @@ var _ = Describe("Podman exec", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("podman exec environment test", func() {
|
It("podman exec environment test", func() {
|
||||||
Skip(v2remotefail)
|
|
||||||
setup := podmanTest.RunTopContainer("test1")
|
setup := podmanTest.RunTopContainer("test1")
|
||||||
setup.WaitWithDefaultTimeout()
|
setup.WaitWithDefaultTimeout()
|
||||||
Expect(setup.ExitCode()).To(Equal(0))
|
Expect(setup.ExitCode()).To(Equal(0))
|
||||||
@ -99,7 +98,6 @@ var _ = Describe("Podman exec", func() {
|
|||||||
|
|
||||||
It("podman exec os.Setenv env", func() {
|
It("podman exec os.Setenv env", func() {
|
||||||
// remote doesn't properly interpret os.Setenv
|
// remote doesn't properly interpret os.Setenv
|
||||||
SkipIfRemote()
|
|
||||||
setup := podmanTest.RunTopContainer("test1")
|
setup := podmanTest.RunTopContainer("test1")
|
||||||
setup.WaitWithDefaultTimeout()
|
setup.WaitWithDefaultTimeout()
|
||||||
Expect(setup.ExitCode()).To(Equal(0))
|
Expect(setup.ExitCode()).To(Equal(0))
|
||||||
@ -159,7 +157,6 @@ var _ = Describe("Podman exec", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("podman exec with user only in container", func() {
|
It("podman exec with user only in container", func() {
|
||||||
Skip(v2remotefail)
|
|
||||||
testUser := "test123"
|
testUser := "test123"
|
||||||
setup := podmanTest.Podman([]string{"run", "--name", "test1", "-d", fedoraMinimal, "sleep", "60"})
|
setup := podmanTest.Podman([]string{"run", "--name", "test1", "-d", fedoraMinimal, "sleep", "60"})
|
||||||
setup.WaitWithDefaultTimeout()
|
setup.WaitWithDefaultTimeout()
|
||||||
@ -176,7 +173,6 @@ var _ = Describe("Podman exec", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("podman exec with user from run", func() {
|
It("podman exec with user from run", func() {
|
||||||
Skip(v2remotefail)
|
|
||||||
testUser := "guest"
|
testUser := "guest"
|
||||||
setup := podmanTest.Podman([]string{"run", "--user", testUser, "-d", ALPINE, "top"})
|
setup := podmanTest.Podman([]string{"run", "--user", testUser, "-d", ALPINE, "top"})
|
||||||
setup.WaitWithDefaultTimeout()
|
setup.WaitWithDefaultTimeout()
|
||||||
@ -196,7 +192,6 @@ var _ = Describe("Podman exec", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("podman exec simple working directory test", func() {
|
It("podman exec simple working directory test", func() {
|
||||||
Skip(v2remotefail)
|
|
||||||
setup := podmanTest.RunTopContainer("test1")
|
setup := podmanTest.RunTopContainer("test1")
|
||||||
setup.WaitWithDefaultTimeout()
|
setup.WaitWithDefaultTimeout()
|
||||||
Expect(setup.ExitCode()).To(Equal(0))
|
Expect(setup.ExitCode()).To(Equal(0))
|
||||||
|
Reference in New Issue
Block a user