diff --git a/ecchronos-binary/src/test/bin/pytests.sh b/ecchronos-binary/src/test/bin/pytests.sh index b306d4419..7652dad7a 100755 --- a/ecchronos-binary/src/test/bin/pytests.sh +++ b/ecchronos-binary/src/test/bin/pytests.sh @@ -167,18 +167,21 @@ else --define cql_client_key="$CERTIFICATE_DIRECTORY/key.pem" \ --define cql_client_ca="$CERTIFICATE_DIRECTORY/ca.crt" fi -RETURN=$? +TEST_RETURN_CODE=$? echo "Fetching OpenAPI spec" +pip install openapi-spec-validator if [ "${LOCAL}" == "true" ]; then curl http://localhost:8080/v3/api-docs.yaml -o ../../../docs/autogenerated/openapi.yaml else curl https://localhost:8080/v3/api-docs.yaml -o ../../../docs/autogenerated/openapi.yaml --cert $CERTIFICATE_DIRECTORY/clientcert.crt --key $CERTIFICATE_DIRECTORY/clientkey.pem --cacert $CERTIFICATE_DIRECTORY/serverca.crt fi +openapi-spec-validator ../../../docs/autogenerated/openapi.yaml --schema 3.0.0 +OPENAPI_RETURN_CODE=$? if [ -f $PIDFILE ]; then cd - bin/ecctool stop -p $PIDFILE fi -exit $RETURN +! (( TEST_RETURN_CODE || $OPENAPI_RETURN_CODE ))