BjornMagnussonXA | f38e1e8 | 2020-10-11 23:05:02 +0200 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # ============LICENSE_START=============================================== |
| 4 | # Copyright (C) 2020 Nordix Foundation. All rights reserved. |
| 5 | # ======================================================================== |
| 6 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | # you may not use this file except in compliance with the License. |
| 8 | # You may obtain a copy of the License at |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, software |
| 13 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | # See the License for the specific language governing permissions and |
| 16 | # limitations under the License. |
| 17 | # ============LICENSE_END================================================= |
| 18 | # |
| 19 | |
| 20 | # Automated test script for producer stub container |
| 21 | |
| 22 | if [ $# -ne 1 ]; then |
| 23 | echo "Usage: ./basic_test.sh nonsecure|secure" |
| 24 | exit 1 |
| 25 | fi |
| 26 | if [ "$1" != "nonsecure" ] && [ "$1" != "secure" ]; then |
| 27 | echo "Usage: ./basic_test.sh nonsecure|secure" |
| 28 | exit 1 |
| 29 | fi |
| 30 | |
| 31 | if [ $1 == "nonsecure" ]; then |
| 32 | #Default http port for the simulator |
| 33 | PORT=8092 |
| 34 | # Set http protocol |
| 35 | HTTPX="http" |
| 36 | else |
| 37 | #Default https port for the simulator |
| 38 | PORT=8093 |
| 39 | # Set https protocol |
| 40 | HTTPX="https" |
| 41 | fi |
| 42 | |
| 43 | # source function to do curl and check result |
| 44 | . ../common/do_curl_function.sh |
| 45 | |
| 46 | echo "=== hello world ===" |
| 47 | RESULT="OK" |
| 48 | do_curl GET / 200 |
| 49 | |
| 50 | |
| 51 | |
| 52 | echo "********************" |
| 53 | echo "*** All tests ok ***" |
| 54 | echo "********************" |