From 71e2956ec9bbbebb31c8b8644ca3ccdbbe477d10 Mon Sep 17 00:00:00 2001 From: Srinivas Rachakonda Date: Wed, 8 Jan 2020 11:45:17 +0530 Subject: [PATCH] NETVIRT-1599 Add support for group-add-mod-enabled param We have a flag group-add-mod-enabled in /etc/opendaylight/ datastore/initial/config/default-openflow-connection-config.xml which needs to be enabled for upgrade scripts. Once we wipe ODL data and then connect back the switch, this flag will enable the ONFT_BUNDLE_ADD_MESSAGE to be accepted by the openvswitch. Change-Id: Ie952d5ca5280fbe750495cd34dfbc065bc9c3e2f Signed-off-by: Srinivas Rachakonda --- csit/configplans/netvirt.txt | 3 +- csit/scripts/set_group_add_mod_enabled.sh | 28 ++++++++++++++ csit/suites/netvirt/upgrade/upgrade.robot | 46 ++++++++++++----------- 3 files changed, 54 insertions(+), 23 deletions(-) create mode 100644 csit/scripts/set_group_add_mod_enabled.sh diff --git a/csit/configplans/netvirt.txt b/csit/configplans/netvirt.txt index 107a0248da..c0c13fa395 100644 --- a/csit/configplans/netvirt.txt +++ b/csit/configplans/netvirt.txt @@ -2,8 +2,9 @@ integration/test/csit/scripts/set_sg_mode.sh integration/test/csit/scripts/set_federation_rabbit.sh integration/test/csit/scripts/set_snat_mode.sh +integration/test/csit/scripts/set_group_add_mod_enabled.sh integration/test/csit/scripts/disable_ofp_stats.sh integration/test/csit/scripts/set_itm_direct_tunnels.sh integration/test/csit/scripts/set_ovsdb_inactivity_probe.sh integration/test/csit/scripts/set_ovsdb_monitor.sh -integration/test/csit/scripts/dcgw-setup.sh +integration/test/csit/scripts/dcgw-setup.sh \ No newline at end of file diff --git a/csit/scripts/set_group_add_mod_enabled.sh b/csit/scripts/set_group_add_mod_enabled.sh new file mode 100644 index 0000000000..bf384c23b5 --- /dev/null +++ b/csit/scripts/set_group_add_mod_enabled.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +GROUP_ADD_MOD_ENABLED=${GROUP_ADD_MOD_ENABLED:-false} + +cat > ${WORKSPACE}/set_group_add_mod_enabled.sh <.*#${GROUP_ADD_MOD_ENABLED}#" /tmp/${BUNDLEFOLDER}/etc/opendaylight/datastore/initial/config/default-openflow-connection-config.xml + cat /tmp/${BUNDLEFOLDER}/etc/opendaylight/datastore/initial/config/default-openflow-connection-config.xml + +EOF + +echo "Copying config files to ODL Controller folder" +for i in `seq 1 ${NUM_ODL_SYSTEM}` +do + CONTROLLERIP=ODL_SYSTEM_${i}_IP + + echo "Setting group-add-mod-enabled mode to ${GROUP_ADD_MOD_ENABLED} on ${!CONTROLLERIP}" + scp ${WORKSPACE}/set_group_add_mod_enabled.sh ${!CONTROLLERIP}:/tmp/ + ssh ${!CONTROLLERIP} 'bash /tmp/set_group_add_mod_enabled.sh' + +done \ No newline at end of file diff --git a/csit/suites/netvirt/upgrade/upgrade.robot b/csit/suites/netvirt/upgrade/upgrade.robot index 6b307cf2a9..df375089fe 100644 --- a/csit/suites/netvirt/upgrade/upgrade.robot +++ b/csit/suites/netvirt/upgrade/upgrade.robot @@ -28,14 +28,15 @@ ${TYPE} tun ${PASSIVE_MANAGER} ptcp:6641:127.0.0.1 @{DEBUG_LOG_COMPONENTS} org.opendaylight.ovsdb org.opendaylight.ovsdb.lib org.opendaylight.netvirt org.opendaylight.genius ${UPDATE_FLAG_PATH} /restconf/config/odl-serviceutils-upgrade:upgrade-config +${GET_ACTIVE_BUNDLE_URI} /restconf/operations/arbitrator-reconcile:get-active-bundle ${COMMIT_ACTIVE_BUNDLE_URI} /restconf/operations/arbitrator-reconcile:commit-active-bundle ${COMMIT_ACTIVE_BUNDLE_DIR} ${CURDIR}/../../../variables/netvirt/commit_active_bundle +${SET_BUNDLE_TIMEOUT} sudo ovs-vsctl set O . other_config:bundle-idle-timeout=3600 *** Test Cases *** Create Setup And Verify Instance Connectivity [Documentation] Create 2 VXLAN networks, subnets with 2 VMs each and a router. Ping all 4 VMs. Check Resource Connectivity - Dump Debug With Annotations POST_SETUP Stop ODL ClusterManagement.Stop_Members_From_List_Or_All @@ -47,6 +48,7 @@ Disconnect OVS OVSDB.Delete OVS Controller ${node} OVSDB.Delete Groups On Bridge ${node} ${INTEGRATION_BRIDGE} OVSDB.Delete Ports On Bridge By Type ${node} ${INTEGRATION_BRIDGE} ${TYPE} + Utils.Run Command On Remote System ${node} ${SET_BUNDLE_TIMEOUT} END Wipe Local Data @@ -68,20 +70,21 @@ Wait For Full Sync Set Upgrade Flag ${resp} = RequestsLibrary.Put Request session ${UPDATE_FLAG_PATH} {"upgrade-config":{"upgradeInProgress":true}} BuiltIn.Should Be Equal As Strings ${resp.status_code} 200 + +Set OVS Manager And Controller + [Documentation] Set controller and manager on each OpenStack node and check that egress flows are present + FOR ${node} IN @{OS_ALL_IPS} + Utils.Run Command On Remote System And Log ${node} sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:${OVSDBPORT} ${PASSIVE_MANAGER} + END + Wait Until Keyword Succeeds 60s 10s Verify Bundle Active State FOR ${node} IN @{OS_ALL_IPS} ${dpnid} = OVSDB.Get DPID ${node} + ${dpnid} = BuiltIn.Convert To String ${dpnid} ${body} = OperatingSystem.Get File ${COMMIT_ACTIVE_BUNDLE_DIR}/data.json ${body} = Replace String ${body} DPNID ${dpnid} ${resp} = RequestsLibrary.Post Request session ${COMMIT_ACTIVE_BUNDLE_URI} data=${body} - BuiltIn.Log ${resp.content} BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} END - -Set OVS Manager And Controller - [Documentation] Set controller and manager on each OpenStack node and check that egress flows are present - FOR ${node} IN @{OS_ALL_IPS} - Utils.Run Command On Remote System And Log ${node} sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:${OVSDBPORT} ${PASSIVE_MANAGER} - END Wait Until Keyword Succeeds 180s 15s Check OVS Nodes Have Egress Flows UnSet Upgrade Flag @@ -91,7 +94,6 @@ UnSet Upgrade Flag Check Connectivity With Previously Created Resources And br-int Info [Documentation] Check that pre-existing instance connectivity still works after the new controller is brought ... up and config is sync'd - Dump Debug With Annotations POST_UPGRADE Wait Until Keyword Succeeds 90s 10s Check Resource Connectivity *** Keywords *** @@ -157,22 +159,22 @@ Set Custom Component Logging To SetupUtils.Setup_Logging_For_Debug_Purposes_On_List_Or_All ${level} ${DEBUG_LOG_COMPONENTS} KarafKeywords.Issue_Command_On_Karaf_Console log:list -Dump Debug With Annotations - [Arguments] ${tag} - [Documentation] Dump tons of debug logs for each OS node but also emit tags to make parsing easier - Builtin.Log Start dumping at phase ${tag} - FOR ${node} IN @{OS_ALL_IPS} - ${conn_id} = DevstackUtils.Open Connection ${node}_CONNECTION_NAME ${node} - Builtin.Log Start dumping for ${node} at phase ${tag} - OpenStackOperations.Get DumpFlows And Ovsconfig ${conn_id} - Builtin.Log End dumping for ${node} at phase ${tag} - SSHLibrary.Close Connection - END - Builtin.Log End dumping at phase ${tag} - Canary Network Should Exist OpenStackOperations.Get Neutron Network Rest bd8db3a8-2b30-4083-a8b3-b3fd46401142 Upgrade Suite Teardown Set Custom Component Logging To INFO OpenStackOperations.OpenStack Suite Teardown + +Verify Bundle Active State + [Documentation] Verify if the bundle is active for the node. + FOR ${node} IN @{OS_ALL_IPS} + ${dpnid} = OVSDB.Get DPID ${node} + ${dpnid} = BuiltIn.Convert To String ${dpnid} + ${body} = OperatingSystem.Get File ${COMMIT_ACTIVE_BUNDLE_DIR}/data.json + ${body} = Replace String ${body} DPNID ${dpnid} + ${resp} = RequestsLibrary.Post Request session ${GET_ACTIVE_BUNDLE_URI} data=${body} + BuiltIn.Log ${resp.content} + BuiltIn.Should Contain ${resp.content} "result": + BuiltIn.Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} + END -- 2.36.6