Skip to content

Commit 7ba7892

Browse files
committed
update failure case handling
1 parent 9c5da36 commit 7ba7892

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

  • qa/L0_pytorch_python_runtime

qa/L0_pytorch_python_runtime/test.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,10 @@ else
132132
RET=1
133133
fi
134134

135-
NEURALNET_DEFAULT_FILENAME=$(curl -s localhost:8000/v2/models/neuralnet/config | python3 -c "import json,sys; print(json.load(sys.stdin).get('default_model_filename', ''))")
136-
if [ "$NEURALNET_DEFAULT_FILENAME" != "" ]; then
135+
if ! NEURALNET_DEFAULT_FILENAME=$(curl -sf localhost:8000/v2/models/neuralnet/config | python3 -c "import json,sys; c=json.load(sys.stdin); assert c.get('name')=='neuralnet', c; print(c.get('default_model_filename', ''))"); then
136+
echo -e "\n***\n*** Failed to retrieve or parse the configuration for 'neuralnet'. \n***"
137+
RET=1
138+
elif [ "$NEURALNET_DEFAULT_FILENAME" != "" ]; then
137139
echo -e "\n***\n*** Expected empty default_model_filename for 'neuralnet', got \"$NEURALNET_DEFAULT_FILENAME\". \n***"
138140
RET=1
139141
fi

0 commit comments

Comments
 (0)