aboutsummaryrefslogtreecommitdiffstats
path: root/extras/hs-test/proxy_test.go
diff options
context:
space:
mode:
authorAdrian Villin <avillin@cisco.com>2024-06-06 04:26:30 -0400
committerDave Wallace <dwallacelf@gmail.com>2024-06-12 23:38:25 +0000
commiteaa7d91ad77f9c6691b42b0e9f631166b4bcf44f (patch)
tree702ea477d752d49a4dc5690d538e6fc666b435e8 /extras/hs-test/proxy_test.go
parent6c37845a87588da8082b931bfce8c680ba1a9ad6 (diff)
hs-test: improved suite teardown and replaced PIDs with PPIDs
- Fixed an issue where containers wouldn't stop and get removed when a test run is interrupted - Replaced PIDs with Ginkgo process indexes + PPIDs - Fixed CPU allocation for envoy and nginx-ldp containers - All container logs should now get saved properly Type: test Change-Id: I4c737c1d326390494c0dda1ec6d3fc1f04f51663 Signed-off-by: Adrian Villin <avillin@cisco.com>
Diffstat (limited to 'extras/hs-test/proxy_test.go')
-rw-r--r--extras/hs-test/proxy_test.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/extras/hs-test/proxy_test.go b/extras/hs-test/proxy_test.go
index ac5f94c8535..c57b927846e 100644
--- a/extras/hs-test/proxy_test.go
+++ b/extras/hs-test/proxy_test.go
@@ -13,9 +13,9 @@ func init() {
}
func testProxyHttpTcp(s *NsSuite, proto string) error {
- var outputFile string = "test" + s.pid + ".data"
- var srcFilePid string = "httpTestFile" + s.pid
- const srcFileNoPid = "httpTestFile"
+ var outputFile string = s.processIndex + "test" + s.ppid + ".data"
+ var srcFilePpid string = s.processIndex + "httpTestFile" + s.ppid
+ const srcFileNoPpid = "httpTestFile"
const fileSize string = "10M"
stopServer := make(chan struct{}, 1)
serverRunning := make(chan struct{}, 1)
@@ -23,9 +23,9 @@ func testProxyHttpTcp(s *NsSuite, proto string) error {
clientNetns := s.getNetNamespaceByName("cln")
// create test file
- err := exechelper.Run(fmt.Sprintf("ip netns exec %s truncate -s %s %s", serverNetns, fileSize, srcFilePid))
+ err := exechelper.Run(fmt.Sprintf("ip netns exec %s truncate -s %s %s", serverNetns, fileSize, srcFilePpid))
s.assertNil(err, "failed to run truncate command: "+fmt.Sprint(err))
- defer func() { os.Remove(srcFilePid) }()
+ defer func() { os.Remove(srcFilePpid) }()
s.log("test file created...")
@@ -48,7 +48,7 @@ func testProxyHttpTcp(s *NsSuite, proto string) error {
if proto == "tls" {
c += " --secure-protocol=TLSv1_3 --no-check-certificate https://"
}
- c += fmt.Sprintf("%s:555/%s", clientVeth.ip4AddressString(), srcFileNoPid)
+ c += fmt.Sprintf("%s:555/%s", clientVeth.ip4AddressString(), srcFileNoPpid)
s.log(c)
_, err = exechelper.CombinedOutput(c)
@@ -57,7 +57,7 @@ func testProxyHttpTcp(s *NsSuite, proto string) error {
s.assertNil(err, "failed to run wget: '%s', cmd: %s", err, c)
stopServer <- struct{}{}
- s.assertNil(assertFileSize(outputFile, srcFilePid))
+ s.assertNil(assertFileSize(outputFile, srcFilePpid))
return nil
}