Skip to content

Commit c8e2ac1

Browse files
author
Doug Davis
committed
error testing
Signed-off-by: Doug Davis <[email protected]>
1 parent 6cb9a7a commit c8e2ac1

File tree

17 files changed

+35
-20
lines changed

17 files changed

+35
-20
lines changed

app-n-job/run

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ ibmcloud ce app create -n anj-app --image ${REGISTRY}/app-n-job
2929
URL=$(ibmcloud ce app get -n anj-app -o url)
3030

3131
# And call it
32-
curl -Ls $URL | tee out
32+
curl -fs $URL | tee out
33+
[[ "${PIPESTATUS[0]}" == "0" ]]
3334

3435
if ! grep "Hello from.*app" out > /dev/null ; then
3536
echo "Unexpected output"

app2job/run

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ URL=$(ibmcloud ce app get -n a2j-app -o url)
3232
ibmcloud ce job create -n a2j-job --ai=1-${COUNT} --image ${REGISTRY}/a2j-job
3333

3434
# Now, curl the app and see if it creates the job
35-
curl -s ${URL}/a2j-job -X PUT | tee out
35+
curl -fs ${URL}/a2j-job -X PUT | tee out
36+
[[ "${PIPESTATUS[0]}" == "0" ]]
3637
jobrun=$(cat out)
3738

3839
while ! ibmcloud ce jobrun get -n ${jobrun} | grep "Succeeded.*${COUNT}" ; do

bin/run-all

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ for file in `find . -name run | sort` ; do (
1414

1515
# Run the sample with whatever REGISTRY we're pointing to
1616
./run "$@"
17+
rc=$?
18+
if [[ "$rc" != "0" ]]; then
19+
echo exit: $rc
20+
exit $rc
21+
fi
1722

1823
) done
1924

bind-app/run

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ URL=$(ibmcloud ce app get -n ba-app -o url)
3636
ibmcloud ce app bind --name ba-app --service-instance ba-db
3737

3838
# Curl the app to make sure it had the creds
39-
curl -Ls ${URL} | tee out
39+
curl -fs ${URL} | tee out
40+
[[ "${PIPESTATUS[0]}" == "0" ]]
4041

4142
if ! grep VCAP_SERVICES out > /dev/null ; then
4243
echo "Missing VCAP_SERVICES in App's env vars"

cecli/run

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ ibmcloud ce app create -n lister --image $REGISTRY/cecli \
4848
APP=$(ibmcloud ce app get -n lister -o url)
4949

5050
# Call the app - if it works it should return the output of the 'app list' cmd
51-
curl -s $APP/list | tee out
51+
curl -fs $APP/list | tee out
52+
[[ "${PIPESTATUS[0]}" == "0" ]]
5253

5354
# Verify we see our App in the output
5455
grep "^lister " out

configmaps-env/run

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,11 @@ ibmcloud ce app create -n cm-app-env --image ${REGISTRY}/ce-config-env \
3939
URL=$(ibmcloud ce app get -n cm-app-env -o url)
4040

4141
# Just force it to log something by hitting it
42-
curl -Ls $URL
42+
curl -fs $URL
4343

4444
# Now check the logs to see if the env vars were set
4545
ibmcloud ce app logs -n cm-app-env | tee out
46+
[[ "${PIPESTATUS[0]}" == "0" ]]
4647
grep MY_ out
4748
if ! [[ $(grep MY_ out | wc -l) == "4" ]]; then
4849
echo "Unexpected output"

configmaps-vol/run

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,11 @@ ibmcloud ce app create -n cm-app-vol --image ${REGISTRY}/ce-config-vol \
3939
URL=$(ibmcloud ce app get -n cm-app-vol -o url)
4040

4141
# Just force it to log something by hitting it
42-
curl -Ls $URL
42+
curl -fs $URL
4343

4444
# Now check the logs to see if the env vars were set
4545
ibmcloud ce app logs -n cm-app-vol | tee out
46+
[[ "${PIPESTATUS[0]}" == "0" ]]
4647
grep MY_ out
4748
if ! [[ $(grep MY_ out | wc -l) == "4" ]]; then
4849
echo "Unexpected output"

cos-event/run

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ cat out
8888
echo "=============="
8989
echo "Event stats:"
9090

91-
curl -Ls ${URL}/stats
91+
curl -fs ${URL}/stats
9292

9393
# Clean up
9494
clean

hello/run

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ ibmcloud ce app create -n hello --image ${REGISTRY}/hello
2525
URL=$(ibmcloud ce app get -n hello -o url)
2626

2727
# Now call it
28-
curl -Ls $URL
28+
curl -fs $URL | tee out
29+
[[ "${PIPESTATUS[0]}" == "0" ]]
2930

30-
if ! [[ "$(curl -Ls $URL)" == "Hello World" ]]; then
31+
if ! [[ "$(cat out)" == "Hello World" ]]; then
3132
echo "Unexpected output"
3233
exit 1
3334
fi

helloworld/run

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ ibmcloud ce app create -n helloworld --image ${REGISTRY}/helloworld
2727
URL=$(ibmcloud ce app get -n helloworld -o url)
2828

2929
# Now call it
30-
curl -Ls $URL
30+
curl -fs $URL | tee out
31+
[[ "${PIPESTATUS[0]}" == "0" ]]
3132

32-
if ! [[ "$(curl -Ls ${URL} --post301 -d "Hi")" == "Hi" ]]; then
33+
if ! [[ "$(curl -fs ${URL} -d "Hi")" == "Hi" ]]; then
3334
echo "Unexpected output"
3435
exit 1
3536
fi

0 commit comments

Comments
 (0)