Skip to content

Commit

Permalink
e2e test: ensure test runs, and returns a success
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Duarte Barroso <[email protected]>
  • Loading branch information
maiqueb committed Feb 22, 2022
1 parent 8c29be7 commit 26f6137
Showing 1 changed file with 23 additions and 27 deletions.
50 changes: 23 additions & 27 deletions e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"encoding/json"
"net"
"os"
"testing"

"time"
Expand All @@ -22,17 +23,11 @@ import (

// Global Constants
const (
testNetworkName = "wa-nad"
wbNamespace = "kube-system"
testNamespace = "default"
timeout = 5000
testImage = "quay.io/dougbtv/alpine:latest"
ipv4TestRange = "10.10.0.0/16"
ipv4RangePoolName = "10.10.0.0-16"
singlePodName = "whereabouts-basic-test"
rsName = "whereabouts-scale-test"
wbLabelEqual = "tier=whereabouts-scale-test"
wbLabelColon = "tier: whereabouts-scale-test"
testNetworkName = "wa-nad"
testNamespace = "default"
testImage = "quay.io/dougbtv/alpine:latest"
ipv4TestRange = "10.10.0.0/16"
singlePodName = "whereabouts-basic-test"
)

// ClientInfo contains information given from k8s client
Expand All @@ -50,25 +45,26 @@ var _ = Describe("Whereabouts functionality", func() {
Context("Test setup", func() {
// Declare variables
var (
err error
numComputeNodes int
kubeconfig *string
fillPercentCapacity int
numThrashIter int
label map[string]string
annotations map[string]string
clientInfo ClientInfo
clientSet *kubernetes.Clientset
netClient *netclient.K8sCniCncfIoV1Client
netAttachDef *nettypes.NetworkAttachmentDefinition
config *rest.Config
netStatus []nettypes.NetworkStatus
pod *core.Pod
err error
kubeconfig string
label map[string]string
annotations map[string]string
clientInfo ClientInfo
clientSet *kubernetes.Clientset
netClient netclient.K8sCniCncfIoV1Interface
netAttachDef *nettypes.NetworkAttachmentDefinition
config *rest.Config
netStatus []nettypes.NetworkStatus
pod *core.Pod
)

BeforeEach(func() {

config, err = clientcmd.BuildConfigFromFlags("", *kubeconfig)
var found bool
kubeconfig, found = os.LookupEnv("KUBECONFIG")
if !found {
panic("must provide the path to the kubeconfig via the `KUBECONFIG` env variable")
}
config, err = clientcmd.BuildConfigFromFlags("", kubeconfig)
Expect(err).To(BeNil())

// Create k8sclient and ClientInfo object
Expand Down

0 comments on commit 26f6137

Please sign in to comment.