diff options
author | Gary Wu <gary.i.wu@huawei.com> | 2018-10-03 16:49:10 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-10-03 16:49:10 +0000 |
commit | 4140bb0ed38567e535b967d47daad4a64ba8c139 (patch) | |
tree | fd084b0367698b07a48227acb1f980e5c031f4f5 | |
parent | e83384b37acfb0e2ce132f09766f5294e0c59cd5 (diff) | |
parent | 050ef547a66e77c61b268528fc36b986a85acea6 (diff) |
Merge "Remove false positive tests"
-rwxr-xr-x | plans/appc/healthcheck/health_check.sh | 2 | ||||
-rw-r--r-- | tests/appc/healthcheck/APPC_GLOBAL_KEYWORDS.robot (renamed from tests/appc/healthcheck/gettime.robot) | 27 | ||||
-rw-r--r-- | tests/appc/healthcheck/APPC_GLOBAL_VARIABLES.robot | 9 | ||||
-rw-r--r-- | tests/appc/healthcheck/APPC_Netstat.robot | 5 | ||||
-rw-r--r-- | tests/appc/healthcheck/LCM_HEALTHCHECK_TIMESTAMP.robot | 78 | ||||
-rw-r--r-- | tests/appc/healthcheck/LCM_VM_RESTART_TIMESTAMP.robot | 64 | ||||
-rw-r--r-- | tests/appc/healthcheck/LCM_VNF_RESTART_TIMESTAMP.robot | 72 |
7 files changed, 114 insertions, 143 deletions
diff --git a/plans/appc/healthcheck/health_check.sh b/plans/appc/healthcheck/health_check.sh index 775188f6..63e0b17a 100755 --- a/plans/appc/healthcheck/health_check.sh +++ b/plans/appc/healthcheck/health_check.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash ############################################################################### -# Copyright 2018 AT&T +# Copyright 2017 Huawei Technologies Co., Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/appc/healthcheck/gettime.robot b/tests/appc/healthcheck/APPC_GLOBAL_KEYWORDS.robot index 9f376f9b..d59fefa8 100644 --- a/tests/appc/healthcheck/gettime.robot +++ b/tests/appc/healthcheck/APPC_GLOBAL_KEYWORDS.robot @@ -3,12 +3,10 @@ Library Selenium2Library Library OperatingSystem Library DateTime Library String -##Library HttpLibrary.HTTP Library Collections *** Keywords *** - Get Server time [Documentation] Getting server time to update the json request [Arguments] ${RequestFile} @@ -16,10 +14,10 @@ Get Server time ${date}= Get Current Date time_zone=local result_format=%Y-%m-%dT%H:%M:%S.%fZ exclude_millis=False #updating the request file with the server time - ${file_content}= OperatingSystem.Get File ${RequestFile} - @{list}= Split to lines ${file_content} - ${data}= Get from list ${list} 5 - @{splitted_string}= Split String ${data} : 1 + ${file_content}= Get File ${RequestFile} + @{list}= Split to lines ${file_content} + ${data}= Get from list ${list} 5 + @{splitted_string}= Split String ${data} : 1 ${time}= Get From List ${splitted_string} 1 Log ${time} @{splitted_string_time}= Split String ${time} " 2 @@ -27,14 +25,9 @@ Get Server time Log ${times1} ${replaced_string}= Replace String ${data} ${times1} ${date} @{list1}= Split to lines ${file_content} - Remove from list ${list1} 5 - Insert into list ${list1} 5 ${replaced_string} - Remove File ${RequestFile} - :FOR ${line} IN @{list1} - \ Append to File ${RequestFile} ${line} encoding=UTF-8 - \ Append to File ${RequestFile} ${\n} encoding=UTF-8 - - - - -
\ No newline at end of file + Remove from list ${list1} 5 + Insert into list ${list1} 5 ${replaced_string} + Remove File ${RequestFile} + :FOR ${line} IN @{list1} + \ Append to File ${RequestFile} ${line} encoding=UTF-8 + \ Append to File ${RequestFile} ${\n} encoding=UTF-8 diff --git a/tests/appc/healthcheck/APPC_GLOBAL_VARIABLES.robot b/tests/appc/healthcheck/APPC_GLOBAL_VARIABLES.robot index b869434f..9b399228 100644 --- a/tests/appc/healthcheck/APPC_GLOBAL_VARIABLES.robot +++ b/tests/appc/healthcheck/APPC_GLOBAL_VARIABLES.robot @@ -5,6 +5,9 @@ Documentation store all properties that can change or are used in multipl *** Variables *** -${GLOBAL_VNF_RESTART_REQUESTFILE} ${CURDIR}/LCM_VNF_RESTART_REQUEST.txt -${GLOBAL_VM_RESTART_REQUESTFILE} ${CURDIR}/LCM_VM_RESTART_REQUEST.txt -${GLOBAL_HEALTHCHECK_REQUESTFILE} ${CURDIR}/LCM_VM_HEALTHCHECK_REQUEST.txt
\ No newline at end of file +#${GLOBAL_VNF_RESTART_REQUESTFILE} ${CURDIR}/LCM_VNF_RESTART_REQUEST.txt +#${GLOBAL_VM_RESTART_REQUESTFILE} ${CURDIR}/LCM_VM_RESTART_REQUEST.txt +#${GLOBAL_HEALTHCHECK_REQUESTFILE} ${CURDIR}/LCM_VM_HEALTHCHECK_REQUEST.txt +${GLOBAL_APPC_ADMIN_USER} admin +${GLOBAL_APPC_ADMIN_PASS} Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U +# to try to fire up the test again because the first one was failure in 90 minutes diff --git a/tests/appc/healthcheck/APPC_Netstat.robot b/tests/appc/healthcheck/APPC_Netstat.robot index 285fc372..200a4966 100644 --- a/tests/appc/healthcheck/APPC_Netstat.robot +++ b/tests/appc/healthcheck/APPC_Netstat.robot @@ -1,8 +1,11 @@ *** Settings *** Library OperatingSystem +Library String *** Test Cases *** APPC Netstat [Documentation] Checking the active ports - ${output}= Run netstat -a | grep -E 8282 | grep LISTEN + ${output}= Run netstat -a | grep -E ":8282 " | grep LISTEN Log To Console ${output} + ${line_count}= Get Line Count ${output} + Should Be Equal As Strings ${line_count} 1 diff --git a/tests/appc/healthcheck/LCM_HEALTHCHECK_TIMESTAMP.robot b/tests/appc/healthcheck/LCM_HEALTHCHECK_TIMESTAMP.robot index 1cea75e9..8c75addc 100644 --- a/tests/appc/healthcheck/LCM_HEALTHCHECK_TIMESTAMP.robot +++ b/tests/appc/healthcheck/LCM_HEALTHCHECK_TIMESTAMP.robot @@ -1,52 +1,42 @@ *** Settings *** Library Selenium2Library -Library OperatingSystem Library XvfbRobot -Resource APPC_GLOBAL_VARIABLES.robot -Resource gettime.robot +Resource ${CURDIR}/APPC_GLOBAL_VARIABLES.robot +Resource ${CURDIR}/APPC_GLOBAL_KEYWORDS.robot -*** Variable *** -${ResponseCode} -${var} *** Test Cases *** - APPC LCM API HEALTHCHECK - [Documentation] APPC LCM API HEALTHCHECK - Start Virtual Display 1920 1080 - Open Browser http://admin:Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U@localhost:8282/apidoc/explorer/index.html chrome -# Maximize Browser Window -# Click Element xpath=.//p[contains(text(),'If you have reason to expect the website is safe, select the I Accept the Risk button to continue.')]//following::img - - Reload Page - -# Wait Until Page Contains Element xpath=.//*[contains(text(),'appc-provider-lcm(2016-01-08)')] - -# Set Selenium Speed 60 -# Click Element xpath=.//*[contains(text(),'appc-provider-lcm(2016-01-08)')] - - -# wait until page contains element xpath=//*[@id="resource_appc-provider-lcm(2016-01-08)"]/div/h2/a//following::a[contains(text(),'/operations/appc-provider-lcm:health-check')] -# Set Selenium Speed 60 -# Click link xpath=.//*[contains(text(),'appc-provider-lcm(2016-01-08)')]/following::li[5]/ul/li/div[1]/h3/span[2]/a -# Click Element xpath=//*[@id="appc-provider-lcm(2016-01-08)_health_check_post_0"]/div[1]/h3/span[2]/a - -# Get Server time ${GLOBAL_HEALTHCHECK_REQUESTFILE} -# ${file_content}= OperatingSystem.Get File ${GLOBAL_HEALTHCHECK_REQUESTFILE} + [Documentation] APPC LCM API HEALTHCHECK + [Teardown] Close All Browsers + Start Virtual Display 1920 1080 + Open Browser http://${GLOBAL_APPC_ADMIN_USER}:${GLOBAL_APPC_ADMIN_PASS}@localhost:8282/apidoc/explorer/index.html chrome + Set Window Size 1920 1080 +# Click Element xpath=.//p[contains(text(),'If you have reason to expect the website is safe, select the I Accept the Risk button to continue.')]//following::img + + Reload Page + +# Wait Until Page Contains Element xpath=.//*[contains(text(),'appc-provider-lcm(2016-01-08)')] + +# Set Selenium Speed 60 +# Click Element xpath=.//*[contains(text(),'appc-provider-lcm(2016-01-08)')] + +# wait until page contains element xpath=//*[@id="resource_appc-provider-lcm(2016-01-08)"]/div/h2/a//following::a[contains(text(),'/operations/appc-provider-lcm:health-check')] +# Set Selenium Speed 60 +# Click link xpath=.//*[contains(text(),'appc-provider-lcm(2016-01-08)')]/following::li[5]/ul/li/div[1]/h3/span[2]/a +# Click Element xpath=//*[@id="appc-provider-lcm(2016-01-08)_health_check_post_0"]/div[1]/h3/span[2]/a + +# Get Server time ${GLOBAL_HEALTHCHECK_REQUESTFILE} +# ${file_content}= OperatingSystem.Get File ${GLOBAL_HEALTHCHECK_REQUESTFILE} -# wait until page contains element xpath=//*[@id="resource_appc-provider-lcm(2016-01-08)"]/div/h2/a//following::a[contains(text(),'/operations/appc-provider-lcm:health-check')]//following::table -# Set Selenium Speed 90 -# Input Text xpath=(.//*[contains(text(),'(health-check)input-TOP')])[1]/following::textarea[1] ${file_content} -# Input Text xpath=//*[@id="resource_appc-provider-lcm(2016-01-08)"]/div/h2/a//following::a[contains(text(),'/operations/appc-provider-lcm:health-check')]//following::table//tbody/tr/td[2]/textarea ${file_content} - -# wait until page contains element xpath=//*[@id="resource_appc-provider-lcm(2016-01-08)"]/div/h2/a//following::a[contains(text(),'/operations/appc-provider-lcm:health-check')]//following::form/div[2]/input[1] -# Set Selenium Speed 90 -# Click Element xpath=//*[@id="appc-provider-lcm(2016-01-08)_health_check_post_0_content"]/form/div[2]/input - -## ${var}= Get Value xpath= //*[@id="appc-provider-lcm(2016-01-08)_health_check_post_0_content"]/div[2]/div[3]/pre -## Element Text Should Be xpath=//*[@id="appc-provider-lcm(2016-01-08)_health_check_post_0_content"]/div[2]/div[3]/pre[1][text()='200'] 200 expected - -Tear Down - - [Documentation] Close all browsers - Close All Browsers +# wait until page contains element xpath=//*[@id="resource_appc-provider-lcm(2016-01-08)"]/div/h2/a//following::a[contains(text(),'/operations/appc-provider-lcm:health-check')]//following::table +# Set Selenium Speed 90 +# Input Text xpath=(.//*[contains(text(),'(health-check)input-TOP')])[1]/following::textarea[1] ${file_content} +# Input Text xpath=//*[@id="resource_appc-provider-lcm(2016-01-08)"]/div/h2/a//following::a[contains(text(),'/operations/appc-provider-lcm:health-check')]//following::table//tbody/tr/td[2]/textarea ${file_content} + +# wait until page contains element xpath=//*[@id="resource_appc-provider-lcm(2016-01-08)"]/div/h2/a//following::a[contains(text(),'/operations/appc-provider-lcm:health-check')]//following::form/div[2]/input[1] +# Set Selenium Speed 90 +# Click Element xpath=//*[@id="appc-provider-lcm(2016-01-08)_health_check_post_0_content"]/form/div[2]/input + +## ${var}= Get Value xpath= //*[@id="appc-provider-lcm(2016-01-08)_health_check_post_0_content"]/div[2]/div[3]/pre +## Element Text Should Be xpath=//*[@id="appc-provider-lcm(2016-01-08)_health_check_post_0_content"]/div[2]/div[3]/pre[1][text()='200'] 200 expected diff --git a/tests/appc/healthcheck/LCM_VM_RESTART_TIMESTAMP.robot b/tests/appc/healthcheck/LCM_VM_RESTART_TIMESTAMP.robot index 7968d552..f49af460 100644 --- a/tests/appc/healthcheck/LCM_VM_RESTART_TIMESTAMP.robot +++ b/tests/appc/healthcheck/LCM_VM_RESTART_TIMESTAMP.robot @@ -1,47 +1,39 @@ *** Settings *** Library Selenium2Library -Library OperatingSystem -Library XvfbRobot -Resource APPC_GLOBAL_VARIABLES.robot -Resource gettime.robot +Library XvfbRobot +Resource ${CURDIR}/APPC_GLOBAL_VARIABLES.robot +Resource ${CURDIR}/APPC_GLOBAL_KEYWORDS.robot -*** Variable *** -${ResponseCode} -${var} *** Test Cases *** APPC LCM API VM RESTART - [Documentation] APPC LCM API VM RESTART - Start Virtual Display 1920 1080 - Open Browser http://admin:Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U@localhost:8282/apidoc/explorer/index.html chrome -# Maximize Browser Window -# Click Element xpath=.//p[contains(text(),'If you have reason to expect the website is safe, select the I Accept the Risk button to continue.')]//following::img - - Reload Page - -# Wait Until Page Contains Element xpath=//*[@id="resource_appc-provider-lcm(2016-01-08)"]/div/h2/a -# Set Selenium Speed 60 -# Click Element xpath=.//*[contains(text(),'appc-provider-lcm(2016-01-08)')] - -# Wait Until Page Contains Element xpath=//*[@id="resource_appc-provider-lcm(2016-01-08)"]/div/h2/a//following::a[contains(text(),'/operations/appc-provider-lcm:restart')] -# Set Selenium Speed 60 -# Click Element xpath=.//*[contains(text(),'appc-provider-lcm:restart')] - + [Documentation] APPC LCM API VM RESTART + [Teardown] Close All Browsers + Start Virtual Display 1920 1080 + Open Browser http://${GLOBAL_APPC_ADMIN_USER}:${GLOBAL_APPC_ADMIN_PASS}@localhost:8282/apidoc/explorer/index.html chrome + Set Window Size 1920 1080 +# Click Element xpath=.//p[contains(text(),'If you have reason to expect the website is safe, select the I Accept the Risk button to continue.')]//following::img + + Reload Page + +# Wait Until Page Contains Element xpath=//*[@id="resource_appc-provider-lcm(2016-01-08)"]/div/h2/a +# Set Selenium Speed 60 +# Click Element xpath=.//*[contains(text(),'appc-provider-lcm(2016-01-08)')] + +# Wait Until Page Contains Element xpath=//*[@id="resource_appc-provider-lcm(2016-01-08)"]/div/h2/a//following::a[contains(text(),'/operations/appc-provider-lcm:restart')] +# Set Selenium Speed 60 +# Click Element xpath=.//*[contains(text(),'appc-provider-lcm:restart')] + # Get Server time ${GLOBAL_VM_RESTART_REQUESTFILE} # ${file_content}= OperatingSystem.Get File ${GLOBAL_VM_RESTART_REQUESTFILE} # Wait Until Page Contains Element xpath=//td[contains(text(), '(restart)input-TOP')]//following::textarea[@name='(restart)input-TOP'][3] -# Set Selenium Speed 90 -# Input Text xpath=(.//*[contains(text(),'(restart)input-TOP')])[5]/following::textarea[1] ${file_content} -# Input Text xpath= //td[contains(text(), '(restart)input-TOP')]//following::textarea[@name='(restart)input-TOP'][3] ${file_content} - -# Click Element xpath=//*[@id="resource_appc-provider-lcm(2016-01-08)"]/div/h2/a//following::a[contains(text(),'/operations/appc-provider-lcm:restart')]//following::form/div[2]/input[1] - -# ${var}= Get Value xpath=//*[@id="resource_appc-provider-lcm(2016-01-08)"]/div/h2/a//following::a[contains(text(),'/operations/appc-provider-lcm:restart')]//following::h4[contains(text(),'Response Code')][1]//following-sibling::div//pre -# Element Text Should Be xpath=//*[contains(text(),'/operations/appc-provider-lcm:restart')]//following::h4[text()='Response Code'][1]//following-sibling::div//pre[1][text()='200'] 200 expected - - -Tear Down - [Documentation] Close all browsers - Close All Browsers +# Set Selenium Speed 90 +# Input Text xpath=(.//*[contains(text(),'(restart)input-TOP')])[5]/following::textarea[1] ${file_content} +# Input Text xpath= //td[contains(text(), '(restart)input-TOP')]//following::textarea[@name='(restart)input-TOP'][3] ${file_content} + +# Click Element xpath=//*[@id="resource_appc-provider-lcm(2016-01-08)"]/div/h2/a//following::a[contains(text(),'/operations/appc-provider-lcm:restart')]//following::form/div[2]/input[1] + +# ${var}= Get Value xpath=//*[@id="resource_appc-provider-lcm(2016-01-08)"]/div/h2/a//following::a[contains(text(),'/operations/appc-provider-lcm:restart')]//following::h4[contains(text(),'Response Code')][1]//following-sibling::div//pre +# Element Text Should Be xpath=//*[contains(text(),'/operations/appc-provider-lcm:restart')]//following::h4[text()='Response Code'][1]//following-sibling::div//pre[1][text()='200'] 200 expected diff --git a/tests/appc/healthcheck/LCM_VNF_RESTART_TIMESTAMP.robot b/tests/appc/healthcheck/LCM_VNF_RESTART_TIMESTAMP.robot index 93c72d72..ed85d4a1 100644 --- a/tests/appc/healthcheck/LCM_VNF_RESTART_TIMESTAMP.robot +++ b/tests/appc/healthcheck/LCM_VNF_RESTART_TIMESTAMP.robot @@ -1,50 +1,40 @@ *** Settings *** Library Selenium2Library -Library OperatingSystem -Library XvfbRobot +Library XvfbRobot Resource ${CURDIR}/APPC_GLOBAL_VARIABLES.robot -Resource ${CURDIR}/gettime.robot +Resource ${CURDIR}/APPC_GLOBAL_KEYWORDS.robot - -*** Variable *** -${ResponseCode} -${var} - *** Test Cases *** - APPC LCM API VNF RESTART - [Documentation] APPC LCM API VNF RESTART - Start Virtual Display 1920 1080 - Open Browser http://admin:Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U@localhost:8282/apidoc/explorer/index.html chrome -# Maximize Browser Window -# Click Element xpath=.//p[contains(text(),'If you have reason to expect the website is safe, select the I Accept the Risk button to continue.')]//following::img - - Reload Page - -# Wait Until Page Contains Element xpath=//*[@id="resource_appc-provider-lcm(2016-01-08)"]/div/h2/a -# Set Selenium Speed 60 -# Click Element xpath=.//*[contains(text(),'appc-provider-lcm(2016-01-08)')] - - -# Wait Until Page Contains Element xpath=//*[@id="resource_appc-provider-lcm(2016-01-08)"]/div/h2/a//following::a[contains(text(),'/operations/appc-provider-lcm:restart')] -# Set Selenium Speed 60 -# Click Element xpath=.//*[contains(text(),'appc-provider-lcm:restart')] - -# Get Server time ${GLOBAL_VNF_RESTART_REQUESTFILE} -# ${file_content}= OperatingSystem.Get File ${GLOBAL_VNF_RESTART_REQUESTFILE} + [Documentation] APPC LCM API VNF RESTART + [Teardown] Close All Browsers +# Set the timeout because Open Browser ended with timeout... + Set Selenium Timeout 5 seconds + Start Virtual Display 1920 1080 + Open Browser http://${GLOBAL_APPC_ADMIN_USER}:${GLOBAL_APPC_ADMIN_PASS}@localhost:8282/apidoc/explorer/index.html chrome + Set Window Size 1920 1080 +# Click Element xpath=.//p[contains(text(),'If you have reason to expect the website is safe, select the I Accept the Risk button to continue.')]//following::img + + Reload Page + +# Wait Until Page Contains Element xpath=//*[@id="resource_appc-provider-lcm(2016-01-08)"]/div/h2/a +# Set Selenium Speed 60 +# Click Element xpath=.//*[contains(text(),'appc-provider-lcm(2016-01-08)')] + +# Wait Until Page Contains Element xpath=//*[@id="resource_appc-provider-lcm(2016-01-08)"]/div/h2/a//following::a[contains(text(),'/operations/appc-provider-lcm:restart')] +# Set Selenium Speed 60 +# Click Element xpath=.//*[contains(text(),'appc-provider-lcm:restart')] + +# Get Server time ${GLOBAL_VNF_RESTART_REQUESTFILE} +# ${file_content}= OperatingSystem.Get File ${GLOBAL_VNF_RESTART_REQUESTFILE} # Wait Until Page Contains Element xpath=//td[contains(text(), '(restart)input-TOP')]//following::textarea[@name='(restart)input-TOP'][3] -# Set Selenium Speed 90 -# Input Text xpath=(.//*[contains(text(),'(restart)input-TOP')])[5]/following::textarea[1] ${file_content} -# Click Element xpath=//*[@id="resource_appc-provider-lcm(2016-01-08)"]/div/h2/a//following::a[contains(text(),'/operations/appc-provider-lcm:restart')]//following::form/div[2]/input[1] - -# Input Text xpath= //td[contains(text(), '(restart)input-TOP')]//following::textarea[@name='(restart)input-TOP'][3] ${file_content} - -# ${var}= Get Value xpath=//*[@id="resource_appc-provider-lcm(2016-01-08)"]/div/h2/a//following::a[contains(text(),'/operations/appc-provider-lcm:restart')]//following::h4[contains(text(),'Response Code')][1]//following-sibling::div//pre -# Element Text Should Be xpath=//*[contains(text(),'/operations/appc-provider-lcm:restart')]//following::h4[text()='Response Code'][1]//following-sibling::div//pre[1][text()='200'] 200 expected - - -Tear Down - [Documentation] Close all browsers - Close All Browsers +# Set Selenium Speed 90 +# Input Text xpath=(.//*[contains(text(),'(restart)input-TOP')])[5]/following::textarea[1] ${file_content} +# Click Element xpath=//*[@id="resource_appc-provider-lcm(2016-01-08)"]/div/h2/a//following::a[contains(text(),'/operations/appc-provider-lcm:restart')]//following::form/div[2]/input[1] + +# Input Text xpath= //td[contains(text(), '(restart)input-TOP')]//following::textarea[@name='(restart)input-TOP'][3] ${file_content} + +# ${var}= Get Value xpath=//*[@id="resource_appc-provider-lcm(2016-01-08)"]/div/h2/a//following::a[contains(text(),'/operations/appc-provider-lcm:restart')]//following::h4[contains(text(),'Response Code')][1]//following-sibling::div//pre +# Element Text Should Be xpath=//*[contains(text(),'/operations/appc-provider-lcm:restart')]//following::h4[text()='Response Code'][1]//following-sibling::div//pre[1][text()='200'] 200 expected |