spacewander commented on code in PR #6981:
URL: https://github.com/apache/apisix/pull/6981#discussion_r867483065
##########
t/cli/test_validate_config.sh:
##########
@@ -167,11 +167,79 @@ plugins:
nginx_config:
http:
real_ip_from:
- - "127.0.0.2"
+ - "128.0.0.2"
' > conf/config.yaml
out=$(make init 2>&1 || true)
-if ! echo "$out" | grep "missing '127.0.0.1' in the
nginx_config.http.real_ip_from for plugin batch-requests"; then
+if ! echo "$out" | grep "missing loopback or unspecified in the
nginx_config.http.real_ip_from for plugin batch-requests"; then
+ echo "failed: should check the realip configuration for batch-requests"
+ exit 1
+fi
+
+echo "passed: check the realip configuration for batch-requests"
+
+echo '
+plugins:
+- batch-requests
+nginx_config:
+ http:
+ real_ip_from:
+ - "127.0.0.1"
+' > conf/config.yaml
+
+out=$(make init 2>&1 || true)
+if echo "$out" | grep "missing loopback or unspecified in the
nginx_config.http.real_ip_from for plugin batch-requests"; then
+ echo "failed: should check the realip configuration for batch-requests"
+ exit 1
+fi
+
+echo "passed: check the realip configuration for batch-requests"
Review Comment:
For multi checks we only need to put one `passed` at the end, like:
https://github.com/apache/apisix/blob/0d1280cde7fcd463f2e86941935e053561bcf331/t/cli/test_validate_config.sh#L149-L162
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]