package main
import (
+ "flag"
"fmt"
"io/ioutil"
"os"
defaultNetworkNumber int = 1
)
-func IsPersistent() bool {
- return os.Getenv("HST_PERSIST") == "1"
-}
-
-func IsVerbose() bool {
- return os.Getenv("HST_VERBOSE") == "1"
-}
+var IsPersistent = flag.Bool("persist", false, "persists topology config")
+var IsVerbose = flag.Bool("verbose", false, "verbose test output")
type HstSuite struct {
suite.Suite
}
func (s *HstSuite) TearDownTest() {
- if IsPersistent() {
+ if *IsPersistent {
return
}
s.ResetContainers()
}
func (s *HstSuite) log(args ...any) {
- if IsVerbose() {
+ if *IsVerbose {
s.T().Log(args...)
}
}
}
func (s *HstSuite) unconfigureNetworkTopology() {
- if IsPersistent() {
+ if *IsPersistent {
return
}
for _, nc := range s.netConfigs {