blob: 9f91e2afeb79944962b1f5d0c74ada8ad3f90319 [file] [log] [blame]
Filip Tehlar229f5fc2022-08-09 14:44:47 +00001package main
2
3import (
4 "fmt"
5
6 "github.com/edwarnicke/exechelper"
7)
8
Maros Ondrejicka11a03e92022-12-01 09:56:37 +01009func (s *VethsSuite) TestEchoBuiltin() {
Filip Tehlar229f5fc2022-08-09 14:44:47 +000010 srvInstance := "echo-srv-internal"
11 clnInstance := "echo-cln-internal"
Maros Ondrejicka11a03e92022-12-01 09:56:37 +010012
13 s.assertNil(dockerRun(srvInstance, ""), "failed to start docker (srv)")
Filip Tehlar229f5fc2022-08-09 14:44:47 +000014 defer func() { exechelper.Run("docker stop " + srvInstance) }()
15
Maros Ondrejicka11a03e92022-12-01 09:56:37 +010016 s.assertNil(dockerRun(clnInstance, ""), "failed to start docker (cln)")
Filip Tehlar229f5fc2022-08-09 14:44:47 +000017 defer func() { exechelper.Run("docker stop " + clnInstance) }()
18
Maros Ondrejicka11a03e92022-12-01 09:56:37 +010019 _, err := hstExec("Configure2Veths srv", srvInstance)
20 s.assertNil(err)
Filip Tehlar229f5fc2022-08-09 14:44:47 +000021
Filip Tehlar1a9dc752022-11-22 12:49:22 +010022 _, err = hstExec("Configure2Veths cln", clnInstance)
Maros Ondrejicka11a03e92022-12-01 09:56:37 +010023 s.assertNil(err)
Filip Tehlar229f5fc2022-08-09 14:44:47 +000024
Filip Tehlar1a9dc752022-11-22 12:49:22 +010025 _, err = hstExec("RunEchoSrvInternal private-segment-size 1g fifo-size 4 no-echo", srvInstance)
Maros Ondrejicka11a03e92022-12-01 09:56:37 +010026 s.assertNil(err)
Filip Tehlar229f5fc2022-08-09 14:44:47 +000027
Filip Tehlar1a9dc752022-11-22 12:49:22 +010028 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 Ondrejicka11a03e92022-12-01 09:56:37 +010029 s.assertNil(err)
Filip Tehlar229f5fc2022-08-09 14:44:47 +000030 fmt.Println(o)
31}