blob: 5c0bf8b76003b34671d9a1f819e31b996a5f6196 [file] [log] [blame]
subhash kumar singh729baad2017-09-06 19:58:29 +05301*** Settings ***
2Library RequestsLibrary
subhash kumar singhe08b8372017-09-08 16:58:57 +05303Library Process
4
5*** Variables ***
6
7${cli_exec} docker exec cli onap
subhash kumar singh7ef73852017-09-20 19:57:34 +05308${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 singh729baad2017-09-06 19:58:29 +053020
21*** Test Cases ***
22Liveness Test
23 [Documentation] Check cli liveness check
24 Create Session cli http://${CLI_IP}:8080
25 CheckUrl cli /
26
subhash kumar singhe08b8372017-09-08 16:58:57 +053027Check Cli help
28 [Documentation] check cli help command
subhash kumar singh7ef73852017-09-20 19:57:34 +053029 ${cli_cmd_output}= Run Process ${cli_exec_cli_10_help} shell=yes
subhash kumar singhe08b8372017-09-08 16:58:57 +053030 Log ${cli_cmd_output.stdout}
31 Should Be Equal As Strings ${cli_cmd_output.rc} 0
Kanagaraj Manickam k0036510689b30052017-09-12 10:06:13 +053032 Should Contain ${cli_cmd_output.stdout} CLI version
subhash kumar singhe08b8372017-09-08 16:58:57 +053033
34Check Cli Version Default
35 [Documentation] check cli default version
subhash kumar singh7ef73852017-09-20 19:57:34 +053036 ${cli_cmd_output}= Run Process ${cli_exec_cli_10_version} shell=yes
subhash kumar singhe08b8372017-09-08 16:58:57 +053037 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
41Check Cli Scheam Refresh
42 [Documentation] check cli schema-refresh command
subhash kumar singh7ef73852017-09-20 19:57:34 +053043 ${cli_cmd_output}= Run Process ${cli_exec_cli_10_schema_refresh} shell=yes
subhash kumar singhe08b8372017-09-08 16:58:57 +053044 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
52Check Cli Schema Validate With Valid Path
53 [Documentation] check cli schema-validate command with valid path
subhash kumar singh7ef73852017-09-20 19:57:34 +053054 ${cli_cmd_output}= Run Process ${cli_exec_cli_10_schema_validate} shell=yes
subhash kumar singhe08b8372017-09-08 16:58:57 +053055 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
60Check Cli Scheam Validate With Invalid Path
61 [Documentation] check cli version
subhash kumar singh7ef73852017-09-20 19:57:34 +053062 ${cli_cmd_output}= Run Process ${cli_exec_cli_10_schema_validate_invalid} shell=yes
subhash kumar singhe08b8372017-09-08 16:58:57 +053063 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
67Check Cli Scheam Validate Empty Argument
68 [Documentation] check cli schema validate with empty argument
subhash kumar singh7ef73852017-09-20 19:57:34 +053069 ${cli_cmd_output}= Run Process ${cli_exec_cli_10_schema_validate_empty} shell=yes
subhash kumar singhe08b8372017-09-08 16:58:57 +053070 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 singh7ef73852017-09-20 19:57:34 +053074Check 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
80Check 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
86Check 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
92Check 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 singhe08b8372017-09-08 16:58:57 +053099
subhash kumar singh729baad2017-09-06 19:58:29 +0530100*** Keywords ***
101CheckUrl
102 [Arguments] ${session} ${path}
103 ${resp}= Get Request ${session} ${path}
104 Should Be Equal As Integers ${resp.status_code} 200