subhash kumar singh | 729baad | 2017-09-06 19:58:29 +0530 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Library RequestsLibrary |
subhash kumar singh | e08b837 | 2017-09-08 16:58:57 +0530 | [diff] [blame] | 3 | Library Process |
| 4 | |
| 5 | *** Variables *** |
| 6 | |
| 7 | ${cli_exec} docker exec cli onap |
| 8 | ${cli_exec_onap_11} docker exec -e CLI_PRODUCT_VERSION=onap-1.1 onap |
| 9 | ${cli_exec_onap_10} docker exec -e CLI_PRODUCT_VERSION=onap-1.0 onap |
| 10 | ${cli_exec_cli_10} docker exec -e CLI_PRODUCT_VERSION=cli-1.0 onap |
subhash kumar singh | 729baad | 2017-09-06 19:58:29 +0530 | [diff] [blame] | 11 | |
| 12 | *** Test Cases *** |
| 13 | Liveness Test |
| 14 | [Documentation] Check cli liveness check |
| 15 | Create Session cli http://${CLI_IP}:8080 |
| 16 | CheckUrl cli / |
| 17 | |
subhash kumar singh | e08b837 | 2017-09-08 16:58:57 +0530 | [diff] [blame] | 18 | Check Cli help |
| 19 | [Documentation] check cli help command |
| 20 | ${cli_cmd_output}= Run Process ${cli_exec} --help shell=yes |
| 21 | Log ${cli_cmd_output.stdout} |
| 22 | Should Be Equal As Strings ${cli_cmd_output.rc} 0 |
| 23 | Should Contain ${cli_cmd_output.stdout} ONAP Command-line interface |
| 24 | |
| 25 | Check Cli Version Default |
| 26 | [Documentation] check cli default version |
| 27 | ${cli_cmd_output}= Run Process ${cli_exec} --version shell=yes |
| 28 | Log ${cli_cmd_output.stdout} |
| 29 | Should Be Equal As Strings ${cli_cmd_output.rc} 0 |
| 30 | Should Contain ${cli_cmd_output.stdout} : cli-1.0 |
| 31 | |
| 32 | Check Cli Scheam Refresh |
| 33 | [Documentation] check cli schema-refresh command |
| 34 | ${cli_cmd_output}= Run Process ${cli_exec} schema-refresh shell=yes |
| 35 | Log ${cli_cmd_output.stdout} |
| 36 | Should Be Equal As Strings ${cli_cmd_output.rc} 0 |
| 37 | Should Contain ${cli_cmd_output.stdout} sl-no |
| 38 | Should Contain ${cli_cmd_output.stdout} command |
| 39 | Should Contain ${cli_cmd_output.stdout} product-version |
| 40 | Should Contain ${cli_cmd_output.stdout} schema |
| 41 | Should Contain ${cli_cmd_output.stdout} version |
| 42 | |
| 43 | Check Cli Schema Validate With Valid Path |
| 44 | [Documentation] check cli schema-validate command with valid path |
| 45 | ${cli_cmd_output}= Run Process ${cli_exec} schema-validate -i -l schema-refresh.yaml shell=yes |
| 46 | Log ${cli_cmd_output.stdout} |
| 47 | Should Be Equal As Strings ${cli_cmd_output.rc} 0 |
| 48 | Should Contain ${cli_cmd_output.stdout} sl-no |
| 49 | Should Contain ${cli_cmd_output.stdout} error |
| 50 | |
| 51 | Check Cli Scheam Validate With Invalid Path |
| 52 | [Documentation] check cli version |
| 53 | ${cli_cmd_output}= Run Process ${cli_exec} schema-validate -i -l invalid-yaml-path.yaml shell=yes |
| 54 | Log ${cli_cmd_output.stdout} |
| 55 | Should Be Equal As Strings ${cli_cmd_output.rc} 1 |
| 56 | Should Contain ${cli_cmd_output.stdout} 0x0007 |
| 57 | |
| 58 | Check Cli Scheam Validate Empty Argument |
| 59 | [Documentation] check cli schema validate with empty argument |
| 60 | ${cli_cmd_output}= Run Process ${cli_exec} schema-validate shell=yes |
| 61 | Log ${cli_cmd_output.stdout} |
| 62 | Should Be Equal As Strings ${cli_cmd_output.rc} 1 |
| 63 | Should Contain ${cli_cmd_output.stdout} 0x0015 |
| 64 | |
| 65 | |
subhash kumar singh | 729baad | 2017-09-06 19:58:29 +0530 | [diff] [blame] | 66 | *** Keywords *** |
| 67 | CheckUrl |
| 68 | [Arguments] ${session} ${path} |
| 69 | ${resp}= Get Request ${session} ${path} |
| 70 | Should Be Equal As Integers ${resp.status_code} 200 |