forked from kubeovn/kube-ovn
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.e2e
122 lines (106 loc) · 4.57 KB
/
Makefile.e2e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
E2E_BRANCH := $(shell echo $${E2E_BRANCH:-master})
E2E_IP_FAMILY := $(shell echo $${E2E_IP_FAMILY:-ipv4})
E2E_NETWORK_MODE := $(shell echo $${E2E_NETWORK_MODE:-overlay})
K8S_CONFORMANCE_E2E_FOCUS = "sig-network.*Conformance" "sig-network.*Feature:NoSNAT"
K8S_CONFORMANCE_E2E_SKIP =
K8S_NETPOL_E2E_FOCUS = "sig-network.*Feature:NetworkPolicy"
K8S_NETPOL_E2E_SKIP = "sig-network.*NetworkPolicyLegacy"
K8S_NETPOL_LEGACY_E2E_FOCUS = "sig-network.*NetworkPolicyLegacy"
ifeq ($(shell echo $(E2E_BRANCH) | grep -o ^release-),release-)
VERSION_NUM = $(subst release-,,$(E2E_BRANCH))
VER_MAJOR = $(shell echo $(VERSION_NUM) | cut -f1 -d.)
VER_MINOR = $(shell echo $(VERSION_NUM) | cut -f2 -d.)
ifeq ($(shell test $(VER_MAJOR) -lt 1 -o \( $(VER_MAJOR) -eq 1 -a $(VER_MINOR) -lt 12 \) && echo true),true)
K8S_CONFORMANCE_E2E_SKIP += "sig-network.*Services.*session affinity"
else
K8S_CONFORMANCE_E2E_FOCUS += "sig-network.*Networking.*Feature:SCTPConnectivity"
endif
else
K8S_CONFORMANCE_E2E_FOCUS += "sig-network.*Networking.*Feature:SCTPConnectivity"
endif
ifneq ($(E2E_IP_FAMILY),ipv6)
K8S_CONFORMANCE_E2E_FOCUS += "sig-network.*Feature:Networking-IPv4"
ifeq ($(E2E_NETWORK_MODE),overlay)
K8S_CONFORMANCE_E2E_FOCUS += "sig-network.*Feature:Networking-DNS"
endif
endif
ifeq ($(E2E_IP_FAMILY),dual)
K8S_CONFORMANCE_E2E_FOCUS += "sig-network.*Feature:IPv6DualStack"
endif
define ginkgo_option
--ginkgo.$(1)=$(shell echo '$(2)' | sed -E 's/^[[:space:]]+//' | sed -E 's/"[[:space:]]+"/" --ginkgo.$(1)="/g')
endef
.PHONY: e2e
e2e: kube-ovn-conformance-e2e
.PHONY: e2e-compile
e2e-compile:
go test ./test/e2e/k8s-network -c -o test/e2e/k8s-network/e2e.test
go test ./test/e2e/kube-ovn -c -o test/e2e/kube-ovn/e2e.test
go test ./test/e2e/ovn-ic -c -o test/e2e/ovn-ic/e2e.test
go test ./test/e2e/lb-svc -c -o test/e2e/lb-svc/e2e.test
go test ./test/e2e/security -c -o test/e2e/security/e2e.test
.PHONY: k8s-conformance-e2e
k8s-conformance-e2e:
go test ./test/e2e/k8s-network -c -o test/e2e/k8s-network/e2e.test
./test/e2e/k8s-network/e2e.test --ginkgo.timeout=1h \
$(call ginkgo_option,focus,$(K8S_CONFORMANCE_E2E_FOCUS)) \
$(call ginkgo_option,skip,$(K8S_CONFORMANCE_E2E_SKIP))
.PHONY: k8s-netpol-legacy-e2e
k8s-netpol-legacy-e2e:
go test ./test/e2e/k8s-network -c -o test/e2e/k8s-network/e2e.test
./test/e2e/k8s-network/e2e.test --ginkgo.timeout=2h \
$(call ginkgo_option,focus,$(K8S_NETPOL_LEGACY_E2E_FOCUS))
.PHONY: k8s-netpol-e2e
k8s-netpol-e2e:
go test ./test/e2e/k8s-network -c -o test/e2e/k8s-network/e2e.test
./test/e2e/k8s-network/e2e.test --ginkgo.timeout=2h \
$(call ginkgo_option,focus,$(K8S_NETPOL_E2E_FOCUS)) \
$(call ginkgo_option,skip,$(K8S_NETPOL_E2E_SKIP))
.PHONY: cyclonus-netpol-e2e
cyclonus-netpol-e2e:
kubectl create ns netpol
kubectl create clusterrolebinding cyclonus --clusterrole=cluster-admin --serviceaccount=netpol:cyclonus
kubectl create sa cyclonus -n netpol
kubectl create -f test/e2e/cyclonus.yaml -n netpol
while ! kubectl wait pod --for=condition=Ready -l job-name=cyclonus -n netpol; do \
sleep 3; \
done
kubectl logs -f -l job-name=cyclonus -n netpol
kubectl -n netpol logs \
$$(kubectl -n netpol get pod -l job-name=cyclonus -o=jsonpath={.items[0].metadata.name}) | \
grep failed; test $$? -ne 0
.PHONY: kube-ovn-conformance-e2e
kube-ovn-conformance-e2e:
go test ./test/e2e/kube-ovn -c -o test/e2e/kube-ovn/e2e.test
E2E_BRANCH=$(E2E_BRANCH) \
E2E_IP_FAMILY=$(E2E_IP_FAMILY) \
E2E_NETWORK_MODE=$(E2E_NETWORK_MODE) \
./test/e2e/kube-ovn/e2e.test --ginkgo.focus=CNI:Kube-OVN
.PHONY: kube-ovn-ic-conformance-e2e
kube-ovn-ic-conformance-e2e:
go test ./test/e2e/ovn-ic -c -o test/e2e/ovn-ic/e2e.test
E2E_BRANCH=$(E2E_BRANCH) \
E2E_IP_FAMILY=$(E2E_IP_FAMILY) \
E2E_NETWORK_MODE=$(E2E_NETWORK_MODE) \
./test/e2e/ovn-ic/e2e.test --ginkgo.focus=CNI:Kube-OVN
.PHONY: kube-ovn-lb-svc-conformance-e2e
kube-ovn-lb-svc-conformance-e2e:
go test ./test/e2e/lb-svc -c -o test/e2e/lb-svc/e2e.test
E2E_BRANCH=$(E2E_BRANCH) \
E2E_IP_FAMILY=$(E2E_IP_FAMILY) \
E2E_NETWORK_MODE=$(E2E_NETWORK_MODE) \
./test/e2e/lb-svc/e2e.test --ginkgo.focus=CNI:Kube-OVN
.PHONY: kube-ovn-eip-conformance-e2e
kube-ovn-eip-conformance-e2e:
go test ./test/e2e/ovn-eip -c -o test/e2e/ovn-eip/e2e.test
E2E_BRANCH=$(E2E_BRANCH) \
E2E_IP_FAMILY=$(E2E_IP_FAMILY) \
E2E_NETWORK_MODE=$(E2E_NETWORK_MODE) \
./test/e2e/ovn-eip/e2e.test --ginkgo.focus=CNI:Kube-OVN
.PHONY: kube-ovn-security-e2e
kube-ovn-security-e2e:
go test ./test/e2e/security -c -o test/e2e/security/e2e.test
E2E_BRANCH=$(E2E_BRANCH) \
E2E_IP_FAMILY=$(E2E_IP_FAMILY) \
E2E_NETWORK_MODE=$(E2E_NETWORK_MODE) \
./test/e2e/security/e2e.test --ginkgo.focus=CNI:Kube-OVN