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 | |
| 9 | func (s *Veths2Suite) TestEchoBuiltin() { |
| 10 | t := s.T() |
| 11 | srvInstance := "echo-srv-internal" |
| 12 | clnInstance := "echo-cln-internal" |
| 13 | err := dockerRun(srvInstance, "") |
| 14 | if err != nil { |
| 15 | t.Errorf("%v", err) |
| 16 | return |
| 17 | } |
| 18 | defer func() { exechelper.Run("docker stop " + srvInstance) }() |
| 19 | |
| 20 | err = dockerRun(clnInstance, "") |
| 21 | if err != nil { |
| 22 | t.Errorf("%v", err) |
| 23 | return |
| 24 | } |
| 25 | defer func() { exechelper.Run("docker stop " + clnInstance) }() |
| 26 | |
Filip Tehlar | 1a9dc75 | 2022-11-22 12:49:22 +0100 | [diff] [blame] | 27 | _, err = hstExec("Configure2Veths srv", srvInstance) |
Filip Tehlar | 229f5fc | 2022-08-09 14:44:47 +0000 | [diff] [blame] | 28 | if err != nil { |
| 29 | t.Errorf("%v", err) |
| 30 | return |
| 31 | } |
| 32 | |
Filip Tehlar | 1a9dc75 | 2022-11-22 12:49:22 +0100 | [diff] [blame] | 33 | _, err = hstExec("Configure2Veths cln", clnInstance) |
Filip Tehlar | 229f5fc | 2022-08-09 14:44:47 +0000 | [diff] [blame] | 34 | if err != nil { |
| 35 | t.Errorf("%v", err) |
| 36 | return |
| 37 | } |
| 38 | |
Filip Tehlar | 1a9dc75 | 2022-11-22 12:49:22 +0100 | [diff] [blame] | 39 | _, err = hstExec("RunEchoSrvInternal private-segment-size 1g fifo-size 4 no-echo", srvInstance) |
Filip Tehlar | 229f5fc | 2022-08-09 14:44:47 +0000 | [diff] [blame] | 40 | if err != nil { |
| 41 | t.Errorf("%v", err) |
| 42 | return |
| 43 | } |
| 44 | |
Filip Tehlar | 1a9dc75 | 2022-11-22 12:49:22 +0100 | [diff] [blame] | 45 | o, err := hstExec("RunEchoClnInternal nclients 10000 bytes 1 syn-timeout 100 test-timeout 100 no-return private-segment-size 1g fifo-size 4", clnInstance) |
Filip Tehlar | 229f5fc | 2022-08-09 14:44:47 +0000 | [diff] [blame] | 46 | if err != nil { |
| 47 | t.Errorf("%v", err) |
| 48 | return |
| 49 | } |
| 50 | fmt.Println(o) |
| 51 | } |