Filip Tehlar | 229f5fc | 2022-08-09 14:44:47 +0000 | [diff] [blame] | 1 | package main |
| 2 | |
| 3 | import ( |
| 4 | "fmt" |
| 5 | |
| 6 | "github.com/edwarnicke/exechelper" |
| 7 | ) |
| 8 | |
Maros Ondrejicka | 11a03e9 | 2022-12-01 09:56:37 +0100 | [diff] [blame^] | 9 | func (s *VethsSuite) TestEchoBuiltin() { |
Filip Tehlar | 229f5fc | 2022-08-09 14:44:47 +0000 | [diff] [blame] | 10 | srvInstance := "echo-srv-internal" |
| 11 | clnInstance := "echo-cln-internal" |
Maros Ondrejicka | 11a03e9 | 2022-12-01 09:56:37 +0100 | [diff] [blame^] | 12 | |
| 13 | s.assertNil(dockerRun(srvInstance, ""), "failed to start docker (srv)") |
Filip Tehlar | 229f5fc | 2022-08-09 14:44:47 +0000 | [diff] [blame] | 14 | defer func() { exechelper.Run("docker stop " + srvInstance) }() |
| 15 | |
Maros Ondrejicka | 11a03e9 | 2022-12-01 09:56:37 +0100 | [diff] [blame^] | 16 | s.assertNil(dockerRun(clnInstance, ""), "failed to start docker (cln)") |
Filip Tehlar | 229f5fc | 2022-08-09 14:44:47 +0000 | [diff] [blame] | 17 | defer func() { exechelper.Run("docker stop " + clnInstance) }() |
| 18 | |
Maros Ondrejicka | 11a03e9 | 2022-12-01 09:56:37 +0100 | [diff] [blame^] | 19 | _, err := hstExec("Configure2Veths srv", srvInstance) |
| 20 | s.assertNil(err) |
Filip Tehlar | 229f5fc | 2022-08-09 14:44:47 +0000 | [diff] [blame] | 21 | |
Filip Tehlar | 1a9dc75 | 2022-11-22 12:49:22 +0100 | [diff] [blame] | 22 | _, err = hstExec("Configure2Veths cln", clnInstance) |
Maros Ondrejicka | 11a03e9 | 2022-12-01 09:56:37 +0100 | [diff] [blame^] | 23 | s.assertNil(err) |
Filip Tehlar | 229f5fc | 2022-08-09 14:44:47 +0000 | [diff] [blame] | 24 | |
Filip Tehlar | 1a9dc75 | 2022-11-22 12:49:22 +0100 | [diff] [blame] | 25 | _, err = hstExec("RunEchoSrvInternal private-segment-size 1g fifo-size 4 no-echo", srvInstance) |
Maros Ondrejicka | 11a03e9 | 2022-12-01 09:56:37 +0100 | [diff] [blame^] | 26 | s.assertNil(err) |
Filip Tehlar | 229f5fc | 2022-08-09 14:44:47 +0000 | [diff] [blame] | 27 | |
Filip Tehlar | 1a9dc75 | 2022-11-22 12:49:22 +0100 | [diff] [blame] | 28 | o, err := hstExec("RunEchoClnInternal nclients 10000 bytes 1 syn-timeout 100 test-timeout 100 no-return private-segment-size 1g fifo-size 4", clnInstance) |
Maros Ondrejicka | 11a03e9 | 2022-12-01 09:56:37 +0100 | [diff] [blame^] | 29 | s.assertNil(err) |
Filip Tehlar | 229f5fc | 2022-08-09 14:44:47 +0000 | [diff] [blame] | 30 | fmt.Println(o) |
| 31 | } |