こんにちは、複数のif条件を持つシェルスクリプトを使用してWebサービスをテストしています。 、失敗をカウントし、失敗の理由シェルスクリプトを使用してファイルから残りのWebサービスをテストする際の成功カウント、失敗回数、失敗の理由
success=0
failure=0
if curl -s --head --request DELETE http://localhost/bimws/delete/[email protected] | grep "200 OK" > /dev/null; then
success=$((success+1))
else
echo "DeleteUser is not working"$'\r' >> serverLog.txt
failure=$((failure+1))
fi
if curl -s --head --request GET http://localhost/bimws/get/[email protected] | grep "200 OK" > /dev/null; then
success=$((success+1))
else
curl -s --head --request GET http://localhost/bimws/get/[email protected] > f1.txt
echo "getUserDetails is not working"$'\r' >> serverLog.txt
failure=$((failure+1))
fi
if curl -s -i -X POST -H "Content-Type:application/json" http://localhost/bimws/post/addProjectLocationAddress -d '{"companyid":"10","projectid":"200","addresstypeid":"5","address":"1234 main st","city":"san jose","state":"CA","zip":"989898","country":"United States"}' | grep "200 OK" > /dev/null; then
success=$((success+1))
else
echo "addProjectLocationAddress is not working"$'\r' >> serverLog.txt
failure=$((failure+1))
fi
echo $success Success
echo $failure failure
しかし、私はすべての私の私が実行しないどのようなシェルスクリプトを使用してWebサービスと成功回数が含まれているweb_services.txtと呼ばれるファイルを持っているように、ファイルからWebサービスをテストするために楽しみにしていますカウントと失敗理由
web_services.txt
すべてが異なる呼び出しが削除され、すべての
http://localhost/bimws/delete/[email protected]
http://localhost/bimws/get/[email protected]
http://localhost/bimws/post/addProjectLocationAddress -d '{"companyid":"10","projectid":"200","addresstypeid":"5","address":"1234 main st"
,"city":"san jose","state":"CA","zip":"989898","country":"United States"}'
使用-wそれをエコーします。 –
私はこれに新しいです。私はあなたに詳細を教えてくれませんでした –