Remove false positive tests 14/69714/6
authorStanislav Chlebec <stanislav.chlebec@pantheon.tech>
Wed, 3 Oct 2018 06:45:16 +0000 (08:45 +0200)
committerStanislav Chlebec <stanislav.chlebec@pantheon.tech>
Wed, 3 Oct 2018 14:47:39 +0000 (16:47 +0200)
Originally abandoned by author Matej Klotton - original Change-Id: I7030428ce113baeafbde205bcb90c85c9d56daf9.

Change-Id: I6f6eeaa49965b96c58d5012b8a5625bc42573693
Signed-off-by: Stanislav Chlebec <stanislav.chlebec@pantheon.tech>
Issue-ID: APPC-1204
Signed-off-by: Stanislav Chlebec <stanislav.chlebec@pantheon.tech>
plans/appc/healthcheck/health_check.sh
tests/appc/healthcheck/APPC_GLOBAL_KEYWORDS.robot [moved from tests/appc/healthcheck/gettime.robot with 57% similarity]
tests/appc/healthcheck/APPC_GLOBAL_VARIABLES.robot
tests/appc/healthcheck/APPC_Netstat.robot
tests/appc/healthcheck/LCM_HEALTHCHECK_TIMESTAMP.robot
tests/appc/healthcheck/LCM_VM_RESTART_TIMESTAMP.robot
tests/appc/healthcheck/LCM_VNF_RESTART_TIMESTAMP.robot

index 775188f..63e0b17 100755 (executable)
@@ -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.
similarity index 57%
rename from tests/appc/healthcheck/gettime.robot
rename to tests/appc/healthcheck/APPC_GLOBAL_KEYWORDS.robot
index 9f376f9..d59fefa 100644 (file)
@@ -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
index b869434..9b39922 100644 (file)
@@ -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
index 285fc37..200a496 100644 (file)
@@ -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
index 1cea75e..8c75add 100644 (file)
@@ -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
index 7968d55..f49af46 100644 (file)
@@ -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
index 93c72d7..ed85d4a 100644 (file)
@@ -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