aboutsummaryrefslogtreecommitdiffstats
path: root/extras/hs-test/infra
diff options
context:
space:
mode:
Diffstat (limited to 'extras/hs-test/infra')
-rw-r--r--extras/hs-test/infra/container.go1
-rw-r--r--extras/hs-test/infra/hst_suite.go17
-rw-r--r--extras/hs-test/infra/suite_cpu_pinning.go4
-rw-r--r--extras/hs-test/infra/suite_envoy_proxy.go4
-rw-r--r--extras/hs-test/infra/suite_iperf_linux.go4
-rw-r--r--extras/hs-test/infra/suite_ldp.go4
-rw-r--r--extras/hs-test/infra/suite_nginx_proxy.go4
-rw-r--r--extras/hs-test/infra/suite_no_topo.go4
-rw-r--r--extras/hs-test/infra/suite_veth.go4
-rw-r--r--extras/hs-test/infra/suite_vpp_proxy.go4
10 files changed, 30 insertions, 20 deletions
diff --git a/extras/hs-test/infra/container.go b/extras/hs-test/infra/container.go
index d4ef693c1c0..cc79a5cbb18 100644
--- a/extras/hs-test/infra/container.go
+++ b/extras/hs-test/infra/container.go
@@ -328,7 +328,6 @@ func (c *Container) getVolumesAsSlice() []string {
}
core_pattern, err := sysctl.Read("kernel.core_pattern")
- core_pattern = strings.ReplaceAll(core_pattern, "%", "%%")
if err == nil {
if len(core_pattern) > 0 && core_pattern[0] != '|' {
index := strings.LastIndex(core_pattern, "/")
diff --git a/extras/hs-test/infra/hst_suite.go b/extras/hs-test/infra/hst_suite.go
index 435001afba7..3aeeb24d14e 100644
--- a/extras/hs-test/infra/hst_suite.go
+++ b/extras/hs-test/infra/hst_suite.go
@@ -43,7 +43,7 @@ var IsLeakCheck = flag.Bool("leak_check", false, "run leak-check tests")
var ParallelTotal = flag.Lookup("ginkgo.parallel.total")
var DryRun = flag.Bool("dryrun", false, "set up containers but don't run tests")
var NumaAwareCpuAlloc bool
-var SuiteTimeout time.Duration
+var TestTimeout time.Duration
type HstSuite struct {
Containers map[string]*Container
@@ -310,6 +310,10 @@ func (s *HstSuite) AssertHttpBody(resp *http.Response, expectedBody string, msgA
ExpectWithOffset(2, resp).To(HaveHTTPBody(expectedBody), msgAndArgs...)
}
+func (s *HstSuite) AssertChannelClosed(timeout time.Duration, channel chan error) {
+ EventuallyWithOffset(2, channel).WithTimeout(timeout).Should(BeClosed())
+}
+
func (s *HstSuite) CreateLogger() {
suiteName := s.GetCurrentSuiteName()
var err error
@@ -323,12 +327,19 @@ func (s *HstSuite) CreateLogger() {
// Logs to files by default, logs to stdout when VERBOSE=true with GinkgoWriter
// to keep console tidy
func (s *HstSuite) Log(log any, arg ...any) {
- logs := strings.Split(fmt.Sprintf(fmt.Sprint(log), arg...), "\n")
+ var logStr string
+ if len(arg) == 0 {
+ logStr = fmt.Sprint(log)
+ } else {
+ logStr = fmt.Sprintf(fmt.Sprint(log), arg...)
+ }
+ logs := strings.Split(logStr, "\n")
+
for _, line := range logs {
s.Logger.Println(line)
}
if *IsVerbose {
- GinkgoWriter.Println(fmt.Sprintf(fmt.Sprint(log), arg...))
+ GinkgoWriter.Println(logStr)
}
}
diff --git a/extras/hs-test/infra/suite_cpu_pinning.go b/extras/hs-test/infra/suite_cpu_pinning.go
index 4adfe16d05e..57efbe7f4f0 100644
--- a/extras/hs-test/infra/suite_cpu_pinning.go
+++ b/extras/hs-test/infra/suite_cpu_pinning.go
@@ -83,7 +83,7 @@ var _ = Describe("CpuPinningSuite", Ordered, ContinueOnFailure, func() {
It(testName, func(ctx SpecContext) {
s.Log(testName + ": BEGIN")
test(&s)
- }, SpecTimeout(SuiteTimeout))
+ }, SpecTimeout(TestTimeout))
}
}
})
@@ -112,7 +112,7 @@ var _ = Describe("CpuPinningSuiteSolo", Ordered, ContinueOnFailure, Serial, func
It(testName, Label("SOLO"), func(ctx SpecContext) {
s.Log(testName + ": BEGIN")
test(&s)
- }, SpecTimeout(SuiteTimeout))
+ }, SpecTimeout(TestTimeout))
}
}
})
diff --git a/extras/hs-test/infra/suite_envoy_proxy.go b/extras/hs-test/infra/suite_envoy_proxy.go
index 9b1ae1fc808..50ffd11898e 100644
--- a/extras/hs-test/infra/suite_envoy_proxy.go
+++ b/extras/hs-test/infra/suite_envoy_proxy.go
@@ -191,7 +191,7 @@ var _ = Describe("EnvoyProxySuite", Ordered, ContinueOnFailure, func() {
It(testName, func(ctx SpecContext) {
s.Log(testName + ": BEGIN")
test(&s)
- }, SpecTimeout(SuiteTimeout))
+ }, SpecTimeout(TestTimeout))
}
}
})
@@ -220,7 +220,7 @@ var _ = Describe("EnvoyProxySuiteSolo", Ordered, ContinueOnFailure, func() {
It(testName, Label("SOLO"), func(ctx SpecContext) {
s.Log(testName + ": BEGIN")
test(&s)
- }, SpecTimeout(SuiteTimeout))
+ }, SpecTimeout(TestTimeout))
}
}
})
diff --git a/extras/hs-test/infra/suite_iperf_linux.go b/extras/hs-test/infra/suite_iperf_linux.go
index 728429b505f..fb685f9ad96 100644
--- a/extras/hs-test/infra/suite_iperf_linux.go
+++ b/extras/hs-test/infra/suite_iperf_linux.go
@@ -61,7 +61,7 @@ var _ = Describe("IperfSuite", Ordered, ContinueOnFailure, func() {
It(testName, func(ctx SpecContext) {
s.Log(testName + ": BEGIN")
test(&s)
- }, SpecTimeout(SuiteTimeout))
+ }, SpecTimeout(TestTimeout))
}
}
})
@@ -90,7 +90,7 @@ var _ = Describe("IperfSuiteSolo", Ordered, ContinueOnFailure, Serial, func() {
It(testName, Label("SOLO"), func(ctx SpecContext) {
s.Log(testName + ": BEGIN")
test(&s)
- }, SpecTimeout(SuiteTimeout))
+ }, SpecTimeout(TestTimeout))
}
}
})
diff --git a/extras/hs-test/infra/suite_ldp.go b/extras/hs-test/infra/suite_ldp.go
index 45f55ce859e..6294fab0dd6 100644
--- a/extras/hs-test/infra/suite_ldp.go
+++ b/extras/hs-test/infra/suite_ldp.go
@@ -163,7 +163,7 @@ var _ = Describe("LdpSuite", Ordered, ContinueOnFailure, func() {
It(testName, func(ctx SpecContext) {
s.Log(testName + ": BEGIN")
test(&s)
- }, SpecTimeout(SuiteTimeout))
+ }, SpecTimeout(TestTimeout))
}
}
})
@@ -193,7 +193,7 @@ var _ = Describe("LdpSuiteSolo", Ordered, ContinueOnFailure, Serial, func() {
It(testName, Label("SOLO"), func(ctx SpecContext) {
s.Log(testName + ": BEGIN")
test(&s)
- }, SpecTimeout(SuiteTimeout))
+ }, SpecTimeout(TestTimeout))
}
}
})
diff --git a/extras/hs-test/infra/suite_nginx_proxy.go b/extras/hs-test/infra/suite_nginx_proxy.go
index 476631ecea8..9d81f70720c 100644
--- a/extras/hs-test/infra/suite_nginx_proxy.go
+++ b/extras/hs-test/infra/suite_nginx_proxy.go
@@ -200,7 +200,7 @@ var _ = Describe("NginxProxySuite", Ordered, ContinueOnFailure, func() {
It(testName, func(ctx SpecContext) {
s.Log(testName + ": BEGIN")
test(&s)
- }, SpecTimeout(SuiteTimeout))
+ }, SpecTimeout(TestTimeout))
}
}
})
@@ -229,7 +229,7 @@ var _ = Describe("NginxProxySuiteSolo", Ordered, ContinueOnFailure, Serial, func
It(testName, Label("SOLO"), func(ctx SpecContext) {
s.Log(testName + ": BEGIN")
test(&s)
- }, SpecTimeout(SuiteTimeout))
+ }, SpecTimeout(TestTimeout))
}
}
})
diff --git a/extras/hs-test/infra/suite_no_topo.go b/extras/hs-test/infra/suite_no_topo.go
index 590bd2b2852..068c43b14d0 100644
--- a/extras/hs-test/infra/suite_no_topo.go
+++ b/extras/hs-test/infra/suite_no_topo.go
@@ -166,7 +166,7 @@ var _ = Describe("NoTopoSuite", Ordered, ContinueOnFailure, func() {
It(testName, func(ctx SpecContext) {
s.Log(testName + ": BEGIN")
test(&s)
- }, SpecTimeout(SuiteTimeout))
+ }, SpecTimeout(TestTimeout))
}
}
})
@@ -195,7 +195,7 @@ var _ = Describe("NoTopoSuiteSolo", Ordered, ContinueOnFailure, Serial, func() {
It(testName, Label("SOLO"), func(ctx SpecContext) {
s.Log(testName + ": BEGIN")
test(&s)
- }, SpecTimeout(SuiteTimeout))
+ }, SpecTimeout(TestTimeout))
}
}
})
diff --git a/extras/hs-test/infra/suite_veth.go b/extras/hs-test/infra/suite_veth.go
index 03640c419f3..cbbd7ee2694 100644
--- a/extras/hs-test/infra/suite_veth.go
+++ b/extras/hs-test/infra/suite_veth.go
@@ -120,7 +120,7 @@ var _ = Describe("VethsSuite", Ordered, ContinueOnFailure, func() {
It(testName, func(ctx SpecContext) {
s.Log(testName + ": BEGIN")
test(&s)
- }, SpecTimeout(SuiteTimeout))
+ }, SpecTimeout(TestTimeout))
}
}
})
@@ -150,7 +150,7 @@ var _ = Describe("VethsSuiteSolo", Ordered, ContinueOnFailure, Serial, func() {
It(testName, Label("SOLO"), func(ctx SpecContext) {
s.Log(testName + ": BEGIN")
test(&s)
- }, SpecTimeout(SuiteTimeout))
+ }, SpecTimeout(TestTimeout))
}
}
})
diff --git a/extras/hs-test/infra/suite_vpp_proxy.go b/extras/hs-test/infra/suite_vpp_proxy.go
index 25bc6a6c8da..16c6115bc23 100644
--- a/extras/hs-test/infra/suite_vpp_proxy.go
+++ b/extras/hs-test/infra/suite_vpp_proxy.go
@@ -184,7 +184,7 @@ var _ = Describe("VppProxySuite", Ordered, ContinueOnFailure, func() {
It(testName, func(ctx SpecContext) {
s.Log(testName + ": BEGIN")
test(&s)
- }, SpecTimeout(SuiteTimeout))
+ }, SpecTimeout(TestTimeout))
}
}
})
@@ -213,7 +213,7 @@ var _ = Describe("VppProxySuiteSolo", Ordered, ContinueOnFailure, func() {
It(testName, Label("SOLO"), func(ctx SpecContext) {
s.Log(testName + ": BEGIN")
test(&s)
- }, SpecTimeout(SuiteTimeout))
+ }, SpecTimeout(TestTimeout))
}
}
})