Skip to content

Commit

Permalink
test: detect if grpc_server_example starts (#3566)
Browse files Browse the repository at this point in the history
Signed-off-by: spacewander <spacewanderlzx@gmail.com>
  • Loading branch information
spacewander authored Feb 9, 2021
1 parent 93a0d77 commit 37a7fae
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .travis/linux_openresty_common_runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ script() {
sleep 1
cat logs/error.log

sh ./t/grpc-proxy-test.sh
./t/grpc-proxy-test.sh
sleep 1

./bin/apisix stop
Expand Down
12 changes: 11 additions & 1 deletion t/grpc-proxy-test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
#!/usr/bin/env bash
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
Expand All @@ -18,6 +18,16 @@

set -ex

# ensure grpc server example is already started
for (( i = 0; i <= 100; i++ )); do
if [[ "$i" -eq 100 ]]; then
echo "failed to start grpc_server_example in time"
exit 1
fi
nc -zv 127.0.0.1 50051 && break
sleep 1
done

#set ssl
curl http://127.0.0.1:9080/apisix/admin/ssl/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
{
Expand Down

0 comments on commit 37a7fae

Please sign in to comment.