From 9abba11a9434e152f35a863de3e7631fe3a00070 Mon Sep 17 00:00:00 2001 From: Filip Tehlar Date: Tue, 7 Mar 2023 10:13:19 +0100 Subject: [PATCH] hs-test: fix envoy test Type: test Signed-off-by: Filip Tehlar Change-Id: I776e0f1f7ea700439d1fe6a598772776ae6a1493 --- extras/hs-test/container.go | 13 ++++++++----- extras/hs-test/proxy_test.go | 3 +-- extras/hs-test/vppinstance.go | 6 +++--- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/extras/hs-test/container.go b/extras/hs-test/container.go index 40dc0828376..4b3002f15be 100644 --- a/extras/hs-test/container.go +++ b/extras/hs-test/container.go @@ -127,17 +127,20 @@ func (c *Container) getContainerArguments() string { args += c.getVolumesAsCliOption() args += c.getEnvVarsAsCliOption() args += " --name " + c.name + " " + c.image + args += " " + c.extraRunningArgs return args } -func (c *Container) create() { +func (c *Container) create() error { cmd := "docker create " + c.getContainerArguments() - exechelper.Run(cmd) + c.Suite().log(cmd) + return exechelper.Run(cmd) } -func (c *Container) start() { +func (c *Container) start() error { cmd := "docker start " + c.name - exechelper.Run(cmd) + c.Suite().log(cmd) + return exechelper.Run(cmd) } func (c *Container) run() error { @@ -145,7 +148,7 @@ func (c *Container) run() error { return fmt.Errorf("run container failed: name is blank") } - cmd := "docker run -d " + c.getContainerArguments() + " " + c.extraRunningArgs + cmd := "docker run -d " + c.getContainerArguments() c.Suite().log(cmd) err := exechelper.Run(cmd) if err != nil { diff --git a/extras/hs-test/proxy_test.go b/extras/hs-test/proxy_test.go index ce0e7ad854d..784e52768aa 100644 --- a/extras/hs-test/proxy_test.go +++ b/extras/hs-test/proxy_test.go @@ -83,8 +83,7 @@ func configureEnvoyProxy(s *NsSuite) { "resources/envoy/proxy.yaml", address, ) - - envoyContainer.start() + s.assertNil(envoyContainer.start()) } func (s *NsSuite) TestEnvoyProxyHttpTcp() { diff --git a/extras/hs-test/vppinstance.go b/extras/hs-test/vppinstance.go index 1c28ec920b7..c6771f697f8 100644 --- a/extras/hs-test/vppinstance.go +++ b/extras/hs-test/vppinstance.go @@ -2,7 +2,6 @@ package main import ( "fmt" - "github.com/edwarnicke/exechelper" "os" "os/exec" "os/signal" @@ -10,6 +9,8 @@ import ( "syscall" "time" + "github.com/edwarnicke/exechelper" + "go.fd.io/govpp" "go.fd.io/govpp/api" "go.fd.io/govpp/binapi/af_packet" @@ -121,8 +122,7 @@ func (vpp *VppInstance) start() error { signal.Notify(sig, syscall.SIGINT) cont := make(chan bool, 1) go func() { - sig := <-sig - fmt.Println(sig) + <-sig cont <- true }() -- 2.16.6