blob: 6af5b95cbe4f4aa881192202b966e69e911b4697 [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",
A R Karthicke7232092017-09-07 18:01:33 -070011 "VOLTHA_REST_PORT" : 8882,
A R Karthick78669922017-07-18 12:35:03 -070012 "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
A R Karthicke7232092017-09-07 18:01:33 -070032echo "Test successful"