hs-test: add more asserts
Type: test
Change-Id: Ia285ff39d9b19464ea086ec847ceaf52c6c0195c
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
diff --git a/extras/hs-test/suite_nginx_test.go b/extras/hs-test/suite_nginx_test.go
index c250ed7..4fc0626 100644
--- a/extras/hs-test/suite_nginx_test.go
+++ b/extras/hs-test/suite_nginx_test.go
@@ -33,13 +33,13 @@
// ... for proxy
vppProxyContainer := s.getContainerByName(vppProxyContainerName)
proxyVpp, _ := vppProxyContainer.newVppInstance(cpus, sessionConfig)
- proxyVpp.start()
+ s.assertNil(proxyVpp.start())
clientInterface := s.netInterfaces[mirroringClientInterfaceName]
- proxyVpp.createTap(clientInterface, 1)
+ s.assertNil(proxyVpp.createTap(clientInterface, 1))
serverInterface := s.netInterfaces[mirroringServerInterfaceName]
- proxyVpp.createTap(serverInterface, 2)
+ s.assertNil(proxyVpp.createTap(serverInterface, 2))
nginxContainer := s.getTransientContainerByName(nginxProxyContainerName)
nginxContainer.create()
@@ -56,7 +56,7 @@
"./resources/nginx/nginx_proxy_mirroring.conf",
values,
)
- nginxContainer.start()
+ s.assertNil(nginxContainer.start())
proxyVpp.waitForApp("nginx-", 5)
}
diff --git a/extras/hs-test/suite_no_topo_test.go b/extras/hs-test/suite_no_topo_test.go
index 8f7c876..c6b3170 100644
--- a/extras/hs-test/suite_no_topo_test.go
+++ b/extras/hs-test/suite_no_topo_test.go
@@ -30,9 +30,9 @@
cpus := s.AllocateCpus()
container := s.getContainerByName(singleTopoContainerVpp)
vpp, _ := container.newVppInstance(cpus, sessionConfig)
- vpp.start()
+ s.assertNil(vpp.start())
tapInterface := s.netInterfaces[tapInterfaceName]
- vpp.createTap(tapInterface)
+ s.assertNil(vpp.createTap(tapInterface), "failed to create tap interface")
}
diff --git a/extras/hs-test/suite_ns_test.go b/extras/hs-test/suite_ns_test.go
index 3bf3cc7..2c1ac34 100644
--- a/extras/hs-test/suite_ns_test.go
+++ b/extras/hs-test/suite_ns_test.go
@@ -31,7 +31,7 @@
cpus := s.AllocateCpus()
container := s.getContainerByName("vpp")
vpp, _ := container.newVppInstance(cpus, sessionConfig)
- vpp.start()
+ s.assertNil(vpp.start())
idx, err := vpp.createAfPacket(s.netInterfaces[serverInterface])
s.assertNil(err)
diff --git a/extras/hs-test/suite_veth_test.go b/extras/hs-test/suite_veth_test.go
index d099127..de4812d 100644
--- a/extras/hs-test/suite_veth_test.go
+++ b/extras/hs-test/suite_veth_test.go
@@ -53,9 +53,7 @@
func (s *VethsSuite) setupServerVpp() {
serverVpp := s.getContainerByName("server-vpp").vppInstance
-
- err := serverVpp.start()
- s.assertNil(err)
+ s.assertNil(serverVpp.start())
serverVeth := s.netInterfaces[serverInterfaceName]
idx, err := serverVpp.createAfPacket(serverVeth)
@@ -65,9 +63,7 @@
func (s *VethsSuite) setupClientVpp() {
clientVpp := s.getContainerByName("client-vpp").vppInstance
-
- err := clientVpp.start()
- s.assertNil(err)
+ s.assertNil(clientVpp.start())
clientVeth := s.netInterfaces[clientInterfaceName]
idx, err := clientVpp.createAfPacket(clientVeth)
diff --git a/extras/hs-test/vppinstance.go b/extras/hs-test/vppinstance.go
index e909b85..1a058c8 100644
--- a/extras/hs-test/vppinstance.go
+++ b/extras/hs-test/vppinstance.go
@@ -159,6 +159,7 @@
core.DefaultReconnectInterval)
if err != nil {
fmt.Println("async connect error: ", err)
+ return err
}
vpp.connection = conn
@@ -172,12 +173,15 @@
ch, err := conn.NewAPIChannel()
if err != nil {
fmt.Println("creating channel failed: ", err)
+ return err
}
if err := ch.CheckCompatiblity(vpe.AllMessages()...); err != nil {
fmt.Println("compatibility error: ", err)
+ return err
}
if err := ch.CheckCompatiblity(interfaces.AllMessages()...); err != nil {
fmt.Println("compatibility error: ", err)
+ return err
}
vpp.apiChannel = ch