diff options
author | 2024-06-26 09:47:10 +0200 | |
---|---|---|
committer | 2024-09-18 18:09:44 +0000 | |
commit | 3ecd6840af4f890a11d26628ac34d31786b16758 (patch) | |
tree | c87d6a0407460efca5a13fd54afe1850ddbb6376 /extras/hs-test/infra | |
parent | 0950830ee9fff7ce62145cab64ed76605487e647 (diff) |
hs-test: containerize iperf tests
Type: test
Change-Id: I2c0bb76d96ccadd5ecfd6a04565420855043699e
Signed-off-by: Adrian Villin <avillin@cisco.com>
Diffstat (limited to 'extras/hs-test/infra')
-rw-r--r-- | extras/hs-test/infra/suite_iperf_linux.go (renamed from extras/hs-test/infra/suite_tap.go) | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/extras/hs-test/infra/suite_tap.go b/extras/hs-test/infra/suite_iperf_linux.go index c02ab8e8535..728429b505f 100644 --- a/extras/hs-test/infra/suite_tap.go +++ b/extras/hs-test/infra/suite_iperf_linux.go @@ -9,28 +9,36 @@ import ( . "github.com/onsi/ginkgo/v2" ) -type TapSuite struct { +type IperfSuite struct { HstSuite } -var tapTests = map[string][]func(s *TapSuite){} -var tapSoloTests = map[string][]func(s *TapSuite){} +const ( + ServerIperfContainerName string = "server" + ServerIperfInterfaceName string = "hstsrv" + ClientIperfContainerName string = "client" + ClientIperfInterfaceName string = "hstcln" +) + +var iperfTests = map[string][]func(s *IperfSuite){} +var iperfSoloTests = map[string][]func(s *IperfSuite){} -func RegisterTapTests(tests ...func(s *TapSuite)) { - tapTests[getTestFilename()] = tests +func RegisterIperfTests(tests ...func(s *IperfSuite)) { + iperfTests[getTestFilename()] = tests } -func RegisterTapSoloTests(tests ...func(s *TapSuite)) { - tapSoloTests[getTestFilename()] = tests +func RegisterIperfSoloTests(tests ...func(s *IperfSuite)) { + iperfSoloTests[getTestFilename()] = tests } -func (s *TapSuite) SetupSuite() { +func (s *IperfSuite) SetupSuite() { time.Sleep(1 * time.Second) s.HstSuite.SetupSuite() - s.ConfigureNetworkTopology("tap") + s.ConfigureNetworkTopology("2taps") + s.LoadContainerTopology("2containers") } -var _ = Describe("TapSuite", Ordered, ContinueOnFailure, func() { - var s TapSuite +var _ = Describe("IperfSuite", Ordered, ContinueOnFailure, func() { + var s IperfSuite BeforeAll(func() { s.SetupSuite() }) @@ -44,7 +52,7 @@ var _ = Describe("TapSuite", Ordered, ContinueOnFailure, func() { s.TearDownTest() }) - for filename, tests := range tapTests { + for filename, tests := range iperfTests { for _, test := range tests { test := test pc := reflect.ValueOf(test).Pointer() @@ -58,8 +66,8 @@ var _ = Describe("TapSuite", Ordered, ContinueOnFailure, func() { } }) -var _ = Describe("TapSuiteSolo", Ordered, ContinueOnFailure, Serial, func() { - var s TapSuite +var _ = Describe("IperfSuiteSolo", Ordered, ContinueOnFailure, Serial, func() { + var s IperfSuite BeforeAll(func() { s.SetupSuite() }) @@ -73,7 +81,7 @@ var _ = Describe("TapSuiteSolo", Ordered, ContinueOnFailure, Serial, func() { s.TearDownTest() }) - for filename, tests := range tapSoloTests { + for filename, tests := range iperfSoloTests { for _, test := range tests { test := test pc := reflect.ValueOf(test).Pointer() |