blob: 7cace255c448519d72f0572209a4fca210d3a5fa [file] [log] [blame]
#!/usr/bin/env bash
# example cord webserver post request to run tls test case
cat > /tmp/testrun.json <<EOF
{
"manifest" : "manifest.json",
"test" : "tls:eap_auth_exchange.test_eap_tls",
"config" : {
"VOLTHA_HOST" : "172.17.0.1",
"VOLTHA_REST_PORT" : 8881,
"VOLTHA_OLT_TYPE" : "ponsim_olt",
"VOLTHA_OLT_MAC" : "00:0c:e2:31:10:00"
}
}
EOF
status=`curl -s -w "%{http_code}" -o /dev/null -H "Content-Type: application/json" -X POST -d '{ "manifest" : "manifest.json" }' http://localhost:5000/start`
if [ $status -ne 200 ]; then
echo "Test setup failed with status code $status"
exit 1
fi
status=`curl -s -w "%{http_code}" -o /dev/null -H "Content-Type: application/json" -X POST -d @/tmp/testrun.json http://localhost:5000/test`
if [ $status -ne 200 ]; then
echo "Test run failed with status code $status"
exit 1
fi
status=`curl -s -w "%{http_code}" -o /dev/null -H "Content-Type: application/json" -X POST -d '{ "manifest" : "manifest.json" }' http://localhost:5000/cleanup`
if [ $status -ne 200 ]; then
echo "Test cleanup failed with status code $status"
fi
rm -f /tmp/testrun.json
echo "Test successful"