blob: 7cace255c448519d72f0572209a4fca210d3a5fa [file] [log] [blame]
A R Karthick78669922017-07-18 12:35:03 -07001#!/usr/bin/env bash
2
3# example cord webserver post request to run tls test case
4
5cat > /tmp/testrun.json <<EOF
6{
7 "manifest" : "manifest.json",
8 "test" : "tls:eap_auth_exchange.test_eap_tls",
9 "config" : {
10 "VOLTHA_HOST" : "172.17.0.1",
11 "VOLTHA_REST_PORT" : 8881,
12 "VOLTHA_OLT_TYPE" : "ponsim_olt",
13 "VOLTHA_OLT_MAC" : "00:0c:e2:31:10:00"
14 }
15}
16EOF
17status=`curl -s -w "%{http_code}" -o /dev/null -H "Content-Type: application/json" -X POST -d '{ "manifest" : "manifest.json" }' http://localhost:5000/start`
18if [ $status -ne 200 ]; then
19 echo "Test setup failed with status code $status"
20 exit 1
21fi
22status=`curl -s -w "%{http_code}" -o /dev/null -H "Content-Type: application/json" -X POST -d @/tmp/testrun.json http://localhost:5000/test`
23if [ $status -ne 200 ]; then
24 echo "Test run failed with status code $status"
25 exit 1
26fi
27status=`curl -s -w "%{http_code}" -o /dev/null -H "Content-Type: application/json" -X POST -d '{ "manifest" : "manifest.json" }' http://localhost:5000/cleanup`
28if [ $status -ne 200 ]; then
29 echo "Test cleanup failed with status code $status"
30fi
31rm -f /tmp/testrun.json
32echo "Test successful"