ffa3f60290
Instead of configuring VPP instances running inside of a container, now the configuration is going to be done from within the test context by using binary API and shared volume that exposes api socket. This converts just some of the test cases, rest is to follow. Type: test Signed-off-by: Maros Ondrejicka <maros.ondrejicka@pantheon.tech> Change-Id: I87e4ab15de488f0eebb01ff514596265fc2a787f
47 lines
771 B
Go
47 lines
771 B
Go
package main
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/suite"
|
|
)
|
|
|
|
func setupSuite(s *suite.Suite, topologyName string) func() {
|
|
t := s.T()
|
|
topology, err := LoadTopology(NetworkTopologyDir, topologyName)
|
|
if err != nil {
|
|
t.Fatalf("error on loading topology '%s': %v", topologyName, err)
|
|
}
|
|
err = topology.Configure()
|
|
if err != nil {
|
|
t.Fatalf("failed to configure %s: %v", topologyName, err)
|
|
}
|
|
|
|
return func() {
|
|
if IsPersistent() {
|
|
return
|
|
}
|
|
topology.Unconfigure()
|
|
}
|
|
}
|
|
|
|
func TestTapSuite(t *testing.T) {
|
|
var m TapSuite
|
|
suite.Run(t, &m)
|
|
}
|
|
|
|
func TestNs(t *testing.T) {
|
|
var m NsSuite
|
|
suite.Run(t, &m)
|
|
}
|
|
|
|
func TestVeths(t *testing.T) {
|
|
var m VethsSuite
|
|
suite.Run(t, &m)
|
|
}
|
|
|
|
func TestNoTopo(t *testing.T) {
|
|
var m NoTopoSuite
|
|
suite.Run(t, &m)
|
|
}
|