Files
vpp/extras/hs-test/framework_test.go
Adrian Villin 2acdf1e629 hs-test: added dry run mode
- DRYRUN=true will set up most containers. Some need to be started
  manually (curl, nginx...). The framework will create a vpp-config
  file with interface configs that will get executed on VPP startup.
- set Ginkgo to use -v instead of -vv when running a single test
- s.Log() now supports formatting
- added 'useEnvVars' parameter to container.Exec

Type: test

Change-Id: Id1da7947a1448ee4b74b86cc4f243442256a5ba8
Signed-off-by: Adrian Villin <avillin@cisco.com>
2024-10-10 15:50:15 +00:00

41 lines
918 B
Go

package main
import (
"fmt"
"os"
"strings"
"testing"
"time"
. "fd.io/hs-test/infra"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)
func TestHst(t *testing.T) {
if *IsVppDebug {
// 30 minute timeout so that the framework won't timeout while debugging
SuiteTimeout = time.Minute * 30
} else {
SuiteTimeout = time.Minute * 5
}
output, err := os.ReadFile("/sys/devices/system/node/online")
if err == nil && strings.Contains(string(output), "-") {
NumaAwareCpuAlloc = true
}
// creates a file with PPID, used for 'make cleanup-hst'
ppid := fmt.Sprint(os.Getppid())
ppid = ppid[:len(ppid)-1]
f, _ := os.Create(".last_hst_ppid")
f.Write([]byte(ppid))
f.Close()
RegisterFailHandler(Fail)
RunSpecs(t, "HST")
if *DryRun || *IsPersistent {
fmt.Println("\033[36m" + "Use 'make cleanup-hst' to remove IP files, " +
"namespaces and containers. \nPPID: " + ppid + "\033[0m")
}
}