From d6d5a285f1d9e5fac99cb55b2df25558b1633ca1 Mon Sep 17 00:00:00 2001 From: Lukas Baca Date: Mon, 3 Aug 2020 20:06:07 +0200 Subject: [PATCH] Disable SSE notifications 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 Change-Id: I0dc87e2731927c2ec61c683d1a2f238e2b03e8d0 Signed-off-by: Lukas Baca --- csit/libraries/NetconfKeywords.robot | 23 +++++++++++++++++++ .../notifications/notifications_basic.robot | 8 ++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/csit/libraries/NetconfKeywords.robot b/csit/libraries/NetconfKeywords.robot index 9beab46b99..d0b7238cdd 100644 --- a/csit/libraries/NetconfKeywords.robot +++ b/csit/libraries/NetconfKeywords.robot @@ -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 diff --git a/csit/suites/netconf/notifications/notifications_basic.robot b/csit/suites/netconf/notifications/notifications_basic.robot index 6ebe1a88ae..0a1371641d 100644 --- a/csit/suites/netconf/notifications/notifications_basic.robot +++ b/csit/suites/netconf/notifications/notifications_basic.robot @@ -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 -- 2.36.6