Skip to content

Commit 5e0d723

Browse files
authored
Add dataplane performance automated test (#1356)
* Add dataplane performance automated test
1 parent bcd8c5e commit 5e0d723

27 files changed

+584
-132
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,6 @@ internal/mode/static/nginx/modules/coverage
4141
# Certs and keys
4242
*.crt
4343
*.key
44+
45+
# Dotenv files
46+
**/*.env

go.mod

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ require (
1515
github.com/onsi/gomega v1.30.0
1616
github.com/prometheus/client_golang v1.17.0
1717
github.com/spf13/cobra v1.8.0
18+
github.com/tsenart/vegeta/v12 v12.11.1
1819
go.uber.org/zap v1.26.0
1920
k8s.io/api v0.29.0
2021
k8s.io/apiextensions-apiserver v0.29.0
@@ -51,6 +52,7 @@ require (
5152
github.com/gorilla/websocket v1.5.0 // indirect
5253
github.com/imdario/mergo v0.3.16 // indirect
5354
github.com/inconshreveable/mousetrap v1.1.0 // indirect
55+
github.com/influxdata/tdigest v0.0.1 // indirect
5456
github.com/josharian/intern v1.0.0 // indirect
5557
github.com/json-iterator/go v1.1.12 // indirect
5658
github.com/mailru/easyjson v0.7.7 // indirect
@@ -67,13 +69,15 @@ require (
6769
github.com/prometheus/client_model v0.5.0 // indirect
6870
github.com/prometheus/common v0.45.0 // indirect
6971
github.com/prometheus/procfs v0.12.0 // indirect
72+
github.com/rs/dnscache v0.0.0-20211102005908-e0241e321417 // indirect
7073
github.com/spf13/pflag v1.0.5 // indirect
7174
github.com/stretchr/testify v1.8.4 // indirect
7275
go.uber.org/multierr v1.11.0 // indirect
7376
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
7477
golang.org/x/mod v0.13.0 // indirect
7578
golang.org/x/net v0.17.0 // indirect
7679
golang.org/x/oauth2 v0.13.0 // indirect
80+
golang.org/x/sync v0.4.0 // indirect
7781
golang.org/x/sys v0.14.0 // indirect
7882
golang.org/x/term v0.13.0 // indirect
7983
golang.org/x/text v0.13.0 // indirect

go.sum

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkY
33
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
44
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
55
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
6+
github.com/bmizerany/perks v0.0.0-20230307044200-03f9df79da1e h1:mWOqoK5jV13ChKf/aF3plwQ96laasTJgZi4f1aSOu+M=
7+
github.com/bmizerany/perks v0.0.0-20230307044200-03f9df79da1e/go.mod h1:ac9efd0D1fsDb3EJvhqgXRbFx7bs2wqZ10HQPeU8U/Q=
68
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
79
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
810
github.com/chzyer/logex v1.2.0/go.mod h1:9+9sk7u7pGNWYMkh0hdiL++6OeibzJccyQU4p4MedaY=
@@ -13,6 +15,8 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3
1315
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
1416
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
1517
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
18+
github.com/dgryski/go-gk v0.0.0-20200319235926-a69029f61654 h1:XOPLOMn/zT4jIgxfxSsoXPxkrzz0FaCHwp33x5POJ+Q=
19+
github.com/dgryski/go-gk v0.0.0-20200319235926-a69029f61654/go.mod h1:qm+vckxRlDt0aOla0RYJJVeqHZlWfOm2UIxHaqPB46E=
1620
github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g=
1721
github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
1822
github.com/evanphx/json-patch v5.7.0+incompatible h1:vgGkfT/9f8zE6tvSCe74nfpAVDQ2tG6yudJd8LBksgI=
@@ -50,6 +54,7 @@ github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg
5054
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
5155
github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I=
5256
github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U=
57+
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
5358
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
5459
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
5560
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
@@ -69,6 +74,8 @@ github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4=
6974
github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY=
7075
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
7176
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
77+
github.com/influxdata/tdigest v0.0.1 h1:XpFptwYmnEKUqmkcDjrzffswZ3nvNeevbUSLPP/ZzIY=
78+
github.com/influxdata/tdigest v0.0.1/go.mod h1:Z0kXnxzbTC2qrx4NaIzYkE1k66+6oEDQTvL95hQFh5Y=
7279
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
7380
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
7481
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
@@ -132,13 +139,17 @@ github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k
132139
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
133140
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
134141
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
142+
github.com/rs/dnscache v0.0.0-20211102005908-e0241e321417 h1:Lt9DzQALzHoDwMBGJ6v8ObDPR0dzr2a6sXTB1Fq7IHs=
143+
github.com/rs/dnscache v0.0.0-20211102005908-e0241e321417/go.mod h1:qe5TWALJ8/a1Lqznoc5BDHpYX/8HU60Hm2AwRmqzxqA=
135144
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
136145
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
137146
github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM=
138147
github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
139148
github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho=
140149
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
141150
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
151+
github.com/streadway/quantile v0.0.0-20220407130108-4246515d968d h1:X4+kt6zM/OVO6gbJdAfJR60MGPsqCzbtXNnjoGqdfAs=
152+
github.com/streadway/quantile v0.0.0-20220407130108-4246515d968d/go.mod h1:lbP8tGiBjZ5YWIc2fzuRpTaz0b/53vT6PEs3QuAWzuU=
142153
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
143154
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
144155
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
@@ -150,6 +161,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
150161
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
151162
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
152163
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
164+
github.com/tsenart/vegeta/v12 v12.11.1 h1:Rbwe7Zxr7sJ+BDTReemeQalYPvKiSV+O7nwmUs20B3E=
165+
github.com/tsenart/vegeta/v12 v12.11.1/go.mod h1:swiFmrgpqj2llHURgHYFRFN0tfrIrlnspg01HjwOnSQ=
153166
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
154167
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
155168
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
@@ -168,6 +181,7 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk
168181
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
169182
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
170183
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
184+
golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
171185
golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI=
172186
golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo=
173187
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
@@ -221,6 +235,7 @@ golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
221235
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
222236
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
223237
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
238+
golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
224239
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
225240
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
226241
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
@@ -236,6 +251,9 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T
236251
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
237252
gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw=
238253
gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY=
254+
gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca h1:PupagGYwj8+I4ubCxcmcBRk3VlUWtTg5huQpZR9flmE=
255+
gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo=
256+
gonum.org/v1/netlib v0.0.0-20181029234149-ec6d1f5cefe6/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw=
239257
google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM=
240258
google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds=
241259
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
@@ -272,6 +290,8 @@ k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/A
272290
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA=
273291
k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI=
274292
k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
293+
pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw=
294+
pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04=
275295
sigs.k8s.io/controller-runtime v0.16.3 h1:2TuvuokmfXvDUamSx1SuAOO3eTyye+47mJCigwG62c4=
276296
sigs.k8s.io/controller-runtime v0.16.3/go.mod h1:j7bialYoSn142nv9sCOJmQgDXQXxnroFU4VnX/brVJ0=
277297
sigs.k8s.io/controller-tools v0.13.0 h1:NfrvuZ4bxyolhDBt/rCZhDnx3M2hzlhgo5n3Iv2RykI=

tests/Makefile

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ NGINX_PREFIX = $(PREFIX)/nginx
44
PULL_POLICY=Never
55
GW_API_VERSION ?= 1.0.0
66
K8S_VERSION ?= latest ## Expected format: 1.24 (major.minor) or latest
7+
GW_SERVICE_TYPE=NodePort
8+
GW_SVC_GKE_INTERNAL=false
9+
GINKGO_LABEL=
10+
GINKGO_FLAGS=
11+
12+
ifneq ($(GINKGO_LABEL),)
13+
override GINKGO_FLAGS += -ginkgo.label-filter "$(GINKGO_LABEL)"
14+
endif
715

816
.PHONY: help
917
help: Makefile ## Display this help
@@ -22,10 +30,25 @@ load-images: ## Load NGF and NGINX images on configured kind cluster
2230
kind load docker-image $(PREFIX):$(TAG) $(NGINX_PREFIX):$(TAG)
2331

2432
test: ## Run the system tests against your default k8s cluster
25-
go test -v ./suite -args --gateway-api-version=$(GW_API_VERSION) --image-tag=$(TAG) \
33+
go test -v ./suite $(GINKGO_FLAGS) -args --gateway-api-version=$(GW_API_VERSION) --image-tag=$(TAG) \
2634
--ngf-image-repo=$(PREFIX) --nginx-image-repo=$(NGINX_PREFIX) --pull-policy=$(PULL_POLICY) \
27-
--k8s-version=$(K8S_VERSION)
35+
--k8s-version=$(K8S_VERSION) --service-type=$(GW_SERVICE_TYPE) --is-gke-internal-lb=$(GW_SVC_GKE_INTERNAL)
2836

2937
.PHONY: delete-kind-cluster
3038
delete-kind-cluster: ## Delete kind cluster
3139
kind delete cluster
40+
41+
.PHONY: run-tests-on-vm
42+
run-tests-on-vm: ## Run the tests on a GCP VM
43+
bash scripts/run-tests-gcp-vm.sh
44+
45+
.PHONY: create-and-setup-vm
46+
create-and-setup-vm: ## Create and setup a GCP VM for tests
47+
bash scripts/create-and-setup-gcp-vm.sh
48+
49+
.PHONY: create-vm-and-run-tests
50+
create-vm-and-run-tests: create-and-setup-vm run-tests-on-vm ## Create and setup a GCP VM for tests and run the tests
51+
52+
.PHONY: cleanup-vm
53+
cleanup-vm: ## Delete the test GCP VM and delete the firewall rule
54+
bash scripts/cleanup-vm.sh

tests/README.md

Lines changed: 83 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,30 @@ are similar to the existing [conformance tests](../conformance/README.md), but w
66
- NGF-specific functionality
77
- Non-Functional requirements testing (such as performance, scale, etc.)
88

9-
When running, the tests create a port-forward from your NGF Pod to localhost using a port chosen by the
10-
test framework. Traffic is sent over this port.
9+
When running locally, the tests create a port-forward from your NGF Pod to localhost using a port chosen by the
10+
test framework. Traffic is sent over this port. If running on a GCP VM targeting a GKE cluster, the tests will create an
11+
internal LoadBalancer service which will receive the test traffic.
1112

1213
Directory structure is as follows:
1314

1415
- `framework`: contains utility functions for running the tests
1516
- `suite`: contains the test files
17+
- `results`: contains the results files
1618

17-
**Note**: Existing NFR tests will be migrated into this testing `suite` and results stored in a `results` directory.
19+
**Note**: Existing NFR tests will be migrated into this testing `suite` and results stored in the `results` directory.
1820

1921
## Prerequisites
2022

2123
- Kubernetes cluster.
2224
- Docker.
2325
- Golang.
2426

27+
If running the tests on a VM (`make create-vm-and-run-tests` or `make run-tests-on-vm`):
28+
29+
- The [gcloud CLI](https://cloud.google.com/sdk/docs/install)
30+
- A GKE cluster (if `master-authorized-networks` is enabled, please set `ADD_VM_IP_AUTH_NETWORKS=true` in your vars.env file)
31+
- Access to GCP Service Account with Kubernetes admin permissions
32+
2533
**Note**: all commands in steps below are executed from the `tests` directory
2634

2735
```shell
@@ -30,23 +38,31 @@ make
3038

3139
```text
3240
build-images Build NGF and NGINX images
41+
cleanup-vm Delete the test GCP VM and the firewall rule
42+
create-and-setup-vm Create and setup a GCP VM for tests
3343
create-kind-cluster Create a kind cluster
44+
create-vm-and-run-tests Create and setup a GCP VM for tests and run the tests
3445
delete-kind-cluster Delete kind cluster
3546
help Display this help
3647
load-images Load NGF and NGINX images on configured kind cluster
48+
run-tests-on-vm Run the tests on a GCP VM
3749
test Run the system tests against your default k8s cluster
3850
```
3951

4052
**Note:** The following variables are configurable when running the below `make` commands:
4153

42-
| Variable | Default | Description |
43-
|----------|---------|-------------|
44-
| TAG | edge | tag for the locally built NGF images |
45-
| PREFIX | nginx-gateway-fabric | prefix for the locally built NGF image |
46-
| NGINX_PREFIX | nginx-gateway-fabric/nginx | prefix for the locally built NGINX image |
47-
| PULL_POLICY | Never | NGF image pull policy |
48-
| GW_API_VERSION | 1.0.0 | version of Gateway API resources to install |
49-
| K8S_VERSION | latest | version of k8s that the tests are run on |
54+
| Variable | Default | Description |
55+
| ------------------- | -------------------------- | -------------------------------------------------------------- |
56+
| TAG | edge | tag for the locally built NGF images |
57+
| PREFIX | nginx-gateway-fabric | prefix for the locally built NGF image |
58+
| NGINX_PREFIX | nginx-gateway-fabric/nginx | prefix for the locally built NGINX image |
59+
| PULL_POLICY | Never | NGF image pull policy |
60+
| GW_API_VERSION | 1.0.0 | version of Gateway API resources to install |
61+
| K8S_VERSION | latest | version of k8s that the tests are run on |
62+
| GW_SERVICE_TYPE | NodePort | type of Service that should be created |
63+
| GW_SVC_GKE_INTERNAL | false | specifies if the LoadBalancer should be a GKE internal service |
64+
| GINKGO_LABEL | "" | name of the ginkgo label that will filter the tests to run |
65+
| GINKGO_FLAGS | "" | other ginkgo flags to pass to the go test command |
5066

5167
## Step 1 - Create a Kubernetes cluster
5268

@@ -74,11 +90,52 @@ make build-images load-images TAG=$(whoami)
7490

7591
## Step 3 - Run the tests
7692

93+
### 3a - Run the tests locally
94+
7795
```makefile
7896
make test TAG=$(whoami)
7997
```
8098

81-
To run a specific test, you can "focus" it by adding the `F` prefix to the name. For example:
99+
### 3b - Run the tests on a GKE cluster from a GCP VM
100+
101+
This step only applies if you would like to run the tests from a GCP based VM.
102+
103+
Before running the below `make` command, copy the `scripts/vars.env-example` file to `scripts/vars.env` and populate the
104+
required env vars. The `GKE_CLUSTER_ZONE` needs to be the zone of your GKE cluster, and `GKE_SVC_ACCOUNT` needs to be
105+
the name of a service account that has Kubernetes admin permissions.
106+
107+
To create and setup the VM (including creating a firewall rule allowing SSH access from your local machine, and
108+
optionally adding the VM IP to the `master-authorized-networks` list of your GKE cluster if
109+
`ADD_VM_IP_AUTH_NETWORKS` is set to `true`) and run the tests, run the following
110+
111+
```makefile
112+
make create-vm-and-run-tests
113+
```
114+
115+
To use an existing VM to run the tests, run the following
116+
117+
```makefile
118+
make run-tests-on-vm
119+
```
120+
121+
### Common test amendments
122+
123+
To run all tests with the label "performance", use the GINKGO_LABEL variable:
124+
125+
```makefile
126+
make test TAG=$(whoami) GINKGO_LABEL=performance
127+
```
128+
129+
or to pass a specific flag, e.g. run a specific test, use the GINKGO_FLAGS variable:
130+
131+
```makefile
132+
make test TAG=$(whoami) GINKGO_FLAGS='-ginkgo.focus "writes the system info to a results file"'
133+
```
134+
135+
If you are running the tests in GCP, add your required label/ flags to `scripts/var.env`.
136+
137+
You can also modify the tests code for a similar outcome. To run a specific test, you can "focus" it by adding the `F`
138+
prefix to the name. For example:
82139

83140
```go
84141
It("runs some test", func(){
@@ -112,8 +169,18 @@ XIt("runs some test", func(){
112169
})
113170
```
114171

115-
## Step 4 - Delete kind cluster
172+
For more information of filtering specs, see [the docs here](https://onsi.github.io/ginkgo/#filtering-specs).
116173

117-
```makefile
118-
make delete-kind-cluster
119-
```
174+
## Step 4 - Cleanup
175+
176+
1. Delete kind cluster, if required
177+
178+
```makefile
179+
make delete-kind-cluster
180+
```
181+
182+
2. Delete the cloud VM and cleanup the firewall rule, if required
183+
184+
```makefile
185+
make cleanup-vm
186+
```

tests/dataplane-performance/scripts/post.lua

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/dataplane-performance/scripts/wrk-latency.sh

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)