Skip to content

Commit

Permalink
trigger cli
Browse files Browse the repository at this point in the history
  • Loading branch information
Revolyssup committed Feb 17, 2025
1 parent 5c15dd0 commit 516007c
Showing 1 changed file with 0 additions and 44 deletions.
44 changes: 0 additions & 44 deletions t/cli/test_access_log.sh
Original file line number Diff line number Diff line change
Expand Up @@ -179,50 +179,6 @@ make stop

echo "don't log uninitialized access log variable when the HTTP request is malformed"

# TLS upstream

echo "
deployment:
admin:
admin_listen:
port: 9180
https_admin: true
admin_api_mtls:
admin_ssl_cert: '../t/certs/apisix_admin_ssl.crt'
admin_ssl_cert_key: '../t/certs/apisix_admin_ssl.key'
nginx_config:
http:
access_log_format: '\"\$upstream_scheme://\$upstream_host\" \$ssl_server_name'
" > conf/config.yaml
# 4. Start APISIX
make run
sleep 2

admin_key=$(yq '.deployment.admin.admin_key[0].key' conf/config.yaml | sed 's/"//g')
curl -k -i https://127.0.0.1:9180/apisix/admin/routes/1 -H "X-API-KEY: $admin_key" -X PUT -d \
'{"uri":"/apisix/admin/routes/1", "upstream":{"nodes":{"localhost:9180":1},"scheme":"https","type":"roundrobin","pass_host":"node"}}'

curl -i http://127.0.0.1:9080/apisix/admin/routes/1
sleep 4
tail -n 2 logs/access.log > output.log

# APISIX
if ! grep '"http://127.0.0.1:9180" -' output.log; then
echo "failed: should find upstream scheme"
cat output.log
exit 1
fi

# admin
if ! grep '"http://127.0.0.1:9180" localhost' output.log; then
echo "failed: should find upstream scheme"
cat output.log
exit 1
fi

make stop
echo "passed: should find upstream scheme"

# check stream logs
echo '
apisix:
Expand Down

0 comments on commit 516007c

Please sign in to comment.