You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Test environment: Start with docker-compose, a 3-node ETCD cluster, and 2-node APISIX cluster (2 nodes need to be verified at the same time).
Since APISIX already has complete test cases, we plan to migrate the test cases under the APISIX t directory.
Because of the huge workload, I will first migrate the test cases under t/node/ and t/router/, and leave other use cases to others who have time, or migrate later when I have time to complete the coverage.
Test cases
route
host:
Configure the correct host and hosts through the manager api, including wildcard domain name, and verify the correctness of the route by accessing APISIX.
Confirm that the manager api cannot configure host and hosts at the same time
Make sure that the manager api cannot be configured with wrong hosts and hosts, including illegal strings, too high length, wrong data types, etc.
invalid conf
Confirm that the manager api verifies the correctness of each field. include:
String: length check, regular expression check
IP: v4 v6 format verification
int, float, bool and other types check
config route with not exist service_id or upstream_id
remote_addr, remote_addrs: v4 v6 format verification
uri, uris
invalid value check
empty value check
vars: args, cookie, header, different operators
check combinations of different types of vars and operators
methods
Wrong data type (not string array)
Not in enumerated values
priority
Customize different priority checks
Custom and default priority verification
plugins
Extract at least one plug-in from auth, limit, log, trace, metrics and other types respectively for verification
plugin orchestration check (normal and invalid check)
other fields: name, desc, create_time, update_time, labels, filter_func(can't verify in Go, TODO)
not exist field
Confirm that the manager api can refuse to configure undefined fields
Verify routing correctness under multi routes
router engine: check radixtree_uri first, radixtree_host_uri TODO
upstream
key: remote_addr, query_string, arg_xxx
hash_on: consumer, header, cookie, vars
node: ipv6, domain, array nodes (struct)
ewma: latency, frequency
roundrobin:, weight
timeout
retries
websocket
health check: active, passive, healthy, unhealthy
invalid conf
ssl
cert + key + sni
cert + key + snis
certs + keys + snis
wildcard domain name
4.consumer
missing auth plugin
two or more auth plugins
with plugins
service
invalid route
route with empty service
global rules
add
update
delete
cover by route plugins
plugins merge
route + service
route + consumer
route + service + consumer
The test cases only describe the route part in detail, and the other parts will be detailed in the issue later.
Background
Manager api no longer interacts with admin api, but writes data directly to etcd.
At present, we do not have the e2e test cases that cover from dashboard, manager api to Apache APISIX.
Plan
e2e test is divided into two parts, front-end e2e and back-end e2e
Because the front-end only uses part of the interface of
manager api, the front-end e2e only needs to ensure normal interaction withmanager apiBack-end e2e, APISIX is started through docker, Go calls manager api to configure routing and other resources, then access APISIX for verification.
Details
Development language: Go
Test library: https://github.com/gavv/httpexpect
Test environment: Start with docker-compose, a 3-node ETCD cluster, and 2-node APISIX cluster (2 nodes need to be verified at the same time).
Since APISIX already has complete test cases, we plan to migrate the test cases under the APISIX t directory.
Because of the huge workload, I will first migrate the test cases under t/node/ and t/router/, and leave other use cases to others who have time, or migrate later when I have time to complete the coverage.
Test cases
host:
Configure the correct host and hosts through the
manager api, including wildcard domain name, and verify the correctness of the route by accessing APISIX.Confirm that the
manager apicannot configure host and hosts at the same timeMake sure that the
manager apicannot be configured with wrong hosts and hosts, including illegal strings, too high length, wrong data types, etc.invalid conf
Confirm that the
manager apiverifies the correctness of each field. include:String: length check, regular expression check
IP: v4 v6 format verification
int, float, bool and other types check
config route with not exist service_id or upstream_id
remote_addr, remote_addrs: v4 v6 format verification
uri, uris
invalid value check
empty value check
vars: args, cookie, header, different operators
check combinations of different types of vars and operators
methods
Wrong data type (not string array)
Not in enumerated values
priority
Customize different priority checks
Custom and default priority verification
plugins
Extract at least one plug-in from auth, limit, log, trace, metrics and other types respectively for verification
plugin orchestration check (normal and invalid check)
other fields: name, desc, create_time, update_time, labels, filter_func(can't verify in Go, TODO)
not exist field
Confirm that the
manager apican refuse to configure undefined fieldsVerify routing correctness under multi routes
router engine: check radixtree_uri first, radixtree_host_uri TODO
4.consumer
The test cases only describe the route part in detail, and the other parts will be detailed in the issue later.