blob: a104670783b61a395d6471bf491996bd16abd695 [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
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 singh729baad2017-09-06 19:58:29 +053011
12*** Test Cases ***
13Liveness Test
14 [Documentation] Check cli liveness check
15 Create Session cli http://${CLI_IP}:8080
16 CheckUrl cli /
17
subhash kumar singhe08b8372017-09-08 16:58:57 +053018Check 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
25Check 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
32Check 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
43Check 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
51Check 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
58Check 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 singh729baad2017-09-06 19:58:29 +053066*** Keywords ***
67CheckUrl
68 [Arguments] ${session} ${path}
69 ${resp}= Get Request ${session} ${path}
70 Should Be Equal As Integers ${resp.status_code} 200