Skip to content

Commit

Permalink
Merge pull request #32 from RamLavi/modify_tests_for_tier1
Browse files Browse the repository at this point in the history
tier1 tests, Modify tests for tier1
  • Loading branch information
kubevirt-bot authored Nov 5, 2020
2 parents 7e7c46b + 0197a5a commit a1fd875
Show file tree
Hide file tree
Showing 14 changed files with 724 additions and 2 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ require (
github.com/mattn/go-colorable v0.1.7 // indirect
github.com/onsi/ginkgo v1.14.1
github.com/onsi/gomega v1.10.2
github.com/pkg/errors v0.9.1
github.com/tomnomnom/linkheader v0.0.0-20180905144013-02ca5825eb80 // indirect
github.com/vishvananda/netlink v1.1.0
github.com/vishvananda/netns v0.0.0-20200520041808-52d707b772fe
Expand Down
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
Expand Down
3 changes: 2 additions & 1 deletion hack/functest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ set -ex

source ./cluster/kubevirtci.sh

go test ./tests/e2e --kubeconfig $(kubevirtci::kubeconfig) -ginkgo.v
KUBECONFIG=${KUBECONFIG:-$(kubevirtci::kubeconfig)}
go test ./tests/e2e --kubeconfig ${KUBECONFIG} -ginkgo.v
24 changes: 23 additions & 1 deletion tests/e2e/macvtap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import (

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

"github.com/pkg/errors"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -64,7 +66,12 @@ var nad = `
var _ = Describe("macvtap-cni", func() {

lowerDevice := "eth0"
namespace := "default"
namespace := ""
BeforeEach(func() {
var err error
namespace, err = findMacvtapNamespace()
Expect(err).ToNot(HaveOccurred(), "Should succeed finding macvtap namespace")
})

Describe("macvtap-cni infrastructure", func() {
Context("WHEN make cluster-sync is executed", func() {
Expand Down Expand Up @@ -231,6 +238,21 @@ func filterPods(pods []v1.Pod, filterFunction func(v1.Pod) bool) []v1.Pod {
return filteredPods
}

func findMacvtapNamespace() (string, error) {
macvtapDaemonSetName := "macvtap-cni"
daemonSetList, err := clientset.ExtensionsV1beta1().DaemonSets(v1.NamespaceAll).List(context.TODO(), metav1.ListOptions{
FieldSelector: fmt.Sprintf("metadata.name=%s", macvtapDaemonSetName),
})
if err != nil {
return "", errors.Wrap(err, "Failed to get daemonSet list in all namespaces")
}
if len(daemonSetList.Items) == 0 {
return "", errors.New("Failed to find macvtap daemonSet")
}

return daemonSetList.Items[0].GetNamespace(), nil
}

func buildMacvtapResourceName(macvtapIfaceName string) string {
return fmt.Sprintf("%s/%s", macvtapResource, macvtapIfaceName)
}
Expand Down
24 changes: 24 additions & 0 deletions vendor/github.com/pkg/errors/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions vendor/github.com/pkg/errors/.travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions vendor/github.com/pkg/errors/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 44 additions & 0 deletions vendor/github.com/pkg/errors/Makefile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

59 changes: 59 additions & 0 deletions vendor/github.com/pkg/errors/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions vendor/github.com/pkg/errors/appveyor.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a1fd875

Please sign in to comment.