From 7550dd268f80334cbb9127feefe35319b9c7e572 Mon Sep 17 00:00:00 2001 From: Maros Ondrejicka Date: Tue, 7 Feb 2023 20:40:27 +0100 Subject: hs-test: refactor test cases from no-topo suite This converts remaining tests to configation of VPP from test context. Type: test Change-Id: I386714f6b290e03d1757c2a033a25fae0340f5d6 Signed-off-by: Maros Ondrejicka --- extras/hs-test/utils.go | 63 ------------------------------------------------- 1 file changed, 63 deletions(-) (limited to 'extras/hs-test/utils.go') diff --git a/extras/hs-test/utils.go b/extras/hs-test/utils.go index c5889035c40..f912880a78a 100644 --- a/extras/hs-test/utils.go +++ b/extras/hs-test/utils.go @@ -1,55 +1,15 @@ package main import ( - "encoding/json" "errors" "fmt" "io" - "io/ioutil" "os" "os/exec" "strings" "time" ) -// TODO remove `configTemplate` once its usage has been replaced everywhere with VppConfig -const configTemplate = `unix { - nodaemon - log %[1]s/var/log/vpp/vpp.log - full-coredump - cli-listen %[1]s/var/run/vpp/cli.sock - runtime-dir %[1]s/var/run - gid vpp -} - -api-trace { - on -} - -api-segment { - gid vpp -} - -socksvr { - socket-name %[1]s/var/run/vpp/api.sock -} - -statseg { - socket-name %[1]s/var/run/vpp/stats.sock -} - -plugins { - plugin default { disable } - - plugin unittest_plugin.so { enable } - plugin quic_plugin.so { enable } - plugin af_packet_plugin.so { enable } - plugin hs_apps_plugin.so { enable } - plugin http_plugin.so { enable } -} - -` - const vclTemplate = `vcl { app-socket-api %[1]s/var/run/app_ns_sockets/%[2]s app-scope-global @@ -126,29 +86,6 @@ func StartClientApp(ipAddress string, env []string, clnCh chan error, clnRes cha } } -func waitForSyncFile(fname string) (*JsonResult, error) { - var res JsonResult - - for i := 0; i < 360; i++ { - f, err := os.Open(fname) - if err == nil { - defer f.Close() - - data, err := ioutil.ReadFile(fname) - if err != nil { - return nil, fmt.Errorf("read error: %v", err) - } - err = json.Unmarshal(data, &res) - if err != nil { - return nil, fmt.Errorf("json unmarshal error: %v", err) - } - return &res, nil - } - time.Sleep(1 * time.Second) - } - return nil, fmt.Errorf("no sync file found") -} - func assertFileSize(f1, f2 string) error { fi1, err := os.Stat(f1) if err != nil { -- cgit 1.2.3-korg