aboutsummaryrefslogtreecommitdiffstats
path: root/extras/hs-test/infra/utils.go
diff options
context:
space:
mode:
Diffstat (limited to 'extras/hs-test/infra/utils.go')
-rw-r--r--extras/hs-test/infra/utils.go32
1 files changed, 32 insertions, 0 deletions
diff --git a/extras/hs-test/infra/utils.go b/extras/hs-test/infra/utils.go
index bd603f863fc..2f4328b4a74 100644
--- a/extras/hs-test/infra/utils.go
+++ b/extras/hs-test/infra/utils.go
@@ -18,6 +18,8 @@ import (
const networkTopologyDir string = "topo-network/"
const containerTopologyDir string = "topo-containers/"
const HttpCapsuleTypeDatagram = uint64(0)
+const iperfLogFileName = "iperf.log"
+const redisLogFileName = "redis-server.log"
type Stanza struct {
content string
@@ -223,6 +225,36 @@ func (s *HstSuite) CollectEnvoyLogs(envoyContainer *Container) {
}
}
+func (s *HstSuite) IperfLogFileName(serverContainer *Container) string {
+ return serverContainer.GetContainerWorkDir() + "/" + serverContainer.Name + "-" + iperfLogFileName
+}
+
+func (s *HstSuite) CollectIperfLogs(serverContainer *Container) {
+ targetDir := serverContainer.Suite.getLogDirPath()
+ source := serverContainer.GetHostWorkDir() + "/" + serverContainer.Name + "-" + iperfLogFileName
+ cmd := exec.Command("cp", "-t", targetDir, source)
+ s.Log(cmd.String())
+ err := cmd.Run()
+ if err != nil {
+ s.Log(fmt.Sprint(err))
+ }
+}
+
+func (s *HstSuite) RedisServerLogFileName(serverContainer *Container) string {
+ return serverContainer.GetContainerWorkDir() + "/" + serverContainer.Name + "-" + redisLogFileName
+}
+
+func (s *HstSuite) CollectRedisServerLogs(serverContainer *Container) {
+ targetDir := serverContainer.Suite.getLogDirPath()
+ source := serverContainer.GetHostWorkDir() + "/" + serverContainer.Name + "-" + redisLogFileName
+ cmd := exec.Command("cp", "-t", targetDir, source)
+ s.Log(cmd.String())
+ err := cmd.Run()
+ if err != nil {
+ s.Log(fmt.Sprint(err))
+ }
+}
+
func (s *HstSuite) StartIperfServerApp(running chan error, done chan struct{}, env []string) {
cmd := exec.Command("iperf3", "-4", "-s", "-p", s.GetPortFromPpid())
if env != nil {