summaryrefslogtreecommitdiffstats
path: root/extras/hs-test/infra/container.go
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2024-07-19 16:04:09 +0200
committerFlorin Coras <florin.coras@gmail.com>2024-07-22 17:44:42 +0000
commite99d266612b53163d460f3ceab96934b1d961ac8 (patch)
treeb0bf01f2802f2a7c282ff268b48bd412edfd3c98 /extras/hs-test/infra/container.go
parent7f163b682a57f42bd9b39a7f2d7e4c1c67df8386 (diff)
hs-test: memory leak testing
add infra for memory leak testing Type: test Change-Id: I882e8dbb360597cdb82ad52682725f7d39b2df24 Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'extras/hs-test/infra/container.go')
-rw-r--r--extras/hs-test/infra/container.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/extras/hs-test/infra/container.go b/extras/hs-test/infra/container.go
index 5093398ae56..44f141a9102 100644
--- a/extras/hs-test/infra/container.go
+++ b/extras/hs-test/infra/container.go
@@ -4,6 +4,7 @@ import (
"bytes"
"context"
"fmt"
+ "github.com/docker/go-units"
"os"
"os/exec"
"slices"
@@ -15,7 +16,6 @@ import (
containerTypes "github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/image"
"github.com/docker/docker/pkg/stdcopy"
- "github.com/docker/go-units"
"github.com/edwarnicke/exechelper"
. "github.com/onsi/ginkgo/v2"
)
@@ -382,6 +382,11 @@ func (c *Container) CreateFile(destFileName string, content string) error {
return nil
}
+func (c *Container) GetFile(sourceFileName, targetFileName string) error {
+ cmd := exec.Command("docker", "cp", c.Name+":"+sourceFileName, targetFileName)
+ return cmd.Run()
+}
+
/*
* Executes in detached mode so that the started application can continue to run
* without blocking execution of test