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 |
subhash kumar singh | 7ef7385 | 2017-09-20 19:57:34 +0530 | [diff] [blame^] | 8 | ${cli_exec_cli_10_help} docker exec cli bash -c "export CLI_PRODUCT_VERSION=cli-1.0 && onap --help" |
| 9 | ${cli_exec_cli_10_version} docker exec cli bash -c "export CLI_PRODUCT_VERSION=cli-1.0 && onap --version" |
| 10 | ${cli_exec_cli_10_schema_refresh} docker exec cli bash -c "export CLI_PRODUCT_VERSION=cli-1.0 && onap schema-refresh" |
| 11 | ${cli_exec_cli_10_schema_validate} docker exec cli bash -c "export CLI_PRODUCT_VERSION=cli-1.0 && onap schema-validate -i -l schema-refresh.yaml" |
| 12 | ${cli_exec_cli_10_schema_validate_invalid} docker exec cli bash -c "export CLI_PRODUCT_VERSION=cli-1.0 && onap schema-validate -i -l invalid-yaml-path.yaml" |
| 13 | ${cli_exec_cli_10_schema_validate_empty} docker exec cli bash -c "export CLI_PRODUCT_VERSION=cli-1.0 && onap schema-validate" |
| 14 | |
| 15 | ${cli_exec_onap_11} docker exec cli bash -c "export CLI_PRODUCT_VERSION=onap-1.1 && onap" |
| 16 | ${cli_exec_onap_11_microservice_create} docker exec cli bash -c "export CLI_PRODUCT_VERSION=onap-1.1 && onap microservice-create --service-name test-service --service-version v1 --service-url /api/test/v1 --host-url http://${MSB_IAG_IP}:80 23.14.15.156 80" |
| 17 | ${cli_exec_onap_11_microservice_list} docker exec cli bash -c "export CLI_PRODUCT_VERSION=onap-1.1 && onap microservice-list --host-url http://${MSB_IAG_IP}:80 --long" |
| 18 | ${cli_exec_onap_11_microservice_show} docker exec cli bash -c "export CLI_PRODUCT_VERSION=onap-1.1 && onap microservice-show --service-name test-service --service-version v1 --host-url http://${MSB_IAG_IP}:80" |
| 19 | ${cli_exec_onap_11_microservice_delete} docker exec cli bash -c "export CLI_PRODUCT_VERSION=onap-1.1 && onap microservice-delete --service-name test-service --service-version v1 --host-url http://${MSB_IAG_IP}:80 --node-ip 23.14.15.156 --node-port 80" |
subhash kumar singh | 729baad | 2017-09-06 19:58:29 +0530 | [diff] [blame] | 20 | |
| 21 | *** Test Cases *** |
| 22 | Liveness Test |
| 23 | [Documentation] Check cli liveness check |
| 24 | Create Session cli http://${CLI_IP}:8080 |
| 25 | CheckUrl cli / |
| 26 | |
subhash kumar singh | e08b837 | 2017-09-08 16:58:57 +0530 | [diff] [blame] | 27 | Check Cli help |
| 28 | [Documentation] check cli help command |
subhash kumar singh | 7ef7385 | 2017-09-20 19:57:34 +0530 | [diff] [blame^] | 29 | ${cli_cmd_output}= Run Process ${cli_exec_cli_10_help} shell=yes |
subhash kumar singh | e08b837 | 2017-09-08 16:58:57 +0530 | [diff] [blame] | 30 | Log ${cli_cmd_output.stdout} |
| 31 | Should Be Equal As Strings ${cli_cmd_output.rc} 0 |
Kanagaraj Manickam k00365106 | 89b3005 | 2017-09-12 10:06:13 +0530 | [diff] [blame] | 32 | Should Contain ${cli_cmd_output.stdout} CLI version |
subhash kumar singh | e08b837 | 2017-09-08 16:58:57 +0530 | [diff] [blame] | 33 | |
| 34 | Check Cli Version Default |
| 35 | [Documentation] check cli default version |
subhash kumar singh | 7ef7385 | 2017-09-20 19:57:34 +0530 | [diff] [blame^] | 36 | ${cli_cmd_output}= Run Process ${cli_exec_cli_10_version} shell=yes |
subhash kumar singh | e08b837 | 2017-09-08 16:58:57 +0530 | [diff] [blame] | 37 | Log ${cli_cmd_output.stdout} |
| 38 | Should Be Equal As Strings ${cli_cmd_output.rc} 0 |
| 39 | Should Contain ${cli_cmd_output.stdout} : cli-1.0 |
| 40 | |
| 41 | Check Cli Scheam Refresh |
| 42 | [Documentation] check cli schema-refresh command |
subhash kumar singh | 7ef7385 | 2017-09-20 19:57:34 +0530 | [diff] [blame^] | 43 | ${cli_cmd_output}= Run Process ${cli_exec_cli_10_schema_refresh} shell=yes |
subhash kumar singh | e08b837 | 2017-09-08 16:58:57 +0530 | [diff] [blame] | 44 | Log ${cli_cmd_output.stdout} |
| 45 | Should Be Equal As Strings ${cli_cmd_output.rc} 0 |
| 46 | Should Contain ${cli_cmd_output.stdout} sl-no |
| 47 | Should Contain ${cli_cmd_output.stdout} command |
| 48 | Should Contain ${cli_cmd_output.stdout} product-version |
| 49 | Should Contain ${cli_cmd_output.stdout} schema |
| 50 | Should Contain ${cli_cmd_output.stdout} version |
| 51 | |
| 52 | Check Cli Schema Validate With Valid Path |
| 53 | [Documentation] check cli schema-validate command with valid path |
subhash kumar singh | 7ef7385 | 2017-09-20 19:57:34 +0530 | [diff] [blame^] | 54 | ${cli_cmd_output}= Run Process ${cli_exec_cli_10_schema_validate} shell=yes |
subhash kumar singh | e08b837 | 2017-09-08 16:58:57 +0530 | [diff] [blame] | 55 | Log ${cli_cmd_output.stdout} |
| 56 | Should Be Equal As Strings ${cli_cmd_output.rc} 0 |
| 57 | Should Contain ${cli_cmd_output.stdout} sl-no |
| 58 | Should Contain ${cli_cmd_output.stdout} error |
| 59 | |
| 60 | Check Cli Scheam Validate With Invalid Path |
| 61 | [Documentation] check cli version |
subhash kumar singh | 7ef7385 | 2017-09-20 19:57:34 +0530 | [diff] [blame^] | 62 | ${cli_cmd_output}= Run Process ${cli_exec_cli_10_schema_validate_invalid} shell=yes |
subhash kumar singh | e08b837 | 2017-09-08 16:58:57 +0530 | [diff] [blame] | 63 | Log ${cli_cmd_output.stdout} |
| 64 | Should Be Equal As Strings ${cli_cmd_output.rc} 1 |
| 65 | Should Contain ${cli_cmd_output.stdout} 0x0007 |
| 66 | |
| 67 | Check Cli Scheam Validate Empty Argument |
| 68 | [Documentation] check cli schema validate with empty argument |
subhash kumar singh | 7ef7385 | 2017-09-20 19:57:34 +0530 | [diff] [blame^] | 69 | ${cli_cmd_output}= Run Process ${cli_exec_cli_10_schema_validate_empty} shell=yes |
subhash kumar singh | e08b837 | 2017-09-08 16:58:57 +0530 | [diff] [blame] | 70 | Log ${cli_cmd_output.stdout} |
| 71 | Should Be Equal As Strings ${cli_cmd_output.rc} 1 |
| 72 | Should Contain ${cli_cmd_output.stdout} 0x0015 |
| 73 | |
subhash kumar singh | 7ef7385 | 2017-09-20 19:57:34 +0530 | [diff] [blame^] | 74 | Check Cli create microservice |
| 75 | [Documentation] check create microservice |
| 76 | ${cli_cmd_output}= Run Process ${cli_exec_onap_11_microservice_create} shell=yes |
| 77 | Log ${cli_cmd_output.stdout} |
| 78 | Should Be Equal As Strings ${cli_cmd_output.rc} 0 |
| 79 | |
| 80 | Check Cli list microservice |
| 81 | [Documentation] check list microservice |
| 82 | ${cli_cmd_output}= Run Process ${cli_exec_onap_11_microservice_list} shell=yes |
| 83 | Log ${cli_cmd_output.stdout} |
| 84 | Should Be Equal As Strings ${cli_cmd_output.rc} 0 |
| 85 | |
| 86 | Check Cli show microservice |
| 87 | [Documentation] check show microservice |
| 88 | ${cli_cmd_output}= Run Process ${cli_exec_onap_11_microservice_show} shell=yes |
| 89 | Log ${cli_cmd_output.stdout} |
| 90 | Should Be Equal As Strings ${cli_cmd_output.rc} 0 |
| 91 | |
| 92 | Check Cli delete microservice |
| 93 | [Documentation] check delete microservice |
| 94 | ${cli_cmd_output}= Run Process ${cli_exec_onap_11_microservice_delete} shell=yes |
| 95 | Log ${cli_cmd_output.stdout} |
| 96 | Should Be Equal As Strings ${cli_cmd_output.rc} 0 |
| 97 | |
| 98 | |
subhash kumar singh | e08b837 | 2017-09-08 16:58:57 +0530 | [diff] [blame] | 99 | |
subhash kumar singh | 729baad | 2017-09-06 19:58:29 +0530 | [diff] [blame] | 100 | *** Keywords *** |
| 101 | CheckUrl |
| 102 | [Arguments] ${session} ${path} |
| 103 | ${resp}= Get Request ${session} ${path} |
| 104 | Should Be Equal As Integers ${resp.status_code} 200 |