Skip to content

Commit

Permalink
kola/test:docker: Prepare for replacing ncat with openbsd nc
Browse files Browse the repository at this point in the history
OpenBSD netcat has no long flags and has no idle timeout flag (there
is some timeout flag, -w, but it's ignored in listening mode). The
timeout flag is no problem in the end, as the whole test has a timeout
of one minute anyway.
  • Loading branch information
krnowak committed Aug 1, 2024
1 parent ac3b487 commit 3dab3fd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions kola/tests/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,15 +367,15 @@ func dockerNetwork(c cluster.TestCluster) {
machines := c.Machines()
src, dest := machines[0], machines[1]

c.Log("creating ncat containers")
c.Log("creating netcat containers")

GenDockerImage(c, src, "ncat", []string{"ncat"})
GenDockerImage(c, dest, "ncat", []string{"ncat"})
GenDockerImage(c, src, "netcat", []string{"nc"})
GenDockerImage(c, dest, "netcat", []string{"nc"})

listener := func(ctx context.Context) error {
// Will block until a message is recieved
// Will block until a message is received
out, err := c.SSH(dest,
`echo "HELLO FROM SERVER" | docker run -i -p 9988:9988 ncat ncat --idle-timeout 20 --listen 0.0.0.0 9988`,
`echo "HELLO FROM SERVER" | docker run -i -p 9988:9988 netcat nc -l 0.0.0.0 9988`,
)
if err != nil {
return err
Expand Down Expand Up @@ -409,7 +409,7 @@ func dockerNetwork(c cluster.TestCluster) {
}
}

srcCmd := fmt.Sprintf(`echo "HELLO FROM CLIENT" | docker run -i ncat ncat %s 9988`, dest.PrivateIP())
srcCmd := fmt.Sprintf(`echo "HELLO FROM CLIENT" | docker run -i netcat nc %s 9988`, dest.PrivateIP())
out, err := c.SSH(src, srcCmd)
if err != nil {
return err
Expand Down

0 comments on commit 3dab3fd

Please sign in to comment.