11a03e972e
Test suite now supports assertions which on fail stop test case run, also it allows to create docker containers which are going to be stopped automatically after the test run is finished. Type: improvement Signed-off-by: Maros Ondrejicka <maros.ondrejicka@pantheon.tech> Change-Id: I2834709b1efd17b8182d36cc0404b986b4ed595d Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
32 lines
917 B
Go
Executable File
32 lines
917 B
Go
Executable File
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)
|
|
s.assertNil(err)
|
|
|
|
_, err = hstExec("Configure2Veths cln", clnInstance)
|
|
s.assertNil(err)
|
|
|
|
_, err = hstExec("RunEchoSrvInternal private-segment-size 1g fifo-size 4 no-echo", srvInstance)
|
|
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)
|
|
s.assertNil(err)
|
|
fmt.Println(o)
|
|
}
|