summaryrefslogtreecommitdiffstats
path: root/extras/hs-test/utils.go
diff options
context:
space:
mode:
authorMaros Ondrejicka <mondreji@cisco.com>2023-02-07 20:40:27 +0100
committerFlorin Coras <florin.coras@gmail.com>2023-02-10 05:23:32 +0000
commit7550dd268f80334cbb9127feefe35319b9c7e572 (patch)
tree08350b3d4dcf5453941312565c63303d95735903 /extras/hs-test/utils.go
parent2908f8cf07c21f385f80d83fdad826a0eea98977 (diff)
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 <mondreji@cisco.com>
Diffstat (limited to 'extras/hs-test/utils.go')
-rw-r--r--extras/hs-test/utils.go63
1 files changed, 0 insertions, 63 deletions
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 {