From 96d14de0fa51d6c7fd5a34c69f27caf76a26f7aa Mon Sep 17 00:00:00 2001 From: Zeling Feng Date: Tue, 8 Dec 2020 23:34:52 -0800 Subject: export MountTempDirectory PiperOrigin-RevId: 346487763 --- test/packetimpact/runner/dut.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/packetimpact/runner/dut.go b/test/packetimpact/runner/dut.go index 8be2c6526..3e26c73cb 100644 --- a/test/packetimpact/runner/dut.go +++ b/test/packetimpact/runner/dut.go @@ -162,7 +162,7 @@ func setUpDUT(ctx context.Context, t *testing.T, id int, mkDevice func(*dockerut Image: "packetimpact", CapAdd: []string{"NET_ADMIN"}, } - if _, err := mountTempDirectory(t, &runOpts, "dut-output", testOutputDir); err != nil { + if _, err := MountTempDirectory(t, &runOpts, "dut-output", testOutputDir); err != nil { return dutInfo{}, err } @@ -228,7 +228,7 @@ func TestWithDUT(ctx context.Context, t *testing.T, mkDevice func(*dockerutil.Co Image: "packetimpact", CapAdd: []string{"NET_ADMIN"}, } - if _, err := mountTempDirectory(t, &runOpts, "testbench-output", testOutputDir); err != nil { + if _, err := MountTempDirectory(t, &runOpts, "testbench-output", testOutputDir); err != nil { t.Fatal(err) } tbb := path.Base(testbenchBinary) @@ -565,11 +565,11 @@ func StartContainer(ctx context.Context, runOpts dockerutil.RunOpts, c *dockerut return nil } -// mountTempDirectory creates a temporary directory on host with the template +// MountTempDirectory creates a temporary directory on host with the template // and then mounts it into the container under the name provided. The temporary // directory name is returned. Content in that directory will be copied to // TEST_UNDECLARED_OUTPUTS_DIR in cleanup phase. -func mountTempDirectory(t *testing.T, runOpts *dockerutil.RunOpts, hostDirTemplate, containerDir string) (string, error) { +func MountTempDirectory(t *testing.T, runOpts *dockerutil.RunOpts, hostDirTemplate, containerDir string) (string, error) { t.Helper() tmpDir, err := ioutil.TempDir("", hostDirTemplate) if err != nil { -- cgit v1.2.3