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