Disable SSE notifications 30/91830/13
authorLukas Baca <lbaca@luminanetworks.com>
Mon, 3 Aug 2020 18:06:07 +0000 (20:06 +0200)
committerJamo Luhrsen <jluhrsen@gmail.com>
Tue, 4 Aug 2020 20:16:50 +0000 (13:16 -0700)
By default in Aluminium, SSE (Server Side Events) are enabled
and websocket notfications are disabled. The existing CSIT
test cases expect websocket notifications to work. For now
we need to disable SSE to allow the test cases to pass with
websockets.

This will be a NOOP for Mg and Na, although the controller
restart is a small waste of time (~2min).

In the future, tests cases for SSE will be written and doing
this config change and restart in the suite setup will
probably not make sense.

JIRA: INTTEST-107

Signed-off-by: Lukas Baca <lbaca@luminanetworks.com>
Change-Id: I0dc87e2731927c2ec61c683d1a2f238e2b03e8d0
Signed-off-by: Lukas Baca <lbaca@luminanetworks.com>
csit/libraries/NetconfKeywords.robot
csit/suites/netconf/notifications/notifications_basic.robot

index 9beab46b99b2387128883f78302b5210fbc87210..d0b7238cddf5d87938846f93e5c4f88a948a887f 100644 (file)
@@ -33,6 +33,7 @@ ${BASE_NETCONF_DEVICE_PORT}    17830
 ${DEVICE_NAME_BASE}    netconf-scaling-device
 ${TESTTOOL_BOOT_TIMEOUT}    60s
 ${ENABLE_NETCONF_TEST_TIMEOUT}    ${ENABLE_GLOBAL_TEST_DEADLINES}
+${SSE_CFG_FILE}    ${WORKSPACE}/${BUNDLEFOLDER}/etc/org.opendaylight.restconf.nb.rfc8040.cfg
 
 *** Keywords ***
 Setup_NetconfKeywords
@@ -271,3 +272,25 @@ Perform_Operation_On_Each_Device
     ${deadline_Date}=    DateTime.Add_Time_To_Date    ${current_Date}    ${timeout}
     BuiltIn.Set_Suite_Variable    ${current_port}    ${BASE_NETCONF_DEVICE_PORT}
     BuiltIn.Repeat_Keyword    ${count} times    NetconfKeywords__Perform_Operation_With_Checking_On_Next_Device    ${operation}    ${deadline_Date}    log_response=${log_response}
+
+Disable SSE On Controller
+    [Arguments]    ${controller_ip}
+    [Documentation]    Sets the config for using SSE (Server Side Events) to false. Note that
+    ...    this keyword only changes the config. A controller restart is needed for the config to
+    ...    to take effect.
+    SSHLibrary.Open Connection    ${controller_ip}
+    Login With Public Key    ${ODL_SYSTEM_USER}    ${USER_HOME}/.ssh/${SSH_KEY}    any
+    ${cmd}=    Set Variable    echo "use-sse=false" > ${SSE_CFG_FILE}
+    SSHLibrary.Execute Command    ${cmd}
+    SSHLibrary.Close Connection
+
+Enable SSE On Controller
+    [Arguments]    ${controller_ip}
+    [Documentation]    Sets the config for using SSE (Server Side Events) to true. Note that
+    ...    this keyword only changes the config. A controller restart is needed for the config to
+    ...    to take effect.
+    SSHLibrary.Open Connection    ${controller_ip}
+    Login With Public Key    ${ODL_SYSTEM_USER}    ${USER_HOME}/.ssh/${SSH_KEY}    any
+    ${cmd}=    Set Variable    echo "use-sse=true" > ${SSE_CFG_FILE}
+    SSHLibrary.Execute Command    ${cmd}
+    SSHLibrary.Close Connection
index 6ebe1a88ae2077c472a5fbbe8e7349958353c2f5..0a1371641d9300a560937e2ac5a744123056a73d 100644 (file)
@@ -33,14 +33,16 @@ Library           OperatingSystem
 Library           RequestsLibrary
 Library           SSHLibrary    timeout=10s
 Library           XML
-Resource          ${CURDIR}/../../../variables/Variables.robot
+Resource          ${CURDIR}/../../../libraries/ClusterManagement.robot
 Resource          ${CURDIR}/../../../libraries/FailFast.robot
 Resource          ${CURDIR}/../../../libraries/KarafKeywords.robot
+Resource          ${CURDIR}/../../../libraries/NetconfKeywords.robot
 Resource          ${CURDIR}/../../../libraries/Restconf.robot
 Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
 Resource          ${CURDIR}/../../../libraries/SSHKeywords.robot
 Resource          ${CURDIR}/../../../libraries/TemplatedRequests.robot
 Resource          ${CURDIR}/../../../libraries/WaitForFailure.robot
+Resource          ${CURDIR}/../../../variables/Variables.robot
 
 *** Variables ***
 ${TEMPLATE_FOLDER}    ${CURDIR}/templates
@@ -160,6 +162,10 @@ Setup_Everything
     [Documentation]    SSH-login to mininet machine, create HTTP session,
     ...    prepare directories for responses, put Python tool to mininet machine, setup imported resources.
     SetupUtils.Setup_Utils_For_Setup_And_Teardown
+    Disable SSE On Controller    ${CONTROLLER}
+    ClusterManagement.Stop_Members_From_List_Or_All
+    ClusterManagement.Start_Members_From_List_Or_All
+    KarafKeywords.Open_Controller_Karaf_Console_On_Background
     TemplatedRequests.Create_Default_Session
     SSHLibrary.Set_Default_Configuration    prompt=${TOOLS_SYSTEM_PROMPT}
     SSHLibrary.Open_Connection    ${TOOLS_SYSTEM_IP}    alias=receiver