aboutsummaryrefslogtreecommitdiffstats
path: root/extras/hs-test/http_test.go
diff options
context:
space:
mode:
authorAdrian Villin <avillin@cisco.com>2024-09-25 14:49:11 +0200
committerFlorin Coras <florin.coras@gmail.com>2024-10-10 15:50:15 +0000
commit2acdf1e629a0e5463ed6820b9de4ae5ab7101cf6 (patch)
treec4a31f7720046076b01529308cf8afc50b124ed5 /extras/hs-test/http_test.go
parent77ca487742310e4cdab5cad134de408b755e388b (diff)
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>
Diffstat (limited to 'extras/hs-test/http_test.go')
-rw-r--r--extras/hs-test/http_test.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/extras/hs-test/http_test.go b/extras/hs-test/http_test.go
index 0e3118f6e80..9e52e961d28 100644
--- a/extras/hs-test/http_test.go
+++ b/extras/hs-test/http_test.go
@@ -314,8 +314,8 @@ func httpClientPostFile(s *NoTopoSuite, usePtr bool, fileSize int) {
serverAddress := s.HostAddr()
vpp := s.GetContainerByName("vpp").VppInstance
fileName := "/tmp/test_file.txt"
- s.Log(vpp.Container.Exec("fallocate -l " + strconv.Itoa(fileSize) + " " + fileName))
- s.Log(vpp.Container.Exec("ls -la " + fileName))
+ s.Log(vpp.Container.Exec(false, "fallocate -l "+strconv.Itoa(fileSize)+" "+fileName))
+ s.Log(vpp.Container.Exec(false, "ls -la "+fileName))
server := ghttp.NewUnstartedServer()
l, err := net.Listen("tcp", serverAddress+":80")
@@ -615,7 +615,7 @@ func HttpStaticFileHandlerTestFunction(s *NoTopoSuite, max_age string) {
content2 := "<html><body><p>Page</p></body></html>"
vpp := s.GetContainerByName("vpp").VppInstance
- vpp.Container.Exec("mkdir -p " + wwwRootPath)
+ vpp.Container.Exec(false, "mkdir -p "+wwwRootPath)
err := vpp.Container.CreateFile(wwwRootPath+"/index.html", content)
s.AssertNil(err, fmt.Sprint(err))
err = vpp.Container.CreateFile(wwwRootPath+"/page.html", content2)
@@ -671,8 +671,8 @@ func HttpStaticFileHandlerTestFunction(s *NoTopoSuite, max_age string) {
func HttpStaticPathTraversalTest(s *NoTopoSuite) {
vpp := s.GetContainerByName("vpp").VppInstance
- vpp.Container.Exec("mkdir -p " + wwwRootPath)
- vpp.Container.Exec("mkdir -p " + "/tmp/secret_folder")
+ vpp.Container.Exec(false, "mkdir -p "+wwwRootPath)
+ vpp.Container.Exec(false, "mkdir -p "+"/tmp/secret_folder")
err := vpp.Container.CreateFile("/tmp/secret_folder/secret_file.txt", "secret")
s.AssertNil(err, fmt.Sprint(err))
serverAddress := s.VppAddr()
@@ -693,7 +693,7 @@ func HttpStaticPathTraversalTest(s *NoTopoSuite) {
func HttpStaticMovedTest(s *NoTopoSuite) {
vpp := s.GetContainerByName("vpp").VppInstance
- vpp.Container.Exec("mkdir -p " + wwwRootPath + "/tmp.aaa")
+ vpp.Container.Exec(false, "mkdir -p "+wwwRootPath+"/tmp.aaa")
err := vpp.Container.CreateFile(wwwRootPath+"/tmp.aaa/index.html", "<html><body><p>Hello</p></body></html>")
s.AssertNil(err, fmt.Sprint(err))
serverAddress := s.VppAddr()
@@ -715,7 +715,7 @@ func HttpStaticMovedTest(s *NoTopoSuite) {
func HttpStaticNotFoundTest(s *NoTopoSuite) {
vpp := s.GetContainerByName("vpp").VppInstance
- vpp.Container.Exec("mkdir -p " + wwwRootPath)
+ vpp.Container.Exec(false, "mkdir -p "+wwwRootPath)
serverAddress := s.VppAddr()
s.Log(vpp.Vppctl("http static server www-root " + wwwRootPath + " uri tcp://" + serverAddress + "/80 debug"))