blob: 74ff4cb0d6e1e7df7881457b051d2e4aef32cbb8 [file] [log] [blame]
Filip Tehlar229f5fc2022-08-09 14:44:47 +00001package main
2
3import (
4 "fmt"
5
6 "github.com/edwarnicke/exechelper"
7)
8
9func (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 Tehlar1a9dc752022-11-22 12:49:22 +010027 _, err = hstExec("Configure2Veths srv", srvInstance)
Filip Tehlar229f5fc2022-08-09 14:44:47 +000028 if err != nil {
29 t.Errorf("%v", err)
30 return
31 }
32
Filip Tehlar1a9dc752022-11-22 12:49:22 +010033 _, err = hstExec("Configure2Veths cln", clnInstance)
Filip Tehlar229f5fc2022-08-09 14:44:47 +000034 if err != nil {
35 t.Errorf("%v", err)
36 return
37 }
38
Filip Tehlar1a9dc752022-11-22 12:49:22 +010039 _, err = hstExec("RunEchoSrvInternal private-segment-size 1g fifo-size 4 no-echo", srvInstance)
Filip Tehlar229f5fc2022-08-09 14:44:47 +000040 if err != nil {
41 t.Errorf("%v", err)
42 return
43 }
44
Filip Tehlar1a9dc752022-11-22 12:49:22 +010045 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 Tehlar229f5fc2022-08-09 14:44:47 +000046 if err != nil {
47 t.Errorf("%v", err)
48 return
49 }
50 fmt.Println(o)
51}