blob: 735b709e15d06c2f0c2040787a4330832ed40e84 [file] [log] [blame]
#!/bin/bash
WD=$(pwd)
cd "$(dirname "$(realpath "${0}")")"
ENDPOINT="chromite.api.%(SERVICE)s/%(METHOD)s"
INPUT="./$(basename "${0}")_input.json"
OUTPUT="./$(basename "${0}")_output.json"
if [ ! -e ${INTPUT} ]; then
echo "Input file not found: ${INPUT}."
exit 1
fi;
echo "" > ${OUTPUT}
echo "Running " ${ENDPOINT}
../../../bin/build_api "${ENDPOINT}" --input-json "${INPUT}" --output-json "${OUTPUT}"
RESULT=$?
echo "Completed ${ENDPOINT}"
if [ ${RESULT} -eq 0 ]; then
echo "Success!"
fi;
echo "Return Code: ${RESULT}"
echo "Result:"
cat ${OUTPUT}
echo ""
cd "$WD"