diff options
author | Maros Ondrejicka <maros.ondrejicka@pantheon.tech> | 2022-12-14 16:30:04 +0100 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2022-12-19 17:11:52 +0000 |
commit | db823ed6e9543741f6969ff160314093002e037e (patch) | |
tree | bf046f85d1052058da38192687874e361c684e4c /extras/hs-test/echo_test.go | |
parent | aff4d320f0fe9ce68fcb83ee9ab0abc2d8612644 (diff) |
hs-test: abstract away topology from test cases
Definition of shared volumes and containers has been moved
to yaml files to be together with network topology.
Containers are automatically run at the beginning of each test case
and stopped afterward.
Type: test
Signed-off-by: Maros Ondrejicka <maros.ondrejicka@pantheon.tech>
Change-Id: I264cbb4f1355f8bd7aade221e9609fb5b9bd693e
Diffstat (limited to 'extras/hs-test/echo_test.go')
-rwxr-xr-x | extras/hs-test/echo_test.go | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/extras/hs-test/echo_test.go b/extras/hs-test/echo_test.go index 9f91e2afeb7..9bc8f76105c 100755 --- a/extras/hs-test/echo_test.go +++ b/extras/hs-test/echo_test.go @@ -2,30 +2,21 @@ package main import ( "fmt" - - "github.com/edwarnicke/exechelper" ) func (s *VethsSuite) TestEchoBuiltin() { - srvInstance := "echo-srv-internal" - clnInstance := "echo-cln-internal" - - s.assertNil(dockerRun(srvInstance, ""), "failed to start docker (srv)") - defer func() { exechelper.Run("docker stop " + srvInstance) }() - - s.assertNil(dockerRun(clnInstance, ""), "failed to start docker (cln)") - defer func() { exechelper.Run("docker stop " + clnInstance) }() - - _, err := hstExec("Configure2Veths srv", srvInstance) + serverContainer := s.getContainerByName("server-vpp") + _, err := serverContainer.execAction("Configure2Veths srv") s.assertNil(err) - _, err = hstExec("Configure2Veths cln", clnInstance) + clientContainer := s.getContainerByName("client-vpp") + _, err = clientContainer.execAction("Configure2Veths cln") s.assertNil(err) - _, err = hstExec("RunEchoSrvInternal private-segment-size 1g fifo-size 4 no-echo", srvInstance) + _, err = serverContainer.execAction("RunEchoSrvInternal private-segment-size 1g fifo-size 4 no-echo") s.assertNil(err) - o, err := hstExec("RunEchoClnInternal nclients 10000 bytes 1 syn-timeout 100 test-timeout 100 no-return private-segment-size 1g fifo-size 4", clnInstance) + o, err := clientContainer.execAction("RunEchoClnInternal nclients 10000 bytes 1 syn-timeout 100 test-timeout 100 no-return private-segment-size 1g fifo-size 4") s.assertNil(err) fmt.Println(o) } |