summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGary Wu <gary.i.wu@huawei.com>2017-09-08 17:07:54 +0000
committerGerrit Code Review <gerrit@onap.org>2017-09-08 17:07:54 +0000
commite2662f5aa9decbd10b8918816fc4cff30118d04f (patch)
tree22e29d527111e536eabc7d02b5d1e916571ec7e6
parentbb44d551e24086117cc4f311e55d26d2dae34118 (diff)
parente08b837f99b490d1a0f935e83694945b5947b494 (diff)
Merge "CSIT test case for CLI project"
-rw-r--r--test/csit/tests/cli/startup/startup_check.robot58
1 files changed, 56 insertions, 2 deletions
diff --git a/test/csit/tests/cli/startup/startup_check.robot b/test/csit/tests/cli/startup/startup_check.robot
index c79da34ba..a10467078 100644
--- a/test/csit/tests/cli/startup/startup_check.robot
+++ b/test/csit/tests/cli/startup/startup_check.robot
@@ -1,5 +1,13 @@
*** Settings ***
Library RequestsLibrary
+Library Process
+
+*** Variables ***
+
+${cli_exec} docker exec cli onap
+${cli_exec_onap_11} docker exec -e CLI_PRODUCT_VERSION=onap-1.1 onap
+${cli_exec_onap_10} docker exec -e CLI_PRODUCT_VERSION=onap-1.0 onap
+${cli_exec_cli_10} docker exec -e CLI_PRODUCT_VERSION=cli-1.0 onap
*** Test Cases ***
Liveness Test
@@ -7,10 +15,56 @@ Liveness Test
Create Session cli http://${CLI_IP}:8080
CheckUrl cli /
+Check Cli help
+ [Documentation] check cli help command
+ ${cli_cmd_output}= Run Process ${cli_exec} --help shell=yes
+ Log ${cli_cmd_output.stdout}
+ Should Be Equal As Strings ${cli_cmd_output.rc} 0
+ Should Contain ${cli_cmd_output.stdout} ONAP Command-line interface
+
+Check Cli Version Default
+ [Documentation] check cli default version
+ ${cli_cmd_output}= Run Process ${cli_exec} --version shell=yes
+ Log ${cli_cmd_output.stdout}
+ Should Be Equal As Strings ${cli_cmd_output.rc} 0
+ Should Contain ${cli_cmd_output.stdout} : cli-1.0
+
+Check Cli Scheam Refresh
+ [Documentation] check cli schema-refresh command
+ ${cli_cmd_output}= Run Process ${cli_exec} schema-refresh shell=yes
+ Log ${cli_cmd_output.stdout}
+ Should Be Equal As Strings ${cli_cmd_output.rc} 0
+ Should Contain ${cli_cmd_output.stdout} sl-no
+ Should Contain ${cli_cmd_output.stdout} command
+ Should Contain ${cli_cmd_output.stdout} product-version
+ Should Contain ${cli_cmd_output.stdout} schema
+ Should Contain ${cli_cmd_output.stdout} version
+
+Check Cli Schema Validate With Valid Path
+ [Documentation] check cli schema-validate command with valid path
+ ${cli_cmd_output}= Run Process ${cli_exec} schema-validate -i -l schema-refresh.yaml shell=yes
+ Log ${cli_cmd_output.stdout}
+ Should Be Equal As Strings ${cli_cmd_output.rc} 0
+ Should Contain ${cli_cmd_output.stdout} sl-no
+ Should Contain ${cli_cmd_output.stdout} error
+
+Check Cli Scheam Validate With Invalid Path
+ [Documentation] check cli version
+ ${cli_cmd_output}= Run Process ${cli_exec} schema-validate -i -l invalid-yaml-path.yaml shell=yes
+ Log ${cli_cmd_output.stdout}
+ Should Be Equal As Strings ${cli_cmd_output.rc} 1
+ Should Contain ${cli_cmd_output.stdout} 0x0007
+
+Check Cli Scheam Validate Empty Argument
+ [Documentation] check cli schema validate with empty argument
+ ${cli_cmd_output}= Run Process ${cli_exec} schema-validate shell=yes
+ Log ${cli_cmd_output.stdout}
+ Should Be Equal As Strings ${cli_cmd_output.rc} 1
+ Should Contain ${cli_cmd_output.stdout} 0x0015
+
+
*** Keywords ***
CheckUrl
[Arguments] ${session} ${path}
${resp}= Get Request ${session} ${path}
Should Be Equal As Integers ${resp.status_code} 200
-
-