A R Karthick | a974c21 | 2017-07-17 19:47:12 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | # example cord webserver post request to update config for cluster test |
| 4 | |
| 5 | cat > /tmp/testconfig.json <<EOF |
| 6 | { |
| 7 | "test_case" : "cluster", |
| 8 | "config" : |
| 9 | { |
| 10 | "TLS_TIMEOUT" : 10, |
| 11 | "ITERATIONS" : 50 |
| 12 | } |
| 13 | } |
| 14 | EOF |
| 15 | curl -H "Content-Type: application/json" -X POST -d @/tmp/testconfig.json http://localhost:5000/update |
| 16 | rm -f /tmp/testconfig.json |
| 17 | read -p "Do you want to restore the config?" ans |
| 18 | case "$ans" in |
| 19 | [Yy]*) |
| 20 | echo "Restoring test case config" |
| 21 | curl -H "Content-Type: application/json" -X POST -d '{ "test_case" : "cluster" }' http://localhost:5000/restore |
| 22 | ;; |
| 23 | esac |