Skip to content

Commit

Permalink
new FAIL tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cageyv committed Nov 10, 2024
1 parent 6f57cc9 commit d047629
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions scripts/test.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

set -e
# set -e
rm -rf ./lprobe
go build

Expand All @@ -15,37 +15,54 @@ echo "Wait 5s"
sleep 5

### HTTP Check Test
./lprobe -mode=http -port=8080 -endpoint=/ -http-codes=200-298,299
./lprobe -mode=http -port=8080 -endpoint=/ -http-codes=200-298,299 -v
if [ "$?" != 0 ]; then
echo "HTTP test failed"
docker stop nginx-lprobe-test
exit 1
fi

### HTTP IPv6 Check Test
./lprobe -mode=http -port=8080 -endpoint=/ -ipv6
./lprobe -mode=http -port=8080 -endpoint=/ -ipv6 -v
if [ "$?" != 0 ]; then
echo "HTTP IPv6 test failed"
docker stop nginx-lprobe-test
exit 1
fi

### gRPC Check Test
./lprobe -mode=grpc -port=8081
./lprobe -mode=grpc -port=8081 -v
if [ "$?" != 0 ]; then
echo "gRPC test failed"
docker stop grpc-lprobe-test
exit 1
fi

### gRPC IPv6 Check Test
./lprobe -mode=grpc -port=8081 -ipv6
./lprobe -mode=grpc -port=8081 -ipv6 -v
if [ "$?" != 0 ]; then
echo "gRPC IPv6 test failed"
docker stop grpc-lprobe-test
exit 1
fi


### FAIL HTTP Check Test
./lprobe -mode=http -port=7777 -endpoint=/ -v
if [ "$?" != 1 ]; then
echo "FAIL HTTP test failed"
docker stop nginx-lprobe-test
exit 1
fi

### FAIL gRPC Check Test
./lprobe -mode=grpc -port=7777 -v
if [ "$?" != 1 ]; then
echo "FAIL gRPC test failed"
docker stop grpc-lprobe-test
exit 1
fi

## Stop docker containers
docker stop nginx-lprobe-test
docker stop grpc-lprobe-test
Expand Down

0 comments on commit d047629

Please sign in to comment.