From 94651ca9711d8eb316721775561e815830bc6c7e Mon Sep 17 00:00:00 2001 From: Jamo Luhrsen Date: Mon, 23 Dec 2019 14:30:46 -0800 Subject: [PATCH] Upgrade RF syntax for v3.2 compatibility Change-Id: I3db4425c219f955ba8ec98cd26246a5561b77c64 Signed-off-by: Jamo Luhrsen --- .pre-commit-config.yaml | 2 +- csit/libraries/BgpOperations.robot | 17 +- csit/libraries/BierTeResource.robot | 15 +- csit/libraries/BulkomaticKeywords.robot | 15 +- csit/libraries/CarPeople.robot | 24 +- csit/libraries/CheckJVMResource.robot | 21 +- csit/libraries/ClusterManagement.robot | 177 ++++++----- csit/libraries/ClusterOpenFlow.robot | 26 +- csit/libraries/Coe.robot | 125 ++++---- csit/libraries/CompareStream.robot | 19 +- csit/libraries/DIDMKeywords.robot | 49 +-- csit/libraries/DaeximKeywords.robot | 14 +- csit/libraries/DataModels.robot | 14 +- csit/libraries/DatastoreCRUD.robot | 46 +-- csit/libraries/ExaBgpLib.robot | 32 +- csit/libraries/FlowLib.robot | 64 ++-- csit/libraries/GBP/AssertionUtils.robot | 29 +- csit/libraries/GBP/OpenFlowUtils.robot | 26 +- csit/libraries/GBP/RestconfUtils.robot | 14 +- csit/libraries/GbpSxp.robot | 13 +- csit/libraries/Genius.robot | 149 +++++---- csit/libraries/KarafKeywords.robot | 82 ++--- csit/libraries/L2GatewayOperations.robot | 20 +- csit/libraries/LiveMigration.robot | 14 +- csit/libraries/MdsalLowlevel.robot | 5 +- csit/libraries/MininetKeywords.robot | 64 ++-- csit/libraries/NexusKeywords.robot | 17 +- csit/libraries/ODLTools.robot | 9 +- csit/libraries/OVSDB.robot | 44 +-- csit/libraries/OcpAgentKeywords.robot | 7 +- csit/libraries/OpenStackOperations.robot | 297 ++++++++++-------- csit/libraries/OvsManager.robot | 73 +++-- csit/libraries/SFC/DockerSfc.robot | 7 +- csit/libraries/SFC/SfcKeywords.robot | 39 +-- csit/libraries/SXP/FilteringResources.robot | 135 ++++---- csit/libraries/SetupUtils.robot | 5 +- csit/libraries/ShardStability.robot | 15 +- csit/libraries/SubStrings.robot | 10 +- csit/libraries/SwitchUtils.robot | 34 +- csit/libraries/SxpBindingOriginsLib.robot | 14 +- csit/libraries/SxpClusterLib.robot | 57 ++-- csit/libraries/SxpLib.robot | 74 +++-- csit/libraries/Tcpdump.robot | 14 +- csit/libraries/Tempest.robot | 5 +- csit/libraries/TemplatedRequests.robot | 11 +- csit/libraries/ToolsSystem.robot | 16 +- csit/libraries/TopoprocessingKeywords.robot | 45 +-- csit/libraries/TsdrUtils.robot | 139 ++++---- csit/libraries/UscUtils.robot | 47 +-- csit/libraries/Utils.robot | 27 +- csit/libraries/VpnOperations.robot | 79 +++-- csit/libraries/VtnCoKeywords.robot | 2 +- csit/libraries/VtnMaKeywords.robot | 20 +- csit/libraries/WaitUtils.robot | 134 ++++---- csit/libraries/YangmanKeywords.robot | 18 +- csit/libraries/controller/CsCommon.robot | 36 ++- csit/libraries/controller/DdbCommons.robot | 32 +- csit/libraries/controller/DnbCommons.robot | 47 +-- csit/libraries/controller/DrbCommons.robot | 56 ++-- ..._Reset_And_Set_Nonreplicated_Bgp_Rib.robot | 7 +- .../bgpclustering/PrefixcountKeywords.robot | 20 +- .../singlepeer_pc_shm_300kroutes.robot | 29 +- .../bgpcep/bgpflowspec/010_bgp_flowspec.robot | 11 +- .../bgpfunct/010_bgp_functional_l3vpn.robot | 15 +- .../020_bgp_functional_multipath.robot | 22 +- .../040_bgp_functional_route_ref.robot | 33 +- ...p_functional_rt_constrain_validation.robot | 32 +- .../bgpcep/bgpfunct/bgp_functional_md5.robot | 17 +- .../bgpcep/bgpfunct/bgp_ipv6_basic.robot | 17 +- .../bgpfunct/bgp_policies_default.robot | 61 ++-- .../bgpingest/manypeers_changecount.robot | 34 +- .../bgpingest/manypeers_peercount.robot | 43 +-- .../bgpingest/manypeers_prefixcount.robot | 28 +- .../basic/010_BierTeIntergrationTest.robot | 56 ++-- csit/suites/capwap/basic/capwap_session.robot | 14 +- .../buycar_failover.robot | 42 +-- .../buycar_failover_isolation.robot | 42 +-- .../car_failover_crud.robot | 29 +- .../car_failover_crud_isolation.robot | 22 +- .../car_outage_corners.robot | 16 +- .../car_persistence_recovery.robot | 12 +- .../Clustering_Datastore/carpeople_crud.robot | 22 +- .../controller/benchmark/dsbenchmark.robot | 20 +- .../cluster_singleton/master_stability.robot | 5 +- .../clean_leader_shutdown.robot | 1 - ...clean_leader_shutdown_prefbasedshard.robot | 1 - .../dom_data_broker/client_isolation.robot | 3 - .../client_isolation_prefbasedshard.robot | 3 - .../ddb-sanity-module-based.robot | 20 +- .../ddb-sanity-prefix-based.robot | 20 +- .../explicit_leader_movement.robot | 2 - ...licit_leader_movement_prefbasedshard.robot | 2 - .../dom_data_broker/leader_isolation.robot | 1 - .../leader_isolation_prefbasedshard.robot | 1 - .../dom_data_broker/listener_stability.robot | 2 - .../listener_stability_prefbasedshard.robot | 2 - .../restart_odl_with_tell_based_false.robot | 9 +- .../singleton_service/global_rpc_freeze.robot | 15 +- .../global_rpc_isolate.robot | 15 +- .../singleton_service/global_rpc_kill.robot | 15 +- .../distribution/karaf_sequence_install.robot | 7 +- .../dluxapps/yangman/502__yangman.robot | 15 +- .../505__yangmam_modules_loading.robot | 137 ++++---- csit/suites/genius/BFD_monitoring.robot | 16 +- csit/suites/genius/Configure_ITM.robot | 52 +-- csit/suites/genius/ITM_Direct_Tunnels.robot | 12 +- csit/suites/genius/ITM_Vtep_Auto_Tunnel.robot | 34 +- csit/suites/genius/OF_Tunnels.robot | 108 ++++--- .../GBP/3-node/__init__.robot | 26 +- .../GBP/3-node/gbp1/001_set_odl.robot | 5 +- .../GBP/3-node/gbp1/999_teardown.robot | 5 +- .../3-node/gbp2-multitenant/001_set_odl.robot | 5 +- .../gbp2-multitenant/999_teardown.robot | 5 +- .../GBPSFC/6-node/GBPSFC_6node.robot | 7 +- .../GBPSFC/6-node/__init__.robot | 28 +- .../demo-asymmetric-chain/010_set_odl.robot | 5 +- .../demo-asymmetric-chain/999_teardown.robot | 5 +- .../demo-symmetric-chain/010_set_odl.robot | 5 +- .../demo-symmetric-chain/999_teardown.robot | 5 +- .../GBPSXP/ep_provider_renderer_part.robot | 52 +-- .../iotdm/basic/010_PrimitveParameters.robot | 65 ++-- ...22_ResourceAttributesContentInstance.robot | 5 +- .../basic/091_ResourceHierarchyDelete.robot | 46 +-- .../010__restconf_inventory.robot | 34 +- .../010__finding_max_hosts.robot | 11 +- .../mdsal/binding_v1/binding-parent.robot | 7 +- csit/suites/netconf/ready/netconfready.robot | 14 +- csit/suites/netconf/scale/getmulti.robot | 5 +- csit/suites/netconf/scale/max_devices.robot | 48 +-- csit/suites/netvirt/elan/elan.robot | 40 ++- .../netvirt/elan/elan_service_recovery.robot | 14 +- .../host_route/host_route_handling.robot | 39 ++- csit/suites/netvirt/l2l3_gatewaymac_arp.robot | 39 ++- .../l3vpn_bgp_multipath_maxpath_cli.robot | 135 ++++---- .../netvirt/l3vpn_bgp/multi_vpn_bgp.robot | 94 +++--- .../openflow_punt_path_protection.robot | 135 ++++---- csit/suites/netvirt/snatdnat/snat_dnat.robot | 10 +- .../subnet_routing_and_multicast.robot | 61 ++-- csit/suites/netvirt/upgrade/upgrade.robot | 69 ++-- .../netvirt/vpnservice/arp_learning.robot | 30 +- .../suites/netvirt/vpnservice/vpn_basic.robot | 21 +- .../vpn_basic_dualstack_one_router.robot | 117 ++++--- .../vpn_basic_dualstack_subnet_routing.robot | 110 ++++--- .../netvirt/vpnservice/vpn_basic_ipv6.robot | 36 ++- csit/suites/nic/basic/010_Restconf_OK.robot | 40 +-- csit/suites/nic/cli/console.robot | 37 ++- .../scalability/010__ocp_scalability.robot | 7 +- .../openflowplugin/Bug_Validation/6917.robot | 5 +- .../010_bundle_resync.robot | 17 +- .../010_Group_Flows.robot | 32 +- .../010__Cluster_HA_Owner_Failover.robot | 7 +- .../020__Cluster_HA_Owner_Restart.robot | 7 +- ...rent_Term_Verification_3Node_Cluster.robot | 13 +- .../010_Switch_Disconnect.robot | 18 +- .../020_Cluster_Node_Failure.robot | 18 +- .../030_Cluster_Sync_Problems.robot | 18 +- .../010_SM_add_upd_del_flows.robot | 33 +- .../020_SM_sal_add_upd_del_flows.robot | 33 +- .../010__SM_add_upd_del_flows.robot | 27 +- .../010__restconf_inventory.robot | 34 +- .../010__restconf_inventory.robot | 34 +- .../Longevity/010__longevity_test.robot | 13 +- .../010__finding_max_links.robot | 11 +- .../010__finding_max_switches.robot | 11 +- .../020__find_max_switches.robot | 11 +- .../Performance/010_Cbench.robot | 5 +- .../Reconciliation/010_Group_Flows.robot | 24 +- csit/suites/openstack/clustering/ha_l2.robot | 15 +- csit/suites/openstack/clustering/ha_l3.robot | 30 +- .../clustering/ha_l3_block_port.robot | 30 +- .../connectivity/external_network.robot | 30 +- csit/suites/openstack/connectivity/l3.robot | 20 +- .../connectivity/live_migration.robot | 5 +- .../connectivity/security_group.robot | 20 +- csit/suites/openstack/extensions/sfc.robot | 20 +- csit/suites/openstack/securitygroup/acl.robot | 22 +- .../security_group_l3bcast.robot | 39 ++- csit/suites/persistence/basic/test_app.robot | 13 +- .../Full_Deploy/011__sfc_service_paths.robot | 2 +- .../012__sfc_service_paths_validation.robot | 2 +- .../014__sfc_service_forwarders_logical.robot | 2 +- .../020__sfc_service_forwarders.robot | 2 +- .../SFC_Basic/030__sfc_service_nodes.robot | 2 +- .../SFC_Basic/040__sfc_service_chains.robot | 2 +- .../050__sfc_service_schedule_types.robot | 2 +- .../SFC_Basic/060__sfc_service_paths.robot | 2 +- csit/suites/sxp/basic/030_Connectivity.robot | 47 +-- csit/suites/sxp/basic/040_SSL_Passwords.robot | 31 +- .../010_Bindings_consistency.robot | 10 +- .../020_Sxp_Node_Switching.robot | 10 +- .../sxp/clustering/020_RPC_Redirecting.robot | 5 +- .../clustering/030_RPC_functionality.robot | 20 +- .../030_Inbound_Filtering_Discarding.robot | 45 +-- .../040_Peer_Sequence_filtering.robot | 117 +++---- .../sxp/filtering/050_Domain_filtering.robot | 78 ++--- .../100_Inbound_Filtering_Policy.robot | 7 +- .../performance/010_ConnectivityTests.robot | 28 +- .../performance/020_BindingExportTests.robot | 199 ++++++------ .../sxp/topology/010_Topology_Features.robot | 21 +- .../suites/sxp/topology/020_Scalability.robot | 67 ++-- .../sxp/topology/030_Domains_Forwarding.robot | 70 +++-- .../topology/040_Domains_Substraction.robot | 74 +++-- .../070_Underlay_update.robot | 62 ++-- .../tsdr/Cassandra/010_InterfaceMetrics.robot | 113 +++---- .../tsdr/Cassandra/020_FlowMetrics.robot | 72 +++-- .../tsdr/Cassandra/030_FlowTableMetrics.robot | 15 +- .../tsdr/Cassandra/040_QueueMetrics.robot | 15 +- .../tsdr/Cassandra/050_SyslogTable.robot | 22 +- .../suites/tsdr/H2/010_InterfaceMetrics.robot | 21 +- csit/suites/tsdr/H2/020_FlowMetrics.robot | 12 +- .../suites/tsdr/H2/030_FlowTableMetrics.robot | 12 +- csit/suites/tsdr/H2/040_QueueMetrics.robot | 26 +- csit/suites/tsdr/H2/050_GroupMetrics.robot | 17 +- .../suites/tsdr/H2/060_FlowMeterMetrics.robot | 17 +- .../tsdr/HBase/010_InterfaceMetrics.robot | 19 +- csit/suites/tsdr/HBase/020_FlowMetrics.robot | 5 +- csit/suites/tsdr/HBase/040_QueueMetrics.robot | 5 +- csit/suites/tsdr/HBase/050_SyslogTable.robot | 18 +- .../tsdr/HSQLDB/010_InterfaceMetrics.robot | 14 +- csit/suites/tsdr/HSQLDB/020_FlowMetrics.robot | 5 +- .../tsdr/HSQLDB/030_FlowTableMetrics.robot | 5 +- .../suites/tsdr/HSQLDB/040_QueueMetrics.robot | 5 +- .../tsdr/HSQLDB/060_syslog_Collector.robot | 9 +- csit/suites/usc/tcp/110_TCP/Test.robot | 11 +- .../tcp/200_Multiple_Sessions_TCP/Test.robot | 60 ++-- .../usc/tcp/300_Callhome_TCP/test.robot | 11 +- csit/suites/usc/udp/110_UDP/Test.robot | 11 +- .../udp/200_Multiple_Sessions_UDP/Test.robot | 60 ++-- .../usc/udp/300_Callhome_UDP/Test.robot | 11 +- .../vpnservice/010__verify_feature.robot | 10 +- .../vpnservice/020__configure_vpn.robot | 15 +- .../030__configure_2_switches.robot | 11 +- .../yang-model-validator.robot | 29 +- .../openstack_ha/deploy/01_mysql_setup.robot | 4 +- .../libraries/OpenStackOperations.robot | 246 ++++++++------- 235 files changed, 4257 insertions(+), 3376 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6514c9e44d..bb08b167bf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,7 +16,7 @@ rev: 'master' hooks: - id: robotframework-tidy-wrapper - additional_dependencies: ['robotframework==3.1.1'] # Pin due to tidy warning in 3.1.2 + additional_dependencies: ['robotframework==3.2a1'] # Pin due to tidy warning in 3.1.2 - repo: https://github.com/jorisroovers/gitlint rev: v0.11.0 diff --git a/csit/libraries/BgpOperations.robot b/csit/libraries/BgpOperations.robot index 840ff99e27..d15120d29c 100644 --- a/csit/libraries/BgpOperations.robot +++ b/csit/libraries/BgpOperations.robot @@ -188,8 +188,9 @@ Verify Routes On Quagga [Documentation] Verify routes on quagga ${output} = Execute Show Command On quagga ${dcgw_ip} show ip bgp vrf ${rd} Log ${output} - : FOR ${ip} IN @{ip_list} - \ Should Contain ${output} ${ip} + FOR ${ip} IN @{ip_list} + Should Contain ${output} ${ip} + END Delete BGP Config On Quagga [Arguments] ${dcgw_ip} ${bgp_id} ${user}=bgpd ${password}=sdncbgpc @@ -220,8 +221,9 @@ Delete L3VPN on DCGW BgpOperations.Create Quagga Telnet Session ${dcgw_ip} bgpd sdncbgpc BgpOperations.Execute Command On Quagga Telnet Session configure terminal BgpOperations.Execute Command On Quagga Telnet Session router bgp ${as_id} - : FOR ${vpn} IN @{vpns} - \ BgpOperations.Execute Command On Quagga Telnet Session no vrf ${vpn} + FOR ${vpn} IN @{vpns} + BgpOperations.Execute Command On Quagga Telnet Session no vrf ${vpn} + END BgpOperations.Execute Command On Quagga Telnet Session end Verify L3VPN On DCGW @@ -411,6 +413,7 @@ Check BGP VPNv4 Nbr On ODL [Arguments] ${dcgw_count} ${flag}=True ${start}=${START_VALUE} [Documentation] Check all BGP VPNv4 neighbor on ODL ${output} = KarafKeywords.Issue Command On Karaf Console ${DISPLAY_VPN4_ALL} - : FOR ${index} IN RANGE ${start} ${dcgw_count} - \ BuiltIn.Run Keyword If ${flag}==True BuiltIn.Should Contain ${output} ${DCGW_IP_LIST[${index}]} - \ ... ELSE BuiltIn.Should Not Contain ${output} ${DCGW_IP_LIST[${index}]} + FOR ${index} IN RANGE ${start} ${dcgw_count} + BuiltIn.Run Keyword If ${flag}==True BuiltIn.Should Contain ${output} ${DCGW_IP_LIST[${index}]} + ... ELSE BuiltIn.Should Not Contain ${output} ${DCGW_IP_LIST[${index}]} + END diff --git a/csit/libraries/BierTeResource.robot b/csit/libraries/BierTeResource.robot index 5d0802ef54..79b0683390 100644 --- a/csit/libraries/BierTeResource.robot +++ b/csit/libraries/BierTeResource.robot @@ -39,10 +39,11 @@ Node Online Second Layer Loop [Arguments] ${node-id} ${tp-id-list} ${bp-list} ${length} [Documentation] The keyword is used for the second layer of loop TC5_Configure Te Node. - : FOR ${j} IN RANGE ${length} - \ ${tp-id} Get From List ${tp-id-list} ${j} - \ ${bp} Get From List ${bp-list} ${j} - \ ${mapping} Create Dictionary TOPOLOGYID=${TOPOLOGY_ID} NODEID=${node-id} DOMAINID=${DOMAIN_ID_LIST[0]} SUBDOMAINID=${SUBDOMAIN_ID_LIST[0]} - \ ... TPID=${tp-id} BP=${bp} - \ ${resp} TemplatedRequests.Post_As_Json_Templated ${BIER_TE_VAR_FOLDER}/bier_node_configuration/configure_te_node ${mapping} session - \ Verify_Response_As_Json_Templated ${resp} ${BIER_TE_VAR_FOLDER}/common success_response + FOR ${j} IN RANGE ${length} + ${tp-id} Get From List ${tp-id-list} ${j} + ${bp} Get From List ${bp-list} ${j} + ${mapping} Create Dictionary TOPOLOGYID=${TOPOLOGY_ID} NODEID=${node-id} DOMAINID=${DOMAIN_ID_LIST[0]} SUBDOMAINID=${SUBDOMAIN_ID_LIST[0]} + ... TPID=${tp-id} BP=${bp} + ${resp} TemplatedRequests.Post_As_Json_Templated ${BIER_TE_VAR_FOLDER}/bier_node_configuration/configure_te_node ${mapping} session + Verify_Response_As_Json_Templated ${resp} ${BIER_TE_VAR_FOLDER}/common success_response + END diff --git a/csit/libraries/BulkomaticKeywords.robot b/csit/libraries/BulkomaticKeywords.robot index 84e3697112..8bb8864473 100644 --- a/csit/libraries/BulkomaticKeywords.robot +++ b/csit/libraries/BulkomaticKeywords.robot @@ -90,12 +90,15 @@ Get Bulk Flow And Verify Count In Cluster [Arguments] ${json_body_get} ${timeout} ${flow_count} ${controller_index_list}=${EMPTY} [Documentation] Get Bulk Flow and Verify Flow Count in ${controller_index_list} matches ${flow_count}. ${index_list} = ClusterManagement.List Indices Or All given_list=${controller_index_list} - : FOR ${index} IN @{index_list} - \ Get Bulk Flow ${json_body_get} ${index} - : FOR ${index} IN @{index_list} - \ Wait Until Read Finishes ${index} ${timeout} - : FOR ${index} IN @{index_list} - \ Verify Flow Count ${flow_count} ${index} + FOR ${index} IN @{index_list} + Get Bulk Flow ${json_body_get} ${index} + END + FOR ${index} IN @{index_list} + Wait Until Read Finishes ${index} ${timeout} + END + FOR ${index} IN @{index_list} + Verify Flow Count ${flow_count} ${index} + END Set DPN And Flow Count In Json Add [Arguments] ${json_config} ${dpn_count} ${flows_count} diff --git a/csit/libraries/CarPeople.robot b/csit/libraries/CarPeople.robot index 767e25b9de..2a61689e1f 100644 --- a/csit/libraries/CarPeople.robot +++ b/csit/libraries/CarPeople.robot @@ -21,16 +21,18 @@ Add_Several_People [Documentation] Simple loop for issuing add-person RPCs to session, one by one. ... People need to be added via RPC, otherwise buy-car routed RPC will not find registered path. ... See javadocs in RpcProviderRegistry.java - : FOR ${i} IN RANGE ${iter_start} ${iter_start}+${iterations} - \ TemplatedRequests.Post_As_Json_Templated folder=${VAR_DIR}/add-person mapping={"i": "${i}"} session=${session} + FOR ${i} IN RANGE ${iter_start} ${iter_start}+${iterations} + TemplatedRequests.Post_As_Json_Templated folder=${VAR_DIR}/add-person mapping={"i": "${i}"} session=${session} + END Buy_Several_Cars [Arguments] ${session} ${iterations} ${iter_start}=1 ${registration_delay}=20s [Documentation] Simple loop for issuing buy-car RPCs to session, one by one. ... This needs to be a separate Keyword mostly just because nested FOR loops are not allowed. ... Actual fact of buying one car is done by inner Keyword. - : FOR ${iter} IN RANGE ${iter_start} ${iter_start}+${iterations} - \ Buy_Single_Car session=${session} iteration=${iter} registration_delay=${registration_delay} + FOR ${iter} IN RANGE ${iter_start} ${iter_start}+${iterations} + Buy_Single_Car session=${session} iteration=${iter} registration_delay=${registration_delay} + END Buy_Single_Car [Arguments] ${session} ${iteration}=1 ${registration_delay}=20s @@ -54,9 +56,10 @@ Set_Variables_For_Shard ${leader_session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${leader} BuiltIn.Set_Suite_Variable \${${shard_name}_leader_session} ${leader_session} ${sessions} = BuiltIn.Create_List - : FOR ${follower_index} IN @{follower_list} - \ ${follower_session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${follower_index} - \ Collections.Append_To_List ${sessions} ${follower_session} + FOR ${follower_index} IN @{follower_list} + ${follower_session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${follower_index} + Collections.Append_To_List ${sessions} ${follower_session} + END BuiltIn.Set_Suite_Variable \${${shard_name}_follower_sessions} ${sessions} ${first_follower_session} = Collections.Get_From_List ${sessions} 0 BuiltIn.Set_Suite_Variable \${${shard_name}_first_follower_session} ${first_follower_session} @@ -77,9 +80,10 @@ Set_Tmp_Variables_For_Shard_For_Nodes ${leader_session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${leader} BuiltIn.Set_Suite_Variable \${new_leader_session} ${leader_session} ${sessions} = BuiltIn.Create_List - : FOR ${follower_index} IN @{follower_list} - \ ${follower_session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${follower_index} - \ Collections.Append_To_List ${sessions} ${follower_session} + FOR ${follower_index} IN @{follower_list} + ${follower_session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${follower_index} + Collections.Append_To_List ${sessions} ${follower_session} + END BuiltIn.Set_Suite_Variable \${new_follower_sessions} ${sessions} ${first_follower_session} = Collections.Get_From_List ${sessions} 0 BuiltIn.Set_Suite_Variable \${new_first_follower_session} ${first_follower_session} diff --git a/csit/libraries/CheckJVMResource.robot b/csit/libraries/CheckJVMResource.robot index 760f0660d4..07d24a5e06 100644 --- a/csit/libraries/CheckJVMResource.robot +++ b/csit/libraries/CheckJVMResource.robot @@ -39,13 +39,14 @@ Get JVM Operatingsystem Create JVM Plots [Arguments] ${controllers_number}=${NUM_ODL_SYSTEM} ${elastic-port}=${ELASTICPORT} [Documentation] Draw Resource usage plot using plot_points method. - : FOR ${index} IN RANGE 1 ${controllers_number}+1 - \ ${controller-ip}= Builtin.Set Variable ${ODL_SYSTEM_${index}_IP} - \ Log ${controller-ip} - \ ${session} ElasticsearchAppender.Get_Connection ${controller-ip} ${elastic-port} - \ Log ${session} - \ ElasticsearchAppender.Plot Points ${session} JVM Threads threadcount_${index}.png 'Threading' 'ThreadCount' - \ ElasticsearchAppender.Plot Points ${session} JVM Heap Memory heapmemory_${index}.png 'Memory' 'HeapMemoryUsage' - \ ... 'used' - \ ElasticsearchAppender.Plot Points ${session} JVM Loaded Classes class_count_${index}.png 'ClassLoading' 'TotalLoadedClassCount' - \ ElasticsearchAppender.Plot Points ${session} JVM CPU Usage cpu_usage_${index}.png 'OperatingSystem' 'ProcessCpuLoad' + FOR ${index} IN RANGE 1 ${controllers_number}+1 + ${controller-ip}= Builtin.Set Variable ${ODL_SYSTEM_${index}_IP} + Log ${controller-ip} + ${session} ElasticsearchAppender.Get_Connection ${controller-ip} ${elastic-port} + Log ${session} + ElasticsearchAppender.Plot Points ${session} JVM Threads threadcount_${index}.png 'Threading' 'ThreadCount' + ElasticsearchAppender.Plot Points ${session} JVM Heap Memory heapmemory_${index}.png 'Memory' 'HeapMemoryUsage' + ... 'used' + ElasticsearchAppender.Plot Points ${session} JVM Loaded Classes class_count_${index}.png 'ClassLoading' 'TotalLoadedClassCount' + ElasticsearchAppender.Plot Points ${session} JVM CPU Usage cpu_usage_${index}.png 'OperatingSystem' 'ProcessCpuLoad' + END diff --git a/csit/libraries/ClusterManagement.robot b/csit/libraries/ClusterManagement.robot index 80a3c0db56..92c861e1f4 100644 --- a/csit/libraries/ClusterManagement.robot +++ b/csit/libraries/ClusterManagement.robot @@ -86,10 +86,11 @@ Check_Cluster_Is_In_Sync [Arguments] ${member_index_list}=${EMPTY} [Documentation] Fail if no-sync is detected on a member from list (or any). ${index_list} = List_Indices_Or_All given_list=${member_index_list} - : FOR ${index} IN @{index_list} # usually: 1, 2, 3. - \ ${status} = Get_Sync_Status_Of_Member member_index=${index} - \ BuiltIn.Continue_For_Loop_If 'True' == '${status}' - \ BuiltIn.Fail Index ${index} has incorrect status: ${status} + FOR ${index} IN @{index_list} # usually: 1, 2, 3. + ${status} = Get_Sync_Status_Of_Member member_index=${index} + BuiltIn.Continue_For_Loop_If 'True' == '${status}' + BuiltIn.Fail Index ${index} has incorrect status: ${status} + END Get_Sync_Status_Of_Member [Arguments] ${member_index} @@ -106,8 +107,9 @@ Verify_Leader_Exists_For_Each_Shard [Arguments] ${shard_name_list} ${shard_type}=operational ${member_index_list}=${EMPTY} ${verify_restconf}=True [Documentation] For each shard name, call Get_Leader_And_Followers_For_Shard. ... Not much logic there, but single Keyword is useful when using BuiltIn.Wait_Until_Keyword_Succeeds. - : FOR ${shard_name} IN @{shard_name_list} - \ Get_Leader_And_Followers_For_Shard shard_name=${shard_name} shard_type=${shard_type} validate=True member_index_list=${member_index_list} verify_restconf=${verify_restconf} + FOR ${shard_name} IN @{shard_name_list} + Get_Leader_And_Followers_For_Shard shard_name=${shard_name} shard_type=${shard_type} validate=True member_index_list=${member_index_list} verify_restconf=${verify_restconf} + END Get_Leader_And_Followers_For_Shard [Arguments] ${shard_name}=default ${shard_type}=operational ${validate}=True ${member_index_list}=${EMPTY} ${verify_restconf}=True ${http_timeout}=${EMPTY} @@ -134,12 +136,13 @@ Get_State_Info_For_Shard ${ds_type} = BuiltIn.Set_Variable_If '${shard_type}' != 'config' operational config ${leader_list} = BuiltIn.Create_List ${follower_list} = BuiltIn.Create_List - : FOR ${index} IN @{index_list} # usually: 1, 2, 3. - \ ${raft_state} = Get_Raft_State_Of_Shard_At_Member shard_name=${shard_name} shard_type=${ds_type} member_index=${index} verify_restconf=${verify_restconf} - \ ... http_timeout=${http_timeout} - \ BuiltIn.Run_Keyword_If 'Follower' == '${raft_state}' Collections.Append_To_List ${follower_list} ${index} - \ ... ELSE IF 'Leader' == '${raft_state}' Collections.Append_To_List ${leader_list} ${index} - \ ... ELSE IF ${validate} BuiltIn.Fail Unrecognized Raft state: ${raft_state} + FOR ${index} IN @{index_list} # usually: 1, 2, 3. + ${raft_state} = Get_Raft_State_Of_Shard_At_Member shard_name=${shard_name} shard_type=${ds_type} member_index=${index} verify_restconf=${verify_restconf} + ... http_timeout=${http_timeout} + BuiltIn.Run_Keyword_If 'Follower' == '${raft_state}' Collections.Append_To_List ${follower_list} ${index} + ... ELSE IF 'Leader' == '${raft_state}' Collections.Append_To_List ${leader_list} ${index} + ... ELSE IF ${validate} BuiltIn.Fail Unrecognized Raft state: ${raft_state} + END [Return] ${leader_list} ${follower_list} Get_Raft_State_Of_Shard_At_Member @@ -238,10 +241,11 @@ Get_Owner_And_Candidates_For_Device_Old ${owner} = String.Replace_String ${entity_owner} member- ${EMPTY} ${owner} = BuiltIn.Convert_To_Integer ${owner} ${entity_candidates_list} = Collections.Get_From_Dictionary @{entity_list}[${entity_index}] candidate - : FOR ${entity_candidate} IN @{entity_candidates_list} - \ ${candidate} = String.Replace_String &{entity_candidate}[name] member- ${EMPTY} - \ ${candidate} = BuiltIn.Convert_To_Integer ${candidate} - \ Collections.Append_To_List ${candidate_list} ${candidate} + FOR ${entity_candidate} IN @{entity_candidates_list} + ${candidate} = String.Replace_String &{entity_candidate}[name] member- ${EMPTY} + ${candidate} = BuiltIn.Convert_To_Integer ${candidate} + Collections.Append_To_List ${candidate_list} ${candidate} + END Collections.Sort_List ${candidate_list} [Return] ${owner} ${candidate_list} @@ -357,10 +361,11 @@ Get_Owner_And_Candidates_For_Type_And_Id ${owner} = String.Replace_String ${entity_owner} member- ${EMPTY} ${owner} = BuiltIn.Convert_To_Integer ${owner} ${entity_candidates_list} = Collections.Get_From_Dictionary @{entity_list}[${entity_index}] candidate - : FOR ${entity_candidate} IN @{entity_candidates_list} - \ ${candidate} = String.Replace_String &{entity_candidate}[name] member- ${EMPTY} - \ ${candidate} = BuiltIn.Convert_To_Integer ${candidate} - \ Collections.Append_To_List ${candidate_list} ${candidate} + FOR ${entity_candidate} IN @{entity_candidates_list} + ${candidate} = String.Replace_String &{entity_candidate}[name] member- ${EMPTY} + ${candidate} = BuiltIn.Convert_To_Integer ${candidate} + Collections.Append_To_List ${candidate_list} ${candidate} + END Collections.Sort_List ${candidate_list} BuiltIn.Comment TODO: Separate check lines into Verify_Owner_And_Candidates_For_Type_And_Id BuiltIn.Run_Keyword_If """${require_candidate_list}""" BuiltIn.Should_Be_Equal ${require_candidate_list} ${candidate_list} Candidate list does not match: ${candidate_list} is not ${require_candidate_list} @@ -415,8 +420,9 @@ Kill_Members_From_List_Or_All BuiltIn.Return_From_Keyword_If not ${confirm} ${updated_index_list} # TODO: Convert to WUKS with configurable timeout if it turns out 1 second is not enough. BuiltIn.Sleep 1s Kill -9 closes open files, which may take longer than ssh overhead, but not long enough to warrant WUKS. - : FOR ${index} IN @{kill_index_list} - \ Verify_Karaf_Is_Not_Running_On_Member member_index=${index} + FOR ${index} IN @{kill_index_list} + Verify_Karaf_Is_Not_Running_On_Member member_index=${index} + END Run_Bash_Command_On_List_Or_All command=netstat -pnatu | grep 2550 [Return] ${updated_index_list} @@ -442,8 +448,9 @@ Stop_Members_From_List_Or_All ${updated_index_list} = BuiltIn.Create_List @{index_list} Collections.Remove_Values_From_List ${updated_index_list} @{stop_index_list} BuiltIn.Return_From_Keyword_If not ${confirm} ${updated_index_list} - : FOR ${index} IN @{stop_index_list} - \ BuiltIn.Wait Until Keyword Succeeds ${timeout} 2s Verify_Karaf_Is_Not_Running_On_Member member_index=${index} + FOR ${index} IN @{stop_index_list} + BuiltIn.Wait Until Keyword Succeeds ${timeout} 2s Verify_Karaf_Is_Not_Running_On_Member member_index=${index} + END Run_Bash_Command_On_List_Or_All command=netstat -pnatu | grep 2550 [Return] ${updated_index_list} @@ -489,9 +496,10 @@ Verify_Members_Are_Ready Verify_Restconf_Is_Available [Arguments] ${member_index_list} ${index_list} = List_Indices_Or_All given_list=${member_index_list} - : FOR ${index} IN @{index_list} - \ ${session} = Resolve_Http_Session_For_Member member_index=${index} - \ TemplatedRequests.Get_As_Json_Templated session=${session} folder=${RESTCONF_MODULES_DIR} verify=False + FOR ${index} IN @{index_list} + ${session} = Resolve_Http_Session_For_Member member_index=${index} + TemplatedRequests.Get_As_Json_Templated session=${session} folder=${RESTCONF_MODULES_DIR} verify=False + END Freeze_Single_Member [Arguments] ${member} @@ -520,8 +528,9 @@ Clean_Journals_Data_And_Snapshots_On_List_Or_All ... See https://bugs.opendaylight.org/show_bug.cgi?id=8138 ${index_list} = List_Indices_Or_All given_list=${member_index_list} ${command} = Set Variable rm -rf "${karaf_home}/journal" "${karaf_home}/snapshots" "${karaf_home}/data" - : FOR ${index} IN @{index_list} # usually: 1, 2, 3. - \ Run_Bash_Command_On_Member command=${command} member_index=${index} + FOR ${index} IN @{index_list} # usually: 1, 2, 3. + Run_Bash_Command_On_Member command=${command} member_index=${index} + END Verify_Karaf_Is_Not_Running_On_Member [Arguments] ${member_index} @@ -549,10 +558,11 @@ Isolate_Member_From_List_Or_All ${index_list} = List_Indices_Or_All given_list=${member_index_list} ${source} = Collections.Get_From_Dictionary ${ClusterManagement__index_to_ip_mapping} ${isolate_member_index} ${dport} = BuiltIn.Set_Variable_If '${port}' != '${EMPTY}' --dport ${port} ${EMPTY} - : FOR ${index} IN @{index_list} - \ ${destination} = Collections.Get_From_Dictionary ${ClusterManagement__index_to_ip_mapping} ${index} - \ ${command} = BuiltIn.Set_Variable sudo /sbin/iptables -I OUTPUT -p ${protocol} ${dport} --source ${source} --destination ${destination} -j DROP - \ BuiltIn.Run_Keyword_If "${index}" != "${isolate_member_index}" Run_Bash_Command_On_Member command=${command} member_index=${isolate_member_index} + FOR ${index} IN @{index_list} + ${destination} = Collections.Get_From_Dictionary ${ClusterManagement__index_to_ip_mapping} ${index} + ${command} = BuiltIn.Set_Variable sudo /sbin/iptables -I OUTPUT -p ${protocol} ${dport} --source ${source} --destination ${destination} -j DROP + BuiltIn.Run_Keyword_If "${index}" != "${isolate_member_index}" Run_Bash_Command_On_Member command=${command} member_index=${isolate_member_index} + END ${command} = BuiltIn.Set_Variable sudo /sbin/iptables -L -n ${output} = Run_Bash_Command_On_Member command=${command} member_index=${isolate_member_index} BuiltIn.Log ${output} @@ -566,10 +576,11 @@ Rejoin_Member_From_List_Or_All ${index_list} = List_Indices_Or_All given_list=${member_index_list} ${source} = Collections.Get_From_Dictionary ${ClusterManagement__index_to_ip_mapping} ${rejoin_member_index} ${dport} = BuiltIn.Set_Variable_If '${port}' != '${EMPTY}' --dport ${port} ${EMPTY} - : FOR ${index} IN @{index_list} - \ ${destination} = Collections.Get_From_Dictionary ${ClusterManagement__index_to_ip_mapping} ${index} - \ ${command} = BuiltIn.Set_Variable sudo /sbin/iptables -D OUTPUT -p ${protocol} ${dport} --source ${source} --destination ${destination} -j DROP - \ BuiltIn.Run_Keyword_If "${index}" != "${rejoin_member_index}" Run_Bash_Command_On_Member command=${command} member_index=${rejoin_member_index} + FOR ${index} IN @{index_list} + ${destination} = Collections.Get_From_Dictionary ${ClusterManagement__index_to_ip_mapping} ${index} + ${command} = BuiltIn.Set_Variable sudo /sbin/iptables -D OUTPUT -p ${protocol} ${dport} --source ${source} --destination ${destination} -j DROP + BuiltIn.Run_Keyword_If "${index}" != "${rejoin_member_index}" Run_Bash_Command_On_Member command=${command} member_index=${rejoin_member_index} + END ${command} = BuiltIn.Set_Variable sudo /sbin/iptables -L -n ${output} = Run_Bash_Command_On_Member command=${command} member_index=${rejoin_member_index} BuiltIn.Log ${output} @@ -585,9 +596,10 @@ Check_Bash_Command_On_List_Or_All [Arguments] ${command} ${member_index_list}=${EMPTY} ${return_success_only}=False ${log_on_success}=True ${log_on_failure}=True ${stderr_must_be_empty}=True [Documentation] Cycle through indices (or all), run bash command on each, using temporary SSH session and restoring the previously active one. ${index_list} = List_Indices_Or_All given_list=${member_index_list} - : FOR ${index} IN @{index_list} - \ Check_Bash_Command_On_Member command=${command} member_index=${index} return_success_only=${return_success_only} log_on_success=${log_on_success} log_on_failure=${log_on_failure} - \ ... stderr_must_be_empty=${stderr_must_be_empty} + FOR ${index} IN @{index_list} + Check_Bash_Command_On_Member command=${command} member_index=${index} return_success_only=${return_success_only} log_on_success=${log_on_success} log_on_failure=${log_on_failure} + ... stderr_must_be_empty=${stderr_must_be_empty} + END Check_Bash_Command_On_Member [Arguments] ${command} ${member_index} ${return_success_only}=False ${log_on_success}=True ${log_on_failure}=True ${stderr_must_be_empty}=True @@ -607,8 +619,9 @@ Run_Bash_Command_On_List_Or_All [Documentation] Cycle through indices (or all), run command on each. # TODO: Migrate callers to Check_Bash_Command_* ${index_list} = List_Indices_Or_All given_list=${member_index_list} - : FOR ${index} IN @{index_list} - \ Run_Bash_Command_On_Member command=${command} member_index=${index} + FOR ${index} IN @{index_list} + Run_Bash_Command_On_Member command=${command} member_index=${index} + END Run_Bash_Command_On_Member [Arguments] ${command} ${member_index} @@ -623,9 +636,10 @@ Run_Karaf_Command_On_List_Or_All [Arguments] ${command} ${member_index_list}=${EMPTY} ${timeout}=10s [Documentation] Cycle through indices (or all), run karaf command on each. ${index_list} = List_Indices_Or_All given_list=${member_index_list} - : FOR ${index} IN @{index_list} - \ ${member_ip} = Collections.Get_From_Dictionary dictionary=${ClusterManagement__index_to_ip_mapping} key=${index} - \ KarafKeywords.Safe_Issue_Command_On_Karaf_Console ${command} ${member_ip} timeout=${timeout} + FOR ${index} IN @{index_list} + ${member_ip} = Collections.Get_From_Dictionary dictionary=${ClusterManagement__index_to_ip_mapping} key=${index} + KarafKeywords.Safe_Issue_Command_On_Karaf_Console ${command} ${member_ip} timeout=${timeout} + END Run_Karaf_Command_On_Member [Arguments] ${command} ${member_index} ${timeout}=10s @@ -640,13 +654,15 @@ Install_Feature_On_List_Or_All [Documentation] Attempt installation on each member from list (or all). Then look for failures. ${index_list} = List_Indices_Or_All given_list=${member_index_list} ${status_list} = BuiltIn.Create_List - : FOR ${index} IN @{index_list} - \ ${status} ${text} = BuiltIn.Run_Keyword_And_Ignore_Error Install_Feature_On_Member feature_name=${feature_name} member_index=${index} - \ ... timeout=${timeout} - \ BuiltIn.Log ${text} - \ Collections.Append_To_List ${status_list} ${status} - : FOR ${status} IN @{status_list} - \ BuiltIn.Run_Keyword_If "${status}" != "PASS" BuiltIn.Fail ${feature_name} installation failed, see log. + FOR ${index} IN @{index_list} + ${status} ${text} = BuiltIn.Run_Keyword_And_Ignore_Error Install_Feature_On_Member feature_name=${feature_name} member_index=${index} + ... timeout=${timeout} + BuiltIn.Log ${text} + Collections.Append_To_List ${status_list} ${status} + END + FOR ${status} IN @{status_list} + BuiltIn.Run_Keyword_If "${status}" != "PASS" BuiltIn.Fail ${feature_name} installation failed, see log. + END Install_Feature_On_Member [Arguments] ${feature_name} ${member_index} ${timeout}=60s @@ -664,9 +680,10 @@ With_Ssh_To_List_Or_All_Run_Keyword # TODO: For_Index_From_List_Or_All_Run_Keyword applied to With_Ssh_To_Member_Run_Keyword? # TODO: Imagine another keyword, using ScalarClosures and adding member index as first argument for each call. Worth it? ${index_list} = List_Indices_Or_All given_list=${member_index_list} - : FOR ${member_index} IN @{index_list} - \ ${member_ip} = Resolve_IP_Address_For_Member ${member_index} - \ SSHKeywords.Run_Unsafely_Keyword_Over_Temporary_Odl_Session ${member_ip} ${keyword_name} @{args} &{kwargs} + FOR ${member_index} IN @{index_list} + ${member_ip} = Resolve_IP_Address_For_Member ${member_index} + SSHKeywords.Run_Unsafely_Keyword_Over_Temporary_Odl_Session ${member_ip} ${keyword_name} @{args} &{kwargs} + END Safe_With_Ssh_To_List_Or_All_Run_Keyword [Arguments] ${member_index_list} ${keyword_name} @{args} &{kwargs} @@ -696,8 +713,9 @@ Restore_Karaf_Log_On_List_Or_All ClusterManagement__Clean_Directories [Arguments] ${relative_path_list} ${karaf_home} [Documentation] For each relative path, remove files with respect to ${karaf_home}. Return None. - : FOR ${relative_path} IN @{relative_path_list} - \ SSHLibrary.Execute_Command rm -rf ${karaf_home}${/}${relative_path} + FOR ${relative_path} IN @{relative_path_list} + SSHLibrary.Execute_Command rm -rf ${karaf_home}${/}${relative_path} + END Put_As_Json_And_Check_Member_List_Or_All [Arguments] ${uri} ${data} ${member_index} ${member_index_list}=${EMPTY} @@ -741,27 +759,30 @@ Check_Json_Member_List_Or_All [Documentation] Send a GET with the supplied uri to all or some members defined in ${member_index_list}. ... Then check received data is = ${expected data}. ${index_list} = List_Indices_Or_All given_list=${member_index_list} - : FOR ${index} IN @{index_list} - \ ${data} = Get_From_Member uri=${uri} member_index=${index} - \ TemplatedRequests.Normalize_Jsons_And_Compare ${expected_data} ${data} + FOR ${index} IN @{index_list} + ${data} = Get_From_Member uri=${uri} member_index=${index} + TemplatedRequests.Normalize_Jsons_And_Compare ${expected_data} ${data} + END Check_Item_Occurrence_Member_List_Or_All [Arguments] ${uri} ${dictionary} ${member_index_list}=${EMPTY} [Documentation] Send a GET with the supplied uri to all or some members defined in ${member_index_list}. ... Then check received for occurrences of items expressed in a dictionary ${dictionary}. ${index_list} = List_Indices_Or_All given_list=${member_index_list} - : FOR ${index} IN @{index_list} - \ ${data} = Get_From_Member uri=${uri} member_index=${index} - \ Utils.Check Item Occurrence ${data} ${dictionary} + FOR ${index} IN @{index_list} + ${data} = Get_From_Member uri=${uri} member_index=${index} + Utils.Check Item Occurrence ${data} ${dictionary} + END Check_No_Content_Member_List_Or_All [Arguments] ${uri} ${member_index_list}=${EMPTY} [Documentation] Send a GET with the supplied uri to all or some members defined in ${member_index_list}. ... Then check there is no content. ${index_list} = List_Indices_Or_All given_list=${member_index_list} - : FOR ${index} IN @{index_list} - \ ${session} = Resolve_Http_Session_For_Member member_index=${index} - \ Utils.No_Content_From_URI ${session} ${uri} + FOR ${index} IN @{index_list} + ${session} = Resolve_Http_Session_For_Member member_index=${index} + Utils.No_Content_From_URI ${session} ${uri} + END Get_From_Member [Arguments] ${uri} ${member_index} ${access}=${ACCEPT_EMPTY} @@ -780,9 +801,10 @@ Resolve_IP_Address_For_Members [Arguments] ${member_index_list} [Documentation] Return a list of IP address of given indexes. ${member_ip_list} = BuiltIn.Create_List - : FOR ${index} IN @{member_index_list} - \ ${ip_address} = Collections.Get From Dictionary dictionary=${ClusterManagement__index_to_ip_mapping} key=${index} - \ Collections.Append_To_List ${member_ip_list} ${ip_address} + FOR ${index} IN @{member_index_list} + ${ip_address} = Collections.Get From Dictionary dictionary=${ClusterManagement__index_to_ip_mapping} key=${index} + Collections.Append_To_List ${member_ip_list} ${ip_address} + END [Return] ${member_ip_list} Resolve_Http_Session_For_Member @@ -840,9 +862,10 @@ ClusterManagement__Compute_Derived_Variables @{member_index_list} = BuiltIn.Create_List @{session_list} = BuiltIn.Create_List &{index_to_ip_mapping} = BuiltIn.Create_Dictionary - : FOR ${index} IN RANGE 1 ${int_of_members+1} - \ ClusterManagement__Include_Member_Index ${index} ${member_index_list} ${session_list} ${index_to_ip_mapping} http_timeout=${http_timeout} - \ ... http_retries=${http_retries} + FOR ${index} IN RANGE 1 ${int_of_members+1} + ClusterManagement__Include_Member_Index ${index} ${member_index_list} ${session_list} ${index_to_ip_mapping} http_timeout=${http_timeout} + ... http_retries=${http_retries} + END BuiltIn.Set_Suite_Variable \${ClusterManagement__member_index_list} ${member_index_list} BuiltIn.Set_Suite_Variable \${ClusterManagement__index_to_ip_mapping} ${index_to_ip_mapping} BuiltIn.Set_Suite_Variable \${ClusterManagement__session_list} ${session_list} @@ -885,11 +908,13 @@ Check Service Status ${service_status_output} = BuiltIn.Run Keyword If ${NUM_ODL_SYSTEM} > 1 KarafKeywords.Issue_Command_On_Karaf_Console showSvcStatus -n ${odl_ip} ${odl_ip} ${KARAF_SHELL_PORT} ... ELSE KarafKeywords.Issue_Command_On_Karaf_Console showSvcStatus ${odl_ip} ${KARAF_SHELL_PORT} BuiltIn.Should Contain ${service_status_output} ${system_ready_state} - : FOR ${service} IN @{service_list} - \ BuiltIn.Should Match Regexp ${service_status_output} ${service} +: ${service_state} + FOR ${service} IN @{service_list} + BuiltIn.Should Match Regexp ${service_status_output} ${service} +: ${service_state} + END Check Status Of Services Is OPERATIONAL [Arguments] @{service_list} [Documentation] This keyword will verify whether all the services are operational in all the ODL nodes - : FOR ${i} IN RANGE ${NUM_ODL_SYSTEM} - \ ClusterManagement.Check Service Status ${ODL_SYSTEM_${i+1}_IP} ACTIVE OPERATIONAL @{service_list} + FOR ${i} IN RANGE ${NUM_ODL_SYSTEM} + ClusterManagement.Check Service Status ${ODL_SYSTEM_${i+1}_IP} ACTIVE OPERATIONAL @{service_list} + END diff --git a/csit/libraries/ClusterOpenFlow.robot b/csit/libraries/ClusterOpenFlow.robot index ae539deb6d..4936e3de43 100644 --- a/csit/libraries/ClusterOpenFlow.robot +++ b/csit/libraries/ClusterOpenFlow.robot @@ -157,16 +157,17 @@ Check Linear Topology On Member ${resp} RequestsLibrary.Get Request ${session} ${OPERATIONAL_TOPO_API} Log ${resp.content} Should Be Equal As Strings ${resp.status_code} 200 - : FOR ${switch} IN RANGE 1 ${switches+1} - \ Should Contain ${resp.content} "node-id":"openflow:${switch}" - \ Should Contain ${resp.content} "tp-id":"openflow:${switch}:1" - \ Should Contain ${resp.content} "tp-id":"openflow:${switch}:2" - \ Should Contain ${resp.content} "source-tp":"openflow:${switch}:2" - \ Should Contain ${resp.content} "dest-tp":"openflow:${switch}:2" - \ ${edge} Evaluate ${switch}==1 or ${switch}==${switches} - \ Run Keyword Unless ${edge} Should Contain ${resp.content} "tp-id":"openflow:${switch}:3" - \ Run Keyword Unless ${edge} Should Contain ${resp.content} "source-tp":"openflow:${switch}:3" - \ Run Keyword Unless ${edge} Should Contain ${resp.content} "dest-tp":"openflow:${switch}:3 + FOR ${switch} IN RANGE 1 ${switches+1} + Should Contain ${resp.content} "node-id":"openflow:${switch}" + Should Contain ${resp.content} "tp-id":"openflow:${switch}:1" + Should Contain ${resp.content} "tp-id":"openflow:${switch}:2" + Should Contain ${resp.content} "source-tp":"openflow:${switch}:2" + Should Contain ${resp.content} "dest-tp":"openflow:${switch}:2" + ${edge} Evaluate ${switch}==1 or ${switch}==${switches} + Run Keyword Unless ${edge} Should Contain ${resp.content} "tp-id":"openflow:${switch}:3" + Run Keyword Unless ${edge} Should Contain ${resp.content} "source-tp":"openflow:${switch}:3" + Run Keyword Unless ${edge} Should Contain ${resp.content} "dest-tp":"openflow:${switch}:3 + END Check No Switches On Member [Arguments] ${switches} ${member_index}=1 @@ -175,8 +176,9 @@ Check No Switches On Member ${resp} RequestsLibrary.Get Request ${session} ${OPERATIONAL_TOPO_API} Log ${resp.content} Should Be Equal As Strings ${resp.status_code} 200 - : FOR ${switch} IN RANGE 1 ${switches+1} - \ Should Not Contain ${resp.content} openflow:${switch} + FOR ${switch} IN RANGE 1 ${switches+1} + Should Not Contain ${resp.content} openflow:${switch} + END Check Number Of Flows On Member [Arguments] ${flows} ${member_index}=1 diff --git a/csit/libraries/Coe.robot b/csit/libraries/Coe.robot index 3f9c287844..d9572bff8e 100644 --- a/csit/libraries/Coe.robot +++ b/csit/libraries/Coe.robot @@ -52,9 +52,10 @@ Start Suite Set Connection ids and Bridge [Documentation] Sets the connection ids for all the nodes and get the bridge from configuration file . - : FOR ${conn_id} IN @{TOOLS_SYSTEM_ALL_CONN_IDS} - \ SSHLibrary.Switch Connection ${conn_id} - \ SSHKeywords.Flexible_SSH_Login ${DEFAULT_USER} ${DEFAULT_PASSWORD} + FOR ${conn_id} IN @{TOOLS_SYSTEM_ALL_CONN_IDS} + SSHLibrary.Switch Connection ${conn_id} + SSHKeywords.Flexible_SSH_Login ${DEFAULT_USER} ${DEFAULT_PASSWORD} + END ${file} = OperatingSystem.Get File ${CONFIG_FILE_TEMPLATE} ${ovs bridge output} ${bridge} = BuiltIn.Should Match Regexp ${file} "ovsBridge": "(\\w.*)" BuiltIn.Set Suite Variable ${bridge} @@ -88,20 +89,22 @@ Modifying templates in playbook ${template} = String.Replace String ${template} minion_ip ${TOOLS_SYSTEM_ALL_IPS[0]} @{minions} Create List coe-minion ${hosts} Set Variable coe-master: - : FOR ${i} IN RANGE 1 ${NUM_TOOLS_SYSTEM} - \ Append To List ${minions} coe-minion${i} - \ ${hosts} = Catenate ${hosts} coe-minion${i}: + FOR ${i} IN RANGE 1 ${NUM_TOOLS_SYSTEM} + Append To List ${minions} coe-minion${i} + ${hosts} = Catenate ${hosts} coe-minion${i}: + END ${hosts} = Replace String Using Regexp ${hosts} :$ ${EMPTY} ${hosts} = Remove Space on String ${hosts} ${minion hosts} = Replace String Using Regexp ${hosts} ^[\\w-]+: ${EMPTY} - : FOR ${i} IN RANGE 1 ${NUM_TOOLS_SYSTEM} - \ ${j} = Evaluate ${i}+1 - \ ${template} = String.Replace String ${template} ${minions[${i}-1]} ${minions[${i}]} - \ ${template} = String.Replace String ${template} ${TOOLS_SYSTEM_ALL_IPS[${i}-1]} ${TOOLS_SYSTEM_ALL_IPS[${i}]} - \ ${template} = String.Replace String ${template} 192.168.50.1${i} 192.168.50.1${j} - \ ${template} = String.Replace String ${template} 10.11.${i}.0/24 10.11.${j}.0/24 - \ ${template} = String.Replace String ${template} 10.11.${i}.1 10.11.${j}.1 - \ Append To File ${HOST_INVENTORY} ${template} + FOR ${i} IN RANGE 1 ${NUM_TOOLS_SYSTEM} + ${j} = Evaluate ${i}+1 + ${template} = String.Replace String ${template} ${minions[${i}-1]} ${minions[${i}]} + ${template} = String.Replace String ${template} ${TOOLS_SYSTEM_ALL_IPS[${i}-1]} ${TOOLS_SYSTEM_ALL_IPS[${i}]} + ${template} = String.Replace String ${template} 192.168.50.1${i} 192.168.50.1${j} + ${template} = String.Replace String ${template} 10.11.${i}.0/24 10.11.${j}.0/24 + ${template} = String.Replace String ${template} 10.11.${i}.1 10.11.${j}.1 + Append To File ${HOST_INVENTORY} ${template} + END ${host file} = OperatingSystem.Get File ${HOST_INVENTORY} ${host file} = String.Replace String ${host file} master_ip ${TOOLS_SYSTEM_ALL_IPS[0]} ${host file} = String.Replace String ${host file} odl_ip ${ODL_SYSTEM_IP} @@ -114,10 +117,12 @@ Modifying templates in playbook Verify Config Files [Documentation] Checks if the configuration files are present in all nodes - : FOR ${nodes} IN @{TOOLS_SYSTEM_ALL_IPS} - \ Utils.Verify File Exists On Remote System ${nodes} ${CONFIG_FILE} - : FOR ${nodes} IN @{TOOLS_SYSTEM_ALL_IPS} - \ Utils.Verify File Exists On Remote System ${nodes} ${CNI_BINARY_FILE} + FOR ${nodes} IN @{TOOLS_SYSTEM_ALL_IPS} + Utils.Verify File Exists On Remote System ${nodes} ${CONFIG_FILE} + END + FOR ${nodes} IN @{TOOLS_SYSTEM_ALL_IPS} + Utils.Verify File Exists On Remote System ${nodes} ${CNI_BINARY_FILE} + END Verify Watcher Is Running [Documentation] Checks if watcher is running in the background @@ -136,28 +141,32 @@ Label Nodes ${i} = BuiltIn.Set Variable 1 ${get nodes} = Utils.Run Command On Remote System And Log ${K8s_MASTER_IP} kubectl get nodes @{get nodes} = String.Split To Lines ${get nodes} 2 - : FOR ${status} IN @{get nodes} - \ ${minion} = BuiltIn.Should Match Regexp ${status} ^\\w+-.*-\\d+ - \ Utils.Run Command On Remote System And Log ${K8s_MASTER_IP} kubectl label nodes ${minion} disktype=ss${i} - \ ${i} = BuiltIn.Evaluate ${i}+1 + FOR ${status} IN @{get nodes} + ${minion} = BuiltIn.Should Match Regexp ${status} ^\\w+-.*-\\d+ + Utils.Run Command On Remote System And Log ${K8s_MASTER_IP} kubectl label nodes ${minion} disktype=ss${i} + ${i} = BuiltIn.Evaluate ${i}+1 + END Utils.Run Command On Remote System And Log ${K8s_MASTER_IP} kubectl get nodes --show-labels Derive Coe Data Models [Documentation] Data models is created by integrating netvirt and coe data models which is given as input to get the model dumps - : FOR ${models} IN @{netvirt_data_models} - \ Collections.Append To List ${coe_data_models} ${models} + FOR ${models} IN @{netvirt_data_models} + Collections.Append To List ${coe_data_models} ${models} + END Check Pod Status Is Running [Documentation] Checks the status of pods.This keyword is repeated until the status of all pods is Running ${pods} = Utils.Run Command On Remote System And Log ${K8s_MASTER_IP} kubectl get pods -o wide ${DEFAULT_USER} ${DEFAULT_PASSWORD} ${DEFAULT_LINUX_PROMPT_STRICT} @{cluster} = String.Split To Lines ${pods} 1 - : FOR ${pod} IN @{cluster} - \ BuiltIn.Should Match Regexp ${pod} ${POD_RUNNING_STATUS} + FOR ${pod} IN @{cluster} + BuiltIn.Should Match Regexp ${pod} ${POD_RUNNING_STATUS} + END Tear Down [Documentation] Test teardown to get dumpflows,ovsconfig,model dump,node status,pod status and to dump config files \ and delete pods. - : FOR ${conn_id} IN @{TOOLS_SYSTEM_ALL_CONN_IDS} - \ OVSDB.Get DumpFlows And Ovsconfig ${conn_id} ${bridge} + FOR ${conn_id} IN @{TOOLS_SYSTEM_ALL_CONN_IDS} + OVSDB.Get DumpFlows And Ovsconfig ${conn_id} ${bridge} + END BuiltIn.Run Keyword And Ignore Error DataModels.Get Model Dump ${ODL_SYSTEM_IP} ${coe_data_models} Coe.DumpConfig File Utils.Run Command On Remote System And Log ${K8s_MASTER_IP} kubectl get nodes ${DEFAULT_USER} ${DEFAULT_PASSWORD} ${DEFAULT_LINUX_PROMPT_STRICT} @@ -168,9 +177,10 @@ Delete Pods [Documentation] Waits till the keyword delete status succeeds implying that all pods created have been deleted ${get pods} = Utils.Run Command On Remote System ${K8s_MASTER_IP} kubectl get pods -o wide @{get pods} = String.Split To Lines ${get pods} 1 - : FOR ${status} IN @{get pods} - \ ${pod_name} = BuiltIn.Should Match Regexp ${status} ^\\w+-\\w+ - \ Utils.Run Command On Remote System ${K8s_MASTER_IP} kubectl delete pods ${pod_name} + FOR ${status} IN @{get pods} + ${pod_name} = BuiltIn.Should Match Regexp ${status} ^\\w+-\\w+ + Utils.Run Command On Remote System ${K8s_MASTER_IP} kubectl delete pods ${pod_name} + END BuiltIn.Wait Until Keyword Succeeds 60s 3s Coe.Check If Pods Are Terminated Coe.Check For Stale veth Ports @@ -182,8 +192,9 @@ Check If Pods Are Terminated Dump Config File [Documentation] Logs the configuration files present in all nodes - : FOR ${nodes} IN @{TOOLS_SYSTEM_ALL_IPS} - \ Utils.Run Command On Remote System And Log ${nodes} cat ${CONFIG_FILE} + FOR ${nodes} IN @{TOOLS_SYSTEM_ALL_IPS} + Utils.Run Command On Remote System And Log ${nodes} cat ${CONFIG_FILE} + END Stop Suite [Documentation] Suite teardown keyword @@ -212,9 +223,10 @@ Stop Watcher Kube reset [Documentation] Reset K8s to clear up all stale entries - : FOR ${nodes} IN @{TOOLS_SYSTEM_ALL_IPS} - \ ${kube} = Utils.Run Command On Remote System And Log ${nodes} sudo kubeadm reset - \ BuiltIn.Should Contain ${kube} Stopping the kubelet service. + FOR ${nodes} IN @{TOOLS_SYSTEM_ALL_IPS} + ${kube} = Utils.Run Command On Remote System And Log ${nodes} sudo kubeadm reset + BuiltIn.Should Contain ${kube} Stopping the kubelet service. + END Create Pods [Arguments] ${label} ${yaml} ${name} @@ -232,28 +244,31 @@ Collect Pod Names and Ping ${get pods} = Write Commands Until Expected Prompt kubectl get pods -o wide ${DEFAULT_LINUX_PROMPT_STRICT} @{pod ips} = String.Get Regexp Matches ${get pods} \\d+\\.\\d+\\.\\d+\\.\\d+ @{pod names} = String.Get Regexp Matches ${get pods} ss\\w+-\\w+ - : FOR ${pod_name} IN @{pod names} - \ ${logs} = Log Statements ${pod ips} ${pod names} ${pod_name} - \ Ping Pods ${pod_name} ${pod ips} ${logs} + FOR ${pod_name} IN @{pod names} + ${logs} = Log Statements ${pod ips} ${pod names} ${pod_name} + Ping Pods ${pod_name} ${pod ips} ${logs} + END Log Statements [Arguments] ${pod ips} ${pod names} ${pod_name} @{log statement} = Create List ${i} = Set Variable 0 - : FOR ${pod_ip} IN @{pod ips} - \ ${ping statement} Set Variable Ping from ${pod_name} to ${pod names[${i}]} (${pod ip}) - \ Append To List ${log statement} ${ping statement} - \ ${i} = Evaluate ${i}+1 + FOR ${pod_ip} IN @{pod ips} + ${ping statement} Set Variable Ping from ${pod_name} to ${pod names[${i}]} (${pod ip}) + Append To List ${log statement} ${ping statement} + ${i} = Evaluate ${i}+1 + END [Return] @{log statement} Ping Pods [Arguments] ${pod_name} ${pod ips} ${logs} ${i} = Set Variable 0 - : FOR ${ping info} IN @{logs} - \ ${ping} = Write Commands Until Expected Prompt kubectl exec -it ${pod_name} -- ping -c 3 ${pod ips[${i}]} ${DEFAULT_LINUX_PROMPT_STRICT} - \ BuiltIn.log ${ping} - \ BuiltIn.Should Contain ${ping} 64 bytes - \ ${i} Evaluate ${i}+1 + FOR ${ping info} IN @{logs} + ${ping} = Write Commands Until Expected Prompt kubectl exec -it ${pod_name} -- ping -c 3 ${pod ips[${i}]} ${DEFAULT_LINUX_PROMPT_STRICT} + BuiltIn.log ${ping} + BuiltIn.Should Contain ${ping} 64 bytes + ${i} Evaluate ${i}+1 + END Coe Suite Teardown [Documentation] COE project requires stop suite to be executed only for the last test suite.This keyword find the current suite,compares it with the stored last suite value and executes Coe.Stop suite only if the cuurent suite is equal to the last suite. @@ -268,9 +283,10 @@ Extract current suite name BuiltIn.Log SUITES: ${SUITES} @{suite_names} Get Regexp Matches ${SUITES} coe\\/(\\w+).robot 1 @{suite_names_updated} Create List - : FOR ${suite} IN @{suite_names} - \ ${suite} Replace String ${suite} _ ${SPACE} - \ Append To List ${suite_names_updated} ${suite} + FOR ${suite} IN @{suite_names} + ${suite} Replace String ${suite} _ ${SPACE} + Append To List ${suite_names_updated} ${suite} + END ${num_suites} = BuiltIn.Get Length ${suite_names_updated} ${suite line} ${current_suite} = BuiltIn.Run Keyword If ${num_suites} > ${1} Should Match Regexp ${SUITE_NAME} .txt.(\\w.*) ... ELSE BuiltIn.Set Variable @{suite_names_updated}[0] @{suite_names_updated}[0] @@ -278,6 +294,7 @@ Extract current suite name Check For Stale veth Ports [Documentation] Check on switches(except master) where pods were created and deleted to ensure there are no stale veth ports left behind. - : FOR ${minion_index} IN RANGE 2 ${NUM_TOOLS_SYSTEM}+1 - \ ${switch output} = Utils.Run Command On Remote System And Log ${TOOLS_SYSTEM_${minion_index}_IP} sudo ovs-vsctl show - \ BuiltIn.Should Not Contain ${switch output} veth + FOR ${minion_index} IN RANGE 2 ${NUM_TOOLS_SYSTEM}+1 + ${switch output} = Utils.Run Command On Remote System And Log ${TOOLS_SYSTEM_${minion_index}_IP} sudo ovs-vsctl show + BuiltIn.Should Not Contain ${switch output} veth + END diff --git a/csit/libraries/CompareStream.robot b/csit/libraries/CompareStream.robot index e52be2e5b2..ee04dae782 100644 --- a/csit/libraries/CompareStream.robot +++ b/csit/libraries/CompareStream.robot @@ -116,15 +116,16 @@ CompareStream__Convert_Input ... are not supported. ${args} BuiltIn.Create_List ${kwargs} BuiltIn.Create_Dictionary - : FOR ${arg} IN @{arguments} - \ ${arg} BuiltIn.Convert_To_String ${arg} - \ ${removed} String.Remove_String ${arg} \n ${Space} \t - \ ... \r - \ ${splitted} BuiltIn.Run_Keyword_If "${removed[0]}" == "<" BuiltIn.Create List ${arg} - \ ... ELSE String.Split_String ${arg} separator== max_split=1 - \ ${len} BuiltIn.Get_Length ${splitted} - \ Run Keyword If ${len}==1 Collections.Append_To_List ${args} @{splitted}[0] - \ ... ELSE Collections.Set_To_Dictionary ${kwargs} @{splitted} + FOR ${arg} IN @{arguments} + ${arg} BuiltIn.Convert_To_String ${arg} + ${removed} String.Remove_String ${arg} \n ${Space} \t + ... \r + ${splitted} BuiltIn.Run_Keyword_If "${removed[0]}" == "<" BuiltIn.Create List ${arg} + ... ELSE String.Split_String ${arg} separator== max_split=1 + ${len} BuiltIn.Get_Length ${splitted} + Run Keyword If ${len}==1 Collections.Append_To_List ${args} @{splitted}[0] + ... ELSE Collections.Set_To_Dictionary ${kwargs} @{splitted} + END BuiltIn.Return_From_Keyword ${args} ${kwargs} Run_Keyword_If_At_Least diff --git a/csit/libraries/DIDMKeywords.robot b/csit/libraries/DIDMKeywords.robot index 036105c4a1..2d6f0c920f 100644 --- a/csit/libraries/DIDMKeywords.robot +++ b/csit/libraries/DIDMKeywords.robot @@ -33,9 +33,10 @@ Check Device IP ${device_keys}= Get Dictionary Keys ${node_data} Log ${device_keys} ${length}= Get Length ${device_keys} - : FOR ${index} IN RANGE 0 ${length} - \ ${line}= Get From List ${device_keys} ${index} - \ Run Keyword And Return If '${dev_ip}' == '${line}' Get From Dictionary ${node_data} ${dev_ip} + FOR ${index} IN RANGE 0 ${length} + ${line}= Get From List ${device_keys} ${index} + Run Keyword And Return If '${dev_ip}' == '${line}' Get From Dictionary ${node_data} ${dev_ip} + END [Return] ${dev_ip} Find Device Type @@ -46,9 +47,10 @@ Find Device Type ${device_keys}= Get Dictionary Keys ${node_data} Log ${device_keys} ${length}= Get Length ${device_keys} - : FOR ${index} IN RANGE 0 ${length} - \ ${line}= Get From List ${device_keys} ${index} - \ Run Keyword And Return If '${device_type}' == '${line}' Get From Dictionary ${node_data} ${device_type} + FOR ${index} IN RANGE 0 ${length} + ${line}= Get From List ${device_keys} ${index} + Run Keyword And Return If '${device_type}' == '${line}' Get From Dictionary ${node_data} ${device_type} + END [Return] ${device_type} Find Device Hardware @@ -57,9 +59,10 @@ Find Device Hardware ${device_keys}= Get Dictionary Keys ${node_data} Log ${device_keys} ${length}= Get Length ${device_keys} - : FOR ${index} IN RANGE 0 ${length} - \ ${line}= Get From List ${device_keys} ${index} - \ Run Keyword And Return If '${device_hw}' == '${line}' Get From Dictionary ${node_data} ${device_hw} + FOR ${index} IN RANGE 0 ${length} + ${line}= Get From List ${device_keys} ${index} + Run Keyword And Return If '${device_hw}' == '${line}' Get From Dictionary ${node_data} ${device_hw} + END [Return] ${device_hw} Find Device Software @@ -68,9 +71,10 @@ Find Device Software ${device_keys}= Get Dictionary Keys ${node_data} Log ${device_keys} ${length}= Get Length ${device_keys} - : FOR ${index} IN RANGE 0 ${length} - \ ${line}= Get From List ${device_keys} ${index} - \ Run Keyword And Return If '${device_sw}' == '${line}' Get From Dictionary ${node_data} ${device_sw} + FOR ${index} IN RANGE 0 ${length} + ${line}= Get From List ${device_keys} ${index} + Run Keyword And Return If '${device_sw}' == '${line}' Get From Dictionary ${node_data} ${device_sw} + END [Return] ${device_sw} Find Device Manufacturer @@ -79,9 +83,10 @@ Find Device Manufacturer ${device_keys}= Get Dictionary Keys ${node_data} Log ${device_keys} ${length}= Get Length ${device_keys} - : FOR ${index} IN RANGE 0 ${length} - \ ${line}= Get From List ${device_keys} ${index} - \ Run Keyword And Return If '${manufacture}' == '${line}' Get From Dictionary ${node_data} ${manufacture} + FOR ${index} IN RANGE 0 ${length} + ${line}= Get From List ${device_keys} ${index} + Run Keyword And Return If '${manufacture}' == '${line}' Get From Dictionary ${node_data} ${manufacture} + END [Return] ${manufacture} Find Serial Number @@ -90,9 +95,10 @@ Find Serial Number ${device_keys}= Get Dictionary Keys ${node_data} Log ${device_keys} ${length}= Get Length ${device_keys} - : FOR ${index} IN RANGE 0 ${length} - \ ${line}= Get From List ${device_keys} ${index} - \ Run Keyword And Return If '${serial_number}' == '${line}' Get From Dictionary ${node_data} ${serial_number} + FOR ${index} IN RANGE 0 ${length} + ${line}= Get From List ${device_keys} ${index} + Run Keyword And Return If '${serial_number}' == '${line}' Get From Dictionary ${node_data} ${serial_number} + END [Return] ${serial_number} Find Device Description @@ -101,7 +107,8 @@ Find Device Description ${device_keys}= Get Dictionary Keys ${node_data} Log ${device_keys} ${length}= Get Length ${device_keys} - : FOR ${index} IN RANGE 0 ${length} - \ ${line}= Get From List ${device_keys} ${index} - \ Run Keyword And Return If '${description}' == '${line}' Get From Dictionary ${node_data} ${description} + FOR ${index} IN RANGE 0 ${length} + ${line}= Get From List ${device_keys} ${index} + Run Keyword And Return If '${description}' == '${line}' Get From Dictionary ${node_data} ${description} + END [Return] ${description} diff --git a/csit/libraries/DaeximKeywords.robot b/csit/libraries/DaeximKeywords.robot index 5ed266ad90..f52f619bcd 100644 --- a/csit/libraries/DaeximKeywords.robot +++ b/csit/libraries/DaeximKeywords.robot @@ -199,10 +199,11 @@ Fetch Status Information From Netconf Endpoint Verify Status Information [Arguments] ${endpoint} ${host_index} ${itr}=50 [Documentation] Verify if a netconf endpoint status is connected by running in a loop - : FOR ${i} IN RANGE ${itr} - \ ${sts} ${op} Fetch Status Information From Netconf Endpoint ${endpoint} ${host_index} - \ Builtin.Log ${i} - \ Builtin.Exit For Loop If "${sts}" == "${NTCF_OPR_STATUS}" + FOR ${i} IN RANGE ${itr} + ${sts} ${op} Fetch Status Information From Netconf Endpoint ${endpoint} ${host_index} + Builtin.Log ${i} + Builtin.Exit For Loop If "${sts}" == "${NTCF_OPR_STATUS}" + END [Return] ${sts} ${op} Verify Netconf Mount @@ -233,5 +234,6 @@ Cleanup Cluster Export Files [Arguments] ${member_index_list}=${EMPTY} [Documentation] This keyword cleansup export files of a cluster ${index_list} = List Indices Or All given_list=${member_index_list} - : FOR ${index} IN @{index_list} # usually: 1, 2, 3. - \ DaeximKeywords.Cleanup The Export Files ${index} + FOR ${index} IN @{index_list} # usually: 1, 2, 3. + DaeximKeywords.Cleanup The Export Files ${index} + END diff --git a/csit/libraries/DataModels.robot b/csit/libraries/DataModels.robot index 51fab3c575..d97a069e1a 100644 --- a/csit/libraries/DataModels.robot +++ b/csit/libraries/DataModels.robot @@ -17,10 +17,11 @@ Get Model Dump # is resolved, we can remove the timeout=1 and max_retries=0, but likely have to modify the request itself to # pass a timeout to restconf Create Session model_dump_session http://${controller_ip}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS} timeout=1 max_retries=0 - : FOR ${model} IN @{data_models} - \ ${resp}= RequestsLibrary.Get Request model_dump_session restconf/${model} - \ ${pretty_output}= To Json ${resp.content} pretty_print=True - \ Log ${pretty_output} + FOR ${model} IN @{data_models} + ${resp}= RequestsLibrary.Get Request model_dump_session restconf/${model} + ${pretty_output}= To Json ${resp.content} pretty_print=True + Log ${pretty_output} + END Verify No Ingress Dispatcher Non-Default Flow Entries [Arguments] ${ovs_ip} @@ -31,5 +32,6 @@ Verify No Ingress Dispatcher Non-Default Flow Entries Verify Flows Are Cleaned Up On All OpenStack Nodes [Documentation] Verify flows are cleaned up from all OpenStack nodes - : FOR ${ip} IN @{OS_ALL_IPS} - \ Run Keyword And Continue On Failure Verify No Ingress Dispatcher Non-Default Flow Entries ${ip} + FOR ${ip} IN @{OS_ALL_IPS} + Run Keyword And Continue On Failure Verify No Ingress Dispatcher Non-Default Flow Entries ${ip} + END diff --git a/csit/libraries/DatastoreCRUD.robot b/csit/libraries/DatastoreCRUD.robot index 7ac899c931..ce6f98a50e 100644 --- a/csit/libraries/DatastoreCRUD.robot +++ b/csit/libraries/DatastoreCRUD.robot @@ -12,13 +12,14 @@ Create Records ... onto which will be appended the index number. Prefix and postfix are used to complete ... the JSON payload. The keyword passes if return code is correct. ${last} Convert to Integer ${last} - : FOR ${INDEX} IN RANGE ${first} ${last+1} - \ ${payload}= Assemble Payload ${INDEX} ${prefix} ${field bases} ${postfix} - \ Log ${payload} - \ Create_Session session http://${controller_ip}:${RESTCONFPORT}${CONFIG_API} headers=${HEADERS} auth=${AUTH} - \ ${resp} RequestsLibrary.Post Request session ${node} ${payload} - \ Log ${resp} - \ Should Be Equal As Strings ${resp} + FOR ${INDEX} IN RANGE ${first} ${last+1} + ${payload}= Assemble Payload ${INDEX} ${prefix} ${field bases} ${postfix} + Log ${payload} + Create_Session session http://${controller_ip}:${RESTCONFPORT}${CONFIG_API} headers=${HEADERS} auth=${AUTH} + ${resp} RequestsLibrary.Post Request session ${node} ${payload} + Log ${resp} + Should Be Equal As Strings ${resp} + END Read Records [Arguments] ${controller_ip} ${node} @@ -35,22 +36,24 @@ Update Records ... onto which will be appended the index number. Prefix and postfix are used to complete ... the JSON payload. The keyword passes if return code is correct. ${last} Convert to Integer ${last} - : FOR ${INDEX} IN RANGE ${first} ${last+1} - \ ${payload}= Assemble Payload ${INDEX} ${prefix} ${field bases} ${postfix} - \ Log ${payload} - \ Create_Session session http://${controller_ip}:${RESTCONFPORT}${CONFIG_API} headers=${HEADERS} auth=${AUTH} - \ ${resp}= RequestsLibrary.Put Request session ${node}/${INDEX} ${payload} - \ Log ${resp} - \ Should Be Equal As Strings ${resp} + FOR ${INDEX} IN RANGE ${first} ${last+1} + ${payload}= Assemble Payload ${INDEX} ${prefix} ${field bases} ${postfix} + Log ${payload} + Create_Session session http://${controller_ip}:${RESTCONFPORT}${CONFIG_API} headers=${HEADERS} auth=${AUTH} + ${resp}= RequestsLibrary.Put Request session ${node}/${INDEX} ${payload} + Log ${resp} + Should Be Equal As Strings ${resp} + END Delete Records [Arguments] ${controller_ip} ${node} ${first} ${last} [Documentation] DELETEs specified range of records from a shard on a contrsoller's data store. ${last} Convert to Integer ${last} - : FOR ${INDEX} IN RANGE ${first} ${last+1} - \ Create_Session session http://${controller_ip}:${RESTCONFPORT}${CONFIG_API} headers=${HEADERS} auth=${AUTH} - \ ${resp}= RequestsLibrary.Delete Request session ${node}/${INDEX} - \ Should Be Equal As Strings ${resp} + FOR ${INDEX} IN RANGE ${first} ${last+1} + Create_Session session http://${controller_ip}:${RESTCONFPORT}${CONFIG_API} headers=${HEADERS} auth=${AUTH} + ${resp}= RequestsLibrary.Delete Request session ${node}/${INDEX} + Should Be Equal As Strings ${resp} + END Delete All Records [Arguments] ${controller_ip} ${node} @@ -69,9 +72,10 @@ Assemble Payload ${length}= Get Length ${field bases} ${keys}= Get Dictionary Keys ${field bases} ${payload}= Set Variable ${prefix} - : FOR ${key string} IN @{keys} - \ ${value string}= Get From Dictionary ${field bases} ${key string} - \ ${payload}= Catenate ${payload} "${key string}": "${value string}${id}", + FOR ${key string} IN @{keys} + ${value string}= Get From Dictionary ${field bases} ${key string} + ${payload}= Catenate ${payload} "${key string}": "${value string}${id}", + END ${payload}= Get Substring ${payload} ${EMPTY} -1 ${payload}= Catenate ${payload} ${postfix} [Return] ${payload} diff --git a/csit/libraries/ExaBgpLib.robot b/csit/libraries/ExaBgpLib.robot index 6b38c48622..ef110c9ee5 100644 --- a/csit/libraries/ExaBgpLib.robot +++ b/csit/libraries/ExaBgpLib.robot @@ -53,12 +53,13 @@ Start_ExaBgp_And_Verify_Connected [Arguments] ${cfg_file} ${session} ${exabgp_ip} ${connection_retries}=${3} [Documentation] Starts the ExaBgp and verifies its connection. The verification is done by checking the presence ... of the peer in the bgp rib. - : FOR ${idx} IN RANGE ${connection_retries} - \ Start_ExaBgp ${cfg_file} - \ ${status} ${value}= BuiltIn.Run_Keyword_And_Ignore_Error BuiltIn.Wait_Until_Keyword_Succeeds 3x 3s - \ ... Verify_ExaBgps_Connection ${session} ${exabgp_ip} connected=${True} - \ BuiltIn.Run_Keyword_Unless "${status}" == "PASS" Stop_ExaBgp - \ BuiltIn.Return_From_Keyword_If "${status}" == "PASS" + FOR ${idx} IN RANGE ${connection_retries} + Start_ExaBgp ${cfg_file} + ${status} ${value}= BuiltIn.Run_Keyword_And_Ignore_Error BuiltIn.Wait_Until_Keyword_Succeeds 3x 3s + ... Verify_ExaBgps_Connection ${session} ${exabgp_ip} connected=${True} + BuiltIn.Run_Keyword_Unless "${status}" == "PASS" Stop_ExaBgp + BuiltIn.Return_From_Keyword_If "${status}" == "PASS" + END BuiltIn.Fail Unable to connect ExaBgp to ODL Verify_ExaBgps_Connection @@ -74,12 +75,13 @@ Upload_ExaBgp_Cluster_Config_Files [Documentation] Uploads exabgp config files. SSHLibrary.Put_File ${bgp_var_folder}/${cfg_file} . @{cfgfiles}= SSHLibrary.List_Files_In_Directory . *.cfg - : FOR ${cfgfile} IN @{cfgfiles} - \ SSHLibrary.Execute_Command sed -i -e 's/EXABGPIP/${TOOLS_SYSTEM_IP}/g' ${cfgfile} - \ SSHLibrary.Execute_Command sed -i -e 's/ODLIP1/${ODL_SYSTEM_1_IP}/g' ${cfgfile} - \ SSHLibrary.Execute_Command sed -i -e 's/ODLIP2/${ODL_SYSTEM_2_IP}/g' ${cfgfile} - \ SSHLibrary.Execute_Command sed -i -e 's/ODLIP3/${ODL_SYSTEM_3_IP}/g' ${cfgfile} - \ SSHLibrary.Execute_Command sed -i -e 's/ROUTEREFRESH/disable/g' ${cfgfile} - \ SSHLibrary.Execute_Command sed -i -e 's/ADDPATH/disable/g' ${cfgfile} - \ ${stdout}= SSHLibrary.Execute_Command cat ${cfgfile} - \ Log ${stdout} + FOR ${cfgfile} IN @{cfgfiles} + SSHLibrary.Execute_Command sed -i -e 's/EXABGPIP/${TOOLS_SYSTEM_IP}/g' ${cfgfile} + SSHLibrary.Execute_Command sed -i -e 's/ODLIP1/${ODL_SYSTEM_1_IP}/g' ${cfgfile} + SSHLibrary.Execute_Command sed -i -e 's/ODLIP2/${ODL_SYSTEM_2_IP}/g' ${cfgfile} + SSHLibrary.Execute_Command sed -i -e 's/ODLIP3/${ODL_SYSTEM_3_IP}/g' ${cfgfile} + SSHLibrary.Execute_Command sed -i -e 's/ROUTEREFRESH/disable/g' ${cfgfile} + SSHLibrary.Execute_Command sed -i -e 's/ADDPATH/disable/g' ${cfgfile} + ${stdout}= SSHLibrary.Execute_Command cat ${cfgfile} + Log ${stdout} + END diff --git a/csit/libraries/FlowLib.robot b/csit/libraries/FlowLib.robot index e65a04a32f..143b06f46d 100644 --- a/csit/libraries/FlowLib.robot +++ b/csit/libraries/FlowLib.robot @@ -18,8 +18,9 @@ Check No Switches In Inventory [Documentation] Check no switch is in inventory ${resp} RequestsLibrary.Get Request session ${OPERATIONAL_NODES_API} Log ${resp.content} - : FOR ${switch} IN RANGE 1 ${switches+1} - \ Should Not Contain ${resp.content} "openflow:${switch}" + FOR ${switch} IN RANGE 1 ${switches+1} + Should Not Contain ${resp.content} "openflow:${switch}" + END Check No Switches In Topology [Arguments] ${switches} @@ -27,18 +28,20 @@ Check No Switches In Topology ${resp} RequestsLibrary.Get Request session ${OPERATIONAL_TOPO_API} Log ${resp.content} Should Be Equal As Strings ${resp.status_code} 200 - : FOR ${switch} IN RANGE 1 ${switches+1} - \ Should Not Contain ${resp.content} openflow:${switch} + FOR ${switch} IN RANGE 1 ${switches+1} + Should Not Contain ${resp.content} openflow:${switch} + END Check Switches In Inventory [Arguments] ${switches} [Documentation] Check all switches and stats in operational inventory - : FOR ${switch} IN RANGE 1 ${switches+1} - \ ${resp} RequestsLibrary.Get Request session ${OPERATIONAL_NODES_API}/node/openflow:${switch} - \ Log ${resp.content} - \ Should Be Equal As Strings ${resp.status_code} 200 - \ Should Contain ${resp.content} flow-capable-node-connector-statistics - \ Should Contain ${resp.content} flow-table-statistics + FOR ${switch} IN RANGE 1 ${switches+1} + ${resp} RequestsLibrary.Get Request session ${OPERATIONAL_NODES_API}/node/openflow:${switch} + Log ${resp.content} + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain ${resp.content} flow-capable-node-connector-statistics + Should Contain ${resp.content} flow-table-statistics + END Check Switches In Topology [Arguments] ${switches} @@ -64,16 +67,17 @@ Check Linear Topology ${resp} RequestsLibrary.Get Request session ${OPERATIONAL_TOPO_API} Log ${resp.content} Should Be Equal As Strings ${resp.status_code} 200 - : FOR ${switch} IN RANGE 1 ${switches+1} - \ Should Contain ${resp.content} "node-id":"openflow:${switch}" - \ Should Contain ${resp.content} "tp-id":"openflow:${switch}:1" - \ Should Contain ${resp.content} "tp-id":"openflow:${switch}:2" - \ Should Contain ${resp.content} "source-tp":"openflow:${switch}:2" - \ Should Contain ${resp.content} "dest-tp":"openflow:${switch}:2" - \ ${edge} Evaluate ${switch}==1 or ${switch}==${switches} - \ Run Keyword Unless ${edge} Should Contain ${resp.content} "tp-id":"openflow:${switch}:3" - \ Run Keyword Unless ${edge} Should Contain ${resp.content} "source-tp":"openflow:${switch}:3" - \ Run Keyword Unless ${edge} Should Contain ${resp.content} "dest-tp":"openflow:${switch}:3" + FOR ${switch} IN RANGE 1 ${switches+1} + Should Contain ${resp.content} "node-id":"openflow:${switch}" + Should Contain ${resp.content} "tp-id":"openflow:${switch}:1" + Should Contain ${resp.content} "tp-id":"openflow:${switch}:2" + Should Contain ${resp.content} "source-tp":"openflow:${switch}:2" + Should Contain ${resp.content} "dest-tp":"openflow:${switch}:2" + ${edge} Evaluate ${switch}==1 or ${switch}==${switches} + Run Keyword Unless ${edge} Should Contain ${resp.content} "tp-id":"openflow:${switch}:3" + Run Keyword Unless ${edge} Should Contain ${resp.content} "source-tp":"openflow:${switch}:3" + Run Keyword Unless ${edge} Should Contain ${resp.content} "dest-tp":"openflow:${switch}:3" + END Check Flows Operational Datastore [Arguments] ${flow_count} ${controller_ip}=${ODL_SYSTEM_IP} @@ -127,15 +131,17 @@ Add Table Miss Flows [Documentation] Add table miss flows to switches. ${switches}= Convert To Integer ${switches} ${data}= OperatingSystem.Get File ${CURDIR}/../variables/openflowplugin/table_miss_flow.json - : FOR ${switch} IN RANGE 1 ${switches+1} - \ TemplatedRequests.Put As Json To Uri ${CONFIG_NODES_API}/node/openflow:${switch}/table/0/flow/default ${data} session + FOR ${switch} IN RANGE 1 ${switches+1} + TemplatedRequests.Put As Json To Uri ${CONFIG_NODES_API}/node/openflow:${switch}/table/0/flow/default ${data} session + END Check Table Miss Flows [Arguments] ${switches} [Documentation] Check table miss flows in switches. ${switches}= Convert To Integer ${switches} - : FOR ${switch} IN RANGE 1 ${switches+1} - \ TemplatedRequests.Get As Json From Uri ${OPERATIONAL_NODES_API}/node/openflow:${switch}/table/0/flow/default session + FOR ${switch} IN RANGE 1 ${switches+1} + TemplatedRequests.Get As Json From Uri ${OPERATIONAL_NODES_API}/node/openflow:${switch}/table/0/flow/default session + END Create Inventory Flow [Documentation] Calls FlowLib.Make_Inventory_Flow function and initializes and sanitizes @@ -293,8 +299,9 @@ Verify Flow On Mininet Switch Sleep 1 Write dpctl dump-flows -O OpenFlow13 ${switchoutput} Read Until > - : FOR ${flowElement} IN @{flow_elements} - \ Should Contain ${switchoutput} ${flowElement} + FOR ${flowElement} IN @{flow_elements} + Should Contain ${switchoutput} ${flowElement} + END Remove Group From Controller And Verify [Arguments] ${node_id} ${group_id} @@ -324,8 +331,9 @@ Verify Flow Does Not Exist On Mininet Switch Sleep 1 Write dpctl dump-flows -O OpenFlow13 ${switchoutput} Read Until > - : FOR ${flowElement} IN @{flow_elements} - \ Should Not Contain ${switchoutput} ${flowElement} + FOR ${flowElement} IN @{flow_elements} + Should Not Contain ${switchoutput} ${flowElement} + END Remove Default Flows [Arguments] ${node_id} diff --git a/csit/libraries/GBP/AssertionUtils.robot b/csit/libraries/GBP/AssertionUtils.robot index fbd2ead828..392f56801c 100644 --- a/csit/libraries/GBP/AssertionUtils.robot +++ b/csit/libraries/GBP/AssertionUtils.robot @@ -78,13 +78,14 @@ Check Endpoint Should Be Equal As Strings ${ep_tenant} ${tenant} Check Group References ${epg} @{ep_endpoint_groups} LOG ${ep_l3-addresses} - : FOR ${l3} IN @{ep_l3-addresses} - \ LOG ${l3-context} - \ LOG ${ip_address} - \ LOG ${l3['l3-context']} - \ LOG ${l3['ip-address']} - \ Continue For Loop If "${l3['l3-context']}" == "${l3-context}" and "${l3['ip-address']}" == "${ip_address}" - \ Fail + FOR ${l3} IN @{ep_l3-addresses} + LOG ${l3-context} + LOG ${ip_address} + LOG ${l3['l3-context']} + LOG ${l3['ip-address']} + Continue For Loop If "${l3['l3-context']}" == "${l3-context}" and "${l3['ip-address']}" == "${ip_address}" + Fail + END Check Endpoint-L3 [Arguments] ${endpoint-l3} ${mac_address} ${epg} ${l2-context} ${network-containment} ${tenant} @@ -107,10 +108,11 @@ Check Group References ... among given endpoint groups Should Not Be Empty ${epg_to_look_for} Should Not Be Empty ${endpoint_groups} - : FOR ${epg} IN @{endpoint_groups} - \ Continue For Loop If "${epg}" == "${epg_to_look_for}" - \ Continue For Loop If "${epg}" == "${NETWORK_CLIENT_GROUP}" - \ Fail + FOR ${epg} IN @{endpoint_groups} + Continue For Loop If "${epg}" == "${epg_to_look_for}" + Continue For Loop If "${epg}" == "${NETWORK_CLIENT_GROUP}" + Fail + END Check Endpoint Group Name and Selector [Arguments] ${epg_id} ${epg_name} ${tenant_id} ${contract_id} ${named-selector} @@ -122,6 +124,7 @@ Check Endpoint Group Name and Selector ${endpoint_group_json} To Json ${endpoint_group} ${named_selectors} Set Variable ${endpoint_group_json['endpoint-group'][0]['${named-selector}']} ${selector_found} Set Variable FALSE - : FOR ${selector} IN @{named_selectors} - \ Return From Keyword If "${selector['contract'][0]}" == "${contract_id}" + FOR ${selector} IN @{named_selectors} + Return From Keyword If "${selector['contract'][0]}" == "${contract_id}" + END Fail diff --git a/csit/libraries/GBP/OpenFlowUtils.robot b/csit/libraries/GBP/OpenFlowUtils.robot index 73bfc8bb69..69729ef9c1 100644 --- a/csit/libraries/GBP/OpenFlowUtils.robot +++ b/csit/libraries/GBP/OpenFlowUtils.robot @@ -113,12 +113,13 @@ Find Flow in DPCTL Output @{lines} Split To Lines ${output} ${match_result} Set Variable ${action_result} Set Variable - : FOR ${line} IN @{lines} - \ ${match} Get Matches Part ${line} - \ ${action} Get Actions Part ${line} - \ ${match_result} Check Match ${match} @{flow_match_criteria} - \ ${action_result} Check Match ${action} @{flow_action_criteria} - \ Run Keyword If "${match_result}" == "TRUE" and "${action_result}" == "TRUE" Return From Keyword ${line} + FOR ${line} IN @{lines} + ${match} Get Matches Part ${line} + ${action} Get Actions Part ${line} + ${match_result} Check Match ${match} @{flow_match_criteria} + ${action_result} Check Match ${action} @{flow_action_criteria} + Run Keyword If "${match_result}" == "TRUE" and "${action_result}" == "TRUE" Return From Keyword ${line} + END Log ${flow_match_criteria} Log ${flow_action_criteria} Fail Flow not found! @@ -140,12 +141,13 @@ Check Match [Arguments] ${string} @{match_criteria} [Documentation] Applies 'grep' on the string argument for each criterion. ${conditions} Set Variable - : FOR ${criterio} IN @{match_criteria} - \ ${grep_criterio} Catenate | grep ${criterio} - \ ${conditions} Catenate ${conditions} ${grep_criterio} - \ ${debug_output} OperatingSystem.Run echo "${string}" ${conditions} - \ Log ${debug_output} - \ Run Keyword If "${debug_output}" == "${EMPTY}" Log ${criterio} + FOR ${criterio} IN @{match_criteria} + ${grep_criterio} Catenate | grep ${criterio} + ${conditions} Catenate ${conditions} ${grep_criterio} + ${debug_output} OperatingSystem.Run echo "${string}" ${conditions} + Log ${debug_output} + Run Keyword If "${debug_output}" == "${EMPTY}" Log ${criterio} + END ${output} OperatingSystem.Run echo "${string}" ${conditions} Log ${output} Run Keyword If "${output}" == "${EMPTY}" Return From Keyword FALSE diff --git a/csit/libraries/GBP/RestconfUtils.robot b/csit/libraries/GBP/RestconfUtils.robot index cc08418e7f..268226a6a3 100644 --- a/csit/libraries/GBP/RestconfUtils.robot +++ b/csit/libraries/GBP/RestconfUtils.robot @@ -30,16 +30,18 @@ Unregister Endpoints Unregister L2Endpoints [Arguments] ${l2_eps} [Documentation] Unregister Endpoints L2Endpoints from ODL - : FOR ${endpoint} IN @{l2_eps} - \ ${l2_data} = Create L2 Endpoint JSON Data ${endpoint} - \ Post Elements To URI ${ENDPOINT_UNREG_PATH} ${l2_data} ${HEADERS_YANG_JSON} + FOR ${endpoint} IN @{l2_eps} + ${l2_data} = Create L2 Endpoint JSON Data ${endpoint} + Post Elements To URI ${ENDPOINT_UNREG_PATH} ${l2_data} ${HEADERS_YANG_JSON} + END Unregister L3Endpoints [Arguments] ${l3_eps} [Documentation] Unregister Endpoints L3Endpoints from ODL - : FOR ${endpoint} IN @{l3_eps} - \ ${l3_data} = Create L3 Endpoint JSON Data ${endpoint} - \ Post Elements To URI ${ENDPOINT_UNREG_PATH} ${l3_data} ${HEADERS_YANG_JSON} + FOR ${endpoint} IN @{l3_eps} + ${l3_data} = Create L3 Endpoint JSON Data ${endpoint} + Post Elements To URI ${ENDPOINT_UNREG_PATH} ${l3_data} ${HEADERS_YANG_JSON} + END Create L2 Endpoint JSON Data [Arguments] ${endpoint} diff --git a/csit/libraries/GbpSxp.robot b/csit/libraries/GbpSxp.robot index 581aa53dbf..54864522fb 100644 --- a/csit/libraries/GbpSxp.robot +++ b/csit/libraries/GbpSxp.robot @@ -64,12 +64,13 @@ Teardown_Ise_Mock_Server Teardown_Ssh_Tooling [Arguments] ${session_list}=@{EMPTY} [Documentation] Deactivate virtualenv and close ssh session on tools system - : FOR ${ssh_session} IN @{session_list} - \ BuiltIn.Log ${ssh_session} - \ SSHKeywords.Restore_Current_Ssh_Connection_From_Index ${ssh_session} - \ SSHKeywords.Virtual_Env_Deactivate_On_Current_Session - \ SSHKeywords.Virtual_Env_Delete - # fallback to single session + FOR ${ssh_session} IN @{session_list} + BuiltIn.Log ${ssh_session} + SSHKeywords.Restore_Current_Ssh_Connection_From_Index ${ssh_session} + SSHKeywords.Virtual_Env_Deactivate_On_Current_Session + SSHKeywords.Virtual_Env_Delete + # fallback to single session + END ${session_list_size} get length ${session_list} BuiltIn.Log ${session_list_size} BuiltIn.Run_Keyword_If ${session_list_size} == 0 SSHKeywords.Virtual_Env_Deactivate_On_Current_Session diff --git a/csit/libraries/Genius.robot b/csit/libraries/Genius.robot index bf8aedcc4b..6080bfc800 100644 --- a/csit/libraries/Genius.robot +++ b/csit/libraries/Genius.robot @@ -62,19 +62,21 @@ Start Suite Stop Suite [Documentation] stops all connections and deletes all the bridges available on OVS - : FOR ${tool_system_index} IN RANGE ${NUM_TOOLS_SYSTEM} - \ SSHLibrary.Switch Connection @{TOOLS_SYSTEM_ALL_CONN_IDS}[${tool_system_index}] - \ SSHLibrary.Execute Command sudo ovs-vsctl del-br ${Bridge} - \ SSHLibrary.Execute Command sudo ovs-vsctl del-manager - \ SSHLibrary.Write exit - \ SSHLibrary.Close Connection + FOR ${tool_system_index} IN RANGE ${NUM_TOOLS_SYSTEM} + SSHLibrary.Switch Connection @{TOOLS_SYSTEM_ALL_CONN_IDS}[${tool_system_index}] + SSHLibrary.Execute Command sudo ovs-vsctl del-br ${Bridge} + SSHLibrary.Execute Command sudo ovs-vsctl del-manager + SSHLibrary.Write exit + SSHLibrary.Close Connection + END Check Port Status Is ESTABLISHED [Arguments] ${port} @{tools_ips} [Documentation] This keyword will check whether ports are established or not on OVS - : FOR ${tools_ip} IN @{tools_ips} - \ ${check_establishment} = Utils.Run Command On Remote System And Log ${tools_ip} netstat -anp | grep ${port} - \ BuiltIn.Should Contain ${check_establishment} ESTABLISHED + FOR ${tools_ip} IN @{tools_ips} + ${check_establishment} = Utils.Run Command On Remote System And Log ${tools_ip} netstat -anp | grep ${port} + BuiltIn.Should Contain ${check_establishment} ESTABLISHED + END [Return] ${check_establishment} Create Vteps @@ -95,19 +97,21 @@ Set Json ... ELSE BuiltIn.Set Variable ${body} ${body} = BuiltIn.Run Keyword If ${odl_stream_check } String.Replace String ${body} "gateway-ip": "0.0.0.0" "gateway-ip": "${gateway_ip}" ... ELSE BuiltIn.Set Variable ${body} - : FOR ${tool_system_index} IN RANGE ${NUM_TOOLS_SYSTEM} - \ ${body} String.Replace String ${body} "dpn-id": 10${tool_system_index} "dpn-id": ${DPN_ID_LIST[${tool_system_index}]} - \ ${body} String.Replace String ${body} "ip-address": "${tool_system_index+2}.${tool_system_index+2}.${tool_system_index+2}.${tool_system_index+2}" "ip-address": "@{tools_ips}[${tool_system_index}]" + FOR ${tool_system_index} IN RANGE ${NUM_TOOLS_SYSTEM} + ${body} String.Replace String ${body} "dpn-id": 10${tool_system_index} "dpn-id": ${DPN_ID_LIST[${tool_system_index}]} + ${body} String.Replace String ${body} "ip-address": "${tool_system_index+2}.${tool_system_index+2}.${tool_system_index+2}.${tool_system_index+2}" "ip-address": "@{tools_ips}[${tool_system_index}]" + END BuiltIn.Log ${body} [Return] ${body} # returns complete json that has been updated Build Dpn List [Documentation] This keyword builds the list of DPN ids after configuring OVS bridges on each of the TOOLS_SYSTEM_IPs. @{DPN_ID_LIST} = BuiltIn.Create List - : FOR ${tools_ip} IN @{TOOLS_SYSTEM_ALL_IPS} - \ ${output} Utils.Run Command On Remote System And Log ${tools_ip} sudo ovs-ofctl show -O Openflow13 ${Bridge} | head -1 | awk -F "dpid:" '{ print $2 }' - \ ${dpn_id} Utils.Run Command On Remote System And Log ${tools_ip} echo \$\(\(16\#${output}\)\) - \ Collections.Append To List ${DPN_ID_LIST} ${dpn_id} + FOR ${tools_ip} IN @{TOOLS_SYSTEM_ALL_IPS} + ${output} Utils.Run Command On Remote System And Log ${tools_ip} sudo ovs-ofctl show -O Openflow13 ${Bridge} | head -1 | awk -F "dpid:" '{ print $2 }' + ${dpn_id} Utils.Run Command On Remote System And Log ${tools_ip} echo \$\(\(16\#${output}\)\) + Collections.Append To List ${DPN_ID_LIST} ${dpn_id} + END BuiltIn.Set Suite Variable @{DPN_ID_LIST} BFD Suite Teardown @@ -127,8 +131,9 @@ Genius Test Setup Genius Test Teardown [Arguments] ${data_models} ${test_name}=${SUITE_NAME}.${TEST_NAME} ${fail}=${FAIL_ON_EXCEPTIONS} - : FOR ${tool_system_index} IN RANGE ${NUM_TOOLS_SYSTEM} - \ OVSDB.Get DumpFlows And Ovsconfig @{TOOLS_SYSTEM_ALL_CONN_IDS}[${tool_system_index}] ${Bridge} + FOR ${tool_system_index} IN RANGE ${NUM_TOOLS_SYSTEM} + OVSDB.Get DumpFlows And Ovsconfig @{TOOLS_SYSTEM_ALL_CONN_IDS}[${tool_system_index}] ${Bridge} + END BuiltIn.Run Keyword And Ignore Error DataModels.Get Model Dump ${ODL_SYSTEM_IP} ${data_models} KarafKeywords.Fail If Exceptions Found During Test ${test_name} fail=${fail} ODLTools.Get All test_name=${test_name} @@ -141,21 +146,24 @@ ITM Direct Tunnels Start Suite [Documentation] start suite for itm scalability ClusterManagement.ClusterManagement_Setup ClusterManagement.Stop_Members_From_List_Or_All - : FOR ${controller_index} IN RANGE ${NUM_ODL_SYSTEM} - \ Utils.Run Command On Remote System And Log ${ODL_SYSTEM_${controller_index+1}_IP} sed -i -- 's/false/true/g' ${GENIUS_IFM_CONFIG_FLAG} + FOR ${controller_index} IN RANGE ${NUM_ODL_SYSTEM} + Utils.Run Command On Remote System And Log ${ODL_SYSTEM_${controller_index+1}_IP} sed -i -- 's/false/true/g' ${GENIUS_IFM_CONFIG_FLAG} + END ClusterManagement.Start_Members_From_List_Or_All Genius.Genius Suite Setup ITM Direct Tunnels Stop Suite [Documentation] Stop suite for ITM Direct Tunnels. - : FOR ${controller_index} IN RANGE ${NUM_ODL_SYSTEM} - \ Utils.Run Command On Remote System And Log ${ODL_SYSTEM_${controller_index+1}_IP} sed -i -- 's/true/false/g' ${GENIUS_IFM_CONFIG_FLAG} + FOR ${controller_index} IN RANGE ${NUM_ODL_SYSTEM} + Utils.Run Command On Remote System And Log ${ODL_SYSTEM_${controller_index+1}_IP} sed -i -- 's/true/false/g' ${GENIUS_IFM_CONFIG_FLAG} + END Genius.Genius Suite Teardown Ovs Interface Verification [Documentation] Checks whether the created Interface is seen on OVS or not. - : FOR ${tools_ip} IN @{TOOLS_SYSTEM_ALL_IPS} - \ Genius.Ovs Verification For Each Dpn ${tools_ip} ${TOOLS_SYSTEM_ALL_IPS} + FOR ${tools_ip} IN @{TOOLS_SYSTEM_ALL_IPS} + Genius.Ovs Verification For Each Dpn ${tools_ip} ${TOOLS_SYSTEM_ALL_IPS} + END Get ITM [Arguments] ${itm_created[0]} ${switch_data}=${SWITCH_DATA} @@ -166,17 +174,19 @@ Get ITM Check Tunnel Delete On OVS [Arguments] ${tunnel_list} [Documentation] Verifies the Tunnel is deleted from OVS. - : FOR ${tools_ip} IN @{TOOLS_SYSTEM_ALL_IPS} - \ ${output} = Utils.Run Command On Remote System ${tools_ip} sudo ovs-vsctl show - \ Genius.Verify Deleted Tunnels on OVS ${tunnel_list} ${output} + FOR ${tools_ip} IN @{TOOLS_SYSTEM_ALL_IPS} + ${output} = Utils.Run Command On Remote System ${tools_ip} sudo ovs-vsctl show + Genius.Verify Deleted Tunnels on OVS ${tunnel_list} ${output} + END Check Table0 Entry In a Dpn [Arguments] ${tools_ip} ${bridgename} ${port_numbers} [Documentation] Checks the Table 0 entry in the OVS when flows are dumped. ${check} = Utils.Run Command On Remote System And Log ${tools_ip} sudo ovs-ofctl -OOpenFlow13 dump-flows ${bridgename} ${num_ports} = BuiltIn.Get Length ${port_numbers} - : FOR ${port_index} IN RANGE ${num_ports} - \ BuiltIn.Should Contain ${check} in_port=@{port_numbers}[${port_index}] + FOR ${port_index} IN RANGE ${num_ports} + BuiltIn.Should Contain ${check} in_port=@{port_numbers}[${port_index}] + END Verify Tunnel Status As Up [Arguments] ${no_of_switches}=${NUM_TOOLS_SYSTEM} @@ -192,10 +202,11 @@ Verify Tunnel Status [Documentation] Verifies if all tunnels in the input, has the expected status(UP/DOWN/UNKNOWN) ${tep_result} = KarafKeywords.Issue Command On Karaf Console ${TEP_SHOW_STATE} ${number_of_tunnels} = BuiltIn.Get Length ${tunnel_names} - : FOR ${each_tunnel} IN RANGE ${number_of_tunnels} - \ ${tunnel} = Collections.Get From List ${tunnel_names} ${each_tunnel} - \ ${tep_output} = String.Get Lines Containing String ${tep_result} ${tunnel} - \ BuiltIn.Should Contain ${tep_output} ${tunnel_status} + FOR ${each_tunnel} IN RANGE ${number_of_tunnels} + ${tunnel} = Collections.Get From List ${tunnel_names} ${each_tunnel} + ${tep_output} = String.Get Lines Containing String ${tep_result} ${tunnel} + BuiltIn.Should Contain ${tep_output} ${tunnel_status} + END Get Tunnels On OVS [Arguments] ${connection_id} @@ -205,9 +216,10 @@ Get Tunnels On OVS @{tunnel_names} = BuiltIn.Create List ${tunnels} = String.Get Lines Matching Regexp ${ovs_result} Interface "tun.*" True @{tunnels_list} = String.Split To Lines ${tunnels} - : FOR ${tun} IN @{tunnels_list} - \ ${tun_list} Get Regexp Matches ${tun} tun.*\\w - \ Collections.Append To List ${tunnel_names} @{tun_list} + FOR ${tun} IN @{tunnels_list} + ${tun_list} Get Regexp Matches ${tun} tun.*\\w + Collections.Append To List ${tunnel_names} @{tun_list} + END ${items_in_list} = BuiltIn.Get Length ${tunnel_names} [Return] @{tunnel_names} @@ -260,16 +272,17 @@ Verify Tunnel Monitoring Status Set Switch Configuration [Documentation] This keyword will set manager,controller,tap port,bridge on each OVS - : FOR ${tool_system_index} IN RANGE ${NUM_TOOLS_SYSTEM} - \ SSHLibrary.Switch Connection @{TOOLS_SYSTEM_ALL_CONN_IDS}[${tool_system_index}] - \ SSHLibrary.Login With Public Key ${TOOLS_SYSTEM_USER} ${USER_HOME}/.ssh/${SSH_KEY} any - \ SSHLibrary.Execute Command sudo ovs-vsctl add-br ${Bridge} - \ SSHLibrary.Execute Command sudo ovs-vsctl set bridge ${Bridge} protocols=OpenFlow13 - \ SSHLibrary.Execute Command sudo ovs-vsctl set-controller ${Bridge} tcp:${ODL_SYSTEM_IP}:${ODL_OF_PORT_6653} - \ SSHLibrary.Execute Command sudo ifconfig ${Bridge} up - \ SSHLibrary.Execute Command sudo ovs-vsctl add-port ${Bridge} tap${tool_system_index}ed70586-6c -- set Interface tap${tool_system_index}ed70586-6c type=tap - \ SSHLibrary.Execute Command sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:${OVSDBPORT} - \ SSHLibrary.Execute Command sudo ovs-vsctl show + FOR ${tool_system_index} IN RANGE ${NUM_TOOLS_SYSTEM} + SSHLibrary.Switch Connection @{TOOLS_SYSTEM_ALL_CONN_IDS}[${tool_system_index}] + SSHLibrary.Login With Public Key ${TOOLS_SYSTEM_USER} ${USER_HOME}/.ssh/${SSH_KEY} any + SSHLibrary.Execute Command sudo ovs-vsctl add-br ${Bridge} + SSHLibrary.Execute Command sudo ovs-vsctl set bridge ${Bridge} protocols=OpenFlow13 + SSHLibrary.Execute Command sudo ovs-vsctl set-controller ${Bridge} tcp:${ODL_SYSTEM_IP}:${ODL_OF_PORT_6653} + SSHLibrary.Execute Command sudo ifconfig ${Bridge} up + SSHLibrary.Execute Command sudo ovs-vsctl add-port ${Bridge} tap${tool_system_index}ed70586-6c -- set Interface tap${tool_system_index}ed70586-6c type=tap + SSHLibrary.Execute Command sudo ovs-vsctl set-manager tcp:${ODL_SYSTEM_IP}:${OVSDBPORT} + SSHLibrary.Execute Command sudo ovs-vsctl show + END Ovs Verification For Each Dpn [Arguments] ${tools_system_ip} ${tools_ips} @@ -279,9 +292,10 @@ Ovs Verification For Each Dpn Collections.Remove Values From List ${updated_tools_ip_list} ${tools_system_ip} BuiltIn.Log Many @{updated_tools_ip_list} ${num_tool_ips} BuiltIn.Get Length ${updated_tools_ip_list} - : FOR ${num} IN RANGE ${num_tool_ips} - \ ${tools_ip} = Collections.Get From List ${updated_tools_ip_list} ${num} - \ BuiltIn.Should Contain ${ovs_output} ${tools_ip} + FOR ${num} IN RANGE ${num_tool_ips} + ${tools_ip} = Collections.Get From List ${updated_tools_ip_list} ${num} + BuiltIn.Should Contain ${ovs_output} ${tools_ip} + END Get Tunnels List [Documentation] The keyword fetches the list of operational tunnels from ODL @@ -292,36 +306,41 @@ Get Tunnels List Verify Table0 Entry After fetching Port Number [Documentation] This keyword will get the port number and checks the table0 entry for each dpn - : FOR ${tools_ip} IN @{TOOLS_SYSTEM_ALL_IPS} - \ ${check} = Utils.Run Command On Remote System And Log ${tools_ip} sudo ovs-ofctl -O OpenFlow13 show ${Bridge} - \ ${port_numbers} = String.Get Regexp Matches ${check} (\\d+).tun.* 1 - \ Genius.Check Table0 Entry In a Dpn ${tools_ip} ${Bridge} ${port_numbers} + FOR ${tools_ip} IN @{TOOLS_SYSTEM_ALL_IPS} + ${check} = Utils.Run Command On Remote System And Log ${tools_ip} sudo ovs-ofctl -O OpenFlow13 show ${Bridge} + ${port_numbers} = String.Get Regexp Matches ${check} (\\d+).tun.* 1 + Genius.Check Table0 Entry In a Dpn ${tools_ip} ${Bridge} ${port_numbers} + END Verify Deleted Tunnels On OVS [Arguments] ${tunnel_list} ${resp_data} [Documentation] This will verify whether tunnel is deleted. BuiltIn.Log ${resp_data} - : FOR ${tunnel} IN @{tunnel_list} - \ BuiltIn.Should Not Contain ${resp_data} ${tunnel} + FOR ${tunnel} IN @{tunnel_list} + BuiltIn.Should Not Contain ${resp_data} ${tunnel} + END Verify Response Code Of Dpn End Point Config API [Arguments] ${dpn_list}=${DPN_ID_LIST} [Documentation] This keyword will verify response code from itm-state: dpn endpoints config api for each dpn - : FOR ${dpn} IN @{dpn_list} - \ BuiltIn.Wait Until Keyword Succeeds 40 5 Utils.Get Data From URI session ${CONFIG_API}/itm-state:dpn-endpoints/DPN-TEPs-info/${dpn}/ + FOR ${dpn} IN @{dpn_list} + BuiltIn.Wait Until Keyword Succeeds 40 5 Utils.Get Data From URI session ${CONFIG_API}/itm-state:dpn-endpoints/DPN-TEPs-info/${dpn}/ + END Get Tunnel Between DPNs [Arguments] ${tunnel_type} ${config_api_type} ${src_dpn_id} @{dst_dpn_ids} [Documentation] This keyword will Get All the Tunnels available on DPN's - : FOR ${dst_dpn_id} IN @{dst_dpn_ids} - \ ${tunnel} = BuiltIn.Wait Until Keyword Succeeds 30 10 Genius.Get Tunnel ${src_dpn_id} - \ ... ${dst_dpn_id} ${tunnel_type} ${config_api_type} + FOR ${dst_dpn_id} IN @{dst_dpn_ids} + ${tunnel} = BuiltIn.Wait Until Keyword Succeeds 30 10 Genius.Get Tunnel ${src_dpn_id} + ... ${dst_dpn_id} ${tunnel_type} ${config_api_type} + END Update Dpn id List And Get Tunnels [Arguments] ${tunnel_type} ${config_api_type}=${EMPTY} ${dpn_ids}=${DPN_ID_LIST} [Documentation] Update the exisisting dpn id list to form different combination of dpn ids such that tunnel formation between all dpns is verified. - : FOR ${dpn_id} IN @{dpn_ids} - \ @{dpn_ids_updated} = BuiltIn.Create List @{dpn_ids} - \ Collections.Remove Values From List ${dpn_ids_updated} ${dpn_id} - \ BuiltIn.Log Many ${dpn_ids_updated} - \ Genius.Get Tunnel Between DPNs ${tunnel_type} ${config_api_type} ${dpn_id} @{dpn_ids_updated} + FOR ${dpn_id} IN @{dpn_ids} + @{dpn_ids_updated} = BuiltIn.Create List @{dpn_ids} + Collections.Remove Values From List ${dpn_ids_updated} ${dpn_id} + BuiltIn.Log Many ${dpn_ids_updated} + Genius.Get Tunnel Between DPNs ${tunnel_type} ${config_api_type} ${dpn_id} @{dpn_ids_updated} + END diff --git a/csit/libraries/KarafKeywords.robot b/csit/libraries/KarafKeywords.robot index 39592b1a23..0463c81577 100644 --- a/csit/libraries/KarafKeywords.robot +++ b/csit/libraries/KarafKeywords.robot @@ -23,8 +23,9 @@ Setup_Karaf_Keywords ClusterManagement.ClusterManagement_Setup http_timeout=${http_timeout} ClusterManagement.Run_Bash_Command_On_List_Or_All iptables -I INPUT -p tcp --dport ${KARAF_SHELL_PORT} -j ACCEPT; iptables-save BuiltIn.Comment First connections to Karaf console may fail, so WUKS is used. TODO: Track as a Bug. - : FOR ${index} IN @{ClusterManagement__member_index_list} - \ BuiltIn.Run_Keyword_And_Ignore_Error BuiltIn.Wait_Until_Keyword_Succeeds 3s 1s Open_Controller_Karaf_Console_On_Background member_index=${index} + FOR ${index} IN @{ClusterManagement__member_index_list} + BuiltIn.Run_Keyword_And_Ignore_Error BuiltIn.Wait_Until_Keyword_Succeeds 3s 1s Open_Controller_Karaf_Console_On_Background member_index=${index} + END Verify_Feature_Is_Installed [Arguments] ${feature_name} ${controller}=${ODL_SYSTEM_IP} ${karaf_port}=${KARAF_SHELL_PORT} @@ -57,8 +58,9 @@ Check For Elements On Karaf Command Output Message [Documentation] Will execute the command using Issue Command On Karaf Console then check for the given elements ... in the command output message ${output} Issue_Command_On_Karaf_Console ${cmd} ${controller} ${karaf_port} ${timeout} - : FOR ${i} IN @{elements} - \ BuiltIn.Should_Contain ${output} ${i} + FOR ${i} IN @{elements} + BuiltIn.Should_Contain ${output} ${i} + END Verify_Bundle_Is_Installed [Arguments] ${bundle_name} ${controller}=${ODL_SYSTEM_IP} ${karaf_port}=${KARAF_SHELL_PORT} @@ -78,8 +80,9 @@ Check_Karaf_Log_Has_Messages [Arguments] ${filter_string} @{message_list} [Documentation] Will succeed if the @{messages} are found in \ the output of "log:display" ${output} = Issue_Command_On_Karaf_Console log:display | grep ${filter_string} - : FOR ${message} IN @{message_list} - \ BuiltIn.Should_Contain ${output} ${message} + FOR ${message} IN @{message_list} + BuiltIn.Should_Contain ${output} ${message} + END [Return] ${output} Check_Karaf_Log_Message_Count @@ -162,10 +165,11 @@ Configure_Timeout_For_Karaf_Console [Documentation] Configure a different timeout for each Karaf console. ${index_list} = ClusterManagement.List_Indices_Or_All given_list=${member_index_list} ${current_connection_object} = SSHLibrary.Get_Connection - : FOR ${member_index} IN @{index_list} # usually: 1, 2, 3 - \ ${karaf_connection_index} = Collections.Get_From_Dictionary ${connection_index_dict} ${member_index} - \ SSHLibrary.Switch_Connection ${karaf_connection_index} - \ SSHLibrary.Set_Client_Configuration timeout=${timeout} + FOR ${member_index} IN @{index_list} # usually: 1, 2, 3 + ${karaf_connection_index} = Collections.Get_From_Dictionary ${connection_index_dict} ${member_index} + SSHLibrary.Switch_Connection ${karaf_connection_index} + SSHLibrary.Set_Client_Configuration timeout=${timeout} + END [Teardown] SSHKeywords.Restore_Current_Ssh_Connection_From_Index ${current_connection_object.index} Execute_Controller_Karaf_Command_On_Background @@ -196,9 +200,10 @@ Log_Message_To_Controller_Karaf [Documentation] Make sure this resource is initialized. Send a message into the controller's karaf log file on every node listed (or all). ... By default, failure while processing a node is silently ignored, unless ${tolerate_failure} is False. ${index_list} = ClusterManagement.List_Indices_Or_All given_list=${member_index_list} - : FOR ${index} IN @{index_list} # usually: 1, 2, 3. - \ ${status} ${output} = BuiltIn.Run_Keyword_And_Ignore_Error Execute_Controller_Karaf_Command_With_Retry_On_Background log:log "ROBOT MESSAGE: ${message}" member_index=${index} - \ BuiltIn.Run_Keyword_Unless ${tolerate_failure} or "${status}" == "PASS" BuiltIn.Fail ${output} + FOR ${index} IN @{index_list} # usually: 1, 2, 3. + ${status} ${output} = BuiltIn.Run_Keyword_And_Ignore_Error Execute_Controller_Karaf_Command_With_Retry_On_Background log:log "ROBOT MESSAGE: ${message}" member_index=${index} + BuiltIn.Run_Keyword_Unless ${tolerate_failure} or "${status}" == "PASS" BuiltIn.Fail ${output} + END Log_Test_Suite_Start_To_Controller_Karaf [Arguments] ${member_index_list}=${EMPTY} @@ -215,9 +220,10 @@ Set_Bgpcep_Log_Levels [Documentation] Assuming OCKCOB was used, set logging level on bgpcep and protocol loggers without affecting current SSH session. # FIXME: Move to appropriate Resource ${index_list} = ClusterManagement.List_Indices_Or_All given_list=${member_index_list} - : FOR ${index} IN @{index_list} # usually: 1, 2, 3. - \ Execute_Controller_Karaf_Command_On_Background log:set ${bgpcep_level} org.opendaylight.bgpcep member_index=${index} - \ Execute_Controller_Karaf_Command_On_Background log:set ${protocol_level} org.opendaylight.protocol member_index=${index} + FOR ${index} IN @{index_list} # usually: 1, 2, 3. + Execute_Controller_Karaf_Command_On_Background log:set ${bgpcep_level} org.opendaylight.bgpcep member_index=${index} + Execute_Controller_Karaf_Command_On_Background log:set ${protocol_level} org.opendaylight.protocol member_index=${index} + END Get Karaf Log Lines From Test Start [Arguments] ${ip} ${test_name} ${cmd} ${user}=${ODL_SYSTEM_USER} ${password}=${ODL_SYSTEM_PASSWORD} ${prompt}=${ODL_SYSTEM_PROMPT} @@ -234,14 +240,15 @@ Fail If Exceptions Found During Test [Arguments] ${test_name} ${log_file}=${KARAF_LOG} ${fail}=False [Documentation] Create a failure if an Exception is found in the karaf.log that has not been whitelisted. ... Will work for single controller jobs as well as 3node cluster jobs - : FOR ${i} IN RANGE 1 ${NUM_ODL_SYSTEM} + 1 - \ ${cmd} = Set Variable sed '1,/ROBOT MESSAGE: Starting test ${test_name}/d' ${log_file} - \ ${output} = Get Karaf Log Lines From Test Start ${ODL_SYSTEM_${i}_IP} ${test_name} ${cmd} - \ ${exlist} ${matchlist} = Verify Exceptions ${output} - \ Write Exceptions Map To File ${SUITE_NAME}.${TEST_NAME} /tmp/odl${i}_exceptions.txt - \ ${listlength} = BuiltIn.Get Length ${exlist} - \ BuiltIn.Run Keyword If "${fail}"=="True" and ${listlength} != 0 Log And Fail Exceptions ${exlist} ${listlength} - \ ... ELSE Collections.Log List ${matchlist} + FOR ${i} IN RANGE 1 ${NUM_ODL_SYSTEM} + 1 + ${cmd} = Set Variable sed '1,/ROBOT MESSAGE: Starting test ${test_name}/d' ${log_file} + ${output} = Get Karaf Log Lines From Test Start ${ODL_SYSTEM_${i}_IP} ${test_name} ${cmd} + ${exlist} ${matchlist} = Verify Exceptions ${output} + Write Exceptions Map To File ${SUITE_NAME}.${TEST_NAME} /tmp/odl${i}_exceptions.txt + ${listlength} = BuiltIn.Get Length ${exlist} + BuiltIn.Run Keyword If "${fail}"=="True" and ${listlength} != 0 Log And Fail Exceptions ${exlist} ${listlength} + ... ELSE Collections.Log List ${matchlist} + END Log And Fail Exceptions [Arguments] ${exlist} ${listlength} @@ -266,24 +273,27 @@ Get Karaf Log Types From Test Start ... ${log_file}=${KARAF_LOG} [Documentation] A wrapper keyword for "Get Karaf Log Type From Test Start" so that we can parse for multiple types ... of log messages. For example, we can grab all messages of type WARN and ERROR - : FOR ${type} IN @{types} - \ Get Karaf Log Type From Test Start ${ip} ${test_name} ${type} ${user} ${password} - \ ... ${prompt} ${log_file} + FOR ${type} IN @{types} + Get Karaf Log Type From Test Start ${ip} ${test_name} ${type} ${user} ${password} + ... ${prompt} ${log_file} + END Get Karaf Log Events From Test Start [Arguments] ${test_name} ${user}=${ODL_SYSTEM_USER} ${password}=${ODL_SYSTEM_PASSWORD} ${prompt}=${ODL_SYSTEM_PROMPT} [Documentation] Wrapper for the wrapper "Get Karaf Log Types From Test Start" so that we can easily loop over ... any number of controllers to analyze karaf.log for ERROR, WARN and Exception log messages ${log_types} = Create List ERROR WARN Exception - : FOR ${i} IN RANGE 1 ${NUM_ODL_SYSTEM} + 1 - \ Get Karaf Log Types From Test Start ${ODL_SYSTEM_${i}_IP} ${test_name} ${log_types} + FOR ${i} IN RANGE 1 ${NUM_ODL_SYSTEM} + 1 + Get Karaf Log Types From Test Start ${ODL_SYSTEM_${i}_IP} ${test_name} ${log_types} + END Fail If Exceptions Found During Test Deprecated [Arguments] ${test_name} ${exceptions_white_list}=${EMPTY} [Documentation] Create a failure if an Exception is found in the karaf.log. Will work for single controller jobs ... as well as 3node cluster jobs - : FOR ${i} IN RANGE 1 ${NUM_ODL_SYSTEM} + 1 - \ Verify Exception Logging In Controller ${ODL_SYSTEM_${i}_IP} ${test_name} ${exceptions_white_list} + FOR ${i} IN RANGE 1 ${NUM_ODL_SYSTEM} + 1 + Verify Exception Logging In Controller ${ODL_SYSTEM_${i}_IP} ${test_name} ${exceptions_white_list} + END Verify Exception Logging In Controller [Arguments] ${controller_ip} ${test_name} ${exceptions_white_list} @@ -293,8 +303,9 @@ Verify Exception Logging In Controller @{log_lines}= Split String ${exceptions} ${\n} ${num_log_entries} Get Length ${log_lines} Return From Keyword If ${num_log_entries} == ${0} No Exceptions found. - : FOR ${log_message} IN @{log_lines} - \ Check Against White List ${log_message} ${exceptions_white_list} + FOR ${log_message} IN @{log_lines} + Check Against White List ${log_message} ${exceptions_white_list} + END Check Against White List [Arguments] ${exception_line} ${exceptions_white_list} @@ -304,8 +315,9 @@ Check Against White List ... empty line as that is what is returned when a grep on karaf.log has no match, so we can safely return ... in that case as well. Return From Keyword If "${exception_line}" == "" - : FOR ${exception} IN @{exceptions_white_list} - \ Return From Keyword If "${exception}" in "${exception_line}" Exceptions found, but whitelisted: ${\n}${exception_line}${\n} + FOR ${exception} IN @{exceptions_white_list} + Return From Keyword If "${exception}" in "${exception_line}" Exceptions found, but whitelisted: ${\n}${exception_line}${\n} + END Fail Exceptions Found: ${\n}${exception_line}${\n} Wait_For_Karaf_Log diff --git a/csit/libraries/L2GatewayOperations.robot b/csit/libraries/L2GatewayOperations.robot index 2c0a86d0d0..bbd3d9e8ea 100644 --- a/csit/libraries/L2GatewayOperations.robot +++ b/csit/libraries/L2GatewayOperations.robot @@ -168,8 +168,9 @@ Verify Strings In Command Output [Arguments] ${conn_id} ${command} @{string_list} [Documentation] Keyword to run the ${command} in ${conn_id} and verify if the output contains the list @{string_list}. ${output}= Exec Command ${conn_id} ${command} - : FOR ${item} IN @{string_list} - \ Should Contain ${output} ${item} + FOR ${item} IN @{string_list} + Should Contain ${output} ${item} + END Verify Ping In Namespace Extra Timeout [Arguments] ${ns_name} ${ns_port_mac} ${vm_ip} ${conn_id}=${hwvtep_conn_id} ${hwvtep_ip}=${HWVTEP_IP} @@ -230,8 +231,9 @@ Verify Vtep List [Arguments] ${conn_id} ${table_name} @{list} [Documentation] Keyword to run vtep-ctl list for the table ${table_name} and verify the list @{list} contents exists in output. ${output}= Exec Command ${conn_id} ${VTEP LIST} ${table_name} - : FOR ${item} IN @{list} - \ Should Contain ${output} ${item} + FOR ${item} IN @{list} + Should Contain ${output} ${item} + END Get Vtep List [Arguments] ${table_name} ${conn_id}=${hwvtep_conn_id} @@ -289,13 +291,15 @@ Verify Elan Flow Entries Should Contain ${flow_output} table=50 ${sMac_output} = Get Lines Containing String ${flow_output} table=50 Log ${sMac_output} - : FOR ${sMacAddr} IN @{srcMacAddrs} - \ ${resp}= Should Contain ${sMac_output} dl_src=${sMacAddr} + FOR ${sMacAddr} IN @{srcMacAddrs} + ${resp}= Should Contain ${sMac_output} dl_src=${sMacAddr} + END Should Contain ${flow_output} table=51 ${dMac_output} = Get Lines Containing String ${flow_output} table=51 Log ${dMac_output} - : FOR ${dMacAddr} IN @{destMacAddrs} - \ ${resp}= Should Contain ${dMac_output} dl_dst=${dMacAddr} + FOR ${dMacAddr} IN @{destMacAddrs} + ${resp}= Should Contain ${dMac_output} dl_dst=${dMacAddr} + END Should Contain ${flow_output} table=52 ${sMac_output} = Get Lines Containing String ${flow_output} table=52 Log ${sMac_output} diff --git a/csit/libraries/LiveMigration.robot b/csit/libraries/LiveMigration.robot index d080b56194..f4cb9f8cb8 100644 --- a/csit/libraries/LiveMigration.robot +++ b/csit/libraries/LiveMigration.robot @@ -24,12 +24,14 @@ Live Migration Suite Teardown Setup Live Migration In Compute Nodes [Documentation] Set instances to be created in the shared directory. - : FOR ${conn_id} IN @{OS_CMP_CONN_IDS} - \ OpenStackOperations.Modify OpenStack Configuration File ${conn_id} ${NOVA_CPU_CONF} DEFAULT instances_path ${CMP_INSTANCES_SHARED_PATH} - \ OpenStackOperations.Restart DevStack Service ${conn_id} ${NOVA_COMPUTE_SERVICE} + FOR ${conn_id} IN @{OS_CMP_CONN_IDS} + OpenStackOperations.Modify OpenStack Configuration File ${conn_id} ${NOVA_CPU_CONF} DEFAULT instances_path ${CMP_INSTANCES_SHARED_PATH} + OpenStackOperations.Restart DevStack Service ${conn_id} ${NOVA_COMPUTE_SERVICE} + END UnSet Live Migration In Compute Nodes [Documentation] Clear settings done for Live Migration - : FOR ${conn_id} IN @{OS_CMP_CONN_IDS} - \ OpenStackOperations.Modify OpenStack Configuration File ${conn_id} ${NOVA_CPU_CONF} DEFAULT instances_path ${CMP_INSTANCES_DEFAULT_PATH} - \ OpenStackOperations.Restart DevStack Service ${conn_id} ${NOVA_COMPUTE_SERVICE} + FOR ${conn_id} IN @{OS_CMP_CONN_IDS} + OpenStackOperations.Modify OpenStack Configuration File ${conn_id} ${NOVA_CPU_CONF} DEFAULT instances_path ${CMP_INSTANCES_DEFAULT_PATH} + OpenStackOperations.Restart DevStack Service ${conn_id} ${NOVA_COMPUTE_SERVICE} + END diff --git a/csit/libraries/MdsalLowlevel.robot b/csit/libraries/MdsalLowlevel.robot index 7af26d4c92..9dcaaa74e0 100644 --- a/csit/libraries/MdsalLowlevel.robot +++ b/csit/libraries/MdsalLowlevel.robot @@ -137,8 +137,9 @@ Create_Prefix_Shard [Documentation] Create prefix based shard. ${replicas} is a list of cluster node indexes, taken e.g. from ClusterManagement.List_Indices_Or_All. ${session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${member_index} ${replicas_str} BuiltIn.Set_Variable ${EMPTY} - : FOR ${replica} IN @{replicas} - \ ${replicas_str} BuiltIn.Set_Variable ${replicas_str}member-${replica} + FOR ${replica} IN @{replicas} + ${replicas_str} BuiltIn.Set_Variable ${replicas_str}member-${replica} + END &{mapping} BuiltIn.Create_Dictionary PREFIX=${prefix} REPLICAS=${replicas_str} ${text} = TemplatedRequests.Post_As_Xml_Templated ${CREATE_PREFIX_SHARD_DIR} mapping=${mapping} session=${session} diff --git a/csit/libraries/MininetKeywords.robot b/csit/libraries/MininetKeywords.robot index b8faeed66b..209b71f4bb 100644 --- a/csit/libraries/MininetKeywords.robot +++ b/csit/libraries/MininetKeywords.robot @@ -48,21 +48,24 @@ Start Mininet Multiple Controllers SSHLibrary.Read Until mininet> Log Create controller configuration ${controller_opt}= Set Variable - : FOR ${index} IN @{index_list} - \ ${controller_opt}= Catenate ${controller_opt} ${SPACE}${protocol}:${ODL_SYSTEM_${index}_IP}:${ofport} - \ Log ${controller_opt} + FOR ${index} IN @{index_list} + ${controller_opt}= Catenate ${controller_opt} ${SPACE}${protocol}:${ODL_SYSTEM_${index}_IP}:${ofport} + Log ${controller_opt} + END Log Open extra SSH connection to configure the OVS bridges SSHKeywords.Open_Connection_To_Tools_System ip_address=${mininet} timeout=${timeout} ${num_bridges} SSHLibrary.Execute Command sudo ovs-vsctl show | grep Bridge | wc -l ${num_bridges}= Convert To Integer ${num_bridges} ${bridges}= Create List - : FOR ${i} IN RANGE 1 ${num_bridges+1} - \ ${bridge}= SSHLibrary.Execute Command sudo ovs-vsctl show | grep Bridge | cut -c 12- | sort | head -${i} | tail -1 - \ SSHLibrary.Execute Command sudo ovs-vsctl del-controller ${bridge} && sudo ovs-vsctl set bridge ${bridge} protocols=OpenFlow${ofversion} - \ Collections.Append To List ${bridges} ${bridge} + FOR ${i} IN RANGE 1 ${num_bridges+1} + ${bridge}= SSHLibrary.Execute Command sudo ovs-vsctl show | grep Bridge | cut -c 12- | sort | head -${i} | tail -1 + SSHLibrary.Execute Command sudo ovs-vsctl del-controller ${bridge} && sudo ovs-vsctl set bridge ${bridge} protocols=OpenFlow${ofversion} + Collections.Append To List ${bridges} ${bridge} + END Log Configure OVS controllers ${controller_opt} in all bridges - : FOR ${bridge} IN @{bridges} - \ SSHLibrary.Execute Command sudo ovs-vsctl set-controller ${bridge} ${controller_opt} + FOR ${bridge} IN @{bridges} + SSHLibrary.Execute Command sudo ovs-vsctl set-controller ${bridge} ${controller_opt} + END Log Check OVS configuratiom ${output}= SSHLibrary.Execute Command sudo ovs-vsctl show Log ${output} @@ -113,9 +116,10 @@ Send Mininet Command Multiple Sessions [Arguments] ${mininet_conn_list} ${cmd}=help [Documentation] Sends Command ${cmd} to Mininet sessions in ${mininet_conn_list} and returns list of read buffer responses. ${output_list}= Create List - : FOR ${mininet_conn} IN @{mininet_conn_list} - \ ${output}= Utils.Send Mininet Command ${mininet_conn} ${cmd} - \ Collections.Append To List ${output_list} ${output} + FOR ${mininet_conn} IN @{mininet_conn_list} + ${output}= Utils.Send Mininet Command ${mininet_conn} ${cmd} + Collections.Append To List ${output_list} ${output} + END [Return] ${output_list} Stop Mininet And Exit @@ -129,21 +133,23 @@ Stop Mininet And Exit Stop Mininet And Exit Multiple Sessions [Arguments] ${mininet_conn_list} [Documentation] Stops Mininet and exits sessions in ${mininet_conn_list}. - : FOR ${mininet_conn} IN @{mininet_conn_list} - \ MininetKeywords.Stop Mininet And Exit ${mininet_conn} + FOR ${mininet_conn} IN @{mininet_conn_list} + MininetKeywords.Stop Mininet And Exit ${mininet_conn} + END Disconnect Cluster Mininet [Arguments] ${action}=break ${member_index_list}=${EMPTY} [Documentation] Break and restore controller to mininet connection via iptables. ${index_list} = ClusterManagement.List_Indices_Or_All given_list=${member_index_list} - : FOR ${index} IN @{index_list} - \ ${rule} = BuiltIn.Set Variable OUTPUT -p all --source ${ODL_SYSTEM_${index}_IP} --destination ${TOOLS_SYSTEM_IP} -j DROP - \ ${command} = BuiltIn.Set Variable If '${action}'=='restore' sudo /sbin/iptables -D ${rule} sudo /sbin/iptables -I ${rule} - \ Log To Console ${ODL_SYSTEM_${index}_IP} - \ Utils.Run Command On Controller ${ODL_SYSTEM_${index}_IP} cmd=${command} - \ ${command} = BuiltIn.Set Variable sudo /sbin/iptables -L -n - \ ${output} = Utils.Run Command On Controller cmd=${command} - \ BuiltIn.Log ${output} + FOR ${index} IN @{index_list} + ${rule} = BuiltIn.Set Variable OUTPUT -p all --source ${ODL_SYSTEM_${index}_IP} --destination ${TOOLS_SYSTEM_IP} -j DROP + ${command} = BuiltIn.Set Variable If '${action}'=='restore' sudo /sbin/iptables -D ${rule} sudo /sbin/iptables -I ${rule} + Log To Console ${ODL_SYSTEM_${index}_IP} + Utils.Run Command On Controller ${ODL_SYSTEM_${index}_IP} cmd=${command} + ${command} = BuiltIn.Set Variable sudo /sbin/iptables -L -n + ${output} = Utils.Run Command On Controller cmd=${command} + BuiltIn.Log ${output} + END Verify Aggregate Flow From Mininet Session [Arguments] ${mininet_conn}=${EMPTY} ${flow_count}=0 ${time_out}=0s @@ -179,9 +185,10 @@ Ping All Hosts [Documentation] Do one round of ping from one host to all other hosts in mininet. ... Note that a single ping failure will exit the loop and return a non zero value. ${source}= Get From List ${host_list} ${0} - : FOR ${h} IN @{host_list} - \ ${status}= Ping Two Hosts ${source} ${h} 1 - \ Exit For Loop If ${status}!=${0} + FOR ${h} IN @{host_list} + ${status}= Ping Two Hosts ${source} ${h} 1 + Exit For Loop If ${status}!=${0} + END [Return] ${status} Ping Two Hosts @@ -200,9 +207,10 @@ Get Mininet Hosts SSHLibrary.Write nodes ${out}= SSHLibrary.Read Until mininet> @{words}= String.Split String ${out} ${SPACE} - : FOR ${item} IN @{words} - \ ${h}= String.Get Lines Matching Regexp ${item} h[0-9]* - \ Run Keyword If '${h}' != '${EMPTY}' Collections.Append To List ${host_list} ${h} + FOR ${item} IN @{words} + ${h}= String.Get Lines Matching Regexp ${item} h[0-9]* + Run Keyword If '${h}' != '${EMPTY}' Collections.Append To List ${host_list} ${h} + END [Return] ${host_list} Install Certificates In Mininet diff --git a/csit/libraries/NexusKeywords.robot b/csit/libraries/NexusKeywords.robot index 2446517545..690e80d5c8 100644 --- a/csit/libraries/NexusKeywords.robot +++ b/csit/libraries/NexusKeywords.robot @@ -280,8 +280,9 @@ Get_ODL_Versions_From_Nexus BuiltIn.Log ${latest} @{elements}= XML.Get_Elements ${root} .//version ${versions}= BuiltIn.Create_List - : FOR ${element} IN @{elements} - \ Collections.Append_To_List ${versions} ${element.text} + FOR ${element} IN @{elements} + Collections.Append_To_List ${versions} ${element.text} + END Collections.Sort_List ${versions} BuiltIn.Log_Many @{versions} [Return] ${latest} @{versions} @@ -297,8 +298,9 @@ Get_Latest_ODL_Stream_Release ${latest} @{versions}= Get_ODL_Versions_From_Nexus BuiltIn.Return_From_Keyword_If '${stream}'=='latest' ${latest} ${latest_version}= BuiltIn.Set_Variable xxx - : FOR ${version} IN @{versions} - \ ${latest_version}= BuiltIn.Set_Variable_If '${stream}'.title() in '${version}' ${version} ${latest_version} + FOR ${version} IN @{versions} + ${latest_version}= BuiltIn.Set_Variable_If '${stream}'.title() in '${version}' ${version} ${latest_version} + END BuiltIn.Run_Keyword_If '${latest_version}'=='xxx' BuiltIn.Fail Could not find latest release for stream ${stream} BuiltIn.Log ${latest_version} [Return] ${latest_version} @@ -318,9 +320,10 @@ Get_Latest_ODL_Previous_Stream_Release ... So in this case, latest release version is return. ${latest} @{versions}= Get_ODL_Versions_From_Nexus ${latest_version}= BuiltIn.Set_Variable xxx - : FOR ${version} IN @{versions} - \ BuiltIn.Exit_For_Loop_If '${stream}'.title() in '${version}' - \ ${latest_version}= BuiltIn.Set_Variable ${version} + FOR ${version} IN @{versions} + BuiltIn.Exit_For_Loop_If '${stream}'.title() in '${version}' + ${latest_version}= BuiltIn.Set_Variable ${version} + END BuiltIn.Run_Keyword_If '${latest_version}'=='xxx' BuiltIn.Fail Could not find latest previous release for stream ${stream} BuiltIn.Log ${latest_version} [Return] ${latest_version} diff --git a/csit/libraries/ODLTools.robot b/csit/libraries/ODLTools.robot index c216803220..de9c8d2436 100644 --- a/csit/libraries/ODLTools.robot +++ b/csit/libraries/ODLTools.robot @@ -25,10 +25,11 @@ Get EOS Get Cluster Info [Arguments] ${port}=${RESTCONFPORT} [Documentation] Get ODL Cluster related information like transaction counts, commit rates, etc. - : FOR ${i} IN RANGE ${NUM_ODL_SYSTEM} - \ ${cmd} = BuiltIn.Set Variable odltools netvirt show cluster-info -i ${ODL_SYSTEM_${i+1}_IP} -t ${port} -u ${ODL_RESTCONF_USER} -w ${ODL_RESTCONF_PASSWORD} - \ ${output} = OperatingSystem.Run ${cmd} - \ BuiltIn.Log output: ${output} + FOR ${i} IN RANGE ${NUM_ODL_SYSTEM} + ${cmd} = BuiltIn.Set Variable odltools netvirt show cluster-info -i ${ODL_SYSTEM_${i+1}_IP} -t ${port} -u ${ODL_RESTCONF_USER} -w ${ODL_RESTCONF_PASSWORD} + ${output} = OperatingSystem.Run ${cmd} + BuiltIn.Log output: ${output} + END Analyze Tunnels [Arguments] ${node_ip}=${ODL_SYSTEM_IP} ${port}=${RESTCONFPORT} ${test_name}=${SUITE_NAME}.${TEST_NAME} diff --git a/csit/libraries/OVSDB.robot b/csit/libraries/OVSDB.robot index a1549c1728..6414300f05 100644 --- a/csit/libraries/OVSDB.robot +++ b/csit/libraries/OVSDB.robot @@ -131,12 +131,13 @@ Get OVSDB UUID BuiltIn.Log ${node_list} # Since bridges are also listed as nodes, but will not have the extra "ovsdb:connection-info data, # we need to use "Run Keyword And Ignore Error" below. - : FOR ${node} IN @{node_list} - \ ${node_id} = Collections.Get From Dictionary ${node} node-id - \ ${node_uuid} = String.Replace String ${node_id} ovsdb://uuid/ ${EMPTY} - \ ${status} ${connection_info} = BuiltIn.Run Keyword And Ignore Error Collections.Get From Dictionary ${node} ovsdb:connection-info - \ ${status} ${remote_ip} = BuiltIn.Run Keyword And Ignore Error Collections.Get From Dictionary ${connection_info} remote-ip - \ ${uuid} = Set Variable If '${remote_ip}' == '${ovs_system_ip}' ${node_uuid} ${uuid} + FOR ${node} IN @{node_list} + ${node_id} = Collections.Get From Dictionary ${node} node-id + ${node_uuid} = String.Replace String ${node_id} ovsdb://uuid/ ${EMPTY} + ${status} ${connection_info} = BuiltIn.Run Keyword And Ignore Error Collections.Get From Dictionary ${node} ovsdb:connection-info + ${status} ${remote_ip} = BuiltIn.Run Keyword And Ignore Error Collections.Get From Dictionary ${connection_info} remote-ip + ${uuid} = Set Variable If '${remote_ip}' == '${ovs_system_ip}' ${node_uuid} ${uuid} + END [Return] ${uuid} Collect OVSDB Debugs @@ -183,9 +184,10 @@ Add Multiple Managers to OVS ${index_list} = ClusterManagement.List Indices Or All given_list=${controller_index_list} Utils.Clean Mininet System ${tools_system} ${ovs_opt} = BuiltIn.Set Variable - : FOR ${index} IN @{index_list} - \ ${ovs_opt} = BuiltIn.Catenate ${ovs_opt} ${SPACE}tcp:${ODL_SYSTEM_${index}_IP}:${ovs_mgr_port} - \ BuiltIn.Log ${ovs_opt} + FOR ${index} IN @{index_list} + ${ovs_opt} = BuiltIn.Catenate ${ovs_opt} ${SPACE}tcp:${ODL_SYSTEM_${index}_IP}:${ovs_mgr_port} + BuiltIn.Log ${ovs_opt} + END Utils.Run Command On Mininet ${tools_system} sudo ovs-vsctl set-manager ${ovs_opt} ${output} = BuiltIn.Wait Until Keyword Succeeds 5s 1s Verify OVS Reports Connected ${tools_system} BuiltIn.Log ${output} @@ -324,8 +326,9 @@ Add OVS Logging SSHLibrary.Switch Connection ${conn_id} @{modules} = BuiltIn.Create List bridge:file:dbg connmgr:file:dbg inband:file:dbg ofp_actions:file:dbg ofp_errors:file:dbg ... ofp_msgs:file:dbg ovsdb_error:file:dbg rconn:file:dbg tunnel:file:dbg vconn:file:dbg - : FOR ${module} IN @{modules} - \ Utils.Write Commands Until Expected Prompt sudo ovs-appctl --target ovs-vswitchd vlog/set ${module} ${DEFAULT_LINUX_PROMPT_STRICT} + FOR ${module} IN @{modules} + Utils.Write Commands Until Expected Prompt sudo ovs-appctl --target ovs-vswitchd vlog/set ${module} ${DEFAULT_LINUX_PROMPT_STRICT} + END Utils.Write Commands Until Expected Prompt sudo ovs-appctl --target ovs-vswitchd vlog/list ${DEFAULT_LINUX_PROMPT_STRICT} Reset OVS Logging @@ -344,8 +347,9 @@ Suite Teardown [Arguments] ${uris}=@{EMPTY} [Documentation] Cleans up test environment, close existing sessions. OVSDB.Clean OVSDB Test Environment ${TOOLS_SYSTEM_IP} - : FOR ${uri} IN @{uris} - \ RequestsLibrary.Delete Request session ${uri} + FOR ${uri} IN @{uris} + RequestsLibrary.Delete Request session ${uri} + END ${resp} = RequestsLibrary.Get Request session ${CONFIG_TOPO_API} OVSDB.Log Config And Operational Topology RequestsLibrary.Delete All Sessions @@ -410,9 +414,10 @@ Delete Ports On Bridge By Type [Arguments] ${ovs_ip} ${br} ${type} [Documentation] List all ports of ${br} and delete ${type} ports ${ports_present} = Get Ports From Bridge By Type ${ovs_ip} ${br} ${type} - : FOR ${port} IN @{ports_present} - \ ${del-ports} = Utils.Run Command On Remote System ${ovs_ip} sudo ovs-vsctl del-port ${br} ${port} - \ BuiltIn.Log ${del-ports} + FOR ${port} IN @{ports_present} + ${del-ports} = Utils.Run Command On Remote System ${ovs_ip} sudo ovs-vsctl del-port ${br} ${port} + BuiltIn.Log ${del-ports} + END ${ports_present_after_delete} = Get Ports From Bridge By Type ${ovs_ip} ${br} ${type} BuiltIn.Log ${ports_present_after_delete} @@ -442,9 +447,10 @@ Verify Dump Flows For Specific Table [Documentation] To Verify flows are present for the corresponding table Number ${flow_output} = Utils.Run Command On Remote System ${compute_ip} sudo ovs-ofctl -O OpenFlow13 dump-flows ${INTEGRATION_BRIDGE}|grep table=${table_num} ${additional_args} Log ${flow_output} - : FOR ${matching_str} IN @{matching_paras} - \ BuiltIn.Run Keyword If ${flag}==True BuiltIn.Should Contain ${flow_output} ${matching_str} - \ ... ELSE BuiltIn.Should Not Contain ${flow_output} ${matching_str} + FOR ${matching_str} IN @{matching_paras} + BuiltIn.Run Keyword If ${flag}==True BuiltIn.Should Contain ${flow_output} ${matching_str} + ... ELSE BuiltIn.Should Not Contain ${flow_output} ${matching_str} + END Verify Vni Segmentation Id and Tunnel Id [Arguments] ${port1} ${port2} ${net1} ${net2} ${vm1_ip} ${vm2_ip} diff --git a/csit/libraries/OcpAgentKeywords.robot b/csit/libraries/OcpAgentKeywords.robot index 2c976ac102..60615c08aa 100644 --- a/csit/libraries/OcpAgentKeywords.robot +++ b/csit/libraries/OcpAgentKeywords.robot @@ -39,9 +39,10 @@ Start Emulator Multiple ${mininet_conn_id}= SSHLibrary.Open Connection ${mininet} prompt=${TOOLS_SYSTEM_PROMPT} timeout=${DEFAULT_TIMEOUT} Set Suite Variable ${mininet_conn_id} SSHKeywords.Flexible Mininet Login - : FOR ${NODE_NUM} IN RANGE 1 ${number} - \ SSHLibrary.Write java -cp /tmp/agent/simple-agent/src/main/java/ org.opendaylight.ocpplugin.OcpAgent ${controller} 1033 ${vendorID} ${NODE_NUM} & - \ SSHLibrary.Read Until getParamResp + FOR ${NODE_NUM} IN RANGE 1 ${number} + SSHLibrary.Write java -cp /tmp/agent/simple-agent/src/main/java/ org.opendaylight.ocpplugin.OcpAgent ${controller} 1033 ${vendorID} ${NODE_NUM} & + SSHLibrary.Read Until getParamResp + END [Return] ${mininet_conn_id} Stop Emulator And Exit diff --git a/csit/libraries/OpenStackOperations.robot b/csit/libraries/OpenStackOperations.robot index ea94831817..4f23c8a25c 100644 --- a/csit/libraries/OpenStackOperations.robot +++ b/csit/libraries/OpenStackOperations.robot @@ -47,10 +47,11 @@ Create Multiple Networks [Arguments] @{name_of_networks} [Documentation] Create required number of networks and return a list of the resulting network ids ${net_list_ids} = BuiltIn.Create List @{EMPTY} - : FOR ${net} IN @{name_of_networks} - \ ${output} = OpenStackOperations.Create Network ${net} - \ ${net_id} = Get Regexp Matches ${output} ${REGEX_UUID} - \ Collections.Append To List ${net_list_ids} ${net_id} + FOR ${net} IN @{name_of_networks} + ${output} = OpenStackOperations.Create Network ${net} + ${net_id} = Get Regexp Matches ${output} ${REGEX_UUID} + Collections.Append To List ${net_list_ids} ${net_id} + END [Return] @{net_list_ids} Update Network @@ -90,13 +91,15 @@ Create Multiple Subnets [Documentation] Create required number of subnets for previously created networks and return subnet id ${number_of_networks} = BuiltIn.Get Length ${network_names} @{subnet_id_list} = BuiltIn.Create List @{EMPTY} - : FOR ${index} IN RANGE ${number_of_networks} - \ OpenStackOperations.Create SubNet ${network_names[${index}]} ${subnet_names[${index}]} ${subnet_cidr[${index}]} + FOR ${index} IN RANGE ${number_of_networks} + OpenStackOperations.Create SubNet ${network_names[${index}]} ${subnet_names[${index}]} ${subnet_cidr[${index}]} + END ${sub_list} = OpenStackOperations.List Subnets - : FOR ${index} IN RANGE ${number_of_networks} - \ BuiltIn.Should Contain ${sub_list} ${subnet_names[${index}]} - \ ${subnet_id} = OpenStackOperations.Get Subnet Id ${subnet_names[${index}]} - \ Collections.Append To List ${subnet_id_list} ${subnet_id} + FOR ${index} IN RANGE ${number_of_networks} + BuiltIn.Should Contain ${sub_list} ${subnet_names[${index}]} + ${subnet_id} = OpenStackOperations.Get Subnet Id ${subnet_names[${index}]} + Collections.Append To List ${subnet_id_list} ${subnet_id} + END [Return] @{subnet_id_list} Update SubNet @@ -158,16 +161,17 @@ Create And Associate Floating IPs [Arguments] ${external_net} @{vm_list} [Documentation] Create and associate floating IPs to VMs with nova request ${ip_list} = BuiltIn.Create List @{EMPTY} - : FOR ${vm} IN @{vm_list} - \ ${output} = OpenStack CLI openstack floating ip create ${external_net} - \ @{ip} = String.Get Regexp Matches ${output} [0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3} - \ ${ip_length} = BuiltIn.Get Length ${ip} - \ BuiltIn.Run Keyword If ${ip_length}>0 Collections.Append To List ${ip_list} @{ip}[0] - \ ... ELSE Collections.Append To List ${ip_list} None - \ ${vm_ip} = OpenStack CLI openstack server show ${vm} | grep "addresses" | awk '{print $4}' | cut -d"=" -f 2 - \ ${port_id} = OpenStack CLI openstack port list | grep "ip_address='${vm_ip}'" | awk '{print $2}' | cut -d"=" -f 2 - \ ${output} = BuiltIn.Run Keyword If '${OPENSTACK_BRANCH}' == 'stable/rocky' OpenStack CLI openstack floating ip set --port ${port_id} @{ip}[0] - \ ... ELSE OpenStack CLI openstack server add floating ip ${vm} @{ip}[0] + FOR ${vm} IN @{vm_list} + ${output} = OpenStack CLI openstack floating ip create ${external_net} + @{ip} = String.Get Regexp Matches ${output} [0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3} + ${ip_length} = BuiltIn.Get Length ${ip} + BuiltIn.Run Keyword If ${ip_length}>0 Collections.Append To List ${ip_list} @{ip}[0] + ... ELSE Collections.Append To List ${ip_list} None + ${vm_ip} = OpenStack CLI openstack server show ${vm} | grep "addresses" | awk '{print $4}' | cut -d"=" -f 2 + ${port_id} = OpenStack CLI openstack port list | grep "ip_address='${vm_ip}'" | awk '{print $2}' | cut -d"=" -f 2 + ${output} = BuiltIn.Run Keyword If '${OPENSTACK_BRANCH}' == 'stable/rocky' OpenStack CLI openstack floating ip set --port ${port_id} @{ip}[0] + ... ELSE OpenStack CLI openstack server add floating ip ${vm} @{ip}[0] + END [Return] ${ip_list} Remove Floating Ip From Vm @@ -275,8 +279,9 @@ Create Vm Instances .. ${max}=1 ${image} BuiltIn.Set Variable If "${image}"=="${EMPTY}" ${CIRROS_${OPENSTACK_BRANCH}} ${image} ${net_id} = OpenStackOperations.Get Net Id ${net_name} - : FOR ${vm} IN @{vm_instance_names} - \ ${output} = OpenStack CLI openstack server create --image ${image} --flavor ${flavor} --nic net-id=${net_id} ${vm} --security-group ${sg} --min ${min} --max ${max} + FOR ${vm} IN @{vm_instance_names} + ${output} = OpenStack CLI openstack server create --image ${image} --flavor ${flavor} --nic net-id=${net_id} ${vm} --security-group ${sg} --min ${min} --max ${max} + END Create Vm Instance On Compute Node [Arguments] ${net_name} ${vm_name} ${node_hostname} ${image}=${EMPTY} ${flavor}=m1.nano ${sg}=default @@ -397,19 +402,20 @@ Get VM IPs ... TODO: there is a potential issue for a caller that passes in VMs belonging to different networks that ... may have different dhcp server addresses. Not sure what TODO about that, but noting it here for reference. @{vm_ips} BuiltIn.Create List @{EMPTY} - : FOR ${vm} IN @{vms} - \ OpenStackOperations.Poll VM Is ACTIVE ${vm} - \ ${status} ${ips_and_console_log} BuiltIn.Run Keyword And Ignore Error BuiltIn.Wait Until Keyword Succeeds 180s 15s - \ ... OpenStackOperations.Get VM IP true ${vm} - \ # If there is trouble with Get VM IP, the status will be FAIL and the return value will be a string of what went - \ # wrong. We need to handle both the PASS and FAIL cases. In the FAIL case we know we wont have access to the - \ # console log, as it would not be returned; so we need to grab it again to log it. We also can append 'None' to - \ # the vm ip list if status is FAIL. - \ BuiltIn.Run Keyword If "${status}" == "PASS" BuiltIn.Log ${ips_and_console_log[2]} - \ BuiltIn.Run Keyword If "${status}" == "PASS" Collections.Append To List ${vm_ips} ${ips_and_console_log[0]} - \ BuiltIn.Run Keyword If "${status}" == "FAIL" Collections.Append To List ${vm_ips} None - \ ${vm_console_output} = BuiltIn.Run Keyword If "${status}" == "FAIL" OpenStack CLI openstack console log show ${vm} - \ BuiltIn.Run Keyword If "${status}" == "FAIL" BuiltIn.Log ${vm_console_output} + FOR ${vm} IN @{vms} + OpenStackOperations.Poll VM Is ACTIVE ${vm} + ${status} ${ips_and_console_log} BuiltIn.Run Keyword And Ignore Error BuiltIn.Wait Until Keyword Succeeds 180s 15s + ... OpenStackOperations.Get VM IP true ${vm} + # If there is trouble with Get VM IP, the status will be FAIL and the return value will be a string of what went + # wrong. We need to handle both the PASS and FAIL cases. In the FAIL case we know we wont have access to the + # console log, as it would not be returned; so we need to grab it again to log it. We also can append 'None' to + # the vm ip list if status is FAIL. + BuiltIn.Run Keyword If "${status}" == "PASS" BuiltIn.Log ${ips_and_console_log[2]} + BuiltIn.Run Keyword If "${status}" == "PASS" Collections.Append To List ${vm_ips} ${ips_and_console_log[0]} + BuiltIn.Run Keyword If "${status}" == "FAIL" Collections.Append To List ${vm_ips} None + ${vm_console_output} = BuiltIn.Run Keyword If "${status}" == "FAIL" OpenStack CLI openstack console log show ${vm} + BuiltIn.Run Keyword If "${status}" == "FAIL" BuiltIn.Log ${vm_console_output} + END OpenStackOperations.Copy DHCP Files From Control Node [Return] @{vm_ips} ${ips_and_console_log[1]} @@ -441,25 +447,27 @@ Collect VM IPv6 SLAAC Addresses ... Returns an empty list if no IPv6 addresses found or if SSH connection fails. ... Otherwise, returns a list of IPv6 addresses. ${ipv6_list} = BuiltIn.Create List @{EMPTY} - : FOR ${vm} IN @{vm_list} - \ ${output} = OpenStack CLI openstack server show ${vm} -f shell - \ ${pattern} = String.Replace String ${subnet} ::/64 (:[a-f0-9]{,4}){,4} - \ @{vm_ipv6} = String.Get Regexp Matches ${output} ${pattern} - \ ${vm_ip_length} = BuiltIn.Get Length ${vm_ipv6}[0] - \ ${ipv6_data_from_vm} = BuiltIn.Run Keyword If ${vm_ip_length}>0 OpenStackOperations.Execute Command on VM Instance ${network} ${vm_ipv6[0]} - \ ... ip -6 a - \ @{ipv6} = String.Get Regexp Matches ${ipv6_data_from_vm} ${pattern} - \ ${ipv6_addr_list_length} BuiltIn.Get Length @{ipv6} - \ BuiltIn.Run Keyword If ${ipv6_addr_list_length}>0 Collections.Append To List ${ipv6_list} ${ipv6[0]} - \ ... ELSE Collections.Append To List ${ipv6_list} None + FOR ${vm} IN @{vm_list} + ${output} = OpenStack CLI openstack server show ${vm} -f shell + ${pattern} = String.Replace String ${subnet} ::/64 (:[a-f0-9]{,4}){,4} + @{vm_ipv6} = String.Get Regexp Matches ${output} ${pattern} + ${vm_ip_length} = BuiltIn.Get Length ${vm_ipv6}[0] + ${ipv6_data_from_vm} = BuiltIn.Run Keyword If ${vm_ip_length}>0 OpenStackOperations.Execute Command on VM Instance ${network} ${vm_ipv6[0]} + ... ip -6 a + @{ipv6} = String.Get Regexp Matches ${ipv6_data_from_vm} ${pattern} + ${ipv6_addr_list_length} BuiltIn.Get Length @{ipv6} + BuiltIn.Run Keyword If ${ipv6_addr_list_length}>0 Collections.Append To List ${ipv6_list} ${ipv6[0]} + ... ELSE Collections.Append To List ${ipv6_list} None + END [Return] ${ipv6_list} View Vm Console [Arguments] ${vm_instance_names} [Documentation] View Console log of the created vm instances using nova show. - : FOR ${vm} IN @{vm_instance_names} - \ ${output} = OpenStack CLI openstack server show ${vm} - \ ${output} = OpenStack CLI openstack console log show ${vm} + FOR ${vm} IN @{vm_instance_names} + ${output} = OpenStack CLI openstack server show ${vm} + ${output} = OpenStack CLI openstack console log show ${vm} + END Ping Vm From DHCP Namespace [Arguments] ${net_name} ${vm_ip} @@ -574,11 +582,12 @@ Test Operations From Vm Instance BuiltIn.Run Keyword If ${rcode} Utils.Write Commands Until Expected Prompt route -A inet6 ${OS_SYSTEM_PROMPT} BuiltIn.Run Keyword If ${rcode} Utils.Write Commands Until Expected Prompt arp -an ${OS_SYSTEM_PROMPT} BuiltIn.Run Keyword If ${rcode} Utils.Write Commands Until Expected Prompt ip -f inet6 neigh show ${OS_SYSTEM_PROMPT} - : FOR ${dest_ip} IN @{dest_ips} - \ ${string_empty} = BuiltIn.Run Keyword And Return Status Should Be Empty ${dest_ip} - \ BuiltIn.Run Keyword If ${string_empty} Continue For Loop - \ BuiltIn.Run Keyword If ${rcode} and "${ping_should_succeed}" == "True" OpenStackOperations.Check Ping ${dest_ip} ttl=${ttl} ping_tries=${ping_tries} - \ ... ELSE OpenStackOperations.Check No Ping ${dest_ip} ttl=${ttl} + FOR ${dest_ip} IN @{dest_ips} + ${string_empty} = BuiltIn.Run Keyword And Return Status Should Be Empty ${dest_ip} + BuiltIn.Run Keyword If ${string_empty} Continue For Loop + BuiltIn.Run Keyword If ${rcode} and "${ping_should_succeed}" == "True" OpenStackOperations.Check Ping ${dest_ip} ttl=${ttl} ping_tries=${ping_tries} + ... ELSE OpenStackOperations.Check No Ping ${dest_ip} ttl=${ttl} + END ${ethertype} = String.Get Regexp Matches ${src_ip} ${IP_REGEX} BuiltIn.Run Keyword If ${rcode} and "${check_metadata}" and ${ethertype} == "True" OpenStackOperations.Check Metadata Access [Teardown] Exit From Vm Console ${console} @@ -604,8 +613,9 @@ Ping Other Instances [Arguments] ${list_of_external_dst_ips} ${console}=cirros [Documentation] Check reachability with other network's instances. ${rcode} = BuiltIn.Run Keyword And Return Status OpenStackOperations.Check If Console Is VmInstance ${console} - : FOR ${dest_ip} IN @{list_of_external_dst_ips} - \ OpenStackOperations.Check Ping ${dest_ip} + FOR ${dest_ip} IN @{list_of_external_dst_ips} + OpenStackOperations.Check Ping ${dest_ip} + END Create Router [Arguments] ${router_name} @@ -667,10 +677,11 @@ Get DumpFlows And Ovsconfig Utils.Write Commands Until Expected Prompt arp -an ${DEFAULT_LINUX_PROMPT_STRICT} ${nslist} = Utils.Write Commands Until Expected Prompt ip netns list | awk '{print $1}' ${DEFAULT_LINUX_PROMPT_STRICT} @{lines} Split To Lines ${nslist} end=-1 - : FOR ${line} IN @{lines} - \ Utils.Write Commands Until Expected Prompt sudo ip netns exec ${line} ip -o link ${DEFAULT_LINUX_PROMPT_STRICT} - \ Utils.Write Commands Until Expected Prompt sudo ip netns exec ${line} ip -o addr ${DEFAULT_LINUX_PROMPT_STRICT} - \ Utils.Write Commands Until Expected Prompt sudo ip netns exec ${line} ip route ${DEFAULT_LINUX_PROMPT_STRICT} + FOR ${line} IN @{lines} + Utils.Write Commands Until Expected Prompt sudo ip netns exec ${line} ip -o link ${DEFAULT_LINUX_PROMPT_STRICT} + Utils.Write Commands Until Expected Prompt sudo ip netns exec ${line} ip -o addr ${DEFAULT_LINUX_PROMPT_STRICT} + Utils.Write Commands Until Expected Prompt sudo ip netns exec ${line} ip route ${DEFAULT_LINUX_PROMPT_STRICT} + END Utils.Write Commands Until Expected Prompt sudo ovs-vsctl show ${DEFAULT_LINUX_PROMPT_STRICT} Utils.Write Commands Until Expected Prompt sudo ovs-vsctl list Open_vSwitch ${DEFAULT_LINUX_PROMPT_STRICT} Utils.Write Commands Until Expected Prompt sudo ovs-ofctl show ${INTEGRATION_BRIDGE} -OOpenFlow13 ${DEFAULT_LINUX_PROMPT_STRICT} @@ -684,8 +695,9 @@ Get ControlNode Connection Get OvsDebugInfo [Documentation] Get the OvsConfig and Flow entries from all Openstack nodes - : FOR ${conn_id} IN @{OS_ALL_CONN_IDS} - \ OpenStackOperations.Get DumpFlows And Ovsconfig ${conn_id} + FOR ${conn_id} IN @{OS_ALL_CONN_IDS} + OpenStackOperations.Get DumpFlows And Ovsconfig ${conn_id} + END Get Test Teardown Debugs [Arguments] ${test_name}=${SUITE_NAME}.${TEST_NAME} ${fail}=${FAIL_ON_EXCEPTIONS} @@ -693,8 +705,9 @@ Get Test Teardown Debugs OpenStackOperations.Get OvsDebugInfo BuiltIn.Run Keyword And Ignore Error DataModels.Get Model Dump ${HA_PROXY_IP} ${netvirt_data_models} KarafKeywords.Fail If Exceptions Found During Test ${test_name} fail=${fail} - : FOR ${i} IN RANGE ${NUM_ODL_SYSTEM} - \ BuiltIn.Run Keyword And Ignore Error Issue_Command_On_Karaf_Console trace:transactions ${ODL_SYSTEM_${i+1}_IP} + FOR ${i} IN RANGE ${NUM_ODL_SYSTEM} + BuiltIn.Run Keyword And Ignore Error Issue_Command_On_Karaf_Console trace:transactions ${ODL_SYSTEM_${i+1}_IP} + END Get Suite Debugs Get Test Teardown Debugs test_name=${SUITE_NAME} fail=False @@ -708,9 +721,10 @@ Show Debugs [Documentation] Run these commands for debugging, it can list state of VM instances and ip information in control node OpenStackOperations.Get ControlNode Connection ${output} = DevstackUtils.Write Commands Until Prompt And Log sudo ip netns list - : FOR ${index} IN @{vm_indices} - \ ${rc} ${output} = OperatingSystem.Run And Return Rc And Output nova show ${index} - \ BuiltIn.Log ${output} + FOR ${index} IN @{vm_indices} + ${rc} ${output} = OperatingSystem.Run And Return Rc And Output nova show ${index} + BuiltIn.Log ${output} + END OpenStackOperations.List Nova VMs OpenStackOperations.List Routers OpenStackOperations.List Networks @@ -802,8 +816,9 @@ Delete All Security Group Rules [Documentation] Delete all security rules from a specified security group ${sg_rules_output} = OpenStack CLI openstack security group rule list ${sg_name} -cID -fvalue @{sg_rules} = String.Split String ${sg_rules_output} \n - : FOR ${rule} IN @{sg_rules} - \ ${output} = OpenStack CLI openstack security group rule delete ${rule} + FOR ${rule} IN @{sg_rules} + ${output} = OpenStack CLI openstack security group rule delete ${rule} + END Create Allow All SecurityGroup [Arguments] ${sg_name} ${ether_type}=IPv4 ${dual}=False @@ -839,9 +854,10 @@ Get Ports MacAddr [Arguments] ${ports} [Documentation] Retrieve the port MacAddr for the given list of port name and return the MAC address list. ${macs} BuiltIn.Create List - : FOR ${port} IN @{ports} - \ ${mac} = OpenStackOperations.Get Port Mac ${port} - \ Collections.Append To List ${macs} ${mac} + FOR ${port} IN @{ports} + ${mac} = OpenStackOperations.Get Port Mac ${port} + Collections.Append To List ${macs} ${mac} + END [Return] ${macs} Get Port Ip @@ -1075,33 +1091,40 @@ Wait For Routes To Propogate [Arguments] ${networks} ${subnets} [Documentation] Check propagated routes OpenStackOperations.Get ControlNode Connection - : FOR ${INDEX} IN RANGE 0 1 - \ ${net_id} = OpenStackOperations.Get Net Id @{networks}[${INDEX}] - \ ${is_ipv6} = String.Get Regexp Matches @{subnets}[${INDEX}] ${IP6_REGEX} - \ ${length} = BuiltIn.Get Length ${is_ipv6} - \ ${cmd} = BuiltIn.Set Variable If ${length} == 0 ip route ip -6 route - \ ${output} = Utils.Write Commands Until Expected Prompt sudo ip netns exec qdhcp-${net_id} ${cmd} ${DEFAULT_LINUX_PROMPT_STRICT} - \ BuiltIn.Should Contain ${output} @{subnets}[${INDEX}] + FOR ${INDEX} IN RANGE 0 1 + ${net_id} = OpenStackOperations.Get Net Id @{networks}[${INDEX}] + ${is_ipv6} = String.Get Regexp Matches @{subnets}[${INDEX}] ${IP6_REGEX} + ${length} = BuiltIn.Get Length ${is_ipv6} + ${cmd} = BuiltIn.Set Variable If ${length} == 0 ip route ip -6 route + ${output} = Utils.Write Commands Until Expected Prompt sudo ip netns exec qdhcp-${net_id} ${cmd} ${DEFAULT_LINUX_PROMPT_STRICT} + BuiltIn.Should Contain ${output} @{subnets}[${INDEX}] + END Neutron Cleanup [Arguments] ${vms}=@{EMPTY} ${networks}=@{EMPTY} ${subnets}=@{EMPTY} ${ports}=@{EMPTY} ${sgs}=@{EMPTY} - : FOR ${vm} IN @{vms} - \ BuiltIn.Run Keyword And Ignore Error Delete Vm Instance ${vm} - : FOR ${port} IN @{ports} - \ BuiltIn.Run Keyword And Ignore Error Delete Port ${port} - : FOR ${subnet} IN @{subnets} - \ BuiltIn.Run Keyword And Ignore Error Delete SubNet ${subnet} - : FOR ${network} IN @{networks} - \ BuiltIn.Run Keyword And Ignore Error Delete Network ${network} - : FOR ${sg} IN @{sgs} - \ BuiltIn.Run Keyword And Ignore Error Delete SecurityGroup ${sg} + FOR ${vm} IN @{vms} + BuiltIn.Run Keyword And Ignore Error Delete Vm Instance ${vm} + END + FOR ${port} IN @{ports} + BuiltIn.Run Keyword And Ignore Error Delete Port ${port} + END + FOR ${subnet} IN @{subnets} + BuiltIn.Run Keyword And Ignore Error Delete SubNet ${subnet} + END + FOR ${network} IN @{networks} + BuiltIn.Run Keyword And Ignore Error Delete Network ${network} + END + FOR ${sg} IN @{sgs} + BuiltIn.Run Keyword And Ignore Error Delete SecurityGroup ${sg} + END OpenStack List All [Documentation] Get a list of different OpenStack resources that might be in use. @{modules} = BuiltIn.Create List server port network subnet security group ... security group rule floating ip router - : FOR ${module} IN @{modules} - \ ${output} = OpenStack CLI openstack ${module} list + FOR ${module} IN @{modules} + ${output} = OpenStack CLI openstack ${module} list + END OpenStack CLI Get List [Arguments] ${cmd} @@ -1132,35 +1155,42 @@ OpenStack Cleanup All [Documentation] Cleanup all Openstack resources with best effort. The keyword will query for all resources ... in use and then attempt to delete them. Errors are ignored to allow the cleanup to continue. @{fips} = OpenStack CLI Get List openstack floating ip list -f json - : FOR ${fip} IN @{fips} - \ BuiltIn.Run Keyword And Ignore Error Delete Floating IP ${fip['ID']} + FOR ${fip} IN @{fips} + BuiltIn.Run Keyword And Ignore Error Delete Floating IP ${fip['ID']} + END @{vms} = OpenStack CLI Get List openstack server list -f json - : FOR ${vm} IN @{vms} - \ OpenStack CLI openstack server show ${vm['ID']} - \ BuiltIn.Run Keyword And Ignore Error Delete Vm Instance ${vm['ID']} + FOR ${vm} IN @{vms} + OpenStack CLI openstack server show ${vm['ID']} + BuiltIn.Run Keyword And Ignore Error Delete Vm Instance ${vm['ID']} + END @{routers} = OpenStack CLI Get List openstack router list -f json - : FOR ${router} IN @{routers} - \ BuiltIn.Run Keyword And Ignore Error Cleanup Router ${router['ID']} + FOR ${router} IN @{routers} + BuiltIn.Run Keyword And Ignore Error Cleanup Router ${router['ID']} + END @{ports} = OpenStack CLI Get List openstack port list -f json - : FOR ${port} IN @{ports} - \ BuiltIn.Run Keyword And Ignore Error Delete Port ${port['ID']} + FOR ${port} IN @{ports} + BuiltIn.Run Keyword And Ignore Error Delete Port ${port['ID']} + END @{networks} = OpenStack CLI Get List openstack network list -f json - : FOR ${network} IN @{networks} - \ BuiltIn.Run Keyword And Ignore Error Delete Subnet ${network['Subnets']} - \ BuiltIn.Run Keyword And Ignore Error Delete Network ${network['ID']} + FOR ${network} IN @{networks} + BuiltIn.Run Keyword And Ignore Error Delete Subnet ${network['Subnets']} + BuiltIn.Run Keyword And Ignore Error Delete Network ${network['ID']} + END @{security_groups} = OpenStack CLI Get List openstack security group list -f json - : FOR ${security_group} IN @{security_groups} - \ BuiltIn.Run Keyword If "${security_group['Name']}" != "default" BuiltIn.Run Keyword And Ignore Error Delete SecurityGroup ${security_group['ID']} + FOR ${security_group} IN @{security_groups} + BuiltIn.Run Keyword If "${security_group['Name']}" != "default" BuiltIn.Run Keyword And Ignore Error Delete SecurityGroup ${security_group['ID']} + END OpenStack List All Cleanup Router [Arguments] ${id} [Documentation] Delete a router, but first remove any interfaces or gateways so that the delete will be successful. @{ports} = OpenStack CLI Get List openstack port list --router ${id} -f json --long - : FOR ${port} IN @{ports} - \ ${subnet_id} = OpenStackOperations.Get Match ${port['Fixed IP Addresses']} ${REGEX_UUID} 0 - \ BuiltIn.Run Keyword If "${port['Device Owner']}" == "network:router_gateway" BuiltIn.Run Keyword And Ignore Error Remove Gateway ${id} - \ BuiltIn.Run Keyword If "${port['Device Owner']}" == "network:router_interface" BuiltIn.Run Keyword And Ignore Error Remove Interface ${id} ${subnet_id} + FOR ${port} IN @{ports} + ${subnet_id} = OpenStackOperations.Get Match ${port['Fixed IP Addresses']} ${REGEX_UUID} 0 + BuiltIn.Run Keyword If "${port['Device Owner']}" == "network:router_gateway" BuiltIn.Run Keyword And Ignore Error Remove Gateway ${id} + BuiltIn.Run Keyword If "${port['Device Owner']}" == "network:router_interface" BuiltIn.Run Keyword And Ignore Error Remove Interface ${id} ${subnet_id} + END BuiltIn.Run Keyword And Ignore Error Delete Router ${id} OpenStack Suite Setup @@ -1186,18 +1216,20 @@ OpenStack Suite Teardown OpenStack Cleanup All OpenStackOperations.Stop Packet Capture On Nodes ${tcpdump_port_6653_conn_ids} SSHLibrary.Close All Connections - : FOR ${i} IN RANGE ${NUM_ODL_SYSTEM} - \ KarafKeywords.Issue Command On Karaf Console threads --list | wc -l ${ODL_SYSTEM_${i+1}_IP} + FOR ${i} IN RANGE ${NUM_ODL_SYSTEM} + KarafKeywords.Issue Command On Karaf Console threads --list | wc -l ${ODL_SYSTEM_${i+1}_IP} + END Validate Deployment [Documentation] Validate the deployment. Examples to validate are verifying default table ... flows are installed and that the tunnel mesh has been built correctly. Write To Validate File ----------------------------------------\n${SUITE_NAME}\n - : FOR ${keyword} IN @{VALIDATION_KEYWORDS} - \ ${status} = Builtin.Run Keyword And Return Status ${keyword} - \ BuiltIn.Run Keyword If "${status}" == "FAIL" or "${status}" == "False" BuiltIn.Run Keywords Write To Validate File Failed: ${keyword} - \ ... AND BuiltIn.Fail - \ ... ELSE Write To Validate File Passed: ${keyword} + FOR ${keyword} IN @{VALIDATION_KEYWORDS} + ${status} = Builtin.Run Keyword And Return Status ${keyword} + BuiltIn.Run Keyword If "${status}" == "FAIL" or "${status}" == "False" BuiltIn.Run Keywords Write To Validate File Failed: ${keyword} + ... AND BuiltIn.Fail + ... ELSE Write To Validate File Passed: ${keyword} + END Write To Validate File [Arguments] ${msg} @@ -1217,20 +1249,23 @@ Copy DHCP Files From Control Node Is Feature Installed [Arguments] ${features}=none - : FOR ${feature} IN @{features} - \ ${status} ${output} BuiltIn.Run Keyword And Ignore Error BuiltIn.Should Contain ${CONTROLLERFEATURES} ${feature} - \ Return From Keyword If "${status}" == "PASS" True + FOR ${feature} IN @{features} + ${status} ${output} BuiltIn.Run Keyword And Ignore Error BuiltIn.Should Contain ${CONTROLLERFEATURES} ${feature} + Return From Keyword If "${status}" == "PASS" True + END [Return] False Add OVS Logging On All OpenStack Nodes [Documentation] Add higher levels of OVS logging to all the OpenStack nodes - : FOR ${conn_id} IN @{OS_ALL_CONN_IDS} - \ OVSDB.Add OVS Logging ${conn_id} + FOR ${conn_id} IN @{OS_ALL_CONN_IDS} + OVSDB.Add OVS Logging ${conn_id} + END Reset OVS Logging On All OpenStack Nodes [Documentation] Reset the OVS logging to all the OpenStack nodes - : FOR ${conn_id} IN @{OS_ALL_CONN_IDS} - \ OVSDB.Reset OVS Logging ${conn_id} + FOR ${conn_id} IN @{OS_ALL_CONN_IDS} + OVSDB.Reset OVS Logging ${conn_id} + END Start Packet Capture On Nodes [Arguments] ${tag} ${filter} @{ips} @@ -1310,10 +1345,11 @@ Verify Expected Default Tables On Nodes ${resp} = RequestsLibrary.Get Request session ${CONFIG_NODES_API} Utils.Log Content ${resp.content} ${failed_node_list} = BuiltIn.Create List - : FOR ${node_ip} IN @{node_ips} - \ ${failed_table_list} = Verify Expected Default Tables ${node_ip} - \ ${failed_table_list_size} = BuiltIn.Get Length ${failed_table_list} - \ BuiltIn.Run Keyword If ${failed_table_list_size} > 0 Collections.Append To List ${failed_node_list} ${node_ip} + FOR ${node_ip} IN @{node_ips} + ${failed_table_list} = Verify Expected Default Tables ${node_ip} + ${failed_table_list_size} = BuiltIn.Get Length ${failed_table_list} + BuiltIn.Run Keyword If ${failed_table_list_size} > 0 Collections.Append To List ${failed_node_list} ${node_ip} + END Builtin.Should Be Empty ${failed_node_list} Verify Expected Default Tables @@ -1322,9 +1358,10 @@ Verify Expected Default Tables ${flow_dump} = Utils.Run Command On Remote System ${ovs_ip} sudo ovs-ofctl dump-flows ${INTEGRATION_BRIDGE} -OOpenFlow13 BuiltIn.Log ${flow_dump} ${failed_table_list} = BuiltIn.Create List - : FOR ${table} IN @{DEFAULT_FLOW_TABLES} - \ ${rc} = Builtin.Run Keyword And Return Status Builtin.Should Not Match Regexp ${flow_dump} .*table=${table}.*priority=0 - \ BuiltIn.Run Keyword If ${rc} Collections.Append To List ${failed_table_list} ${table} + FOR ${table} IN @{DEFAULT_FLOW_TABLES} + ${rc} = Builtin.Run Keyword And Return Status Builtin.Should Not Match Regexp ${flow_dump} .*table=${table}.*priority=0 + BuiltIn.Run Keyword If ${rc} Collections.Append To List ${failed_table_list} ${table} + END [Return] ${failed_table_list} Get Project Id diff --git a/csit/libraries/OvsManager.robot b/csit/libraries/OvsManager.robot index 7f08b3358e..e2beb38703 100644 --- a/csit/libraries/OvsManager.robot +++ b/csit/libraries/OvsManager.robot @@ -57,8 +57,9 @@ Set Bridge Controllers ${output}= SSHLibrary.Read_Until ${lprompt} Log ${output} ${cmd}= BuiltIn.Set Variable ${lcmd_prefix} ovs-vsctl set-controller ${bridge} - : FOR ${cntl} IN @{controllers} - \ ${cmd}= BuiltIn.Set Variable If ${disconnected}==${False} ${cmd} tcp:${cntl}:6653 ${cmd} tcp:${cntl}:6654 + FOR ${cntl} IN @{controllers} + ${cmd}= BuiltIn.Set Variable If ${disconnected}==${False} ${cmd} tcp:${cntl}:6653 ${cmd} tcp:${cntl}:6654 + END BuiltIn.Log ${cmd} SSHLibrary.Write ${cmd} ${output}= SSHLibrary.Read_Until ${lprompt} @@ -143,11 +144,12 @@ Get Master Node ${bridge}= Collections.Get From Dictionary ${ovs_switch_data} ${switch} ${cntls_dict}= Collections.Get From Dictionary ${bridge} controller ${cntls_items}= Collections.Get Dictionary Items ${cntls_dict} - : FOR ${key} ${value} IN @{cntls_items} - \ Log ${key} : ${value} - \ ${role}= Collections.Get From Dictionary ${value} role - \ Run Keyword If "${role}"=="master" BuiltIn.Should Be Equal ${master} ${None} - \ ${master}= BuiltIn.Set Variable If "${role}"=="master" ${key} ${master} + FOR ${key} ${value} IN @{cntls_items} + Log ${key} : ${value} + ${role}= Collections.Get From Dictionary ${value} role + Run Keyword If "${role}"=="master" BuiltIn.Should Be Equal ${master} ${None} + ${master}= BuiltIn.Set Variable If "${role}"=="master" ${key} ${master} + END BuiltIn.Should Not Be Equal ${master} ${None} Return From Keyword ${master} @@ -159,10 +161,11 @@ Get Slave Nodes ${bridge}= Collections.Get From Dictionary ${ovs_switch_data} ${switch} ${cntls_dict}= Collections.Get From Dictionary ${bridge} controller ${cntls_items}= Collections.Get Dictionary Items ${cntls_dict} - : FOR ${key} ${value} IN @{cntls_items} - \ Log ${key} : ${value} - \ ${role}= Collections.Get From Dictionary ${value} role - \ Run Keyword If "${role}"=="slave" Collections.Append To List ${slaves} ${key} + FOR ${key} ${value} IN @{cntls_items} + Log ${key} : ${value} + ${role}= Collections.Get From Dictionary ${value} role + Run Keyword If "${role}"=="slave" Collections.Append To List ${slaves} ${key} + END Return From Keyword ${slaves} Setup Clustered Controller For Switches @@ -170,14 +173,16 @@ Setup Clustered Controller For Switches [Documentation] The idea of this keyword is to setup clustered controller and to be more or less sure that the role is filled correctly. The problem is when ... more controllers are being set up at once, the role shown in Controller ovsdb table is not the same as we can see from wireshark traces. ... Now we set disconnected controllers and we will connect them expecting that the first connected controller will be master. - : FOR ${switch_name} IN @{switches} - \ Set Bridge Controllers ${switch_name} ${controller_ips} disconnected=${True} - # now we need to enable one node which will be master + FOR ${switch_name} IN @{switches} + Set Bridge Controllers ${switch_name} ${controller_ips} disconnected=${True} + # now we need to enable one node which will be master + END OvsManager.Get Ovsdb Data - : FOR ${switch_name} IN @{switches} - \ ${own}= Collections.Get From List ${controller_ips} 0 - \ Reconnect Switch To Controller And Verify Connected ${switch_name} ${own} verify_connected=${False} - # now we need to wait till master controllers are connected + FOR ${switch_name} IN @{switches} + ${own}= Collections.Get From List ${controller_ips} 0 + Reconnect Switch To Controller And Verify Connected ${switch_name} ${own} verify_connected=${False} + # now we need to wait till master controllers are connected + END BuiltIn.Wait Until Keyword Succeeds 5x 2s OvsManager__Verify_Masters_Connected ${switches} update_data=${True} # now we can enable slaves OvsManager__Enable_Slaves ${switches} verify_connected=${verify_connected} @@ -186,15 +191,17 @@ OvsManager__Verify_Masters_Connected [Arguments] ${switches} ${update_data}=${False} [Documentation] Private keyword, the existence of master means it is verified Run Keyword If ${update_data}==${True} Get Ovsdb Data - : FOR ${switch_name} IN @{switches} - \ Get Master Node ${switch_name} + FOR ${switch_name} IN @{switches} + Get Master Node ${switch_name} + END OvsManager__Enable_Slaves [Arguments] ${switches} ${update_data}=${False} ${verify_connected}=${False} [Documentation] This is a private keyword to enable diconnected controllers Run Keyword If ${update_data}==${True} Get Ovsdb Data - : FOR ${switch_name} IN @{switches} - \ OvsManager__Enable_Slaves_For_Switch ${switch_name} verify_connected=${verify_connected} + FOR ${switch_name} IN @{switches} + OvsManager__Enable_Slaves_For_Switch ${switch_name} verify_connected=${verify_connected} + END OvsManager__Enable_Slaves_For_Switch [Arguments] ${switch} ${update_data}=${False} ${verify_connected}=${False} @@ -203,11 +210,12 @@ OvsManager__Enable_Slaves_For_Switch ${bridge}= Collections.Get From Dictionary ${ovs_switch_data} ${switch} ${cntls_dict}= Collections.Get From Dictionary ${bridge} controller ${cntls_items}= Collections.Get Dictionary Items ${cntls_dict} - : FOR ${cntl_id} ${cntl_value} IN @{cntls_items} - \ Log ${cntl_id} : ${cntl_value} - \ ${role}= Collections.Get From Dictionary ${cntl_value} role - \ ${connected}= Collections.Get From Dictionary ${cntl_value} is_connected - \ Run Keyword If ${connected}==${False} Reconnect Switch To Controller And Verify Connected ${switch} ${cntl_id} verify_connected=${verify_connected} + FOR ${cntl_id} ${cntl_value} IN @{cntls_items} + Log ${cntl_id} : ${cntl_value} + ${role}= Collections.Get From Dictionary ${cntl_value} role + ${connected}= Collections.Get From Dictionary ${cntl_value} is_connected + Run Keyword If ${connected}==${False} Reconnect Switch To Controller And Verify Connected ${switch} ${cntl_id} verify_connected=${verify_connected} + END Get Dump Flows Count [Arguments] ${conn_id} ${acl_sr_table_id} ${port_mac}="" @@ -243,11 +251,12 @@ Get Packet Count In Table For IP Verify Ovs Version Greater Than Or Equal To [Arguments] ${ovs_version} @{nodes} [Documentation] Get ovs version and verify greater than required version - : FOR ${ip} IN @{nodes} - \ ${output} = Utils.Run Command On Remote System ${ip} ${SHOW_OVS_VERSION} - \ ${version} = String.Get Regexp Matches ${output} \[0-9].\[0-9] - \ ${result} = BuiltIn.Convert To Number ${version[0]} - \ BuiltIn.Should Be True ${result} >= ${ovs_version} + FOR ${ip} IN @{nodes} + ${output} = Utils.Run Command On Remote System ${ip} ${SHOW_OVS_VERSION} + ${version} = String.Get Regexp Matches ${output} \[0-9].\[0-9] + ${result} = BuiltIn.Convert To Number ${version[0]} + BuiltIn.Should Be True ${result} >= ${ovs_version} + END Get OVS Local Ip [Arguments] ${ip} diff --git a/csit/libraries/SFC/DockerSfc.robot b/csit/libraries/SFC/DockerSfc.robot index 93b9bbe8f1..22f092a98b 100644 --- a/csit/libraries/SFC/DockerSfc.robot +++ b/csit/libraries/SFC/DockerSfc.robot @@ -57,9 +57,10 @@ Multiple Docker Exec [Arguments] ${docker_name_list} ${command} ${return_contains}=${EMPTY} ${result_code}=0 [Documentation] Execute a command in a list of dockers and return all the outputs in a list @{list_output}= Create List - : FOR ${docker_id} IN @{docker_name_list} - \ ${exec_output}= Docker Exec ${docker_id} ${command} ${return_contains} ${result_code} - \ Append To List ${list_output} ${exec_output} + FOR ${docker_id} IN @{docker_name_list} + ${exec_output}= Docker Exec ${docker_id} ${command} ${return_contains} ${result_code} + Append To List ${list_output} ${exec_output} + END [Return] ${list_output} Get Flows In Docker Containers diff --git a/csit/libraries/SFC/SfcKeywords.robot b/csit/libraries/SFC/SfcKeywords.robot index 943ac7b479..5ebe41449a 100644 --- a/csit/libraries/SFC/SfcKeywords.robot +++ b/csit/libraries/SFC/SfcKeywords.robot @@ -58,13 +58,14 @@ Get Rendered Service Path Name # The "sfp-rendered-service-path" will only have 1 or 2 entries, depending on chain symmetry config. # The RSP name will be "-Path-" and the optional symmetric name will be -Path--Reverse" ${value} = BuiltIn.Set Variable None - : FOR ${i} IN RANGE ${list_length} - \ ${rsp_name_dict} = Collections.Get From List ${sfp_state_list} ${i} - \ ${name} = Collections.Get_From_Dictionary ${rsp_name_dict} name - \ @{matches} = String.Get Regexp Matches ${name} .*Reverse$ - \ ${matches_length} = BuiltIn.Get Length ${matches} - \ ${value} = BuiltIn.Set Variable If "${get_reverse}" == "False" and 0 == ${matches_length} ${name} "${get_reverse}" == "True" and 0 < ${matches_length} ${name} - \ ... "${value}" != "None" ${value} + FOR ${i} IN RANGE ${list_length} + ${rsp_name_dict} = Collections.Get From List ${sfp_state_list} ${i} + ${name} = Collections.Get_From_Dictionary ${rsp_name_dict} name + @{matches} = String.Get Regexp Matches ${name} .*Reverse$ + ${matches_length} = BuiltIn.Get Length ${matches} + ${value} = BuiltIn.Set Variable If "${get_reverse}" == "False" and 0 == ${matches_length} ${name} "${get_reverse}" == "True" and 0 < ${matches_length} ${name} + ... "${value}" != "None" ${value} + END [Return] ${value} Create Sfp And Wait For Rsp Creation @@ -76,14 +77,15 @@ Create Sfp And Wait For Rsp Creation ${sfp_json_list} = Collections.Get_From_Dictionary ${sfps} service-function-path ${list_length} = BuiltIn.Get Length ${sfp_json_list} # Each SFP state entry returned from ODL will have either 2 or 3 name elements, 2 for non-symmetric 3 for symmetric RSP - : FOR ${i} IN RANGE ${list_length} - \ ${sfp_entry_dict} = Collections.Get From List ${sfp_json_list} ${i} - \ ${sfp_name} = Collections.Get_From_Dictionary ${sfp_entry_dict} name - \ ${status} ${symmetric} = BuiltIn.Run Keyword And Ignore Error Collections.Get_From_Dictionary ${sfp_entry_dict} symmetric - \ ${symmetric} = BuiltIn.Set Variable If "${status}" == "FAIL" False ${symmetric} - \ ${num_names} = BuiltIn.Set Variable If "${symmetric}" == "False" 2 3 - \ BuiltIn.Wait Until Keyword Succeeds 60s 2s Utils.Check For Specific Number Of Elements At URI ${SERVICE_FUNCTION_PATH_STATE_URI}/${sfp_name} name - \ ... ${num_names} + FOR ${i} IN RANGE ${list_length} + ${sfp_entry_dict} = Collections.Get From List ${sfp_json_list} ${i} + ${sfp_name} = Collections.Get_From_Dictionary ${sfp_entry_dict} name + ${status} ${symmetric} = BuiltIn.Run Keyword And Ignore Error Collections.Get_From_Dictionary ${sfp_entry_dict} symmetric + ${symmetric} = BuiltIn.Set Variable If "${status}" == "FAIL" False ${symmetric} + ${num_names} = BuiltIn.Set Variable If "${symmetric}" == "False" 2 3 + BuiltIn.Wait Until Keyword Succeeds 60s 2s Utils.Check For Specific Number Of Elements At URI ${SERVICE_FUNCTION_PATH_STATE_URI}/${sfp_name} name + ... ${num_names} + END Delete Sfp And Wait For Rsps Deletion [Arguments] ${sfp_name} @@ -99,6 +101,7 @@ Delete All Sfps And Wait For Rsps Deletion Switch Ips In Json Files [Arguments] ${json_dir} ${container_names} ${normalized_dir}= OperatingSystem.Normalize Path ${json_dir}/*.json - : FOR ${cont_name} IN @{container_names} - \ ${cont_ip} = Get Docker IP ${cont_name} - \ OperatingSystem.Run sudo sed -i 's/${cont_name}/${cont_ip}/g' ${normalized_dir} + FOR ${cont_name} IN @{container_names} + ${cont_ip} = Get Docker IP ${cont_name} + OperatingSystem.Run sudo sed -i 's/${cont_name}/${cont_ip}/g' ${normalized_dir} + END diff --git a/csit/libraries/SXP/FilteringResources.robot b/csit/libraries/SXP/FilteringResources.robot index a7253b3e27..edb412f8f3 100644 --- a/csit/libraries/SXP/FilteringResources.robot +++ b/csit/libraries/SXP/FilteringResources.robot @@ -5,11 +5,12 @@ Resource ../SxpLib.robot *** Keywords *** Setup Nodes [Arguments] ${version}=version4 ${password}=none - : FOR ${node} IN RANGE 1 5 - \ SxpLib.Add Bindings ${node}0 10.10.10.${node}0/32 127.0.0.${node} - \ SxpLib.Add Bindings ${node}0 10.10.${node}0.0/24 127.0.0.${node} - \ SxpLib.Add Bindings ${node}0 10.${node}0.0.0/16 127.0.0.${node} - \ SxpLib.Add Bindings ${node}0 ${node}0.0.0.0/8 127.0.0.${node} + FOR ${node} IN RANGE 1 5 + SxpLib.Add Bindings ${node}0 10.10.10.${node}0/32 127.0.0.${node} + SxpLib.Add Bindings ${node}0 10.10.${node}0.0/24 127.0.0.${node} + SxpLib.Add Bindings ${node}0 10.${node}0.0.0/16 127.0.0.${node} + SxpLib.Add Bindings ${node}0 ${node}0.0.0.0/8 127.0.0.${node} + END SxpLib.Add Connection ${version} both 127.0.0.1 64999 127.0.0.2 ${password} SxpLib.Add Connection ${version} both 127.0.0.2 64999 127.0.0.1 ${password} BuiltIn.Wait Until Keyword Succeeds 15 1 Verify Connection ${version} both 127.0.0.2 @@ -43,21 +44,22 @@ Check One Group 4-5 ... deny ACL 10.10.0.0 0.0.255.0 ... permit ACL 10.0.0.0 0.255.255.0 ... Info regarding filtering https://wiki.opendaylight.org/view/SXP:Beryllium:Developer_Guide - : FOR ${node} IN RANGE 4 6 - \ ${resp} = SxpLib.Get Bindings 127.0.0.${node} - \ BuiltIn.Log ${resp} - \ SxpLib.Should Contain Binding ${resp} 10 10.10.10.10/32 - \ SxpLib.Should Contain Binding ${resp} 10 10.10.10.0/24 - \ SxpLib.Should Not Contain Binding ${resp} 10 10.10.0.0/16 - \ SxpLib.Should Contain Binding ${resp} 10 10.0.0.0/8 - \ SxpLib.Should Contain Binding ${resp} 20 10.10.10.20/32 - \ SxpLib.Should Not Contain Binding ${resp} 20 10.10.20.0/24 - \ SxpLib.Should Contain Binding ${resp} 20 10.20.0.0/16 - \ SxpLib.Should Not Contain Binding ${resp} 20 20.0.0.0/8 - \ SxpLib.Should Contain Binding ${resp} 30 10.10.10.30/32 - \ SxpLib.Should Not Contain Binding ${resp} 30 10.10.30.0/24 - \ SxpLib.Should Contain Binding ${resp} 30 10.30.0.0/16 - \ SxpLib.Should Not Contain Binding ${resp} 30 30.0.0.0/8 + FOR ${node} IN RANGE 4 6 + ${resp} = SxpLib.Get Bindings 127.0.0.${node} + BuiltIn.Log ${resp} + SxpLib.Should Contain Binding ${resp} 10 10.10.10.10/32 + SxpLib.Should Contain Binding ${resp} 10 10.10.10.0/24 + SxpLib.Should Not Contain Binding ${resp} 10 10.10.0.0/16 + SxpLib.Should Contain Binding ${resp} 10 10.0.0.0/8 + SxpLib.Should Contain Binding ${resp} 20 10.10.10.20/32 + SxpLib.Should Not Contain Binding ${resp} 20 10.10.20.0/24 + SxpLib.Should Contain Binding ${resp} 20 10.20.0.0/16 + SxpLib.Should Not Contain Binding ${resp} 20 20.0.0.0/8 + SxpLib.Should Contain Binding ${resp} 30 10.10.10.30/32 + SxpLib.Should Not Contain Binding ${resp} 30 10.10.30.0/24 + SxpLib.Should Contain Binding ${resp} 30 10.30.0.0/16 + SxpLib.Should Not Contain Binding ${resp} 30 30.0.0.0/8 + END ${resp} = SxpLib.Get Bindings 127.0.0.2 BuiltIn.Log ${resp} SxpLib.Should Contain Binding ${resp} 10 10.10.10.10/32 @@ -79,21 +81,22 @@ Check Two Group 4-5 ... permit ACL 10.20.0.0 0.0.255.255 ... permit ACL 10.10.0.0 0.0.255.0 ... Info regarding filtering https://wiki.opendaylight.org/view/SXP:Beryllium:Developer_Guide - : FOR ${node} IN RANGE 4 6 - \ ${resp} = SxpLib.Get Bindings 127.0.0.${node} - \ BuiltIn.Log ${resp} - \ SxpLib.Should Not Contain Binding ${resp} 10 10.10.10.10/32 - \ SxpLib.Should Contain Binding ${resp} 10 10.10.10.0/24 - \ SxpLib.Should Contain Binding ${resp} 10 10.10.0.0/16 - \ SxpLib.Should Not Contain Binding ${resp} 10 10.0.0.0/8 - \ SxpLib.Should Not Contain Binding ${resp} 20 10.10.10.20/32 - \ SxpLib.Should Contain Binding ${resp} 20 10.10.20.0/24 - \ SxpLib.Should Contain Binding ${resp} 20 10.20.0.0/16 - \ SxpLib.Should Not Contain Binding ${resp} 20 20.0.0.0/8 - \ SxpLib.Should Not Contain Binding ${resp} 30 10.10.10.30/32 - \ SxpLib.Should Contain Binding ${resp} 30 10.10.30.0/24 - \ SxpLib.Should Not Contain Binding ${resp} 30 10.30.0.0/16 - \ SxpLib.Should Not Contain Binding ${resp} 30 30.0.0.0/8 + FOR ${node} IN RANGE 4 6 + ${resp} = SxpLib.Get Bindings 127.0.0.${node} + BuiltIn.Log ${resp} + SxpLib.Should Not Contain Binding ${resp} 10 10.10.10.10/32 + SxpLib.Should Contain Binding ${resp} 10 10.10.10.0/24 + SxpLib.Should Contain Binding ${resp} 10 10.10.0.0/16 + SxpLib.Should Not Contain Binding ${resp} 10 10.0.0.0/8 + SxpLib.Should Not Contain Binding ${resp} 20 10.10.10.20/32 + SxpLib.Should Contain Binding ${resp} 20 10.10.20.0/24 + SxpLib.Should Contain Binding ${resp} 20 10.20.0.0/16 + SxpLib.Should Not Contain Binding ${resp} 20 20.0.0.0/8 + SxpLib.Should Not Contain Binding ${resp} 30 10.10.10.30/32 + SxpLib.Should Contain Binding ${resp} 30 10.10.30.0/24 + SxpLib.Should Not Contain Binding ${resp} 30 10.30.0.0/16 + SxpLib.Should Not Contain Binding ${resp} 30 30.0.0.0/8 + END ${resp} = SxpLib.Get Bindings 127.0.0.2 BuiltIn.Log ${resp} SxpLib.Should Contain Binding ${resp} 10 10.10.10.10/32 @@ -117,21 +120,22 @@ Check One Group 2-5 ... permit SGT 30 ACL 10.10.10.0 0.0.0.255 ... Info regarding filtering https://wiki.opendaylight.org/view/SXP:Beryllium:Developer_Guide @{list} Create List 127.0.0.2 127.0.0.5 - : FOR ${node} IN @{list} - \ ${resp} = SxpLib.Get Bindings ${node} - \ BuiltIn.Log ${resp} - \ SxpLib.Should Not Contain Binding ${resp} 10 10.10.10.10/32 - \ SxpLib.Should Contain Binding ${resp} 10 10.10.10.0/24 - \ SxpLib.Should Contain Binding ${resp} 10 10.10.0.0/16 - \ SxpLib.Should Not Contain Binding ${resp} 10 10.0.0.0/8 - \ SxpLib.Should Contain Binding ${resp} 30 10.10.10.30/32 - \ SxpLib.Should Contain Binding ${resp} 30 10.10.30.0/24 - \ SxpLib.Should Not Contain Binding ${resp} 30 10.30.0.0/16 - \ SxpLib.Should Not Contain Binding ${resp} 30 30.0.0.0/8 - \ SxpLib.Should Not Contain Binding ${resp} 40 10.10.10.40/32 - \ SxpLib.Should Contain Binding ${resp} 40 10.10.40.0/24 - \ SxpLib.Should Not Contain Binding ${resp} 40 10.40.0.0/16 - \ SxpLib.Should Not Contain Binding ${resp} 40 40.0.0.0/8 + FOR ${node} IN @{list} + ${resp} = SxpLib.Get Bindings ${node} + BuiltIn.Log ${resp} + SxpLib.Should Not Contain Binding ${resp} 10 10.10.10.10/32 + SxpLib.Should Contain Binding ${resp} 10 10.10.10.0/24 + SxpLib.Should Contain Binding ${resp} 10 10.10.0.0/16 + SxpLib.Should Not Contain Binding ${resp} 10 10.0.0.0/8 + SxpLib.Should Contain Binding ${resp} 30 10.10.10.30/32 + SxpLib.Should Contain Binding ${resp} 30 10.10.30.0/24 + SxpLib.Should Not Contain Binding ${resp} 30 10.30.0.0/16 + SxpLib.Should Not Contain Binding ${resp} 30 30.0.0.0/8 + SxpLib.Should Not Contain Binding ${resp} 40 10.10.10.40/32 + SxpLib.Should Contain Binding ${resp} 40 10.10.40.0/24 + SxpLib.Should Not Contain Binding ${resp} 40 10.40.0.0/16 + SxpLib.Should Not Contain Binding ${resp} 40 40.0.0.0/8 + END ${resp} = SxpLib.Get Bindings 127.0.0.4 BuiltIn.Log ${resp} SxpLib.Should Contain Binding ${resp} 10 10.10.10.10/32 @@ -153,21 +157,22 @@ Check Two Group 2-5 ... permit SGT 20,40 ACL 10.10.0.0 0.0.255.255 ... Info regarding filtering https://wiki.opendaylight.org/view/SXP:Beryllium:Developer_Guide @{list} = Create List 127.0.0.2 127.0.0.5 - : FOR ${node} IN @{list} - \ ${resp} = SxpLib.Get Bindings ${node} - \ BuiltIn.Log ${resp} - \ SxpLib.Should Not Contain Binding ${resp} 10 10.10.10.10/32 - \ SxpLib.Should Not Contain Binding ${resp} 10 10.10.10.0/24 - \ SxpLib.Should Not Contain Binding ${resp} 10 10.10.0.0/16 - \ SxpLib.Should Not Contain Binding ${resp} 10 10.0.0.0/8 - \ SxpLib.Should Contain Binding ${resp} 30 10.10.10.30/32 - \ SxpLib.Should Contain Binding ${resp} 30 10.10.30.0/24 - \ SxpLib.Should Not Contain Binding ${resp} 30 10.30.0.0/16 - \ SxpLib.Should Not Contain Binding ${resp} 30 30.0.0.0/8 - \ SxpLib.Should Contain Binding ${resp} 40 10.10.10.40/32 - \ SxpLib.Should Contain Binding ${resp} 40 10.10.40.0/24 - \ SxpLib.Should Not Contain Binding ${resp} 40 10.40.0.0/16 - \ SxpLib.Should Not Contain Binding ${resp} 40 40.0.0.0/8 + FOR ${node} IN @{list} + ${resp} = SxpLib.Get Bindings ${node} + BuiltIn.Log ${resp} + SxpLib.Should Not Contain Binding ${resp} 10 10.10.10.10/32 + SxpLib.Should Not Contain Binding ${resp} 10 10.10.10.0/24 + SxpLib.Should Not Contain Binding ${resp} 10 10.10.0.0/16 + SxpLib.Should Not Contain Binding ${resp} 10 10.0.0.0/8 + SxpLib.Should Contain Binding ${resp} 30 10.10.10.30/32 + SxpLib.Should Contain Binding ${resp} 30 10.10.30.0/24 + SxpLib.Should Not Contain Binding ${resp} 30 10.30.0.0/16 + SxpLib.Should Not Contain Binding ${resp} 30 30.0.0.0/8 + SxpLib.Should Contain Binding ${resp} 40 10.10.10.40/32 + SxpLib.Should Contain Binding ${resp} 40 10.10.40.0/24 + SxpLib.Should Not Contain Binding ${resp} 40 10.40.0.0/16 + SxpLib.Should Not Contain Binding ${resp} 40 40.0.0.0/8 + END ${resp} = SxpLib.Get Bindings 127.0.0.4 BuiltIn.Log ${resp} SxpLib.Should Contain Binding ${resp} 10 10.10.10.10/32 diff --git a/csit/libraries/SetupUtils.robot b/csit/libraries/SetupUtils.robot index 08fc137758..9fb802e8dd 100644 --- a/csit/libraries/SetupUtils.robot +++ b/csit/libraries/SetupUtils.robot @@ -47,8 +47,9 @@ Setup_Test_With_Logging_And_Without_Fast_Failing Setup_Logging_For_Debug_Purposes_On_List_Or_All [Arguments] ${log_level} ${loggers_list} ${member_index_list}=${EMPTY} [Documentation] Set the log level for given loggers on node nodes of the cluster - : FOR ${logger} IN @{loggers_list} - \ ClusterManagement.Run_Karaf_Command_On_List_Or_All log:set ${log_level} ${logger} member_index_list=${member_index_list} + FOR ${logger} IN @{loggers_list} + ClusterManagement.Run_Karaf_Command_On_List_Or_All log:set ${log_level} ${logger} member_index_list=${member_index_list} + END Set_Known_Bug_Id [Arguments] ${id} diff --git a/csit/libraries/ShardStability.robot b/csit/libraries/ShardStability.robot index 89d4f0c6a1..db2e437319 100644 --- a/csit/libraries/ShardStability.robot +++ b/csit/libraries/ShardStability.robot @@ -36,13 +36,14 @@ Shards_Stability_Get_Details [Documentation] Return shard details stored in dictionary. ... ${shard_list} should be initialized as @{list} shard_name1:shard_type1 shard_name2:shard.. &{shards_details} BuiltIn.Create_Dictionary - : FOR ${shard_details} IN @{shard_list} - \ ${shard_name} ${shard_type} String.Split_String ${shard_details} separator=: - \ ${leader} ${followers} ClusterManagement.Get_Leader_And_Followers_For_Shard shard_name=${shard_name} shard_type=${shard_type} member_index_list=${member_index_list} - \ ... verify_restconf=${verify_restconf} http_timeout=${http_timeout} - \ Collections.Sort_List ${followers} - \ Collections.Set_To_Dictionary ${shards_details} ${shard_name}_${shard_type}_leader=${leader} - \ Collections.Set_To_Dictionary ${shards_details} ${shard_name}_${shard_type}_followers=${followers} + FOR ${shard_details} IN @{shard_list} + ${shard_name} ${shard_type} String.Split_String ${shard_details} separator=: + ${leader} ${followers} ClusterManagement.Get_Leader_And_Followers_For_Shard shard_name=${shard_name} shard_type=${shard_type} member_index_list=${member_index_list} + ... verify_restconf=${verify_restconf} http_timeout=${http_timeout} + Collections.Sort_List ${followers} + Collections.Set_To_Dictionary ${shards_details} ${shard_name}_${shard_type}_leader=${leader} + Collections.Set_To_Dictionary ${shards_details} ${shard_name}_${shard_type}_followers=${followers} + END BuiltIn.Return_From_Keyword ${shards_details} Shards_Stability_Verify diff --git a/csit/libraries/SubStrings.robot b/csit/libraries/SubStrings.robot index ef291b1afd..9db03bce63 100644 --- a/csit/libraries/SubStrings.robot +++ b/csit/libraries/SubStrings.robot @@ -5,11 +5,13 @@ Documentation Utility keywords for verification of substring occurrence Should Contain All Sub Strings [Arguments] ${attr} @{checked} [Documentation] Passes if ${attr} includes all substrings from @{checked}, fails otherwise - : FOR ${item} IN @{checked} - \ Should Contain ${attr} ${item} + FOR ${item} IN @{checked} + Should Contain ${attr} ${item} + END Should Not Contain Any Sub Strings [Arguments] ${attr} @{checked} [Documentation] Fails if ${attr} includes at least one substring from @{checked}, passes otherwise - : FOR ${item} IN @{checked} - \ Should Not Contain ${attr} ${item} + FOR ${item} IN @{checked} + Should Not Contain ${attr} ${item} + END diff --git a/csit/libraries/SwitchUtils.robot b/csit/libraries/SwitchUtils.robot index 902c07bd53..a8b8c401fb 100644 --- a/csit/libraries/SwitchUtils.robot +++ b/csit/libraries/SwitchUtils.robot @@ -37,10 +37,11 @@ Iterate Switch Commands From List [Arguments] ${switch} ${cmd_list} [Documentation] Each string in the @{cmd_list} argument is executed on the switch.connection_index. Configure Connection Index And Prompt Wrapper ${switch} - : FOR ${cmd} IN @{cmd_list} - \ Log ${cmd} - \ Read Wrapper ${switch} - \ Execute Command Wrapper ${switch} ${cmd} + FOR ${cmd} IN @{cmd_list} + Log ${cmd} + Read Wrapper ${switch} + Execute Command Wrapper ${switch} ${cmd} + END Configure OpenFlow [Arguments] ${switch} @@ -63,9 +64,10 @@ Validate Switch Output Log ${tmp} ${output}= Execute Command Wrapper ${switch} ${cmd} Log ${output} - : FOR ${str} IN @{validations} - \ Run Keyword If "${should_exist}" == "true" Should Match Regexp ${output} ${str} - \ Run Keyword If "${should_exist}" == "false" Should Not Match Regexp ${output} ${str} + FOR ${str} IN @{validations} + Run Keyword If "${should_exist}" == "true" Should Match Regexp ${output} ${str} + Run Keyword If "${should_exist}" == "false" Should Not Match Regexp ${output} ${str} + END Enable OpenFlow [Arguments] ${switch} @@ -140,10 +142,11 @@ Connect To Switch ${connection_index}= Open Connection Wrapper ${switch} Call Method ${switch} set_connection_index ${connection_index} Configure Connection Index And Prompt Wrapper ${switch} - : FOR ${cmd} IN @{switch.connection_configs} - \ Write Bare Wrapper ${switch} ${cmd} - \ Sleep 1 - \ Read Wrapper ${switch} + FOR ${cmd} IN @{switch.connection_configs} + Write Bare Wrapper ${switch} ${cmd} + Sleep 1 + Read Wrapper ${switch} + END Cleanup Switch [Arguments] ${switch} @@ -158,10 +161,11 @@ Initialize Switch ... and a reconnect to the switch is made. Connect To Switch ${switch} Configure Connection Index And Prompt Wrapper ${switch} - : FOR ${cmd} IN @{switch.initialization_cmds} - \ Write Bare Wrapper ${switch} ${cmd} - \ Sleep 1 - \ Run Keyword And Ignore Error Read Wrapper ${switch} + FOR ${cmd} IN @{switch.initialization_cmds} + Write Bare Wrapper ${switch} ${cmd} + Sleep 1 + Run Keyword And Ignore Error Read Wrapper ${switch} + END Run Keyword If "${switch.initialization_type}" == "reboot" Wait For Switch Reboot ${switch} Run Keyword If "${switch.initialization_type}" == "reboot" Connect To Switch ${switch} diff --git a/csit/libraries/SxpBindingOriginsLib.robot b/csit/libraries/SxpBindingOriginsLib.robot index ba299f06fc..8d8d837727 100644 --- a/csit/libraries/SxpBindingOriginsLib.robot +++ b/csit/libraries/SxpBindingOriginsLib.robot @@ -43,17 +43,19 @@ Should Contain Binding Origins [Arguments] @{origins} [Documentation] Test if data contain specified binding origins ${resp} = SxpBindingOriginsLib.Get Binding Origins - : FOR ${origin} IN @{origins} - \ ${out} = Sxp.Find Binding Origin ${resp.json()} ${origin} - \ BuiltIn.Should Be True ${out} Missing origin: ${origin} in ${resp} + FOR ${origin} IN @{origins} + ${out} = Sxp.Find Binding Origin ${resp.json()} ${origin} + BuiltIn.Should Be True ${out} Missing origin: ${origin} in ${resp} + END Should Not Contain Binding Origins [Arguments] @{origins} [Documentation] Test if data DONT contain specified binding origins ${resp} = SxpBindingOriginsLib.Get Binding Origins - : FOR ${origin} IN @{origins} - \ ${out} = Sxp.Find Binding Origin ${resp.json()} ${origin} - \ BuiltIn.Should Be Equal As Strings False ${out} Not expected origin: ${origin} in ${resp} + FOR ${origin} IN @{origins} + ${out} = Sxp.Find Binding Origin ${resp.json()} ${origin} + BuiltIn.Should Be Equal As Strings False ${out} Not expected origin: ${origin} in ${resp} + END Should Contain Binding Origin With Priority [Arguments] ${origin} ${priority} diff --git a/csit/libraries/SxpClusterLib.robot b/csit/libraries/SxpClusterLib.robot index 86ac4e8bb5..10bc9ef6b2 100644 --- a/csit/libraries/SxpClusterLib.robot +++ b/csit/libraries/SxpClusterLib.robot @@ -54,9 +54,10 @@ Setup SXP Cluster [Documentation] Setup and connect SXP cluster topology SxpLib.Add Node ${DEVICE_NODE_ID} session=${DEVICE_SESSION} BuiltIn.Wait Until Keyword Succeeds 240x 1s SxpLib.Check Node Started ${DEVICE_NODE_ID} session=${DEVICE_SESSION} - : FOR ${i} IN RANGE ${NUM_ODL_SYSTEM} - \ SxpLib.Add Connection version4 ${peer_mode} ${ODL_SYSTEM_${i+1}_IP} 64999 node=${DEVICE_NODE_ID} - \ ... session=${DEVICE_SESSION} + FOR ${i} IN RANGE ${NUM_ODL_SYSTEM} + SxpLib.Add Connection version4 ${peer_mode} ${ODL_SYSTEM_${i+1}_IP} 64999 node=${DEVICE_NODE_ID} + ... session=${DEVICE_SESSION} + END ${cluster_mode} = Sxp.Get Opposing Mode ${peer_mode} SxpLib.Add Node ${INADDR_ANY} session=${CONTROLLER_SESSION} BuiltIn.Wait Until Keyword Succeeds 240x 1s Check Cluster Node Started ${INADDR_ANY} ip=${EMPTY} @@ -76,10 +77,11 @@ Check Cluster Node Started ${resp} = RequestsLibrary.Get Request ${CONTROLLER_SESSION} /restconf/operational/network-topology:network-topology/topology/sxp/node/${node}/ BuiltIn.Should Be Equal As Strings ${resp.status_code} 200 ${started} = BuiltIn.Set Variable ${False} - : FOR ${i} IN RANGE ${NUM_ODL_SYSTEM} - \ ${rc} = Utils.Run Command On Remote System ${ODL_SYSTEM_${i+1}_IP} netstat -tln | grep -q ${ip}:${port} && echo 0 || echo 1 ${ODL_SYSTEM_USER} ${ODL_SYSTEM_PASSWORD} - \ ... prompt=${ODL_SYSTEM_PROMPT} - \ ${started} = BuiltIn.Set Variable If '${rc}' == '0' ${True} ${started} + FOR ${i} IN RANGE ${NUM_ODL_SYSTEM} + ${rc} = Utils.Run Command On Remote System ${ODL_SYSTEM_${i+1}_IP} netstat -tln | grep -q ${ip}:${port} && echo 0 || echo 1 ${ODL_SYSTEM_USER} ${ODL_SYSTEM_PASSWORD} + ... prompt=${ODL_SYSTEM_PROMPT} + ${started} = BuiltIn.Set Variable If '${rc}' == '0' ${True} ${started} + END BuiltIn.Should Be True ${started} Check Cluster Node Stopped @@ -88,10 +90,11 @@ Check Cluster Node Stopped ${resp} = RequestsLibrary.Get Request ${CONTROLLER_SESSION} /restconf/operational/network-topology:network-topology/topology/sxp/node/${node}/ BuiltIn.Should Be Equal As Strings ${resp.status_code} 404 ${stopped} = BuiltIn.Set Variable ${False} - : FOR ${i} IN RANGE ${NUM_ODL_SYSTEM} - \ ${rc} = Utils.Run Command On Remote System ${ODL_SYSTEM_${i+1}_IP} netstat -tln | grep -q ${ip}:${port} && echo 0 || echo 1 ${ODL_SYSTEM_USER} ${ODL_SYSTEM_PASSWORD} - \ ... prompt=${ODL_SYSTEM_PROMPT} - \ ${stopped} = BuiltIn.Set Variable If '${rc}' == '1' ${True} ${stopped} + FOR ${i} IN RANGE ${NUM_ODL_SYSTEM} + ${rc} = Utils.Run Command On Remote System ${ODL_SYSTEM_${i+1}_IP} netstat -tln | grep -q ${ip}:${port} && echo 0 || echo 1 ${ODL_SYSTEM_USER} ${ODL_SYSTEM_PASSWORD} + ... prompt=${ODL_SYSTEM_PROMPT} + ${stopped} = BuiltIn.Set Variable If '${rc}' == '1' ${True} ${stopped} + END BuiltIn.Should Be True ${stopped} Check Device is Connected @@ -99,10 +102,11 @@ Check Device is Connected [Documentation] Checks if SXP device is connected to the cluster. It means it has connection in state "on" with one of the cluster members. ${resp} = SxpLib.Get Connections node=${node} session=${session} ${is_connected} = BuiltIn.Set Variable ${False} - : FOR ${i} IN RANGE ${NUM_ODL_SYSTEM} - \ ${is_connected} = Sxp.Find Connection ${resp} ${version} any ${ODL_SYSTEM_${i+1}_IP} - \ ... ${port} on - \ BuiltIn.Exit For Loop If ${is_connected} + FOR ${i} IN RANGE ${NUM_ODL_SYSTEM} + ${is_connected} = Sxp.Find Connection ${resp} ${version} any ${ODL_SYSTEM_${i+1}_IP} + ... ${port} on + BuiltIn.Exit For Loop If ${is_connected} + END BuiltIn.Should Be True ${is_connected} Check Cluster is Connected @@ -132,9 +136,10 @@ Get Any Controller Map Followers To Mac Addresses [Documentation] Creates Map containing ODL_SYSTEM_IP to corresponding MAC-ADDRESS ${mac_addresses} = BuiltIn.Create dictionary - : FOR ${i} IN RANGE ${NUM_ODL_SYSTEM} - \ ${mac_address} Find Mac Address Of Ip Address ${ODL_SYSTEM_${i+1}_IP} - \ Collections.Set To Dictionary ${mac_addresses} ${ODL_SYSTEM_${i+1}_IP} ${mac_address} + FOR ${i} IN RANGE ${NUM_ODL_SYSTEM} + ${mac_address} Find Mac Address Of Ip Address ${ODL_SYSTEM_${i+1}_IP} + Collections.Set To Dictionary ${mac_addresses} ${ODL_SYSTEM_${i+1}_IP} ${mac_address} + END BuiltIn.Log ${mac_addresses} [Return] ${mac_addresses} @@ -169,13 +174,15 @@ Shutdown Tools Node Create Virtual Interface [Documentation] Create virtual interface on all of the cluster nodes - : FOR ${i} IN RANGE ${NUM_ODL_SYSTEM} - \ Utils.Run Command On Remote System ${ODL_SYSTEM_${i+1}_IP} sudo modprobe dummy ${ODL_SYSTEM_USER} ${ODL_SYSTEM_PASSWORD} - \ Utils.Run Command On Remote System And Log ${ODL_SYSTEM_${i+1}_IP} sudo ip link show ${ODL_SYSTEM_USER} ${ODL_SYSTEM_PASSWORD} + FOR ${i} IN RANGE ${NUM_ODL_SYSTEM} + Utils.Run Command On Remote System ${ODL_SYSTEM_${i+1}_IP} sudo modprobe dummy ${ODL_SYSTEM_USER} ${ODL_SYSTEM_PASSWORD} + Utils.Run Command On Remote System And Log ${ODL_SYSTEM_${i+1}_IP} sudo ip link show ${ODL_SYSTEM_USER} ${ODL_SYSTEM_PASSWORD} + END Delete Virtual Interface [Documentation] Create virtual interface on all of the cluster nodes - : FOR ${i} IN RANGE ${NUM_ODL_SYSTEM} - \ Utils.Run Command On Remote System ${ODL_SYSTEM_${i+1}_IP} sudo ip link delete ${VIRTUAL_INTERFACE} type dummy ${ODL_SYSTEM_USER} ${ODL_SYSTEM_PASSWORD} - \ Utils.Run Command On Remote System ${ODL_SYSTEM_${i+1}_IP} sudo rmmod dummy ${ODL_SYSTEM_USER} ${ODL_SYSTEM_PASSWORD} - \ Utils.Run Command On Remote System And Log ${ODL_SYSTEM_${i+1}_IP} sudo ip link show ${ODL_SYSTEM_USER} ${ODL_SYSTEM_PASSWORD} + FOR ${i} IN RANGE ${NUM_ODL_SYSTEM} + Utils.Run Command On Remote System ${ODL_SYSTEM_${i+1}_IP} sudo ip link delete ${VIRTUAL_INTERFACE} type dummy ${ODL_SYSTEM_USER} ${ODL_SYSTEM_PASSWORD} + Utils.Run Command On Remote System ${ODL_SYSTEM_${i+1}_IP} sudo rmmod dummy ${ODL_SYSTEM_USER} ${ODL_SYSTEM_PASSWORD} + Utils.Run Command On Remote System And Log ${ODL_SYSTEM_${i+1}_IP} sudo ip link show ${ODL_SYSTEM_USER} ${ODL_SYSTEM_PASSWORD} + END diff --git a/csit/libraries/SxpLib.robot b/csit/libraries/SxpLib.robot index c75a7820fa..2c5d9436bc 100644 --- a/csit/libraries/SxpLib.robot +++ b/csit/libraries/SxpLib.robot @@ -68,8 +68,9 @@ Clean Connections [Documentation] Delete all connections via RPC from node ${resp} = Get Connections ${node} ${session} ${domain} @{connections} = Sxp.Parse Connections ${resp} - : FOR ${connection} IN @{connections} - \ Delete Connections ${connection['peer-address']} ${connection['tcp-port']} ${node} ${session} ${domain} + FOR ${connection} IN @{connections} + Delete Connections ${connection['peer-address']} ${connection['tcp-port']} ${node} ${session} ${domain} + END Verify Connection [Arguments] ${version} ${mode} ${ip} ${port}=64999 ${node}=127.0.0.1 ${state}=on @@ -109,10 +110,11 @@ Clean Bindings [Documentation] Delete all bindings via RPC from Master DB of node ${resp} = Get Bindings ${node} ${session} ${domain} ${scope} @{bindings} = Sxp.Parse Bindings ${resp} - : FOR ${binding} IN @{bindings} - \ @{prefixes_list} = collections.Get From Dictionary ${binding} ip-prefix - \ ${prefixes} = BuiltIn.Catenate SEPARATOR=, @{prefixes_list} - \ Delete Bindings ${binding['sgt']} ${prefixes} ${node} ${domain} ${session} + FOR ${binding} IN @{bindings} + @{prefixes_list} = collections.Get From Dictionary ${binding} ip-prefix + ${prefixes} = BuiltIn.Catenate SEPARATOR=, @{prefixes_list} + Delete Bindings ${binding['sgt']} ${prefixes} ${node} ${domain} ${session} + END Delete Bindings [Arguments] ${sgt} ${prefixes} ${node}=127.0.0.1 ${domain}=global ${session}=session @@ -145,8 +147,9 @@ Clean Peer Groups [Documentation] Delete all PeerGroups via RPC from node ${resp} = Get Peer Groups ${node} ${session} @{prefixes} = Sxp.Parse Peer Groups ${resp} - : FOR ${group} IN @{prefixes} - \ Delete Peer Group ${group['name']} ${node} ${session} + FOR ${group} IN @{prefixes} + Delete Peer Group ${group['name']} ${node} ${session} + END Add Filter [Arguments] ${name} ${type} ${entries} ${node}=127.0.0.1 ${session}=session ${policy}=auto-update @@ -238,17 +241,18 @@ Connections Should Not Contain Setup Topology Complex [Arguments] ${version}=version4 ${password}=none - : FOR ${node} IN RANGE 2 6 - \ Add Connection ${version} both 127.0.0.1 64999 127.0.0.${node} - \ ... ${password} - \ Add Connection ${version} both 127.0.0.${node} 64999 127.0.0.1 - \ ... ${password} - \ BuiltIn.Wait Until Keyword Succeeds 15 1 Verify Connection ${version} both - \ ... 127.0.0.${node} - \ Add Bindings ${node}0 10.10.10.${node}0/32 127.0.0.${node} - \ Add Bindings ${node}0 10.10.${node}0.0/24 127.0.0.${node} - \ Add Bindings ${node}0 10.${node}0.0.0/16 127.0.0.${node} - \ Add Bindings ${node}0 ${node}0.0.0.0/8 127.0.0.${node} + FOR ${node} IN RANGE 2 6 + Add Connection ${version} both 127.0.0.1 64999 127.0.0.${node} + ... ${password} + Add Connection ${version} both 127.0.0.${node} 64999 127.0.0.1 + ... ${password} + BuiltIn.Wait Until Keyword Succeeds 15 1 Verify Connection ${version} both + ... 127.0.0.${node} + Add Bindings ${node}0 10.10.10.${node}0/32 127.0.0.${node} + Add Bindings ${node}0 10.10.${node}0.0/24 127.0.0.${node} + Add Bindings ${node}0 10.${node}0.0.0/16 127.0.0.${node} + Add Bindings ${node}0 ${node}0.0.0.0/8 127.0.0.${node} + END Add Bindings 10 10.10.10.10/32 127.0.0.1 Add Bindings 10 10.10.10.0/24 127.0.0.1 Add Bindings 10 10.10.0.0/16 127.0.0.1 @@ -301,26 +305,29 @@ Check Binding Range [Arguments] ${sgt} ${start} ${end} ${node}=127.0.0.1 [Documentation] Check if Node contains Bindings specified by range ${resp} = Get Bindings ${node} - : FOR ${num} IN RANGE ${start} ${end} - \ ${ip} = Sxp.Get Ip From Number ${num} - \ Should Contain Binding ${resp} ${sgt} ${ip}/32 + FOR ${num} IN RANGE ${start} ${end} + ${ip} = Sxp.Get Ip From Number ${num} + Should Contain Binding ${resp} ${sgt} ${ip}/32 + END Check Binding Range Negative [Arguments] ${sgt} ${start} ${end} ${node}=127.0.0.1 [Documentation] Check if Node does not contains Bindings specified by range ${resp} = Get Bindings ${node} - : FOR ${num} IN RANGE ${start} ${end} - \ ${ip} = Sxp.Get Ip From Number ${num} - \ Should Not Contain Binding ${resp} ${sgt} ${ip}/32 + FOR ${num} IN RANGE ${start} ${end} + ${ip} = Sxp.Get Ip From Number ${num} + Should Not Contain Binding ${resp} ${sgt} ${ip}/32 + END Setup SXP Environment [Arguments] ${node_range}=1 [Documentation] Create session to Controller, ${node_range} parameter specifies number of localhost nodes to be created on ${ODL_SYSTEM_IP}. RequestsLibrary.Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} timeout=${DEFAULT_TIMEOUT_HTTP} max_retries=0 - : FOR ${num} IN RANGE 1 ${node_range}+1 - \ ${node} = Sxp.Get Ip From Number ${num} - \ Add Node ${node} retry_open_timer=${num} - \ BuiltIn.Wait Until Keyword Succeeds 20 1 Check Node Started ${node} system=${ODL_SYSTEM_IP} + FOR ${num} IN RANGE 1 ${node_range}+1 + ${node} = Sxp.Get Ip From Number ${num} + Add Node ${node} retry_open_timer=${num} + BuiltIn.Wait Until Keyword Succeeds 20 1 Check Node Started ${node} system=${ODL_SYSTEM_IP} + END Check Node Started [Arguments] ${node} ${port}=64999 ${system}=${node} ${session}=session ${ip}=${node} @@ -347,10 +354,11 @@ Get Node Running Status Clean SXP Environment [Arguments] ${node_range}=1 [Documentation] Destroy created sessions - : FOR ${num} IN RANGE 1 ${node_range}+1 - \ ${ip} = Sxp.Get Ip From Number ${num} - \ Delete Node ${ip} - \ BuiltIn.Wait Until Keyword Succeeds 12x 10s Check Node Stopped ${ip} system=${ODL_SYSTEM_IP} + FOR ${num} IN RANGE 1 ${node_range}+1 + ${ip} = Sxp.Get Ip From Number ${num} + Delete Node ${ip} + BuiltIn.Wait Until Keyword Succeeds 12x 10s Check Node Stopped ${ip} system=${ODL_SYSTEM_IP} + END RequestsLibrary.Delete All Sessions Get Routing Configuration From Controller diff --git a/csit/libraries/Tcpdump.robot b/csit/libraries/Tcpdump.robot index 1f8ddc4d7a..b9d8a48d6c 100644 --- a/csit/libraries/Tcpdump.robot +++ b/csit/libraries/Tcpdump.robot @@ -73,14 +73,16 @@ Start Packet Capture on Nodes [Documentation] Start packet captures on the given list of node ips. ... The captures will be named with the tag and ip. @{conn_ids} = BuiltIn.Create List @{EMPTY} - : FOR ${ip} IN @{ips} - \ ${fname} = BuiltIn.Catenate SEPARATOR=__ ${tag} ${ip} - \ ${conn_id} = Tcpdump.Start Packet Capture on Node ${ip} file_Name=${fname} filter=${filter} - \ Collections.Append To List ${conn_ids} ${conn_id} + FOR ${ip} IN @{ips} + ${fname} = BuiltIn.Catenate SEPARATOR=__ ${tag} ${ip} + ${conn_id} = Tcpdump.Start Packet Capture on Node ${ip} file_Name=${fname} filter=${filter} + Collections.Append To List ${conn_ids} ${conn_id} + END [Return] @{conn_ids} Stop Packet Capture on Nodes [Arguments] ${conn_ids}=@{EMPTY} [Documentation] Stop the packet captures on the given list of node connection ids - : FOR ${conn_id} IN @{conn_ids} - \ Stop Packet Capture on Node ${conn_id} + FOR ${conn_id} IN @{conn_ids} + Stop Packet Capture on Node ${conn_id} + END diff --git a/csit/libraries/Tempest.robot b/csit/libraries/Tempest.robot index fb98481ee1..668e8fb89e 100644 --- a/csit/libraries/Tempest.robot +++ b/csit/libraries/Tempest.robot @@ -130,7 +130,8 @@ Create Blacklist File ... line will be created in the required ${BLACKLIST_FILE} location. This file is pushed to the OS_CONTROL_NODE ... which is assumed to be the tempest executor. OperatingSystem.Create File ${BLACKLIST_FILE} - : FOR ${exclusion} IN @{${OPENSTACK_BRANCH}_EXCLUSION_REGEXES} - \ OperatingSystem.Append To File ${BLACKLIST_FILE} ${exclusion}\n + FOR ${exclusion} IN @{${OPENSTACK_BRANCH}_EXCLUSION_REGEXES} + OperatingSystem.Append To File ${BLACKLIST_FILE} ${exclusion}\n + END OperatingSystem.Log File ${BLACKLIST_FILE} SSHKeywords.Copy File To Remote System ${OS_CNTL_IP} ${BLACKLIST_FILE} ${BLACKLIST_FILE} diff --git a/csit/libraries/TemplatedRequests.robot b/csit/libraries/TemplatedRequests.robot index e514d1f10b..a484e26ae7 100644 --- a/csit/libraries/TemplatedRequests.robot +++ b/csit/libraries/TemplatedRequests.robot @@ -464,11 +464,12 @@ Resolve_Text_From_Template_Folder ${item_template} = Resolve_Text_From_Template_File folder=${folder} file_name=${base_name}.item.${extension} mapping=${mapping} ${items} = BuiltIn.Create_List ${separator} = BuiltIn.Set_Variable_If '${extension}' != 'json' ${endline} ,${endline} - : FOR ${iteration} IN RANGE ${iter_start} ${iterations}+${iter_start} - \ BuiltIn.Run_Keyword_If ${iteration} > ${iter_start} Collections.Append_To_List ${items} ${separator} - \ ${item} = BuiltIn.Evaluate string.Template('''${item_template}''').substitute({"i":"${iteration}"}) modules=string - \ Collections.Append_To_List ${items} ${item} - # TODO: The following makes ugly result for iterations=0. Should we fix that? + FOR ${iteration} IN RANGE ${iter_start} ${iterations}+${iter_start} + BuiltIn.Run_Keyword_If ${iteration} > ${iter_start} Collections.Append_To_List ${items} ${separator} + ${item} = BuiltIn.Evaluate string.Template('''${item_template}''').substitute({"i":"${iteration}"}) modules=string + Collections.Append_To_List ${items} ${item} + # TODO: The following makes ugly result for iterations=0. Should we fix that? + END ${final_text} = BuiltIn.Catenate SEPARATOR= ${prolog} ${endline} @{items} ${endline} ... ${epilog} [Return] ${final_text} diff --git a/csit/libraries/ToolsSystem.robot b/csit/libraries/ToolsSystem.robot index 3842fb9a78..f7c5f0fa7f 100644 --- a/csit/libraries/ToolsSystem.robot +++ b/csit/libraries/ToolsSystem.robot @@ -11,14 +11,16 @@ Resource ../variables/Variables.robot *** Keywords *** Get Tools System Nodes Data - : FOR ${i} IN RANGE 1 ${NUM_TOOLS_SYSTEM} + 1 - \ ${ip} = BuiltIn.Set Variable ${TOOLS_SYSTEM_${i}_IP} - \ Collections.Append To List ${TOOLS_SYSTEM_ALL_IPS} ${ip} - \ ${conn_id} = SSHLibrary.Open Connection ${ip} prompt=${DEFAULT_LINUX_PROMPT} timeout=30s - \ Collections.Append To List ${TOOLS_SYSTEM_ALL_CONN_IDS} ${conn_id} + FOR ${i} IN RANGE 1 ${NUM_TOOLS_SYSTEM} + 1 + ${ip} = BuiltIn.Set Variable ${TOOLS_SYSTEM_${i}_IP} + Collections.Append To List ${TOOLS_SYSTEM_ALL_IPS} ${ip} + ${conn_id} = SSHLibrary.Open Connection ${ip} prompt=${DEFAULT_LINUX_PROMPT} timeout=30s + Collections.Append To List ${TOOLS_SYSTEM_ALL_CONN_IDS} ${conn_id} + END Run Command On All Tools Systems [Arguments] ${cmd} [Documentation] Run command on all tools systems - : FOR ${ip} IN @{TOOLS_SYSTEM_ALL_IPS} - \ Utils.Run Command On Remote System ${ip} ${cmd} + FOR ${ip} IN @{TOOLS_SYSTEM_ALL_IPS} + Utils.Run Command On Remote System ${ip} ${cmd} + END diff --git a/csit/libraries/TopoprocessingKeywords.robot b/csit/libraries/TopoprocessingKeywords.robot index ede3e594e1..7f3e903efc 100644 --- a/csit/libraries/TopoprocessingKeywords.robot +++ b/csit/libraries/TopoprocessingKeywords.robot @@ -136,19 +136,21 @@ Insert Underlay Topologies [Documentation] Insert underlay topologies used by following tests Log Inserting underlay topologies # Network underlay topologies - : FOR ${index} IN RANGE 1 7 - \ ${resp} Put Request session ${CONFIG_API}/${TOPOLOGY_URL}/network-topo:${index} data=${NETWORK_UNDERLAY_TOPOLOGY_${index}} - \ Log ${resp.content} - \ Should Match "${resp.status_code}" "20?" - # Openflow underlay nodes + FOR ${index} IN RANGE 1 7 + ${resp} Put Request session ${CONFIG_API}/${TOPOLOGY_URL}/network-topo:${index} data=${NETWORK_UNDERLAY_TOPOLOGY_${index}} + Log ${resp.content} + Should Match "${resp.status_code}" "20?" + # Openflow underlay nodes + END ${resp} Put Request session ${CONFIG_API}/opendaylight-inventory:nodes data=${OPENFLOW_UNDERLAY_NODES} Log ${resp.content} Should Match "${resp.status_code}" "20?" # Openflow underlay topologies - : FOR ${index} IN RANGE 1 7 - \ ${resp} Put Request session ${CONFIG_API}/${TOPOLOGY_URL}/openflow-topo:${index} data=${OPENFLOW_UNDERLAY_TOPOLOGY_${index}} - \ Log ${resp.content} - \ Should Match "${resp.status_code}" "20?" + FOR ${index} IN RANGE 1 7 + ${resp} Put Request session ${CONFIG_API}/${TOPOLOGY_URL}/openflow-topo:${index} data=${OPENFLOW_UNDERLAY_TOPOLOGY_${index}} + Log ${resp.content} + Should Match "${resp.status_code}" "20?" + END Issue Command On Karaf Console log:clear Log ${resp.content} @@ -409,8 +411,9 @@ Check Aggregated Node in Topology Should Contain X Times ${aggregated_node} ${supp_node_count} Should Contain X Times ${aggregated_node} ${tp_count} Should Contain X Times ${aggregated_node} ${tp_count} - : FOR ${supp_node_id} IN @{supp_node_ids} - \ Element Text Should Be ${aggregated_node} ${supp_node_id} xpath=.//supporting-node[node-ref='${supp_node_id}']/node-ref + FOR ${supp_node_id} IN @{supp_node_ids} + Element Text Should Be ${aggregated_node} ${supp_node_id} xpath=.//supporting-node[node-ref='${supp_node_id}']/node-ref + END ${overlay_node_id} Get Element Text ${aggregated_node} xpath=./node-id [Return] ${overlay_node_id} @@ -421,14 +424,16 @@ Check Aggregated Termination Point in Node ${tp} Extract Termination Point from Topology ${model} ${topology} ${topology_id} ${node_id} ${tp_id} ${supp_tp_count} Get Length ${supp_tp_ids} Should Contain X Times ${tp} ${supp_tp_count} - : FOR ${supp_tp_id} IN @{supp_tp_ids} - \ Should Contain X Times ${tp} ${supp_tp_id} 1 + FOR ${supp_tp_id} IN @{supp_tp_ids} + Should Contain X Times ${tp} ${supp_tp_id} 1 + END Check Filtered Nodes in Topology [Arguments] ${topology} ${tp_count} @{node_ids} [Documentation] Checks nodes in filtered topology - : FOR ${node_id} IN @{node_ids} - \ Element Text Should Be ${topology} ${node_id} xpath=.//node/supporting-node[node-ref='${node_id}']/node-ref + FOR ${node_id} IN @{node_ids} + Element Text Should Be ${topology} ${node_id} xpath=.//node/supporting-node[node-ref='${node_id}']/node-ref + END Check Filtered Termination Points in Node [Arguments] ${topology} ${supp_node_id} @{supp_tp_ids} @@ -438,14 +443,16 @@ Check Filtered Termination Points in Node Should Contain X Times ${node} 1 Should Contain X Times ${node} ${supp_tp_count} Should Contain X Times ${node} ${supp_tp_count} - : FOR ${supp_tp_id} IN @{supp_tp_ids} - \ Should Contain X Times ${node} ${supp_tp_id} 1 + FOR ${supp_tp_id} IN @{supp_tp_ids} + Should Contain X Times ${node} ${supp_tp_id} 1 + END Check Filtered Links In Topology [Arguments] ${topology} @{supp_link_ids} [Documentation] Checks links in filtered topology - : FOR ${supp_link_id} IN @{supp_link_ids} - \ Should Contain X Times ${topology} ${supp_link_id} 1 + FOR ${supp_link_id} IN @{supp_link_ids} + Should Contain X Times ${topology} ${supp_link_id} 1 + END Check Overlay Link Source And Destination [Arguments] ${model} ${topology} ${topo_id} ${link_id} ${expected_source} ${expected_destination} diff --git a/csit/libraries/TsdrUtils.robot b/csit/libraries/TsdrUtils.robot index 398e767d86..19ad16a76e 100644 --- a/csit/libraries/TsdrUtils.robot +++ b/csit/libraries/TsdrUtils.robot @@ -171,11 +171,12 @@ Create the Hbase table row [Arguments] ${tsdr_line} ${metrics} [Documentation] Create the Hbase table row from tsdr:list @{words}= Split String ${tsdr_line} | - : FOR ${li} IN @{words} - \ ${key}= Fetch From Left ${li} = - \ ${value}= Fetch From Right ${li} = - \ ${each_value}= Prepare HBase Filter ${key} ${value} _ - \ ${final}= Concatenate the String ${final} ${each_value} + FOR ${li} IN @{words} + ${key}= Fetch From Left ${li} = + ${value}= Fetch From Right ${li} = + ${each_value}= Prepare HBase Filter ${key} ${value} _ + ${final}= Concatenate the String ${final} ${each_value} + END ${query}= Concatenate the String ${metrics} ${final} ${query}= Remove Space on String ${query} [Return] ${query} @@ -424,11 +425,12 @@ Verify the Metrics Syslog on Cassandra Client Iterating over metricpath [Documentation] Used to traverse over metricpath file and traverse over metricpath file and get the keys @{mp_lines}= Read File and Return Split Lines ${CASSANDRA_DB_PATH}${metric_path} - : FOR ${line} IN @{mp_lines} - \ @{split_line}= Split String ${line} ${SPACE} - \ ${keya}= Get From List ${split_line} 1 - \ ${keyb}= Get From List ${split_line} 2 - \ Iterating over metricval ${keya} ${keyb} + FOR ${line} IN @{mp_lines} + @{split_line}= Split String ${line} ${SPACE} + ${keya}= Get From List ${split_line} 1 + ${keyb}= Get From List ${split_line} 2 + Iterating over metricval ${keya} ${keyb} + END Iterating over metricval [Arguments] ${keya} ${keyb} @@ -564,14 +566,16 @@ Evaluate Datasets Length Evaluate Datasets Value [Arguments] ${tsdr_lines} ${query_output} ${nbi_output} ${TYPE} [Documentation] Compare the outputs returned from all Data Stores - : FOR ${q_item} ${t_item} ${n_item} IN ZIP ${query_output} ${tsdr_lines} + FOR ${q_item} ${t_item} ${n_item} IN ZIP ${query_output} ${tsdr_lines} ... ${nbi_output} - \ ${query_row}= Extract Row Values from TSDR Query ${q_item} ${t_item} ${n_item} ${TYPE} - : FOR ${found_line} IN @{matching_list} - \ @{split_line}= Split String ${found_line} | - \ ${hex_name}= Get From List ${split_line} 2 - \ ${if_desc}= Decode Bytes To String ${hex_name} HEX - \ Append To List ${ifdesc_list} ${if_desc} + ${query_row}= Extract Row Values from TSDR Query ${q_item} ${t_item} ${n_item} ${TYPE} + END + FOR ${found_line} IN @{matching_list} + @{split_line}= Split String ${found_line} | + ${hex_name}= Get From List ${split_line} 2 + ${if_desc}= Decode Bytes To String ${hex_name} HEX + Append To List ${ifdesc_list} ${if_desc} + END [Return] @{ifdesc_list} Write SNMP config @@ -604,56 +608,57 @@ Collect Data from SNMP Agent @{ifEntry}= Get From Dictionary ${dict1_val} ifEntry @{SNMP_ENTRY}= Create List @{SNMP_VALUES}= Create List - : FOR ${int} IN @{ifEntry} - \ ${ifindex}= Get From Dictionary ${int} ifIndex - \ ${ifOutDiscards}= Get From Dictionary ${int} ifOutDiscards - \ ${ifInDiscards}= Get From Dictionary ${int} ifInDiscards - \ ${ifType}= Get From Dictionary ${int} ifType - \ ${ifInOctets}= Get From Dictionary ${int} ifInOctets - \ ${ifSpeed}= Get From Dictionary ${int} ifSpeed - \ ${ifOutQLen}= Get From Dictionary ${int} ifOutQLen - \ ${ifOutErrors}= Get From Dictionary ${int} ifOutErrors - \ ${ifPhysAddress}= Get From Dictionary ${int} ifPhysAddress - \ ${ifInUcastPkts}= Get From Dictionary ${int} ifInUcastPkts - \ ${ifOutNUcastPkts}= Get From Dictionary ${int} ifOutNUcastPkts - \ ${ifInErrors}= Get From Dictionary ${int} ifInErrors - \ ${ifOutOctets}= Get From Dictionary ${int} ifOutOctets - \ ${ifAdminStatus1}= Get From Dictionary ${int} ifAdminStatus - \ ${ifAdminStatus}= Get From Dictionary ${OPER_STATUS} ${ifAdminStatus1} - \ ${ifInUnknownProtos}= Get From Dictionary ${int} ifInUnknownProtos - \ ${ifOutUcastPkts}= Get From Dictionary ${int} ifOutUcastPkts - \ ${ifInNUcastPkts}= Get From Dictionary ${int} ifInNUcastPkts - \ ${ifMtu}= Get From Dictionary ${int} ifMtu - \ ${ifOperStatus1}= Get From Dictionary ${int} ifOperStatus - \ ${ifOperStatus}= Get From Dictionary ${OPER_STATUS} ${ifOperStatus1} - \ Append To List ${SNMP_ENTRY} grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfOutDiscards | grep RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfOutDiscards - \ Append To List ${SNMP_VALUES} ${ifOutDiscards} - \ Append To List ${SNMP_ENTRY} grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfInDiscards | grep RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfInDiscards - \ Append To List ${SNMP_VALUES} ${ifInDiscards} - \ Append To List ${SNMP_ENTRY} grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfInOctets | grep RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfInOctets - \ Append To List ${SNMP_VALUES} ${ifInOctets} - \ Append To List ${SNMP_ENTRY} grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfOutQLen | grep RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfOutQLen - \ Append To List ${SNMP_VALUES} ${ifOutQLen} - \ Append To List ${SNMP_ENTRY} grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfOutErrors | grep RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfOutErrors - \ Append To List ${SNMP_VALUES} ${ifOutErrors} - \ Append To List ${SNMP_ENTRY} grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfInUcastPkts | grep RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfInUcastPkts - \ Append To List ${SNMP_VALUES} ${ifInUcastPkts} - \ Append To List ${SNMP_ENTRY} grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfOutNUcastPkts | grep RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfOutNUcastPkts - \ Append To List ${SNMP_VALUES} ${ifOutNUcastPkts} - \ Append To List ${SNMP_ENTRY} grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfInErrors | grep RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfInErrors - \ Append To List ${SNMP_VALUES} ${ifInErrors} - \ Append To List ${SNMP_ENTRY} grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfOutOctets | grep RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfOutOctets - \ Append To List ${SNMP_VALUES} ${ifOutOctets} - \ Append To List ${SNMP_ENTRY} grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfAdminStatus | grep RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfAdminStatus - \ Append To List ${SNMP_VALUES} ${ifAdminStatus} - \ Append To List ${SNMP_ENTRY} grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfInUnknownProtos | grep RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfInUnknownProtos - \ Append To List ${SNMP_VALUES} ${ifInUnknownProtos} - \ Append To List ${SNMP_ENTRY} grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfOutUcastPkts | grep RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfOutUcastPkts - \ Append To List ${SNMP_VALUES} ${ifOutUcastPkts} - \ Append To List ${SNMP_ENTRY} grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfInNUcastPkts | grep RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfInNUcastPkts - \ Append To List ${SNMP_VALUES} ${ifInNUcastPkts} - \ Append To List ${SNMP_ENTRY} grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfOperStatus | grep RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfOperStatus - \ Append To List ${SNMP_VALUES} ${ifOperStatus} + FOR ${int} IN @{ifEntry} + ${ifindex}= Get From Dictionary ${int} ifIndex + ${ifOutDiscards}= Get From Dictionary ${int} ifOutDiscards + ${ifInDiscards}= Get From Dictionary ${int} ifInDiscards + ${ifType}= Get From Dictionary ${int} ifType + ${ifInOctets}= Get From Dictionary ${int} ifInOctets + ${ifSpeed}= Get From Dictionary ${int} ifSpeed + ${ifOutQLen}= Get From Dictionary ${int} ifOutQLen + ${ifOutErrors}= Get From Dictionary ${int} ifOutErrors + ${ifPhysAddress}= Get From Dictionary ${int} ifPhysAddress + ${ifInUcastPkts}= Get From Dictionary ${int} ifInUcastPkts + ${ifOutNUcastPkts}= Get From Dictionary ${int} ifOutNUcastPkts + ${ifInErrors}= Get From Dictionary ${int} ifInErrors + ${ifOutOctets}= Get From Dictionary ${int} ifOutOctets + ${ifAdminStatus1}= Get From Dictionary ${int} ifAdminStatus + ${ifAdminStatus}= Get From Dictionary ${OPER_STATUS} ${ifAdminStatus1} + ${ifInUnknownProtos}= Get From Dictionary ${int} ifInUnknownProtos + ${ifOutUcastPkts}= Get From Dictionary ${int} ifOutUcastPkts + ${ifInNUcastPkts}= Get From Dictionary ${int} ifInNUcastPkts + ${ifMtu}= Get From Dictionary ${int} ifMtu + ${ifOperStatus1}= Get From Dictionary ${int} ifOperStatus + ${ifOperStatus}= Get From Dictionary ${OPER_STATUS} ${ifOperStatus1} + Append To List ${SNMP_ENTRY} grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfOutDiscards | grep RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfOutDiscards + Append To List ${SNMP_VALUES} ${ifOutDiscards} + Append To List ${SNMP_ENTRY} grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfInDiscards | grep RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfInDiscards + Append To List ${SNMP_VALUES} ${ifInDiscards} + Append To List ${SNMP_ENTRY} grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfInOctets | grep RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfInOctets + Append To List ${SNMP_VALUES} ${ifInOctets} + Append To List ${SNMP_ENTRY} grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfOutQLen | grep RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfOutQLen + Append To List ${SNMP_VALUES} ${ifOutQLen} + Append To List ${SNMP_ENTRY} grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfOutErrors | grep RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfOutErrors + Append To List ${SNMP_VALUES} ${ifOutErrors} + Append To List ${SNMP_ENTRY} grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfInUcastPkts | grep RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfInUcastPkts + Append To List ${SNMP_VALUES} ${ifInUcastPkts} + Append To List ${SNMP_ENTRY} grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfOutNUcastPkts | grep RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfOutNUcastPkts + Append To List ${SNMP_VALUES} ${ifOutNUcastPkts} + Append To List ${SNMP_ENTRY} grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfInErrors | grep RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfInErrors + Append To List ${SNMP_VALUES} ${ifInErrors} + Append To List ${SNMP_ENTRY} grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfOutOctets | grep RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfOutOctets + Append To List ${SNMP_VALUES} ${ifOutOctets} + Append To List ${SNMP_ENTRY} grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfAdminStatus | grep RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfAdminStatus + Append To List ${SNMP_VALUES} ${ifAdminStatus} + Append To List ${SNMP_ENTRY} grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfInUnknownProtos | grep RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfInUnknownProtos + Append To List ${SNMP_VALUES} ${ifInUnknownProtos} + Append To List ${SNMP_ENTRY} grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfOutUcastPkts | grep RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfOutUcastPkts + Append To List ${SNMP_VALUES} ${ifOutUcastPkts} + Append To List ${SNMP_ENTRY} grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfInNUcastPkts | grep RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfInNUcastPkts + Append To List ${SNMP_VALUES} ${ifInNUcastPkts} + Append To List ${SNMP_ENTRY} grep NID=${SNMP_IP} | grep DC=SNMPINTERFACES | grep MN=IfOperStatus | grep RK=ifIndex:${ifindex},ifName:Iso88023Csmacd,SnmpMetric:IfOperStatus + Append To List ${SNMP_VALUES} ${ifOperStatus} + END [Return] ${SNMP_ENTRY} ${SNMP_VALUES} Retrieve Value From Elasticsearch diff --git a/csit/libraries/UscUtils.robot b/csit/libraries/UscUtils.robot index b96500a248..05161a5f5c 100644 --- a/csit/libraries/UscUtils.robot +++ b/csit/libraries/UscUtils.robot @@ -135,14 +135,15 @@ Start Multiple_Sessions_TCP Write ${AgentTcp} Read ${L1} Create List - : FOR ${port_index} IN @{LIST_ECHO_SERVER_PORT} - \ Log ${port_index} - \ ${echo_conn_id}= Open Connection ${TOOLS_SYSTEM_IP} timeout=30s - \ Append To List ${L1} ${echo_conn_id} - \ Flexible Mininet Login - \ Write ${NAV_USC_TOOLS} - \ Write java -jar EchoServer.jar -t true -p ${port_index} - \ Read Until initialized + FOR ${port_index} IN @{LIST_ECHO_SERVER_PORT} + Log ${port_index} + ${echo_conn_id}= Open Connection ${TOOLS_SYSTEM_IP} timeout=30s + Append To List ${L1} ${echo_conn_id} + Flexible Mininet Login + Write ${NAV_USC_TOOLS} + Write java -jar EchoServer.jar -t true -p ${port_index} + Read Until initialized + END Set Suite Variable ${L1} Start Multiple_Sessions_UDP @@ -156,14 +157,15 @@ Start Multiple_Sessions_UDP Write ${AgentUdp} Read ${L1} Create List - : FOR ${port_index} IN @{LIST_ECHO_SERVER_PORT} - \ Log ${port_index} - \ ${echo_conn_id}= Open Connection ${TOOLS_SYSTEM_IP} timeout=30s - \ Append To List ${L1} ${echo_conn_id} - \ Flexible Mininet Login - \ Write ${NAV_USC_TOOLS} - \ Write java -jar EchoServer.jar -t false -p ${port_index} - \ Read Until initialized + FOR ${port_index} IN @{LIST_ECHO_SERVER_PORT} + Log ${port_index} + ${echo_conn_id}= Open Connection ${TOOLS_SYSTEM_IP} timeout=30s + Append To List ${L1} ${echo_conn_id} + Flexible Mininet Login + Write ${NAV_USC_TOOLS} + Write java -jar EchoServer.jar -t false -p ${port_index} + Read Until initialized + END Set Suite Variable ${L1} Stop Agent_Echo @@ -200,9 +202,10 @@ Stop One_Agent_Multiple_Echo Write_Bare_Ctrl_C Write exit Close Connection - : FOR ${echo_conn_id} IN @{L1} - \ Switch Connection ${echo_conn_id} - \ Read - \ Write_Bare_Ctrl_C - \ Write exit - \ Close Connection + FOR ${echo_conn_id} IN @{L1} + Switch Connection ${echo_conn_id} + Read + Write_Bare_Ctrl_C + Write exit + Close Connection + END diff --git a/csit/libraries/Utils.robot b/csit/libraries/Utils.robot index 1289924eb6..7517168480 100644 --- a/csit/libraries/Utils.robot +++ b/csit/libraries/Utils.robot @@ -115,8 +115,9 @@ Check For Elements At URI BuiltIn.Run Keyword If "${pretty_print_json}" == "True" Log Content ${resp.content} ... ELSE BuiltIn.Log ${resp.content} Should Be Equal As Strings ${resp.status_code} 200 - : FOR ${i} IN @{elements} - \ Should Contain ${resp.content} ${i} + FOR ${i} IN @{elements} + Should Contain ${resp.content} ${i} + END Check For Elements Not At URI [Arguments] ${uri} ${elements} ${session}=session ${pretty_print_json}=False ${check_for_null}=False @@ -129,8 +130,9 @@ Check For Elements Not At URI ... ELSE BuiltIn.Log ${resp.content} BuiltIn.Run Keyword If "${check_for_null}" == "True" Builtin.Return From Keyword If ${resp.status_code} == 404 Should Be Equal As Strings ${resp.status_code} 200 - : FOR ${i} IN @{elements} - \ Should Not Contain ${resp.content} ${i} + FOR ${i} IN @{elements} + Should Not Contain ${resp.content} ${i} + END Clean Mininet System [Arguments] ${system}=${TOOLS_SYSTEM_IP} @@ -142,8 +144,9 @@ Clean Up Ovs [Documentation] Cleans up the OVS instance and remove any existing common known bridges. ${output}= Run Command On Mininet ${system} sudo ovs-vsctl list-br Log ${output} - : FOR ${i} IN ${output} - \ Run Command On Mininet ${system} sudo ovs-vsctl --if-exists del-br ${i} + FOR ${i} IN ${output} + Run Command On Mininet ${system} sudo ovs-vsctl --if-exists del-br ${i} + END Run Command On Mininet ${system} sudo ovs-vsctl del-manager Extract Value From Content @@ -411,16 +414,18 @@ Get Index From List Of Dictionaries [Documentation] Extract index for the dictionary in a list that contains a key-value pair. Returns -1 if key-value is not found. ${length}= Get Length ${dictionary_list} ${index}= Set Variable -1 - : FOR ${i} IN RANGE ${length} - \ ${dictionary}= Get From List ${dictionary_list} ${i} - \ Run Keyword If """&{dictionary}[${key}]""" == """${value}""" Set Test Variable ${index} ${i} + FOR ${i} IN RANGE ${length} + ${dictionary}= Get From List ${dictionary_list} ${i} + Run Keyword If """&{dictionary}[${key}]""" == """${value}""" Set Test Variable ${index} ${i} + END [Return] ${index} Check Item Occurrence [Arguments] ${string} ${dictionary_item_occurrence} [Documentation] Check string for occurrences of items expressed in a list of dictionaries {item=occurrences}. 0 occurences means item is not present. - : FOR ${item} IN @{dictionary_item_occurrence} - \ Should Contain X Times ${string} ${item} &{dictionary_item_occurrence}[${item}] + FOR ${item} IN @{dictionary_item_occurrence} + Should Contain X Times ${string} ${item} &{dictionary_item_occurrence}[${item}] + END Post Log Check [Arguments] ${uri} ${body} ${session}=session ${status_codes}=200 diff --git a/csit/libraries/VpnOperations.robot b/csit/libraries/VpnOperations.robot index 9376bd6f81..f4477ebbd3 100644 --- a/csit/libraries/VpnOperations.robot +++ b/csit/libraries/VpnOperations.robot @@ -31,8 +31,9 @@ Basic Suite Setup Basic Vpnservice Suite Cleanup [Arguments] ${vpn_instance_ids}=@{EMPTY} ${vms}=@{EMPTY} ${networks}=@{EMPTY} ${subnets}=@{EMPTY} ${ports}=@{EMPTY} ${sgs}=@{EMPTY} - : FOR ${vpn_instance_id} IN @{vpn_instance_ids} - \ BuiltIn.Run Keyword And Ignore Error VPN Delete L3VPN vpnid=${vpn_instance_id} + FOR ${vpn_instance_id} IN @{vpn_instance_ids} + BuiltIn.Run Keyword And Ignore Error VPN Delete L3VPN vpnid=${vpn_instance_id} + END OpenStackOperations.Neutron Cleanup ${vms} ${networks} ${subnets} ${ports} ${sgs} VPN Create L3VPN @@ -64,9 +65,10 @@ VPN Get L3VPN ID Verify L3VPN On ODL [Arguments] @{vpns} [Documentation] To verify L3VPN on ODL for given vpn ids - : FOR ${vpn} IN @{vpns} - \ ${resp} = VpnOperations.VPN Get L3VPN vpnid=${vpn} - \ BuiltIn.Should Contain ${resp} ${vpn} + FOR ${vpn} IN @{vpns} + ${resp} = VpnOperations.VPN Get L3VPN vpnid=${vpn} + BuiltIn.Should Contain ${resp} ${vpn} + END Associate L3VPN To Network [Arguments] &{Kwargs} @@ -76,11 +78,12 @@ Associate L3VPN To Network Associate L3VPNs To Networks [Arguments] ${vpnid_list} ${network_list} [Documentation] Associates multiple networks to L3VPN and verify the same - : FOR ${network} ${vpnid} IN ZIP ${network_list} ${vpnid_list} - \ ${network_id} = OpenStackOperations.Get Net Id ${network} - \ VpnOperations.Associate L3VPN To Network networkid=${network_id} vpnid=${vpnid} - \ ${resp} = VpnOperations.VPN Get L3VPN vpnid=${vpnid} - \ BuiltIn.Should Contain ${resp} ${network_id} + FOR ${network} ${vpnid} IN ZIP ${network_list} ${vpnid_list} + ${network_id} = OpenStackOperations.Get Net Id ${network} + VpnOperations.Associate L3VPN To Network networkid=${network_id} vpnid=${vpnid} + ${resp} = VpnOperations.VPN Get L3VPN vpnid=${vpnid} + BuiltIn.Should Contain ${resp} ${network_id} + END Dissociate L3VPN From Networks [Arguments] &{Kwargs} @@ -133,14 +136,16 @@ Verify Flows Are Present For L3VPN Should Contain ${flow_output} table=${ODL_FLOWTABLE_L3VPN} ${l3vpn_table} = Get Lines Containing String ${flow_output} table=${ODL_FLOWTABLE_L3VPN}, Log ${l3vpn_table} - : FOR ${i} IN @{vm_ips} - \ ${resp}= Should Contain ${l3vpn_table} ${i} + FOR ${i} IN @{vm_ips} + ${resp}= Should Contain ${l3vpn_table} ${i} + END Verify Flows Are Present For L3VPN On All Compute Nodes [Arguments] ${vm_ips} [Documentation] Verify Flows Are Present For L3VPN On All Compute Nodes - : FOR ${ip} IN @{OS_CMP_IPS} - \ BuiltIn.Wait Until Keyword Succeeds 30s 10s VpnOperations.Verify Flows Are Present For L3VPN ${ip} ${vm_ips} + FOR ${ip} IN @{OS_CMP_IPS} + BuiltIn.Wait Until Keyword Succeeds 30s 10s VpnOperations.Verify Flows Are Present For L3VPN ${ip} ${vm_ips} + END Verify GWMAC Entry On ODL [Arguments] ${GWMAC_ADDRS} @@ -148,8 +153,9 @@ Verify GWMAC Entry On ODL ${resp} = RequestsLibrary.Get Request session ${VPN_PORT_DATA_URL} Log ${resp.content} Should Be Equal As Strings ${resp.status_code} 200 - : FOR ${macAdd} IN @{GWMAC_ADDRS} - \ Should Contain ${resp.content} ${macAdd} + FOR ${macAdd} IN @{GWMAC_ADDRS} + Should Contain ${resp.content} ${macAdd} + END Verify GWMAC Flow Entry Removed From Flow Table [Arguments] ${cnIp} @@ -159,13 +165,15 @@ Verify GWMAC Flow Entry Removed From Flow Table ${gwmac_table} = Get Lines Containing String ${flow_output} table=${GWMAC_TABLE} Log ${gwmac_table} #Verify GWMAC address present in table 19 - : FOR ${macAdd} IN @{GWMAC_ADDRS} - \ Should Not Contain ${gwmac_table} dl_dst=${macAdd} actions=goto_table:${L3_TABLE} + FOR ${macAdd} IN @{GWMAC_ADDRS} + Should Not Contain ${gwmac_table} dl_dst=${macAdd} actions=goto_table:${L3_TABLE} + END Verify GWMAC Flow Entry Removed From Flow Table On All Compute Nodes [Documentation] Verify the GWMAC Table, ARP Response table and Dispatcher table. - : FOR ${ip} IN @{OS_CMP_IPS} - \ BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify GWMAC Flow Entry Removed From Flow Table ${ip} + FOR ${ip} IN @{OS_CMP_IPS} + BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify GWMAC Flow Entry Removed From Flow Table ${ip} + END Verify ARP REQUEST in groupTable [Arguments] ${group_output} ${Group-ID} @@ -236,17 +244,19 @@ Verify IPv4 GWMAC Flow Entry On Flow Table Should Contain ${flow_output} table=${ARP_RESPONSE_TABLE} ${arpResponder_table} = Get Lines Containing String ${flow_output} table=${ARP_RESPONSE_TABLE} Should Contain ${arpResponder_table} priority=0 actions=drop - : FOR ${macAdd} ${ipAdd} IN ZIP ${GWMAC_ADDRS} ${GWIP_ADDRS} - \ ${ARP_RESPONSE_IP_MAC_REGEX} = Set Variable arp_tpa=${ipAdd},arp_op=1 actions=.*,set_field:${macAdd}->eth_src - \ Should Match Regexp ${arpResponder_table} ${ARP_RESPONSE_IP_MAC_REGEX} + FOR ${macAdd} ${ipAdd} IN ZIP ${GWMAC_ADDRS} ${GWIP_ADDRS} + ${ARP_RESPONSE_IP_MAC_REGEX} = Set Variable arp_tpa=${ipAdd},arp_op=1 actions=.*,set_field:${macAdd}->eth_src + Should Match Regexp ${arpResponder_table} ${ARP_RESPONSE_IP_MAC_REGEX} + END Verify IPv6 GWMAC Flow Entry On Flow Table [Arguments] ${flow_output} Should Contain ${flow_output} table=${IPV6_TABLE} ${icmp_ipv6_flows} = Get Lines Containing String ${flow_output} icmp_type=135 - : FOR ${ip_addr} IN @{GWIP_ADDRS} - \ ${rule} = Set Variable icmp_type=135,icmp_code=0,nd_target=${ip_addr} actions=CONTROLLER:65535 - \ Should Match Regexp ${icmp_ipv6_flows} ${rule} + FOR ${ip_addr} IN @{GWIP_ADDRS} + ${rule} = Set Variable icmp_type=135,icmp_code=0,nd_target=${ip_addr} actions=CONTROLLER:65535 + Should Match Regexp ${icmp_ipv6_flows} ${rule} + END Verify GWMAC Flow Entry On Flow Table [Arguments] ${cnIp} ${ipv}=ipv4 @@ -260,9 +270,10 @@ Verify GWMAC Flow Entry On Flow Table Should Contain ${flow_output} table=${GWMAC_TABLE} ${gwmac_table} = Get Lines Containing String ${flow_output} table=${GWMAC_TABLE} #Verify GWMAC address present in table 19 - : FOR ${macAdd} IN @{GWMAC_ADDRS} - \ Should Contain ${gwmac_table} dl_dst=${macAdd} actions=goto_table:${L3_TABLE} - #verify Miss entry + FOR ${macAdd} IN @{GWMAC_ADDRS} + Should Contain ${gwmac_table} dl_dst=${macAdd} actions=goto_table:${L3_TABLE} + #verify Miss entry + END Should Contain ${gwmac_table} actions=resubmit(,17) #Verify ARP_CHECK_TABLE - 43 #arp request and response @@ -279,14 +290,16 @@ Verify GWMAC Flow Entry On Flow Table Verify GWMAC Flow Entry On Flow Table On All Compute Nodes [Arguments] ${ipv}=ipv4 [Documentation] Verify the GWMAC Table, ARP Response table and Dispatcher table. - : FOR ${ip} IN @{OS_CMP_IPS} - \ BuiltIn.Wait Until Keyword Succeeds 30s 10s VpnOperations.Verify GWMAC Flow Entry On Flow Table ${ip} ${ipv} + FOR ${ip} IN @{OS_CMP_IPS} + BuiltIn.Wait Until Keyword Succeeds 30s 10s VpnOperations.Verify GWMAC Flow Entry On Flow Table ${ip} ${ipv} + END Delete Multiple L3VPNs [Arguments] @{vpns} [Documentation] Delete three L3VPNs created using Multiple L3VPN Test - : FOR ${vpn} IN @{vpns} - \ VPN Delete L3VPN vpnid=${vpn} + FOR ${vpn} IN @{vpns} + VPN Delete L3VPN vpnid=${vpn} + END VNI Test Setup BuiltIn.Return From Keyword If "${OPENSTACK_TOPO}" == "1cmb-0ctl-0cmp" diff --git a/csit/libraries/VtnCoKeywords.robot b/csit/libraries/VtnCoKeywords.robot index a657bc5693..239e676ac2 100644 --- a/csit/libraries/VtnCoKeywords.robot +++ b/csit/libraries/VtnCoKeywords.robot @@ -12,7 +12,7 @@ Resource ./CompareStream.robot Resource ./Utils.robot Resource ./MininetKeywords.robot -*** variable *** +*** Variable *** ${vlan_topo} --custom vlan_vtn_test.py --topo vlantopo ${vtn_coordinator_nexus_path} https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/org/opendaylight/vtn/distribution.vtn-coordinator ${vtn_dist} distribution.vtn-coordinator diff --git a/csit/libraries/VtnMaKeywords.robot b/csit/libraries/VtnMaKeywords.robot index 7df9ed6ee1..c8256cb442 100644 --- a/csit/libraries/VtnMaKeywords.robot +++ b/csit/libraries/VtnMaKeywords.robot @@ -168,8 +168,9 @@ Stop PathSuiteVtnMaTest DataFlowsForBridge [Arguments] ${resp} @{BRIDGE_DATAFLOW} [Documentation] Verify whether the required attributes exists. - : FOR ${dataflowElement} IN @{BRIDGE_DATAFLOW} - \ should Contain ${resp.content} ${dataflowElement} + FOR ${dataflowElement} IN @{BRIDGE_DATAFLOW} + should Contain ${resp.content} ${dataflowElement} + END Add a pathmap [Arguments] ${pathmap_data} @@ -180,8 +181,9 @@ Add a pathmap Get a pathmap [Documentation] Get a pathmap for a vtn. ${resp}= RequestsLibrary.Get Request session restconf/operational/vtn-path-map:global-path-maps - : FOR ${pathElement} IN @{PATHMAP_ATTR} - \ should Contain ${resp.content} ${pathElement} + FOR ${pathElement} IN @{PATHMAP_ATTR} + should Contain ${resp.content} ${pathElement} + END Add a pathpolicy [Arguments] ${pathpolicy_data} @@ -193,8 +195,9 @@ Get a pathpolicy [Arguments] ${pathpolicy_id} [Documentation] Get a pathpolicy for a vtn. ${resp}= RequestsLibrary.Get Request session restconf/operational/vtn-path-policy:vtn-path-policies/vtn-path-policy/${pathpolicy_id} - : FOR ${pathpolicyElement} IN @{PATHPOLICY_ATTR} - \ should Contain ${resp.content} ${pathpolicyElement} + FOR ${pathpolicyElement} IN @{PATHPOLICY_ATTR} + should Contain ${resp.content} ${pathpolicyElement} + END Delete a pathmap [Arguments] ${tenant_path} @@ -375,8 +378,9 @@ Verify Actions on Flow Entry [Documentation] check flow action elements by giving dumpflows in mininet write ${dumpflows} ${result} Read Until mininet> - : FOR ${flowElement} IN @{flowfilter_actions} - \ should Contain ${result} ${flowElement} + FOR ${flowElement} IN @{flowfilter_actions} + should Contain ${result} ${flowElement} + END Add a flowcondition [Arguments] ${flowcond_name} ${flowconditiondata} diff --git a/csit/libraries/WaitUtils.robot b/csit/libraries/WaitUtils.robot index 11338f382d..7968ead021 100644 --- a/csit/libraries/WaitUtils.robot +++ b/csit/libraries/WaitUtils.robot @@ -93,13 +93,14 @@ Wait_For_Getter_Failure_Or_Stateless_Validator_Pass ... FIXME: Cover this keyword in WaitUtilTest.robot ${timeout_in_seconds} ${period_in_seconds} ${date_deadline} = WaitUtils__Check_Sanity_And_Compute_Derived_Times timeout=${timeout} period=${period} ${iterations} = BuiltIn.Evaluate ${timeout_in_seconds} / ${period_in_seconds} - : FOR ${i} IN RANGE ${iterations} - \ ${data} = ScalarClosures.Run_Keyword_And_Collect_Garbage ScalarClosures.Run_Closure_As_Is ${getter} - \ ${status} ${message} = BuiltIn.Run_Keyword_And_Ignore_Error ScalarClosures.Run_Keyword_And_Collect_Garbage ScalarClosures.Run_Closure_After_Replacing_First_Argument ${stateless_validator} - \ ... ${data} - \ BuiltIn.Return_From_Keyword_If "${status}" == "PASS" ${message} - \ WaitUtils__Is_Deadline_Reachable date_deadline=${date_deadline} period_in_seconds=${period_in_seconds} message=Last validator message: ${message} - \ BuiltIn.Sleep ${period_in_seconds} s + FOR ${i} IN RANGE ${iterations} + ${data} = ScalarClosures.Run_Keyword_And_Collect_Garbage ScalarClosures.Run_Closure_As_Is ${getter} + ${status} ${message} = BuiltIn.Run_Keyword_And_Ignore_Error ScalarClosures.Run_Keyword_And_Collect_Garbage ScalarClosures.Run_Closure_After_Replacing_First_Argument ${stateless_validator} + ... ${data} + BuiltIn.Return_From_Keyword_If "${status}" == "PASS" ${message} + WaitUtils__Is_Deadline_Reachable date_deadline=${date_deadline} period_in_seconds=${period_in_seconds} message=Last validator message: ${message} + BuiltIn.Sleep ${period_in_seconds} s + END BuiltIn.Fail Logic error, we should have returned before. Stateless_Assert_Closure_Has_To_Succeed_Consecutively_By_Deadline @@ -110,15 +111,16 @@ Stateless_Assert_Closure_Has_To_Succeed_Consecutively_By_Deadline ${sleeps} = BuiltIn.Evaluate ${count} - 1 WaitUtils__Is_Deadline_Reachable date_deadline=${date_deadline} period_in_seconds=${period_in_seconds} sleeps_left=${sleeps} message=Last result: ${result} # Entering the main loop. - : FOR ${sleeps_left} IN RANGE ${count}-1 -1 -1 # If count is 3, for will go through 2, 1, and 0. - \ # Run the assertor and collect the garbage. - \ ${result} = ScalarClosures.Run_Keyword_And_Collect_Garbage ScalarClosures.Run_Closure_As_Is ${assertor} - \ # We have not failed yet. Was this the final try? - \ BuiltIn.Return_From_Keyword_If ${sleeps_left} <= 0 ${result} - \ # Is there enough time left? - \ WaitUtils__Is_Deadline_Reachable date_deadline=${date_deadline} period_in_seconds=${period_in_seconds} sleeps_left=${sleeps_left} message=Last result: ${result} - \ # We will do next try, byt we have to sleep before. - \ BuiltIn.Sleep ${period_in_seconds} s + FOR ${sleeps_left} IN RANGE ${count}-1 -1 -1 # If count is 3, for will go through 2, 1, and 0. + # Run the assertor and collect the garbage. + ${result} = ScalarClosures.Run_Keyword_And_Collect_Garbage ScalarClosures.Run_Closure_As_Is ${assertor} + # We have not failed yet. Was this the final try? + BuiltIn.Return_From_Keyword_If ${sleeps_left} <= 0 ${result} + # Is there enough time left? + WaitUtils__Is_Deadline_Reachable date_deadline=${date_deadline} period_in_seconds=${period_in_seconds} sleeps_left=${sleeps_left} message=Last result: ${result} + # We will do next try, byt we have to sleep before. + BuiltIn.Sleep ${period_in_seconds} s + END BuiltIn.Fail Logic error, we should have returned before. Stateless_Assert_Closure_Has_To_Succeed_Consecutively @@ -139,14 +141,15 @@ Stateful_Assert_Closure_Has_To_Succeed_Consecutively_By_Deadline ${sleeps} = BuiltIn.Evaluate ${count} - 1 WaitUtils__Is_Deadline_Reachable date_deadline=${date_deadline} period_in_seconds=${period_in_seconds} sleeps_left=${sleeps} message=Last result: ${result} # Entering the main loop. - : FOR ${sleeps_left} IN RANGE ${count}-1 -1 -1 - \ ${state} ${result} = ScalarClosures.Run_Keyword_And_Collect_Garbage ScalarClosures.Run_Closure_After_Replacing_First_Argument ${assertor} ${state} - \ # We have not failed yet. Was this the final try? - \ BuiltIn.Return_From_Keyword_If ${sleeps_left} <= 0 ${result} - \ # Is there enough time left? - \ WaitUtils__Is_Deadline_Reachable date_deadline=${date_deadline} period_in_seconds=${period_in_seconds} sleeps_left=${sleeps_left} message=Last result: ${result} - \ # We will do next try, byt we have to sleep before. - \ BuiltIn.Sleep ${period_in_seconds} s + FOR ${sleeps_left} IN RANGE ${count}-1 -1 -1 + ${state} ${result} = ScalarClosures.Run_Keyword_And_Collect_Garbage ScalarClosures.Run_Closure_After_Replacing_First_Argument ${assertor} ${state} + # We have not failed yet. Was this the final try? + BuiltIn.Return_From_Keyword_If ${sleeps_left} <= 0 ${result} + # Is there enough time left? + WaitUtils__Is_Deadline_Reachable date_deadline=${date_deadline} period_in_seconds=${period_in_seconds} sleeps_left=${sleeps_left} message=Last result: ${result} + # We will do next try, byt we have to sleep before. + BuiltIn.Sleep ${period_in_seconds} s + END BuiltIn.Fail Logic error, we should have returned before. Stateful_Assert_Closure_Has_To_Succeed_Consecutively @@ -168,26 +171,27 @@ Getter_And_Safe_Stateful_Validator_Have_To_Succeed_Consecutively_By_Deadline ... message=Last result: ${result} BuiltIn.Return_From_Keyword_If '''${status}''' != '''PASS''' ${state} ${status} ${message} # Entering the main loop. - : FOR ${sleeps_left} IN RANGE ${count}-1 -1 -1 - \ # Getter may fail, but this Keyword should return state, so we need RKAIE. - \ ${status} ${data} = BuiltIn.Run_Keyword_And_Ignore_Error ScalarClosures.Run_Keyword_And_Collect_Garbage ScalarClosures.Run_Closure_As_Is ${getter} - \ BuiltIn.Return_From_Keyword_If '''${status}''' != '''PASS''' ${state} ${status} Getter failed: ${data} - \ # Is there enough time left? - \ ${status} ${message} = BuiltIn.Run_Keyword_And_Ignore_Error WaitUtils__Is_Deadline_Reachable date_deadline=${date_deadline} period_in_seconds=${period_in_seconds} - \ ... sleeps_left=${sleeps_left} message=Last result: ${result} - \ BuiltIn.Return_From_Keyword_If '''${status}''' != '''PASS''' ${state} ${status} ${message} - \ ${state} ${status} ${result} = ScalarClosures.Run_Keyword_And_Collect_Garbage ScalarClosures.Run_Closure_After_Replacing_First_Two_Arguments ${safe_validator} - \ ... ${state} ${data} - \ # Validator may have reported failure. - \ BuiltIn.Return_From_Keyword_If '''${status}''' != '''PASS''' ${state} ${status} Validator failed: ${result} - \ # Was this the final try? - \ BuiltIn.Return_From_Keyword_If ${sleeps_left} <= 0 ${state} ${status} ${result} - \ # Is there enough time left? - \ ${status} ${message} = BuiltIn.Run_Keyword_And_Ignore_Error WaitUtils__Is_Deadline_Reachable date_deadline=${date_deadline} period_in_seconds=${period_in_seconds} - \ ... sleeps_left=${sleeps_left} message=Last result: ${result} - \ BuiltIn.Return_From_Keyword_If '''${status}''' != '''PASS''' ${state} ${status} ${message} - \ # We will do next try, byt we have to sleep before. - \ BuiltIn.Sleep ${period_in_seconds} s + FOR ${sleeps_left} IN RANGE ${count}-1 -1 -1 + # Getter may fail, but this Keyword should return state, so we need RKAIE. + ${status} ${data} = BuiltIn.Run_Keyword_And_Ignore_Error ScalarClosures.Run_Keyword_And_Collect_Garbage ScalarClosures.Run_Closure_As_Is ${getter} + BuiltIn.Return_From_Keyword_If '''${status}''' != '''PASS''' ${state} ${status} Getter failed: ${data} + # Is there enough time left? + ${status} ${message} = BuiltIn.Run_Keyword_And_Ignore_Error WaitUtils__Is_Deadline_Reachable date_deadline=${date_deadline} period_in_seconds=${period_in_seconds} + ... sleeps_left=${sleeps_left} message=Last result: ${result} + BuiltIn.Return_From_Keyword_If '''${status}''' != '''PASS''' ${state} ${status} ${message} + ${state} ${status} ${result} = ScalarClosures.Run_Keyword_And_Collect_Garbage ScalarClosures.Run_Closure_After_Replacing_First_Two_Arguments ${safe_validator} + ... ${state} ${data} + # Validator may have reported failure. + BuiltIn.Return_From_Keyword_If '''${status}''' != '''PASS''' ${state} ${status} Validator failed: ${result} + # Was this the final try? + BuiltIn.Return_From_Keyword_If ${sleeps_left} <= 0 ${state} ${status} ${result} + # Is there enough time left? + ${status} ${message} = BuiltIn.Run_Keyword_And_Ignore_Error WaitUtils__Is_Deadline_Reachable date_deadline=${date_deadline} period_in_seconds=${period_in_seconds} + ... sleeps_left=${sleeps_left} message=Last result: ${result} + BuiltIn.Return_From_Keyword_If '''${status}''' != '''PASS''' ${state} ${status} ${message} + # We will do next try, byt we have to sleep before. + BuiltIn.Sleep ${period_in_seconds} s + END BuiltIn.Fail Logic error, we should have returned before. Propagate_Fail_If_Message_Starts_With_Prefix @@ -215,15 +219,16 @@ Wait_For_Getter_And_Safe_Stateful_Validator_Consecutive_Success ${result} = BuiltIn.Set_Variable No result yet. ${state} = BuiltIn.Set_Variable ${initial_state} # The loop for failures. - : FOR ${try} IN RANGE 1 ${maximum_sleeps}+2 # If maximum_sleeps is 2, for will go through 1, 2, and 3. - \ ${state} ${status} ${result} = Getter_And_Safe_Stateful_Validator_Have_To_Succeed_Consecutively_By_Deadline date_deadline=${date_deadline} period_in_seconds=${period_in_seconds} - \ ... count=${count} getter=${getter} safe_validator=${safe_validator} initial_state=${state} - \ # Have we passed? - \ BuiltIn.Return_From_Keyword_If '''${status}''' == '''PASS''' ${result} - \ # Are we out of time? - \ Propagate_Fail_If_Message_Starts_With_Prefix ${result} Not possible to succeed within the deadline. - \ # We will do next try, but we have to sleep before. - \ BuiltIn.Sleep ${period_in_seconds} s + FOR ${try} IN RANGE 1 ${maximum_sleeps}+2 # If maximum_sleeps is 2, for will go through 1, 2, and 3. + ${state} ${status} ${result} = Getter_And_Safe_Stateful_Validator_Have_To_Succeed_Consecutively_By_Deadline date_deadline=${date_deadline} period_in_seconds=${period_in_seconds} + ... count=${count} getter=${getter} safe_validator=${safe_validator} initial_state=${state} + # Have we passed? + BuiltIn.Return_From_Keyword_If '''${status}''' == '''PASS''' ${result} + # Are we out of time? + Propagate_Fail_If_Message_Starts_With_Prefix ${result} Not possible to succeed within the deadline. + # We will do next try, but we have to sleep before. + BuiltIn.Sleep ${period_in_seconds} s + END BuiltIn.Fail Logic error, we should have returned before. Wait_For_Getter_Error_Or_Safe_Stateful_Validator_Consecutive_Success @@ -238,15 +243,16 @@ Wait_For_Getter_Error_Or_Safe_Stateful_Validator_Consecutive_Success ${result} = BuiltIn.Set_Variable No result yet. ${state} = BuiltIn.Set_Variable ${initial_state} # The loop for failures. - : FOR ${try} IN RANGE 1 ${maximum_sleeps}+2 # If maximum_sleeps is 2, for will go through 1, 2, and 3. - \ ${state} ${status} ${result} = Getter_And_Safe_Stateful_Validator_Have_To_Succeed_Consecutively_By_Deadline date_deadline=${date_deadline} period_in_seconds=${period_in_seconds} - \ ... count=${count} getter=${getter} safe_validator=${safe_validator} initial_state=${state} - \ # Have we passed? - \ BuiltIn.Return_From_Keyword_If '''${status}''' == '''PASS''' ${result} - \ # Are we out of time? Look at ${result}. - \ Propagate_Fail_If_Message_Starts_With_Prefix ${result} Not possible to succeed within the deadline. - \ # Now check for getter error, by analysing ${result}. - \ Propagate_Fail_If_Message_Starts_With_Prefix ${result} Getter failed - \ # We can do the next try, byt we have to sleep before. - \ BuiltIn.Sleep ${period_in_seconds} s + FOR ${try} IN RANGE 1 ${maximum_sleeps}+2 # If maximum_sleeps is 2, for will go through 1, 2, and 3. + ${state} ${status} ${result} = Getter_And_Safe_Stateful_Validator_Have_To_Succeed_Consecutively_By_Deadline date_deadline=${date_deadline} period_in_seconds=${period_in_seconds} + ... count=${count} getter=${getter} safe_validator=${safe_validator} initial_state=${state} + # Have we passed? + BuiltIn.Return_From_Keyword_If '''${status}''' == '''PASS''' ${result} + # Are we out of time? Look at ${result}. + Propagate_Fail_If_Message_Starts_With_Prefix ${result} Not possible to succeed within the deadline. + # Now check for getter error, by analysing ${result}. + Propagate_Fail_If_Message_Starts_With_Prefix ${result} Getter failed + # We can do the next try, byt we have to sleep before. + BuiltIn.Sleep ${period_in_seconds} s + END BuiltIn.Fail Logic error, we should have returned before. diff --git a/csit/libraries/YangmanKeywords.robot b/csit/libraries/YangmanKeywords.robot index 16620fa284..715426a168 100644 --- a/csit/libraries/YangmanKeywords.robot +++ b/csit/libraries/YangmanKeywords.robot @@ -311,19 +311,21 @@ Select Module Detail Config Tab Expand All Branches In Module Detail Content Active Tab [Documentation] Expands all branches in module detail active operations or operational or config tab. Selenium2Library.Wait Until Element Is Visible ${MODULE_DETAIL_EXPAND_BRANCH_BUTTON} - : FOR ${i} IN RANGE 1 1000 - \ ${count}= Selenium2Library.Get Matching Xpath Count ${MODULE_DETAIL_EXPAND_BRANCH_BUTTON} - \ BuiltIn.Exit For Loop If ${count}==0 - \ BuiltIn.Wait Until Keyword Succeeds 30 s 5 s GUIKeywords.Focus And Click Element ${MODULE_DETAIL_EXPAND_BRANCH_BUTTON} + FOR ${i} IN RANGE 1 1000 + ${count}= Selenium2Library.Get Matching Xpath Count ${MODULE_DETAIL_EXPAND_BRANCH_BUTTON} + BuiltIn.Exit For Loop If ${count}==0 + BuiltIn.Wait Until Keyword Succeeds 30 s 5 s GUIKeywords.Focus And Click Element ${MODULE_DETAIL_EXPAND_BRANCH_BUTTON} + END Selenium2Library.Wait Until Page Does Not Contain Element ${MODULE_DETAIL_EXPAND_BRANCH_BUTTON} Collapse All Branches In Module Detail Content Active Tab [Documentation] Collapses all branches in module detail active operations or operational or config tab. Selenium2Library.Wait Until Element Is Visible ${MODULE_DETAIL_COLLAPSE_BRANCH_BUTTON} - : FOR ${i} IN RANGE 1 1000 - \ ${count}= Selenium2Library.Get Matching Xpath Count ${MODULE_DETAIL_COLLAPSE_BRANCH_BUTTON} - \ BuiltIn.Exit For Loop If ${count}==0 - \ BuiltIn.Wait Until Keyword Succeeds 30 s 5 s GUIKeywords.Focus And Click Element ${MODULE_DETAIL_COLLAPSE_BRANCH_BUTTON} + FOR ${i} IN RANGE 1 1000 + ${count}= Selenium2Library.Get Matching Xpath Count ${MODULE_DETAIL_COLLAPSE_BRANCH_BUTTON} + BuiltIn.Exit For Loop If ${count}==0 + BuiltIn.Wait Until Keyword Succeeds 30 s 5 s GUIKeywords.Focus And Click Element ${MODULE_DETAIL_COLLAPSE_BRANCH_BUTTON} + END Selenium2Library.Wait Until Page Does Not Contain Element ${MODULE_DETAIL_COLLAPSE_BRANCH_BUTTON} Return Module Detail Labelled Branch Xpath diff --git a/csit/libraries/controller/CsCommon.robot b/csit/libraries/controller/CsCommon.robot index 42e9818a69..7baed66c48 100644 --- a/csit/libraries/controller/CsCommon.robot +++ b/csit/libraries/controller/CsCommon.robot @@ -66,14 +66,16 @@ Monitor_Owner_And_Candidates_Stability Register_Singleton_Constant_On_Nodes [Arguments] ${index_list} [Documentation] Register a candidate application on given nodes. - : FOR ${index} IN @{index_list} - \ Register_Singleton_And_Update_Expected_Candidates ${index} ${CS_CONSTANT_PREFIX}${index} + FOR ${index} IN @{index_list} + Register_Singleton_And_Update_Expected_Candidates ${index} ${CS_CONSTANT_PREFIX}${index} + END Unregister_Singleton_Constant_On_Nodes [Arguments] ${index_list} [Documentation] Unregister the application from given nodes. - : FOR ${index} IN @{index_list} - \ Unregister_Singleton_And_Update_Expected_Candidates ${index} + FOR ${index} IN @{index_list} + Unregister_Singleton_And_Update_Expected_Candidates ${index} + END Get_And_Save_Present_CsOwner_And_CsCandidates [Arguments] ${node_to_ask} @@ -92,14 +94,16 @@ Verify_Singleton_Constant_On_Node Verify_Singleton_Constant_On_Nodes [Arguments] ${index_list} ${cs_exp_constant} [Documentation] Iterate over all cluster nodes and all should return expected constant. - : FOR ${index} IN @{index_list} - \ Verify_Singleton_Constant_On_Node ${index} ${cs_exp_constant} + FOR ${index} IN @{index_list} + Verify_Singleton_Constant_On_Node ${index} ${cs_exp_constant} + END Verify_Singleton_Constant_During_Isolation [Documentation] Iterate over all non-isolated cluster nodes. They should return the correct constant. - : FOR ${index} IN @{cs_all_indices} - \ BuiltIn.Run_Keyword_If "${index}" == "${cs_isolated_index}" BuiltIn.Log Node not triggered, behavior not well described, see bugs 8207, 8214. - \ BuiltIn.Run_Keyword_Unless "${index}" == "${cs_isolated_index}" Verify_Singleton_Constant_On_Node ${index} ${CS_CONSTANT_PREFIX}${cs_owner} + FOR ${index} IN @{cs_all_indices} + BuiltIn.Run_Keyword_If "${index}" == "${cs_isolated_index}" BuiltIn.Log Node not triggered, behavior not well described, see bugs 8207, 8214. + BuiltIn.Run_Keyword_Unless "${index}" == "${cs_isolated_index}" Verify_Singleton_Constant_On_Node ${index} ${CS_CONSTANT_PREFIX}${cs_owner} + END Isolate_Owner_And_Verify_Isolated [Documentation] Isolate the owner cluster node. Wait until the new owner is elected and store new values of owner and candidates. @@ -121,17 +125,19 @@ Rejoin_Node_And_Verify_Rejoined Register_Flapping_Singleton_On_Nodes [Arguments] ${index_list} [Documentation] Register a candidate application on each node which starts the test. - : FOR ${index} IN @{index_list} - \ MdsalLowlevel.Register_Flapping_Singleton ${index} + FOR ${index} IN @{index_list} + MdsalLowlevel.Register_Flapping_Singleton ${index} + END Unregister_Flapping_Singleton_On_Nodes_And_Validate_Results [Arguments] ${index_list} ${rate_limit_to_pass} ${test_duration} [Documentation] Unregister the testing service and check recevied statistics. ${movements_count} = BuiltIn.Set_Variable ${0} - : FOR ${index} IN @{index_list} - \ ${count} = MdsalLowlevel.Unregister_Flapping_Singleton ${index} - \ BuiltIn.Run_Keyword_If ${count} < 0 BuiltIn.Fail No failure should have occured during the ${test_duration} timeout. - \ ${movements_count} = BuiltIn.Evaluate ${movements_count}+${count} + FOR ${index} IN @{index_list} + ${count} = MdsalLowlevel.Unregister_Flapping_Singleton ${index} + BuiltIn.Run_Keyword_If ${count} < 0 BuiltIn.Fail No failure should have occured during the ${test_duration} timeout. + ${movements_count} = BuiltIn.Evaluate ${movements_count}+${count} + END ${seconds} = DateTime.Convert_Time ${test_duration} ${rate} = BuiltIn.Evaluate ${movements_count}/${seconds} BuiltIn.Run_Keyword_If ${rate} < ${rate_limit_to_pass} BuiltIn.Fail Acceptance rate ${rate_limit_to_pass} not reached, actual rate is ${rate}. diff --git a/csit/libraries/controller/DdbCommons.robot b/csit/libraries/controller/DdbCommons.robot index 9db3aab598..cd6f17f235 100644 --- a/csit/libraries/controller/DdbCommons.robot +++ b/csit/libraries/controller/DdbCommons.robot @@ -199,8 +199,9 @@ Leader_Isolation_Heal_Within_Rt [Documentation] The leader isolation test case end if the heal happens within transaction timeout. All write transaction ... producers shoudl finish without error. ${resp_list} = MdsalLowlevelPy.Wait_For_Transactions - : FOR ${resp} IN @{resp_list} - \ TemplatedRequests.Check_Status_Code @{resp}[2] + FOR ${resp} IN @{resp_list} + TemplatedRequests.Check_Status_Code @{resp}[2] + END Module_Leader_Isolation_Heal_Default [Arguments] ${isolated_node} ${time_to_finish} @@ -216,8 +217,9 @@ Module_Leader_Isolation_Heal_Default MdsalLowlevelPy.Start_Write_Transactions_On_Nodes ${restart_producer_node_ip_as_list} ${restart_producer_node_idx_as_list} ${ID_PREFIX2} ${time_to_finish} ${TRANSACTION_RATE_1K} chained_flag=${CHAINED_TX} ... reset_globals=${False} ${resp_list} = MdsalLowlevelPy.Wait_For_Transactions - : FOR ${resp} IN @{resp_list} - \ TemplatedRequests.Check_Status_Code @{resp}[2] + FOR ${resp} IN @{resp_list} + TemplatedRequests.Check_Status_Code @{resp}[2] + END Prefix_Leader_Isolation_Heal_Default [Arguments] ${isolated_node} ${time_to_finish} @@ -232,8 +234,9 @@ Prefix_Leader_Isolation_Heal_Default ${restart_producer_node_ip_as_list} BuiltIn.Create_List ${restart_producer_node_ip} MdsalLowlevelPy.Start_Produce_Transactions_On_Nodes ${restart_producer_node_ip_as_list} ${restart_producer_node_idx_as_list} ${ID_PREFIX2} ${time_to_finish} ${TRANSACTION_RATE_1K} reset_globals=${False} ${resp_list} = MdsalLowlevelPy.Wait_For_Transactions - : FOR ${resp} IN @{resp_list} - \ TemplatedRequests.Check_Status_Code @{resp}[2] + FOR ${resp} IN @{resp_list} + TemplatedRequests.Check_Status_Code @{resp}[2] + END Client_Isolation_Test_Templ [Arguments] ${listener_node_role} ${trans_chain_flag} ${shard_name}=${SHARD_NAME} ${shard_type}=${SHARD_TYPE} @@ -317,8 +320,9 @@ Listener_Stability_Test_Templ ... ${shard_type} ${True} ${idx_from} verify_restconf=False BuiltIn.Should_Be_Equal ${idx_to} ${new_leader} ${resp_list} = MdsalLowlevelPy.Wait_For_Transactions - : FOR ${resp} IN @{resp_list} - \ TemplatedRequests.Check_Status_Code @{resp}[2] + FOR ${resp} IN @{resp_list} + TemplatedRequests.Check_Status_Code @{resp}[2] + END ${copy_matches} = MdsalLowlevel.Unsubscribe_Dtcl ${idx_listen} ${subscribed} = BuiltIn.Set_Variable ${False} BuiltIn.Should_Be_True ${copy_matches} @@ -341,8 +345,9 @@ Listener_Stability_PrefBasedShard_Test_Templ ... ${shard_type} ${True} ${idx_from} verify_restconf=False BuiltIn.Should_Be_Equal ${idx_to} ${new_leader} ${resp_list} = MdsalLowlevelPy.Wait_For_Transactions - : FOR ${resp} IN @{resp_list} - \ TemplatedRequests.Check_Status_Code @{resp}[2] + FOR ${resp} IN @{resp_list} + TemplatedRequests.Check_Status_Code @{resp}[2] + END ${copy_matches} = MdsalLowlevel.Unsubscribe_Ddtl ${idx_listen} ${subscribed} = BuiltIn.Set_Variable ${False} BuiltIn.Should_Be_True ${copy_matches} @@ -363,9 +368,10 @@ Remove_Prefix_Based_Shard_And_Verify ${all_indices} = ClusterManagement.List_All_Indices ${node_to_trigger} = Collections.Get_From_List ${all_indices} ${0} MdsalLowlevel.Remove_Prefix_Shard ${node_to_trigger} ${prefix} - : FOR ${idx} IN @{all_indices} - \ BuiltIn.Wait_Until_Keyword_Succeeds 60s 5s Verify_Shard_Replica_Not_Present ${idx} ${prefix}!! - \ ... ${SHARD_TYPE} + FOR ${idx} IN @{all_indices} + BuiltIn.Wait_Until_Keyword_Succeeds 60s 5s Verify_Shard_Replica_Not_Present ${idx} ${prefix}!! + ... ${SHARD_TYPE} + END Verify_Shard_Replica_Not_Present [Arguments] ${member_index} ${shard_name} ${shard_type} diff --git a/csit/libraries/controller/DnbCommons.robot b/csit/libraries/controller/DnbCommons.robot index e3de9e5b94..ab4a65df0e 100644 --- a/csit/libraries/controller/DnbCommons.robot +++ b/csit/libraries/controller/DnbCommons.robot @@ -26,12 +26,14 @@ Dom_Notification_Broker_Test_Templ BuiltIn.Log Overall requested rate: ${total_notification_rate}, test duration: ${test_duration_in_seconds} seconds. WaitUtils.WU_Setup ${count} = BuiltIn.Set_variable ${0} - : FOR ${suffix} IN RANGE ${DNB_PUBLISHER_SUBSCRIBER_PAIR_RATE} ${total_notification_rate}+1 ${DNB_PUBLISHER_SUBSCRIBER_PAIR_RATE} - \ ${count} = BuiltIn.Evaluate ${count}+1 - \ MdsalLowlevel.Subscribe_Ynl ${DNB_TESTED_MEMBER_INDEX} ${DNB_PUBLISHER_LISTENER_PREFIX}${count} + FOR ${suffix} IN RANGE ${DNB_PUBLISHER_SUBSCRIBER_PAIR_RATE} ${total_notification_rate}+1 ${DNB_PUBLISHER_SUBSCRIBER_PAIR_RATE} + ${count} = BuiltIn.Evaluate ${count}+1 + MdsalLowlevel.Subscribe_Ynl ${DNB_TESTED_MEMBER_INDEX} ${DNB_PUBLISHER_LISTENER_PREFIX}${count} + END ${count} = BuiltIn.Convert_To_Integer ${count} - : FOR ${index} IN RANGE 1 ${count}+1 - \ MdsalLowlevel.Start_Publish_Notifications ${DNB_TESTED_MEMBER_INDEX} ${DNB_PUBLISHER_LISTENER_PREFIX}${index} ${test_duration_in_seconds} ${DNB_PUBLISHER_SUBSCRIBER_PAIR_RATE} + FOR ${index} IN RANGE 1 ${count}+1 + MdsalLowlevel.Start_Publish_Notifications ${DNB_TESTED_MEMBER_INDEX} ${DNB_PUBLISHER_LISTENER_PREFIX}${index} ${test_duration_in_seconds} ${DNB_PUBLISHER_SUBSCRIBER_PAIR_RATE} + END ${getter} = ScalarClosures.Closure_From_Keyword_And_Arguments Get_Notifications_Active_Status ${DNB_TESTED_MEMBER_INDEX} ${count} ${validator} = ScalarClosures.Closure_From_Keyword_And_Arguments Check_Notifications_Active_Status data_holder ${validation_timeout} = BuiltIn.Evaluate ${test_duration_in_seconds}+${60} @@ -39,16 +41,17 @@ Dom_Notification_Broker_Test_Templ ${sum_local_number} BuiltIn.Set_Variable ${0} ${low_limit_pair_rate} = BuiltIn.Evaluate 0.9*${DNB_PUBLISHER_SUBSCRIBER_PAIR_RATE} ${high_limit_pair_rate} = BuiltIn.Evaluate 1.1*${DNB_PUBLISHER_SUBSCRIBER_PAIR_RATE} - : FOR ${index} IN RANGE 1 ${count}+1 - \ ${all_not} ${id_not} ${err_not} ${local_number} = MdsalLowlevel.Unsubscribe_Ynl ${DNB_TESTED_MEMBER_INDEX} - \ ... ${DNB_PUBLISHER_LISTENER_PREFIX}${index} - \ BuiltIn.Should_Be_Equal_As_Numbers ${err_not} ${0} - \ BuiltIn.Should_Not_Be_Equal_As_Numbers ${local_number} ${0} - \ BuiltIn.Should_Be_Equal_As_Numbers ${id_not} ${local_number} - \ ${rate} = BuiltIn.Evaluate ${local_number}/${test_duration_in_seconds} - \ BuiltIn.Should_Be_True ${rate} > ${low_limit_pair_rate} - \ BuiltIn.Should_Be_True ${rate} < ${high_limit_pair_rate} - \ ${sum_local_number} = BuiltIn.Evaluate ${sum_local_number}+${local_number} + FOR ${index} IN RANGE 1 ${count}+1 + ${all_not} ${id_not} ${err_not} ${local_number} = MdsalLowlevel.Unsubscribe_Ynl ${DNB_TESTED_MEMBER_INDEX} + ... ${DNB_PUBLISHER_LISTENER_PREFIX}${index} + BuiltIn.Should_Be_Equal_As_Numbers ${err_not} ${0} + BuiltIn.Should_Not_Be_Equal_As_Numbers ${local_number} ${0} + BuiltIn.Should_Be_Equal_As_Numbers ${id_not} ${local_number} + ${rate} = BuiltIn.Evaluate ${local_number}/${test_duration_in_seconds} + BuiltIn.Should_Be_True ${rate} > ${low_limit_pair_rate} + BuiltIn.Should_Be_True ${rate} < ${high_limit_pair_rate} + ${sum_local_number} = BuiltIn.Evaluate ${sum_local_number}+${local_number} + END ${final_rate} = BuiltIn.Evaluate ${sum_local_number}/${test_duration_in_seconds} ${low_limit_final_rate} = BuiltIn.Evaluate 0.9*${total_notification_rate} ${high_limit_final_rate} = BuiltIn.Evaluate 1.1*${total_notification_rate} @@ -58,13 +61,15 @@ Dom_Notification_Broker_Test_Templ Get_Notifications_Active_Status [Arguments] ${node_to_ask} ${nr_pairs} ${active_list} = BuiltIn.Create_List - : FOR ${index} IN RANGE 1 ${nr_pairs}+1 - \ ${active} ${publ_count} ${last_error} MdsalLowlevel.Check_Publish_Notifications ${node_to_ask} ${DNB_PUBLISHER_LISTENER_PREFIX}${index} - \ Collections.Append_To_List ${active_list} ${active} - \ BuiltIn.Should_Be_Equal ${EMPTY} ${last_error} + FOR ${index} IN RANGE 1 ${nr_pairs}+1 + ${active} ${publ_count} ${last_error} MdsalLowlevel.Check_Publish_Notifications ${node_to_ask} ${DNB_PUBLISHER_LISTENER_PREFIX}${index} + Collections.Append_To_List ${active_list} ${active} + BuiltIn.Should_Be_Equal ${EMPTY} ${last_error} + END BuiltIn.Return_From_Keyword ${active_list} Check_Notifications_Active_Status [Arguments] ${active_list} - : FOR ${active} IN @{active_list} - \ BuiltIn.Should_Be_Equal ${False} ${active} + FOR ${active} IN @{active_list} + BuiltIn.Should_Be_Equal ${False} ${active} + END diff --git a/csit/libraries/controller/DrbCommons.robot b/csit/libraries/controller/DrbCommons.robot index 16835d2440..1bbd0ab208 100644 --- a/csit/libraries/controller/DrbCommons.robot +++ b/csit/libraries/controller/DrbCommons.robot @@ -84,26 +84,30 @@ Unregister_Action_And_Update_Possible_Constants Register_Rpc_On_Nodes [Arguments] ${index_list} [Documentation] Register global rpc on given nodes of the cluster. - : FOR ${index} IN @{index_list} - \ Register_Rpc_And_Update_Possible_Constants ${index} + FOR ${index} IN @{index_list} + Register_Rpc_And_Update_Possible_Constants ${index} + END Unregister_Rpc_On_Nodes [Arguments] ${index_list} [Documentation] Unregister global rpc on given nodes of the cluster. - : FOR ${index} IN @{index_list} - \ Unregister_Rpc_And_Update_Possible_Constants ${index} + FOR ${index} IN @{index_list} + Unregister_Rpc_And_Update_Possible_Constants ${index} + END Register_Action_On_Nodes [Arguments] ${index_list} [Documentation] Register global rpc on given nodes of the cluster. - : FOR ${index} IN @{index_list} - \ Register_Action_And_Update_Possible_Constants ${index} + FOR ${index} IN @{index_list} + Register_Action_And_Update_Possible_Constants ${index} + END Unregister_Action_On_Nodes [Arguments] ${index_list} [Documentation] Unregister global rpc on given nodes of the cluster. - : FOR ${index} IN @{index_list} - \ Unregister_Action_And_Update_Possible_Constants ${index} + FOR ${index} IN @{index_list} + Unregister_Action_And_Update_Possible_Constants ${index} + END Verify_Constant_On_Registered_Node [Arguments] ${member_index} @@ -138,20 +142,23 @@ Verify_Contexted_Constant_On_Unregistered_Node Verify_Constant_On_Registered_Nodes [Arguments] ${index_list} [Documentation] Verify that the rpc response comes from the local node for every node in the list. - : FOR ${index} IN @{index_list} - \ Verify_Constant_On_Registered_Node ${index} + FOR ${index} IN @{index_list} + Verify_Constant_On_Registered_Node ${index} + END Verify_Contexted_Constant_On_Registered_Nodes [Arguments] ${index_list} [Documentation] Verify that the rpc response comes from the local node for every node in the list. - : FOR ${index} IN @{index_list} - \ Verify_Contexted_Constant_On_Registered_Node ${index} + FOR ${index} IN @{index_list} + Verify_Contexted_Constant_On_Registered_Node ${index} + END Verify_Constant_On_Unregistered_Nodes [Arguments] ${index_list} [Documentation] Verify that the rpc response comes from the remote node for every node in the list. - : FOR ${index} IN @{index_list} - \ Verify_Constant_On_Unregistered_Node ${index} + FOR ${index} IN @{index_list} + Verify_Constant_On_Unregistered_Node ${index} + END Verify_Constant_On_Active_Nodes [Arguments] ${tolerance}=${BUG_8430_TOLERANCE} @@ -159,9 +166,10 @@ Verify_Constant_On_Active_Nodes ... As a workaround for Bug 8430, \${tolerance} can be set as duration (number of seconds) for WUKS. # TODO: Rename most Verify_* keywords to Check_* and use the Verify prefix for the WUKS versions. BuiltIn.Run_Keyword_And_Return_If ${tolerance} BuiltIn.Wait_Until_Keyword_Succeeds ${tolerance} 1s Verify_Constant_On_Active_Nodes tolerance=0 - : FOR ${index} IN @{active_indices} - \ BuiltIn.Run_Keyword_If ${index} in ${registered_indices} Verify_Constant_On_Registered_Node ${index} - \ ... ELSE Verify_Constant_On_Unregistered_Node ${index} + FOR ${index} IN @{active_indices} + BuiltIn.Run_Keyword_If ${index} in ${registered_indices} Verify_Constant_On_Registered_Node ${index} + ... ELSE Verify_Constant_On_Unregistered_Node ${index} + END Verify_Contexted_Constant_On_Active_Nodes [Arguments] ${tolerance}=${BUG_8430_TOLERANCE} @@ -169,16 +177,18 @@ Verify_Contexted_Constant_On_Active_Nodes ... As a workaround for Bug 8430, \${tolerance} can be set as duration (number of seconds) for WUKS. # TODO: Rename most Verify_* keywords to Check_* and use the Verify prefix for the WUKS versions. BuiltIn.Run_Keyword_And_Return_If ${tolerance} BuiltIn.Wait_Until_Keyword_Succeeds ${tolerance} 1s Verify_Contexted_Constant_On_Active_Nodes tolerance=0 - : FOR ${index} IN @{active_indices} - \ BuiltIn.Run_Keyword_If ${index} in ${registered_indices} Verify_Contexted_Constant_On_Registered_Node ${index} - \ ... ELSE Verify_Contexted_Constant_On_Unregistered_Node ${index} + FOR ${index} IN @{active_indices} + BuiltIn.Run_Keyword_If ${index} in ${registered_indices} Verify_Contexted_Constant_On_Registered_Node ${index} + ... ELSE Verify_Contexted_Constant_On_Unregistered_Node ${index} + END Verify_Expected_Constant_On_Nodes [Arguments] ${index_list} ${exp_constant} [Documentation] Verify that the rpc response comes only from one node only for every node in the list. - : FOR ${index} IN @{index_list} - \ ${const_index} = Get_Constant_Index_From_Node ${index} - \ BuiltIn.Should_Be_Equal_As_Strings ${exp_constant} ${CONSTANT_PREFIX}${const_index} + FOR ${index} IN @{index_list} + ${const_index} = Get_Constant_Index_From_Node ${index} + BuiltIn.Should_Be_Equal_As_Strings ${exp_constant} ${CONSTANT_PREFIX}${const_index} + END Get_Constant_Index_From_Node [Arguments] ${member_index} diff --git a/csit/suites/bgpcep/bgpclustering/005_Cluster_Reset_And_Set_Nonreplicated_Bgp_Rib.robot b/csit/suites/bgpcep/bgpclustering/005_Cluster_Reset_And_Set_Nonreplicated_Bgp_Rib.robot index f570e08e78..793849f653 100644 --- a/csit/suites/bgpcep/bgpclustering/005_Cluster_Reset_And_Set_Nonreplicated_Bgp_Rib.robot +++ b/csit/suites/bgpcep/bgpclustering/005_Cluster_Reset_And_Set_Nonreplicated_Bgp_Rib.robot @@ -37,9 +37,10 @@ Store_Karaf_Log_And_Clean_All Upload_Initial_Config_Files [Documentation] Upload config files for non-replicated bgp_rib - : FOR ${idx} IN @{ClusterManagement__member_index_list} - \ ${idxl}= BuiltIn.Create_List ${idx} - \ ClusterManagement.Safe_With_Ssh_To_List_Or_All_Run_Keyword member_index_list=${idxl} keyword_name=Set_Config_Files_With_Nonreplicated_Rib index_list=${idxl} + FOR ${idx} IN @{ClusterManagement__member_index_list} + ${idxl}= BuiltIn.Create_List ${idx} + ClusterManagement.Safe_With_Ssh_To_List_Or_All_Run_Keyword member_index_list=${idxl} keyword_name=Set_Config_Files_With_Nonreplicated_Rib index_list=${idxl} + END Start_All_And_Sync [Documentation] Start each memberand wait for sync. diff --git a/csit/suites/bgpcep/bgpclustering/PrefixcountKeywords.robot b/csit/suites/bgpcep/bgpclustering/PrefixcountKeywords.robot index 5ae8349c15..d4ae715aa6 100644 --- a/csit/suites/bgpcep/bgpclustering/PrefixcountKeywords.robot +++ b/csit/suites/bgpcep/bgpclustering/PrefixcountKeywords.robot @@ -61,9 +61,10 @@ Setup_Everything SetupUtils.Setup_Utils_For_Setup_And_Teardown http_timeout=125 PrefixCounting.PC_Setup ${indices} = ClusterManagement.List_All_Indices - : FOR ${member_index} IN @{indices} - \ ${session} = ClusterManagement.Resolve_Http_Session_For_Member ${member_index} - \ BuiltIn.Set_Suite_Variable ${operational_${member_index}} ${session} + FOR ${member_index} IN @{indices} + ${session} = ClusterManagement.Resolve_Http_Session_For_Member ${member_index} + BuiltIn.Set_Suite_Variable ${operational_${member_index}} ${session} + END BuiltIn.Set_Suite_Variable ${pc_all_indices} ${indices} SSHLibrary.Set_Default_Configuration prompt=${TOOLS_SYSTEM_PROMPT} SSHLibrary.Open_Connection ${TOOLS_SYSTEM_IP} @@ -102,12 +103,13 @@ Start_Bgp_Peer_And_Verify_Connected [Documentation] Starts the peer and verifies its connection. The verification is done by checking the presence ... of the peer in the bgp rib. # TODO: This keyword is not specific to prefix counting. Find a better place for it. - : FOR ${idx} IN RANGE ${connection_retries} - \ Start_Bgp_Peer peerip=${peerip} - \ ${status} ${value}= BuiltIn.Run_Keyword_And_Ignore_Error BuiltIn.Wait_Until_Keyword_Succeeds 3x 3s - \ ... Verify_Bgp_Peer_Connection ${config_session} ${TOOLS_SYSTEM_IP} connected=${True} - \ BuiltIn.Run_Keyword_Unless "${status}" == "PASS" BGPSpeaker.Kill_BGP_Speaker - \ BuiltIn.Return_From_Keyword_If "${status}" == "PASS" + FOR ${idx} IN RANGE ${connection_retries} + Start_Bgp_Peer peerip=${peerip} + ${status} ${value}= BuiltIn.Run_Keyword_And_Ignore_Error BuiltIn.Wait_Until_Keyword_Succeeds 3x 3s + ... Verify_Bgp_Peer_Connection ${config_session} ${TOOLS_SYSTEM_IP} connected=${True} + BuiltIn.Run_Keyword_Unless "${status}" == "PASS" BGPSpeaker.Kill_BGP_Speaker + BuiltIn.Return_From_Keyword_If "${status}" == "PASS" + END BuiltIn.Fail Unable to connect bgp peer to ODL Verify_Bgp_Peer_Connection diff --git a/csit/suites/bgpcep/bgpclustering/singlepeer_pc_shm_300kroutes.robot b/csit/suites/bgpcep/bgpclustering/singlepeer_pc_shm_300kroutes.robot index 78b7f64830..6ee18dbef9 100644 --- a/csit/suites/bgpcep/bgpclustering/singlepeer_pc_shm_300kroutes.robot +++ b/csit/suites/bgpcep/bgpclustering/singlepeer_pc_shm_300kroutes.robot @@ -50,8 +50,9 @@ Check_For_Empty_Ipv4_Topology_Before_Talking [Documentation] Wait for ${EXAMPLE_IPV4_TOPOLOGY} to come up and empty. Give large timeout for case when BGP boots slower than restconf. [Tags] critical [Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing - : FOR ${member_index} IN @{pc_all_indices} - \ BuiltIn.Wait_Until_Keyword_Succeeds ${INITIAL_RESTCONF_TIMEOUT} 1s PrefixCounting.Check_Ipv4_Topology_Is_Empty session=${operational_${member_index}} topology=${EXAMPLE_IPV4_TOPOLOGY} + FOR ${member_index} IN @{pc_all_indices} + BuiltIn.Wait_Until_Keyword_Succeeds ${INITIAL_RESTCONF_TIMEOUT} 1s PrefixCounting.Check_Ipv4_Topology_Is_Empty session=${operational_${member_index}} topology=${EXAMPLE_IPV4_TOPOLOGY} + END Reconfigure_ODL_To_Accept_Connection [Documentation] Configure BGP peer module with initiate-connection set to false. @@ -67,16 +68,18 @@ Start_Talking_BGP_Speaker Wait_For_Stable_Talking_Ipv4_Topology [Documentation] Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable. This is done by checking stability of prefix count as seen from all nodes. - : FOR ${member_index} IN @{pc_all_indices} - \ PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable timeout=${bgp_filling_timeout} period=${CHECK_PERIOD} repetitions=${REPETITIONS} excluded_count=0 session=${operational_${member_index}} - \ ... topology=${EXAMPLE_IPV4_TOPOLOGY} shards_list=${SHARD_MONITOR_LIST} shards_details=${init_shard_details} + FOR ${member_index} IN @{pc_all_indices} + PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable timeout=${bgp_filling_timeout} period=${CHECK_PERIOD} repetitions=${REPETITIONS} excluded_count=0 session=${operational_${member_index}} + ... topology=${EXAMPLE_IPV4_TOPOLOGY} shards_list=${SHARD_MONITOR_LIST} shards_details=${init_shard_details} + END Check_Talking_Ipv4_Topology_Count [Documentation] Count the routes in ${EXAMPLE_IPV4_TOPOLOGY} and fail if the count is not correct as seen from node 1. [Tags] critical [Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing - : FOR ${member_index} IN @{pc_all_indices} - \ PrefixCounting.Check_Ipv4_Topology_Count ${COUNT} session=${operational_${member_index}} topology=${EXAMPLE_IPV4_TOPOLOGY} + FOR ${member_index} IN @{pc_all_indices} + PrefixCounting.Check_Ipv4_Topology_Count ${COUNT} session=${operational_${member_index}} topology=${EXAMPLE_IPV4_TOPOLOGY} + END Kill_Talking_BGP_Speaker [Documentation] Abort the Python speaker. Also, attempt to stop failing fast. @@ -88,16 +91,18 @@ Kill_Talking_BGP_Speaker Wait_For_Stable_Ipv4_Topology_After_Listening [Documentation] Wait until ${EXAMPLE_IPV4_TOPOLOGY} becomes stable again as seen from node 1. [Tags] critical - : FOR ${member_index} IN @{pc_all_indices} - \ PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable timeout=${bgp_filling_timeout} period=${CHECK_PERIOD} repetitions=${REPETITIONS} excluded_count=${COUNT} session=${operational_${member_index}} - \ ... topology=${EXAMPLE_IPV4_TOPOLOGY} + FOR ${member_index} IN @{pc_all_indices} + PrefixCounting.Wait_For_Ipv4_Topology_Prefixes_To_Become_Stable timeout=${bgp_filling_timeout} period=${CHECK_PERIOD} repetitions=${REPETITIONS} excluded_count=${COUNT} session=${operational_${member_index}} + ... topology=${EXAMPLE_IPV4_TOPOLOGY} + END Check_For_Empty_Ipv4_Topology_After_Listening [Documentation] Example-ipv4-topology should be empty now as seen from node 1. [Tags] critical [Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing - : FOR ${member_index} IN @{pc_all_indices} - \ PrefixCounting.Check_Ipv4_Topology_Is_Empty session=${operational_${member_index}} topology=${EXAMPLE_IPV4_TOPOLOGY} + FOR ${member_index} IN @{pc_all_indices} + PrefixCounting.Check_Ipv4_Topology_Is_Empty session=${operational_${member_index}} topology=${EXAMPLE_IPV4_TOPOLOGY} + END Delete_Bgp_Peer_Configuration [Documentation] Revert the BGP configuration to the original state: without any configured peers. diff --git a/csit/suites/bgpcep/bgpflowspec/010_bgp_flowspec.robot b/csit/suites/bgpcep/bgpflowspec/010_bgp_flowspec.robot index f09cdf5328..baebff5145 100644 --- a/csit/suites/bgpcep/bgpflowspec/010_bgp_flowspec.robot +++ b/csit/suites/bgpcep/bgpflowspec/010_bgp_flowspec.robot @@ -85,11 +85,12 @@ Upload_Config_Files [Documentation] Uploads exabgp config files SSHLibrary.Put_Directory ${BGP_VARIABLES_FOLDER} . @{cfgfiles} = SSHLibrary.List_Files_In_Directory . *.cfg - : FOR ${cfgfile} IN @{cfgfiles} - \ SSHLibrary.Execute_Command sed -i -e 's/EXABGPIP/${TOOLS_SYSTEM_IP}/g' ${cfgfile} - \ SSHLibrary.Execute_Command sed -i -e 's/ODLIP/${ODL_SYSTEM_IP}/g' ${cfgfile} - \ ${stdout}= SSHLibrary.Execute_Command cat ${cfgfile} - \ Log ${stdout} + FOR ${cfgfile} IN @{cfgfiles} + SSHLibrary.Execute_Command sed -i -e 's/EXABGPIP/${TOOLS_SYSTEM_IP}/g' ${cfgfile} + SSHLibrary.Execute_Command sed -i -e 's/ODLIP/${ODL_SYSTEM_IP}/g' ${cfgfile} + ${stdout}= SSHLibrary.Execute_Command cat ${cfgfile} + Log ${stdout} + END Setup_Testcase [Arguments] ${cfg_file} diff --git a/csit/suites/bgpcep/bgpfunct/010_bgp_functional_l3vpn.robot b/csit/suites/bgpcep/bgpfunct/010_bgp_functional_l3vpn.robot index 1fe29d9e92..d1af663e07 100644 --- a/csit/suites/bgpcep/bgpfunct/010_bgp_functional_l3vpn.robot +++ b/csit/suites/bgpcep/bgpfunct/010_bgp_functional_l3vpn.robot @@ -142,13 +142,14 @@ Upload_Config_Files SSHLibrary.Put_File ${BGP_L3VPN_DIR}/${L3VPN_EXA_CFG} . SSHLibrary.Put_File ${EXARPCSCRIPT} . @{cfgfiles}= SSHLibrary.List_Files_In_Directory . *.cfg - : FOR ${cfgfile} IN @{cfgfiles} - \ SSHLibrary.Execute_Command sed -i -e 's/EXABGPIP/${TOOLS_SYSTEM_IP}/g' ${cfgfile} - \ SSHLibrary.Execute_Command sed -i -e 's/ODLIP/${ODL_SYSTEM_IP}/g' ${cfgfile} - \ SSHLibrary.Execute_Command sed -i -e 's/ROUTEREFRESH/disable/g' ${cfgfile} - \ SSHLibrary.Execute_Command sed -i -e 's/ADDPATH/disable/g' ${cfgfile} - \ ${stdout}= SSHLibrary.Execute_Command cat ${cfgfile} - \ Log ${stdout} + FOR ${cfgfile} IN @{cfgfiles} + SSHLibrary.Execute_Command sed -i -e 's/EXABGPIP/${TOOLS_SYSTEM_IP}/g' ${cfgfile} + SSHLibrary.Execute_Command sed -i -e 's/ODLIP/${ODL_SYSTEM_IP}/g' ${cfgfile} + SSHLibrary.Execute_Command sed -i -e 's/ROUTEREFRESH/disable/g' ${cfgfile} + SSHLibrary.Execute_Command sed -i -e 's/ADDPATH/disable/g' ${cfgfile} + ${stdout}= SSHLibrary.Execute_Command cat ${cfgfile} + Log ${stdout} + END Setup_Testcase [Arguments] ${cfg_file} diff --git a/csit/suites/bgpcep/bgpfunct/020_bgp_functional_multipath.robot b/csit/suites/bgpcep/bgpfunct/020_bgp_functional_multipath.robot index 518439387b..0d05138532 100644 --- a/csit/suites/bgpcep/bgpfunct/020_bgp_functional_multipath.robot +++ b/csit/suites/bgpcep/bgpfunct/020_bgp_functional_multipath.robot @@ -106,13 +106,14 @@ Upload_Config_Files SSHLibrary.Put_File ${BGP_VAR_FOLDER}/${DEFAUTL_RPC_CFG} . SSHLibrary.Put_File ${EXARPCSCRIPT} . @{cfgfiles}= SSHLibrary.List_Files_In_Directory . *.cfg - : FOR ${cfgfile} IN @{cfgfiles} - \ SSHLibrary.Execute_Command sed -i -e 's/EXABGPIP/${TOOLS_SYSTEM_IP}/g' ${cfgfile} - \ SSHLibrary.Execute_Command sed -i -e 's/ODLIP/${ODL_SYSTEM_IP}/g' ${cfgfile} - \ SSHLibrary.Execute_Command sed -i -e 's/ROUTEREFRESH/enable/g' ${cfgfile} - \ SSHLibrary.Execute_Command sed -i -e 's/ADDPATH/${addpath}/g' ${cfgfile} - \ ${stdout}= SSHLibrary.Execute_Command cat ${cfgfile} - \ Log ${stdout} + FOR ${cfgfile} IN @{cfgfiles} + SSHLibrary.Execute_Command sed -i -e 's/EXABGPIP/${TOOLS_SYSTEM_IP}/g' ${cfgfile} + SSHLibrary.Execute_Command sed -i -e 's/ODLIP/${ODL_SYSTEM_IP}/g' ${cfgfile} + SSHLibrary.Execute_Command sed -i -e 's/ROUTEREFRESH/enable/g' ${cfgfile} + SSHLibrary.Execute_Command sed -i -e 's/ADDPATH/${addpath}/g' ${cfgfile} + ${stdout}= SSHLibrary.Execute_Command cat ${cfgfile} + Log ${stdout} + END Configure_Path_Selection_And_App_Peer_And_Connect_Peer [Arguments] ${odl_path_sel_mode} ${exa_add_path_value} @@ -181,9 +182,10 @@ Configure_App_Peer_With_Routes &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} APP_PEER_NAME=${APP_PEER_NAME} RIB_INSTANCE_NAME=${RIB_INSTANCE} APP_PEER_ID=${ODL_SYSTEM_IP} IP=${ODL_SYSTEM_IP} ... BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG} TemplatedRequests.Put_As_Xml_Templated ${BGP_VAR_FOLDER}/app_peer mapping=${mapping} session=${CONFIG_SESSION} - : FOR ${pathid} IN @{PATH_ID_LIST} - \ &{route_mapping} BuiltIn.Create_Dictionary NEXTHOP=${NEXT_HOP_PREF}${pathid} LOCALPREF=${pathid}00 PATHID=${pathid} APP_RIB=${app_rib} - \ TemplatedRequests.Post_As_Xml_Templated ${MULT_VAR_FOLDER}/route mapping=${route_mapping} session=${CONFIG_SESSION} + FOR ${pathid} IN @{PATH_ID_LIST} + &{route_mapping} BuiltIn.Create_Dictionary NEXTHOP=${NEXT_HOP_PREF}${pathid} LOCALPREF=${pathid}00 PATHID=${pathid} APP_RIB=${app_rib} + TemplatedRequests.Post_As_Xml_Templated ${MULT_VAR_FOLDER}/route mapping=${route_mapping} session=${CONFIG_SESSION} + END Deconfigure_App_Peer [Documentation] Revert the BGP configuration to the original state: without application peer diff --git a/csit/suites/bgpcep/bgpfunct/040_bgp_functional_route_ref.robot b/csit/suites/bgpcep/bgpfunct/040_bgp_functional_route_ref.robot index 25138525a9..c72121ac03 100644 --- a/csit/suites/bgpcep/bgpfunct/040_bgp_functional_route_ref.robot +++ b/csit/suites/bgpcep/bgpfunct/040_bgp_functional_route_ref.robot @@ -116,21 +116,23 @@ Upload_Config_Files SSHLibrary.Put_File ${BGP_VAR_FOLDER}/${BGP_CFG_NAME} . SSHLibrary.Put_File ${EXARPCSCRIPT} . @{cfgfiles}= SSHLibrary.List_Files_In_Directory . *.cfg - : FOR ${cfgfile} IN @{cfgfiles} - \ SSHLibrary.Execute_Command sed -i -e 's/EXABGPIP/${TOOLS_SYSTEM_IP}/g' ${cfgfile} - \ SSHLibrary.Execute_Command sed -i -e 's/ODLIP/${ODL_SYSTEM_IP}/g' ${cfgfile} - \ SSHLibrary.Execute_Command sed -i -e 's/ROUTEREFRESH/enable/g' ${cfgfile} - \ SSHLibrary.Execute_Command sed -i -e 's/ADDPATH/disable/g' ${cfgfile} - \ ${stdout}= SSHLibrary.Execute_Command cat ${cfgfile} - \ Log ${stdout} + FOR ${cfgfile} IN @{cfgfiles} + SSHLibrary.Execute_Command sed -i -e 's/EXABGPIP/${TOOLS_SYSTEM_IP}/g' ${cfgfile} + SSHLibrary.Execute_Command sed -i -e 's/ODLIP/${ODL_SYSTEM_IP}/g' ${cfgfile} + SSHLibrary.Execute_Command sed -i -e 's/ROUTEREFRESH/enable/g' ${cfgfile} + SSHLibrary.Execute_Command sed -i -e 's/ADDPATH/disable/g' ${cfgfile} + ${stdout}= SSHLibrary.Execute_Command cat ${cfgfile} + Log ${stdout} + END Configure_Routes_And_Start_ExaBgp [Arguments] ${cfg_file} [Documentation] Setup keyword for exa to odl test case ${app_rib} Set Variable ${ODL_SYSTEM_IP} - : FOR ${prefix} IN 1.1.1.1/32 2.2.2.2/32 - \ &{mapping} BuiltIn.Create_Dictionary PREFIX=${prefix} APP_RIB=${app_rib} - \ TemplatedRequests.Post_As_Xml_Templated ${BGP_RR_VAR_FOLDER}/route mapping=${mapping} session=${CONFIG_SESSION} + FOR ${prefix} IN 1.1.1.1/32 2.2.2.2/32 + &{mapping} BuiltIn.Create_Dictionary PREFIX=${prefix} APP_RIB=${app_rib} + TemplatedRequests.Post_As_Xml_Templated ${BGP_RR_VAR_FOLDER}/route mapping=${mapping} session=${CONFIG_SESSION} + END ExaBgpLib.Start_ExaBgp_And_Verify_Connected ${cfg_file} ${CONFIG_SESSION} ${TOOLS_SYSTEM_IP} Comment From neon onwards there are extra BGP End-Of-RIB message per address family ${update_count} CompareStream.Set_Variable_If_At_Most_Fluorine 2 4 @@ -176,8 +178,9 @@ Verify_Cli_Output_Count String.Get Line Count ${output} BuiltIn.Log ${expstate} ${expected_line_count} String.Get Line Count ${expstate} - : FOR ${expected_line_pos} IN RANGE 0 ${expected_line_count-1} - \ ${expected_line_offset} BuiltIn.Evaluate ${MSG_STATE_OFFSET} + ${expected_line_pos} - \ ${output_line} String.Get Line ${output} ${expected_line_offset} - \ ${expected_line} String.Get Line ${expstate} ${expected_line_pos} - \ BuiltIn.Should Match ${output_line} ${expected_line} + FOR ${expected_line_pos} IN RANGE 0 ${expected_line_count-1} + ${expected_line_offset} BuiltIn.Evaluate ${MSG_STATE_OFFSET} + ${expected_line_pos} + ${output_line} String.Get Line ${output} ${expected_line_offset} + ${expected_line} String.Get Line ${expstate} ${expected_line_pos} + BuiltIn.Should Match ${output_line} ${expected_line} + END diff --git a/csit/suites/bgpcep/bgpfunct/090_bgp_functional_rt_constrain_validation.robot b/csit/suites/bgpcep/bgpfunct/090_bgp_functional_rt_constrain_validation.robot index 6d77b0463e..b471d4b734 100644 --- a/csit/suites/bgpcep/bgpfunct/090_bgp_functional_rt_constrain_validation.robot +++ b/csit/suites/bgpcep/bgpfunct/090_bgp_functional_rt_constrain_validation.robot @@ -55,19 +55,21 @@ ${NEW_AS_PATH} ${EMPTY} Reconfigure_ODL_To_Accept_Connection [Documentation] Configures BGP peer module with initiate-connection set to false. [Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing - : FOR ${i} ${type} IN ZIP ${ODL_IP_INDICES_ALL} ${BGP_PEER_TYPES} - \ &{ODL_CONFIG}= BuiltIn.Create_Dictionary IP=${ODL_${i}_IP} TYPE=${type} HOLDTIME=${HOLDTIME} PEER_PORT=${BGP_TOOL_PORT} - \ ... INITIATE=false BGP_RIB=${RIB_NAME} PASSIVE_MODE=true - \ TemplatedRequests.Put_As_Xml_Templated ${EBGP_DIR} mapping=${ODL_CONFIG} session=${CONFIG_SESSION} + FOR ${i} ${type} IN ZIP ${ODL_IP_INDICES_ALL} ${BGP_PEER_TYPES} + &{ODL_CONFIG}= BuiltIn.Create_Dictionary IP=${ODL_${i}_IP} TYPE=${type} HOLDTIME=${HOLDTIME} PEER_PORT=${BGP_TOOL_PORT} + ... INITIATE=false BGP_RIB=${RIB_NAME} PASSIVE_MODE=true + TemplatedRequests.Put_As_Xml_Templated ${EBGP_DIR} mapping=${ODL_CONFIG} session=${CONFIG_SESSION} + END Start_Bgp_Peers [Documentation] Start Python speaker to connect to ODL. We give each speaker time until odl really starts to accept incoming ... bgp connection. The failure happens if the incoming connection comes too quickly after configuring the peer. [Tags] local_run [Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing - : FOR ${i} ${as_number} IN ZIP ${ODL_IP_INDICES_ALL} ${BGP_PEER_AS_NUMBERS} - \ BuiltIn.Log_Many IP: ${ODL_${i}_IP} as_number: ${as_number} - \ Start_Bgp_Peer ${ODL_${i}_IP} ${as_number} 800${i} play.py.090.${i} + FOR ${i} ${as_number} IN ZIP ${ODL_IP_INDICES_ALL} ${BGP_PEER_AS_NUMBERS} + BuiltIn.Log_Many IP: ${ODL_${i}_IP} as_number: ${as_number} + Start_Bgp_Peer ${ODL_${i}_IP} ${as_number} 800${i} play.py.090.${i} + END Play_To_Odl_ext_l3vpn_rt_arg [Documentation] This TC sends route-target route containing route-target argument from node 1 to odl @@ -132,10 +134,11 @@ Kill_Talking_BGP_Speakers Delete_Bgp_Peers_Configuration [Documentation] Revert the BGP configuration to the original state: without any configured peers. [Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing - : FOR ${i} ${type} IN ZIP ${ODL_IP_INDICES_ALL} ${BGP_PEER_TYPES} - \ &{ODL_CONFIG} = BuiltIn.Create_Dictionary IP=${ODL_${i}_IP} TYPE=${type} HOLDTIME=${HOLDTIME} PEER_PORT=${BGP_TOOL_PORT} - \ ... INITIATE=false BGP_RIB=${RIB_NAME} PASSIVE_MODE=true - \ TemplatedRequests.Delete_Templated ${EBGP_DIR} mapping=${ODL_CONFIG} session=${CONFIG_SESSION} + FOR ${i} ${type} IN ZIP ${ODL_IP_INDICES_ALL} ${BGP_PEER_TYPES} + &{ODL_CONFIG} = BuiltIn.Create_Dictionary IP=${ODL_${i}_IP} TYPE=${type} HOLDTIME=${HOLDTIME} PEER_PORT=${BGP_TOOL_PORT} + ... INITIATE=false BGP_RIB=${RIB_NAME} PASSIVE_MODE=true + TemplatedRequests.Delete_Templated ${EBGP_DIR} mapping=${ODL_CONFIG} session=${CONFIG_SESSION} + END *** Keywords *** Start_Suite @@ -225,9 +228,10 @@ Get_Update_Message_And_Compare_With_Hex_BgpRpcClient4 Check_For_L3VPN_Odl_Avertisement [Arguments] ${announce_hex} [Documentation] Checks that each node received or did not receive update message containing given hex message. - : FOR ${i} ${option} IN ZIP ${ODL_IP_INDICES_ALL} ${L3VPN_RT_CHECK} - \ ${keyword_name}= BuiltIn.Set_Variable Get_Update_Message_And_Compare_With_Hex_BgpRpcClient${i} - \ BuiltIn.Run_Keyword ${keyword_name} ${announce_hex} ${option} + FOR ${i} ${option} IN ZIP ${ODL_IP_INDICES_ALL} ${L3VPN_RT_CHECK} + ${keyword_name}= BuiltIn.Set_Variable Get_Update_Message_And_Compare_With_Hex_BgpRpcClient${i} + BuiltIn.Run_Keyword ${keyword_name} ${announce_hex} ${option} + END Verify_Reported_Data [Arguments] ${url} ${exprspfile} diff --git a/csit/suites/bgpcep/bgpfunct/bgp_functional_md5.robot b/csit/suites/bgpcep/bgpfunct/bgp_functional_md5.robot index e9acf134bb..6fa33985d4 100644 --- a/csit/suites/bgpcep/bgpfunct/bgp_functional_md5.robot +++ b/csit/suites/bgpcep/bgpfunct/bgp_functional_md5.robot @@ -86,11 +86,12 @@ Upload_Config_Files [Documentation] Uploads exabgp config files SSHLibrary.Put_File ${BGP_VAR_FOLDER}${/}exa-md5.cfg . @{cfgfiles}= SSHLibrary.List_Files_In_Directory . *.cfg - : FOR ${cfgfile} IN @{cfgfiles} - \ SSHLibrary.Execute_Command sed -i -e 's/EXABGPIP/${TOOLS_SYSTEM_IP}/g' ${cfgfile} - \ SSHLibrary.Execute_Command sed -i -e 's/ODLIP/${ODL_SYSTEM_IP}/g' ${cfgfile} - \ SSHLibrary.Execute_Command sed -i -e 's/ROUTEREFRESH/enable/g' ${cfgfile} - \ SSHLibrary.Execute_Command sed -i -e 's/ADDPATH/disable/g' ${cfgfile} - \ SSHLibrary.Execute_Command sed -i -e 's/PASSWORD/${MD5_SAME_PASSWD}/g' ${cfgfile} - \ ${stdout}= SSHLibrary.Execute_Command cat ${cfgfile} - \ Log ${stdout} + FOR ${cfgfile} IN @{cfgfiles} + SSHLibrary.Execute_Command sed -i -e 's/EXABGPIP/${TOOLS_SYSTEM_IP}/g' ${cfgfile} + SSHLibrary.Execute_Command sed -i -e 's/ODLIP/${ODL_SYSTEM_IP}/g' ${cfgfile} + SSHLibrary.Execute_Command sed -i -e 's/ROUTEREFRESH/enable/g' ${cfgfile} + SSHLibrary.Execute_Command sed -i -e 's/ADDPATH/disable/g' ${cfgfile} + SSHLibrary.Execute_Command sed -i -e 's/PASSWORD/${MD5_SAME_PASSWD}/g' ${cfgfile} + ${stdout}= SSHLibrary.Execute_Command cat ${cfgfile} + Log ${stdout} + END diff --git a/csit/suites/bgpcep/bgpfunct/bgp_ipv6_basic.robot b/csit/suites/bgpcep/bgpfunct/bgp_ipv6_basic.robot index c772d75b82..9cf8e6bf2f 100644 --- a/csit/suites/bgpcep/bgpfunct/bgp_ipv6_basic.robot +++ b/csit/suites/bgpcep/bgpfunct/bgp_ipv6_basic.robot @@ -155,11 +155,12 @@ Upload_Config_Files [Documentation] Uploads exabgp config files SSHLibrary.Put_File ${BGP_VAR_FOLDER}/${EXABGP_CFG} . @{cfgfiles}= SSHLibrary.List_Files_In_Directory . *.cfg - : FOR ${cfgfile} IN @{cfgfiles} - \ SSHLibrary.Execute_Command sed -i -e 's/EXABGPIP/${IPV6_IP}/g' ${cfgfile} - \ SSHLibrary.Execute_Command sed -i -e 's/ODLIP/${CONTROLLER_IPV6}/g' ${cfgfile} - \ SSHLibrary.Execute_Command sed -i -e 's/ROUTERID/${EXABGP_ID}/g' ${cfgfile} - \ SSHLibrary.Execute_Command sed -i -e 's/ROUTEREFRESH/disable/g' ${cfgfile} - \ SSHLibrary.Execute_Command sed -i -e 's/ADDPATH/disable/g' ${cfgfile} - \ ${stdout}= SSHLibrary.Execute_Command cat ${cfgfile} - \ Log ${stdout} + FOR ${cfgfile} IN @{cfgfiles} + SSHLibrary.Execute_Command sed -i -e 's/EXABGPIP/${IPV6_IP}/g' ${cfgfile} + SSHLibrary.Execute_Command sed -i -e 's/ODLIP/${CONTROLLER_IPV6}/g' ${cfgfile} + SSHLibrary.Execute_Command sed -i -e 's/ROUTERID/${EXABGP_ID}/g' ${cfgfile} + SSHLibrary.Execute_Command sed -i -e 's/ROUTEREFRESH/disable/g' ${cfgfile} + SSHLibrary.Execute_Command sed -i -e 's/ADDPATH/disable/g' ${cfgfile} + ${stdout}= SSHLibrary.Execute_Command cat ${cfgfile} + Log ${stdout} + END diff --git a/csit/suites/bgpcep/bgpfunct/bgp_policies_default.robot b/csit/suites/bgpcep/bgpfunct/bgp_policies_default.robot index 32c22bda3b..5d4c20dc46 100644 --- a/csit/suites/bgpcep/bgpfunct/bgp_policies_default.robot +++ b/csit/suites/bgpcep/bgpfunct/bgp_policies_default.robot @@ -48,19 +48,21 @@ Configure_App_Peer Reconfigure_ODL_To_Accept_Connections [Documentation] Configure BGP peer modules with initiate-connection set to false. ... Configures 6 different peers, two internal, two external and two route-reflectors. - : FOR ${index} ${peer_type} IN ZIP ${NUMBERS} ${PEER_TYPES} - \ &{mapping} Create Dictionary IP=127.0.0.${index} HOLDTIME=${HOLDTIME} PASSIVE_MODE=true BGP_RIB_OPENCONFIG=${RIB_INSTANCE} - \ ... RIB_INSTANCE_NAME=${RIB_INSTANCE} - \ TemplatedRequests.Put_As_Xml_Templated ${POLICIES_VAR}${/}${peer_type} mapping=${mapping} session=${CONFIG_SESSION} + FOR ${index} ${peer_type} IN ZIP ${NUMBERS} ${PEER_TYPES} + &{mapping} Create Dictionary IP=127.0.0.${index} HOLDTIME=${HOLDTIME} PASSIVE_MODE=true BGP_RIB_OPENCONFIG=${RIB_INSTANCE} + ... RIB_INSTANCE_NAME=${RIB_INSTANCE} + TemplatedRequests.Put_As_Xml_Templated ${POLICIES_VAR}${/}${peer_type} mapping=${mapping} session=${CONFIG_SESSION} + END Start_Exabgps [Documentation] Start 6 exabgps as processes in background, each with it's own configuration. SSHKeywords.Virtual_Env_Activate_On_Current_Session log_output=${True} - : FOR ${index} IN @{NUMBERS} - \ ${start_cmd} BuiltIn.Set_Variable ${CMD} exabgp${index}.cfg > exa${index}.log & - \ BuiltIn.Log ${start_cmd} - \ ${output} SSHLibrary.Write ${start_cmd} - \ BuiltIn.Log ${output} + FOR ${index} IN @{NUMBERS} + ${start_cmd} BuiltIn.Set_Variable ${CMD} exabgp${index}.cfg > exa${index}.log & + BuiltIn.Log ${start_cmd} + ${output} SSHLibrary.Write ${start_cmd} + BuiltIn.Log ${output} + END Verify_Rib_Filled [Documentation] Verifies that sent routes are present in particular ribs. @@ -70,15 +72,17 @@ Verify_Rib_Filled Stop_All_Peers [Documentation] Send command to kill all exabgp processes running on controller ExaBgpLib.Stop_All_ExaBgps - : FOR ${index} IN @{NUMBERS} - \ BGPcliKeywords.Store_File_To_Workspace exa${index}.log exa${index}.log + FOR ${index} IN @{NUMBERS} + BGPcliKeywords.Store_File_To_Workspace exa${index}.log exa${index}.log + END Delete_Bgp_Peer_Configuration [Documentation] Revert the BGP configuration to the original state: without any configured peers. - : FOR ${index} ${peer_type} IN ZIP ${NUMBERS} ${PEER_TYPES} - \ &{mapping} Create Dictionary IP=127.0.0.${index} HOLDTIME=${HOLDTIME} PASSIVE_MODE=true BGP_RIB_OPENCONFIG=${RIB_INSTANCE} - \ ... RIB_INSTANCE_NAME=${RIB_INSTANCE} - \ TemplatedRequests.Delete_Templated ${POLICIES_VAR}/${peer_type} mapping=${mapping} session=${CONFIG_SESSION} + FOR ${index} ${peer_type} IN ZIP ${NUMBERS} ${PEER_TYPES} + &{mapping} Create Dictionary IP=127.0.0.${index} HOLDTIME=${HOLDTIME} PASSIVE_MODE=true BGP_RIB_OPENCONFIG=${RIB_INSTANCE} + ... RIB_INSTANCE_NAME=${RIB_INSTANCE} + TemplatedRequests.Delete_Templated ${POLICIES_VAR}/${peer_type} mapping=${mapping} session=${CONFIG_SESSION} + END Deconfigure_App_Peer [Documentation] Revert the BGP configuration to the original state: without application peer @@ -113,10 +117,11 @@ Verify_Rib_Status ${output} TemplatedRequests.Get_As_Json_Templated ${POLICIES_VAR}/rib_state session=${CONFIG_SESSION} BuiltIn.Log ${output} ${AS_PATH} = CompareStream.Set_Variable_If_At_Least_Neon ${NEW_AS_PATH} ${OLD_AS_PATH} - : FOR ${index} IN @{NUMBERS} - \ &{mapping} BuiltIn.Create_Dictionary IP=127.0.0.${index} AS_PATH=${AS_PATH} - \ BuiltIn.Wait_Until_Keyword_Succeeds 5x 3s TemplatedRequests.Get_As_Json_Templated ${POLICIES_VAR}/effective_rib_in/peer_${index} mapping=${mapping} - \ ... session=${CONFIG_SESSION} verify=True + FOR ${index} IN @{NUMBERS} + &{mapping} BuiltIn.Create_Dictionary IP=127.0.0.${index} AS_PATH=${AS_PATH} + BuiltIn.Wait_Until_Keyword_Succeeds 5x 3s TemplatedRequests.Get_As_Json_Templated ${POLICIES_VAR}/effective_rib_in/peer_${index} mapping=${mapping} + ... session=${CONFIG_SESSION} verify=True + END &{mapping} BuiltIn.Create_Dictionary IP=${ODL_SYSTEM_IP} AS_PATH=${AS_PATH} # application peer verification BuiltIn.Wait_Until_Keyword_Succeeds 5x 3s TemplatedRequests.Get_As_Json_Templated ${POLICIES_VAR}/app_peer_rib mapping=${mapping} session=${CONFIG_SESSION} @@ -129,12 +134,14 @@ Verify_Rib_Status_Empty Upload_Config_Files [Documentation] Uploads exabgp config files and replaces variables within those ... config files with desired values. - : FOR ${index} IN @{NUMBERS} - \ SSHLibrary.Put_File ${POLICIES_VAR}/exabgp_configs/exabgp${index}.cfg . + FOR ${index} IN @{NUMBERS} + SSHLibrary.Put_File ${POLICIES_VAR}/exabgp_configs/exabgp${index}.cfg . + END @{cfgfiles}= SSHLibrary.List_Files_In_Directory . *.cfg - : FOR ${cfgfile} IN @{cfgfiles} - \ SSHLibrary.Execute_Command sed -i -e 's/ODLIP/${ODL_SYSTEM_IP}/g' ${cfgfile} - \ SSHLibrary.Execute_Command sed -i -e 's/ROUTEREFRESH/disable/g' ${cfgfile} - \ SSHLibrary.Execute_Command sed -i -e 's/ADDPATH/disable/g' ${cfgfile} - \ ${stdout}= SSHLibrary.Execute_Command cat ${cfgfile} - \ Log ${stdout} + FOR ${cfgfile} IN @{cfgfiles} + SSHLibrary.Execute_Command sed -i -e 's/ODLIP/${ODL_SYSTEM_IP}/g' ${cfgfile} + SSHLibrary.Execute_Command sed -i -e 's/ROUTEREFRESH/disable/g' ${cfgfile} + SSHLibrary.Execute_Command sed -i -e 's/ADDPATH/disable/g' ${cfgfile} + ${stdout}= SSHLibrary.Execute_Command cat ${cfgfile} + Log ${stdout} + END diff --git a/csit/suites/bgpcep/bgpingest/manypeers_changecount.robot b/csit/suites/bgpcep/bgpingest/manypeers_changecount.robot index ec412ee08e..6880260458 100644 --- a/csit/suites/bgpcep/bgpingest/manypeers_changecount.robot +++ b/csit/suites/bgpcep/bgpingest/manypeers_changecount.robot @@ -109,15 +109,16 @@ Reconfigure_ODL_To_Accept_Connections [Documentation] Configure BGP peer modules with initiate-connection set to false. ... In Versions Fluorine and above, it sets peer-group as template, and than sets all neighbors using it. CompareStream.Run_Keyword_If_At_Least_Fluorine Configure_Peer_Group - : FOR ${index} IN RANGE 1 ${MULTIPLICITY_CHANGE_COUNT_MANY}+1 - \ ${peer_name} = BuiltIn.Set_Variable example-bgp-peer-${index} - \ ${peer_ip} = BuiltIn.Evaluate str(ipaddr.IPAddress('${FIRST_PEER_IP}') + ${index} - 1) modules=ipaddr - \ &{mapping} Create Dictionary DEVICE_NAME=${DEVICE_NAME} BGP_NAME=${peer_name} IP=${peer_ip} HOLDTIME=${HOLDTIME_CHANGE_COUNT_MANY} - \ ... PEER_PORT=${BGP_TOOL_PORT} INITIATE=false BGP_RIB=${RIB_INSTANCE} PASSIVE_MODE=true BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG} - \ ... RIB_INSTANCE_NAME=${RIB_INSTANCE} PEER_GROUP_NAME=${PEER_GROUP} RR_CLIENT=false - \ CompareStream.Run_Keyword_If_At_Least_Fluorine TemplatedRequests.Put_As_Xml_Templated ${BGP_VARIABLES_FOLDER}${/}bgp_peer_group mapping=${mapping} - \ CompareStream.Run_Keyword_If_Less_Than_Fluorine TemplatedRequests.Put_As_Xml_Templated ${BGP_VARIABLES_FOLDER}${/}bgp_peer mapping=${mapping} - # FIXME: Add testcase to change bgpcep and protocol log levels, when a Keyword that does it without messing with current connection is ready. + FOR ${index} IN RANGE 1 ${MULTIPLICITY_CHANGE_COUNT_MANY}+1 + ${peer_name} = BuiltIn.Set_Variable example-bgp-peer-${index} + ${peer_ip} = BuiltIn.Evaluate str(ipaddr.IPAddress('${FIRST_PEER_IP}') + ${index} - 1) modules=ipaddr + &{mapping} Create Dictionary DEVICE_NAME=${DEVICE_NAME} BGP_NAME=${peer_name} IP=${peer_ip} HOLDTIME=${HOLDTIME_CHANGE_COUNT_MANY} + ... PEER_PORT=${BGP_TOOL_PORT} INITIATE=false BGP_RIB=${RIB_INSTANCE} PASSIVE_MODE=true BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG} + ... RIB_INSTANCE_NAME=${RIB_INSTANCE} PEER_GROUP_NAME=${PEER_GROUP} RR_CLIENT=false + CompareStream.Run_Keyword_If_At_Least_Fluorine TemplatedRequests.Put_As_Xml_Templated ${BGP_VARIABLES_FOLDER}${/}bgp_peer_group mapping=${mapping} + CompareStream.Run_Keyword_If_Less_Than_Fluorine TemplatedRequests.Put_As_Xml_Templated ${BGP_VARIABLES_FOLDER}${/}bgp_peer mapping=${mapping} + # FIXME: Add testcase to change bgpcep and protocol log levels, when a Keyword that does it without messing with current connection is ready. + END Reconfigure_Data_Change_Counter [Documentation] Configure data change counter to count transactions in example-ipv4-topology instead of example-linkstate-topology. @@ -181,13 +182,14 @@ Delete_Bgp_Peer_Configuration [Documentation] Revert the BGP configuration to the original state: without any configured peers. [Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing # TODO: Is it useful to extract peer naming logic to separate Keyword? - : FOR ${index} IN RANGE 1 ${MULTIPLICITY_CHANGE_COUNT_MANY}+1 - \ ${peer_name} = BuiltIn.Set_Variable example-bgp-peer-${index} - \ ${peer_ip} = BuiltIn.Evaluate str(ipaddr.IPAddress('${FIRST_PEER_IP}') + ${index} - 1) modules=ipaddr - \ &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} BGP_NAME=${peer_name} IP=${peer_ip} BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG} - \ ... PEER_GROUP_NAME=${PEER_GROUP} RR_CLIENT=false - \ CompareStream.Run_Keyword_If_At_Least_Fluorine TemplatedRequests.Delete_Templated ${BGP_VARIABLES_FOLDER}${/}bgp_peer_group mapping=${mapping} - \ CompareStream.Run_Keyword_If_Less_Than_Fluorine TemplatedRequests.Delete_Templated ${BGP_VARIABLES_FOLDER}${/}bgp_peer mapping=${mapping} + FOR ${index} IN RANGE 1 ${MULTIPLICITY_CHANGE_COUNT_MANY}+1 + ${peer_name} = BuiltIn.Set_Variable example-bgp-peer-${index} + ${peer_ip} = BuiltIn.Evaluate str(ipaddr.IPAddress('${FIRST_PEER_IP}') + ${index} - 1) modules=ipaddr + &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} BGP_NAME=${peer_name} IP=${peer_ip} BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG} + ... PEER_GROUP_NAME=${PEER_GROUP} RR_CLIENT=false + CompareStream.Run_Keyword_If_At_Least_Fluorine TemplatedRequests.Delete_Templated ${BGP_VARIABLES_FOLDER}${/}bgp_peer_group mapping=${mapping} + CompareStream.Run_Keyword_If_Less_Than_Fluorine TemplatedRequests.Delete_Templated ${BGP_VARIABLES_FOLDER}${/}bgp_peer mapping=${mapping} + END CompareStream.Run_Keyword_If_At_Least_Fluorine Deconfigure_Peer_Group *** Keywords *** diff --git a/csit/suites/bgpcep/bgpingest/manypeers_peercount.robot b/csit/suites/bgpcep/bgpingest/manypeers_peercount.robot index 072f9caae3..b093a585fc 100644 --- a/csit/suites/bgpcep/bgpingest/manypeers_peercount.robot +++ b/csit/suites/bgpcep/bgpingest/manypeers_peercount.robot @@ -69,13 +69,14 @@ Check_For_Empty_Ipv4_Topology_Before_Talking Reconfigure_ODL_To_Accept_Connections [Documentation] Configure BGP peer modules with initiate-connection set to false. [Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing - : FOR ${index} IN RANGE 1 ${MULTIPLICITY_PREFIX_COUNT_MANY_RRC}+1 - \ ${peer_name} = BuiltIn.Set_Variable example-bgp-peer-${index} - \ ${peer_ip} = BuiltIn.Evaluate str(ipaddr.IPAddress('${FIRST_PEER_IP}') + ${index} - 1) modules=ipaddr - \ &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} NAME=${peer_name} IP=${peer_ip} HOLDTIME=${HOLDTIME_PREFIX_COUNT_MANY_RRC} - \ ... PEER_PORT=${BGP_TOOL_PORT} PEER_ROLE=rr-client INITIATE=false BGP_RIB=${RIB_INSTANCE} PASSIVE_MODE=true - \ ... BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG} RIB_INSTANCE_NAME=${RIB_INSTANCE} RR_CLIENT=true - \ TemplatedRequests.Put_As_Xml_Templated ${BGP_VARIABLES_FOLDER}${/}ibgp_peers mapping=${mapping} + FOR ${index} IN RANGE 1 ${MULTIPLICITY_PREFIX_COUNT_MANY_RRC}+1 + ${peer_name} = BuiltIn.Set_Variable example-bgp-peer-${index} + ${peer_ip} = BuiltIn.Evaluate str(ipaddr.IPAddress('${FIRST_PEER_IP}') + ${index} - 1) modules=ipaddr + &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} NAME=${peer_name} IP=${peer_ip} HOLDTIME=${HOLDTIME_PREFIX_COUNT_MANY_RRC} + ... PEER_PORT=${BGP_TOOL_PORT} PEER_ROLE=rr-client INITIATE=false BGP_RIB=${RIB_INSTANCE} PASSIVE_MODE=true + ... BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG} RIB_INSTANCE_NAME=${RIB_INSTANCE} RR_CLIENT=true + TemplatedRequests.Put_As_Xml_Templated ${BGP_VARIABLES_FOLDER}${/}ibgp_peers mapping=${mapping} + END Start_Talking_BGP_Manager [Documentation] Start Python manager to connect speakers to ODL. @@ -94,14 +95,15 @@ Check_Logs_For_Updates [Documentation] Check BGP peer logs for received updates. [Tags] critical ${timeout} = BuiltIn.Set_Variable ${bgp_filling_timeout} - : FOR ${index} IN RANGE 1 ${MULTIPLICITY_PREFIX_COUNT_MANY_RRC}+1 - \ ${bgp_peer_label} = BuiltIn.Set_Variable BGP-Dummy-${index} - \ ${expected_prefixcount} = BuiltIn.Evaluate ${COUNT_PREFIX_COUNT_MANY_RRC} - ${COUNT_PREFIX_COUNT_MANY_RRC} / ${MULTIPLICITY_PREFIX_COUNT_MANY_RRC} - \ ${expected_string} = BuiltIn.Set_Variable total_received_nlri_prefix_counter: ${expected_prefixcount} - \ BuiltIn.Wait_Until_Keyword_Succeeds ${timeout} 1s Check_File_For_Occurence ${BGP_PEERS_LOG_FILE_NAME} ${bgp_peer_label} - \ ... ${expected_string} 2 - \ ${timeout} = BuiltIn.Set_Variable 20s - # FIXME: Calculation of ${expected_prefixcount} correct just when the ${COUNT_PREFIX_COUNT_MANY_RRC} is a multiplication of ${MULTIPLICITY_PREFIX_COUNT_MANY_RRC} + FOR ${index} IN RANGE 1 ${MULTIPLICITY_PREFIX_COUNT_MANY_RRC}+1 + ${bgp_peer_label} = BuiltIn.Set_Variable BGP-Dummy-${index} + ${expected_prefixcount} = BuiltIn.Evaluate ${COUNT_PREFIX_COUNT_MANY_RRC} - ${COUNT_PREFIX_COUNT_MANY_RRC} / ${MULTIPLICITY_PREFIX_COUNT_MANY_RRC} + ${expected_string} = BuiltIn.Set_Variable total_received_nlri_prefix_counter: ${expected_prefixcount} + BuiltIn.Wait_Until_Keyword_Succeeds ${timeout} 1s Check_File_For_Occurence ${BGP_PEERS_LOG_FILE_NAME} ${bgp_peer_label} + ... ${expected_string} 2 + ${timeout} = BuiltIn.Set_Variable 20s + # FIXME: Calculation of ${expected_prefixcount} correct just when the ${COUNT_PREFIX_COUNT_MANY_RRC} is a multiplication of ${MULTIPLICITY_PREFIX_COUNT_MANY_RRC} + END Kill_Talking_BGP_Speakers [Documentation] Abort the Python speakers. Also, attempt to stop failing fast. @@ -128,11 +130,12 @@ Delete_Bgp_Peer_Configuration [Documentation] Revert the BGP configuration to the original state: without any configured peers. [Tags] critical [Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing - : FOR ${index} IN RANGE 1 ${MULTIPLICITY_PREFIX_COUNT_MANY_RRC}+1 - \ ${peer_name} = BuiltIn.Set_Variable example-bgp-peer-${index} - \ ${peer_ip} = BuiltIn.Evaluate str(ipaddr.IPAddress('${FIRST_PEER_IP}') + ${index} - 1) modules=ipaddr - \ &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} NAME=${peer_name} IP=${peer_ip} BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG} - \ TemplatedRequests.Delete_Templated ${BGP_VARIABLES_FOLDER}${/}ibgp_peers mapping=${mapping} + FOR ${index} IN RANGE 1 ${MULTIPLICITY_PREFIX_COUNT_MANY_RRC}+1 + ${peer_name} = BuiltIn.Set_Variable example-bgp-peer-${index} + ${peer_ip} = BuiltIn.Evaluate str(ipaddr.IPAddress('${FIRST_PEER_IP}') + ${index} - 1) modules=ipaddr + &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} NAME=${peer_name} IP=${peer_ip} BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG} + TemplatedRequests.Delete_Templated ${BGP_VARIABLES_FOLDER}${/}ibgp_peers mapping=${mapping} + END *** Keywords *** Setup_Everything diff --git a/csit/suites/bgpcep/bgpingest/manypeers_prefixcount.robot b/csit/suites/bgpcep/bgpingest/manypeers_prefixcount.robot index f0ef08de16..996c67d089 100644 --- a/csit/suites/bgpcep/bgpingest/manypeers_prefixcount.robot +++ b/csit/suites/bgpcep/bgpingest/manypeers_prefixcount.robot @@ -99,14 +99,15 @@ Check_For_Empty_Ipv4_Topology_Before_Talking Reconfigure_ODL_To_Accept_Connections [Documentation] Configure BGP peer modules with initiate-connection set to false. - : FOR ${index} IN RANGE 1 ${MULTIPLICITY_PREFIX_COUNT_MANY}+1 - \ ${peer_name} = BuiltIn.Set_Variable example-bgp-peer-${index} - \ ${peer_ip} = BuiltIn.Evaluate str(ipaddr.IPAddress('${FIRST_PEER_IP}') + ${index} - 1) modules=ipaddr - \ &{mapping} Create Dictionary DEVICE_NAME=${DEVICE_NAME} BGP_NAME=${peer_name} IP=${peer_ip} HOLDTIME=${HOLDTIME_PREFIX_COUNT_MANY} - \ ... PEER_PORT=${BGP_TOOL_PORT} INITIATE=false BGP_RIB=${RIB_INSTANCE} PASSIVE_MODE=true BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG} - \ ... RIB_INSTANCE_NAME=${RIB_INSTANCE} - \ TemplatedRequests.Put_As_Xml_Templated ${BGP_VARIABLES_FOLDER}${/}bgp_peer mapping=${mapping} - # FIXME: Add testcase to change bgpcep and protocol log levels, when a Keyword that does it without messing with current connection is ready. + FOR ${index} IN RANGE 1 ${MULTIPLICITY_PREFIX_COUNT_MANY}+1 + ${peer_name} = BuiltIn.Set_Variable example-bgp-peer-${index} + ${peer_ip} = BuiltIn.Evaluate str(ipaddr.IPAddress('${FIRST_PEER_IP}') + ${index} - 1) modules=ipaddr + &{mapping} Create Dictionary DEVICE_NAME=${DEVICE_NAME} BGP_NAME=${peer_name} IP=${peer_ip} HOLDTIME=${HOLDTIME_PREFIX_COUNT_MANY} + ... PEER_PORT=${BGP_TOOL_PORT} INITIATE=false BGP_RIB=${RIB_INSTANCE} PASSIVE_MODE=true BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG} + ... RIB_INSTANCE_NAME=${RIB_INSTANCE} + TemplatedRequests.Put_As_Xml_Templated ${BGP_VARIABLES_FOLDER}${/}bgp_peer mapping=${mapping} + # FIXME: Add testcase to change bgpcep and protocol log levels, when a Keyword that does it without messing with current connection is ready. + END Change_Karaf_Logging_Levels [Documentation] We may want to set more verbose logging here after configuration is done. @@ -157,11 +158,12 @@ Delete_Bgp_Peer_Configuration [Documentation] Revert the BGP configuration to the original state: without any configured peers. [Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing # TODO: Is it useful to extract peer naming logic to separate Keyword? - : FOR ${index} IN RANGE 1 ${MULTIPLICITY_PREFIX_COUNT_MANY}+1 - \ ${peer_name} = BuiltIn.Set_Variable example-bgp-peer-${index} - \ ${peer_ip} = BuiltIn.Evaluate str(ipaddr.IPAddress('${FIRST_PEER_IP}') + ${index} - 1) modules=ipaddr - \ &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} BGP_NAME=${peer_name} IP=${peer_ip} BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG} - \ TemplatedRequests.Delete_Templated ${BGP_VARIABLES_FOLDER}${/}bgp_peer mapping=${mapping} + FOR ${index} IN RANGE 1 ${MULTIPLICITY_PREFIX_COUNT_MANY}+1 + ${peer_name} = BuiltIn.Set_Variable example-bgp-peer-${index} + ${peer_ip} = BuiltIn.Evaluate str(ipaddr.IPAddress('${FIRST_PEER_IP}') + ${index} - 1) modules=ipaddr + &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} BGP_NAME=${peer_name} IP=${peer_ip} BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG} + TemplatedRequests.Delete_Templated ${BGP_VARIABLES_FOLDER}${/}bgp_peer mapping=${mapping} + END *** Keywords *** Setup_Everything diff --git a/csit/suites/bier/basic/010_BierTeIntergrationTest.robot b/csit/suites/bier/basic/010_BierTeIntergrationTest.robot index f68d2bae00..0792636bc3 100644 --- a/csit/suites/bier/basic/010_BierTeIntergrationTest.robot +++ b/csit/suites/bier/basic/010_BierTeIntergrationTest.robot @@ -90,13 +90,14 @@ TC3_Query Subdomain TC4_Configure Node [Documentation] Configure the bier params of nodes in the bier network topology. - : FOR ${i} IN RANGE len(${NODE_ID_LIST}) - \ ${domain-bfr-id} Get From List ${BFR_ID_LIST} ${i} - \ ${node-id} Get From List ${NODE_ID_LIST} ${i} - \ ${mapping1} Create Dictionary TOPOLOGYID=${TOPOLOGY_ID} NODEID=${node-id} DOMAINID=${DOMAIN_ID_LIST[0]} DOMAINBFRID=${domain-bfr-id} - \ ... SUBDOMAINBFRID=${domain-bfr-id} SUBDOMAINID=${SUBDOMAIN_ID_LIST[0]} - \ ${resp} TemplatedRequests.Post_As_Json_Templated ${BIER_TE_VAR_FOLDER}/bier_node_configuration/configure_node ${mapping1} session - \ Verify_Response_As_Json_Templated ${resp} ${BIER_TE_VAR_FOLDER}/common success_response + FOR ${i} IN RANGE len(${NODE_ID_LIST}) + ${domain-bfr-id} Get From List ${BFR_ID_LIST} ${i} + ${node-id} Get From List ${NODE_ID_LIST} ${i} + ${mapping1} Create Dictionary TOPOLOGYID=${TOPOLOGY_ID} NODEID=${node-id} DOMAINID=${DOMAIN_ID_LIST[0]} DOMAINBFRID=${domain-bfr-id} + ... SUBDOMAINBFRID=${domain-bfr-id} SUBDOMAINID=${SUBDOMAIN_ID_LIST[0]} + ${resp} TemplatedRequests.Post_As_Json_Templated ${BIER_TE_VAR_FOLDER}/bier_node_configuration/configure_node ${mapping1} session + Verify_Response_As_Json_Templated ${resp} ${BIER_TE_VAR_FOLDER}/common success_response + END ${resp} TemplatedRequests.Post_As_Json_Templated ${BIER_TE_VAR_FOLDER}/bier_node_configuration/query_node {} session Verify_Response_As_Json_Templated ${resp} ${BIER_TE_VAR_FOLDER}/bier_node_configuration/configure_node config_node_response @@ -121,20 +122,22 @@ TC4_Query Subdomain Link TC5_Configure Te Label [Documentation] Configure the BIER-TE label base and label range size for all nodes in the bier topology. - : FOR ${i} IN RANGE len(${NODE_ID_LIST}) - \ ${node-id} Get From List ${NODE_ID_LIST} ${i} - \ ${label-base} Get From List ${TE_LABEL_BASE_LIST} ${i} - \ ${mapping} Create Dictionary TOPOLOGYID=${TOPOLOGY_ID} NODEID=${node-id} LABELBASE=${label-base} LABELRANGESIZE=${TE_LABEL_RANGE_SIZE} - \ ${resp} TemplatedRequests.Post_As_Json_Templated ${BIER_TE_VAR_FOLDER}/bier_node_configuration/configure_te_label ${mapping} session - \ Verify_Response_As_Json_Templated ${resp} ${BIER_TE_VAR_FOLDER}/common success_response + FOR ${i} IN RANGE len(${NODE_ID_LIST}) + ${node-id} Get From List ${NODE_ID_LIST} ${i} + ${label-base} Get From List ${TE_LABEL_BASE_LIST} ${i} + ${mapping} Create Dictionary TOPOLOGYID=${TOPOLOGY_ID} NODEID=${node-id} LABELBASE=${label-base} LABELRANGESIZE=${TE_LABEL_RANGE_SIZE} + ${resp} TemplatedRequests.Post_As_Json_Templated ${BIER_TE_VAR_FOLDER}/bier_node_configuration/configure_te_label ${mapping} session + Verify_Response_As_Json_Templated ${resp} ${BIER_TE_VAR_FOLDER}/common success_response + END TC5_Configure Te Node [Documentation] Configure the BIER-TE params of nodes in the bier network topology. - : FOR ${i} IN RANGE 4 - \ ${node-id} Get From List ${NODE_ID_LIST} ${i} - \ ${tp-id-list} Get From Dictionary ${NODE_TO_TP_ID_LIST} ${node-id} - \ ${bp-list} Get From Dictionary ${NODE_TO_BP_LIST} ${node-id} - \ Second Layer Loop ${node-id} ${tp-id-list} ${bp-list} len(${bp-list}) + FOR ${i} IN RANGE 4 + ${node-id} Get From List ${NODE_ID_LIST} ${i} + ${tp-id-list} Get From Dictionary ${NODE_TO_TP_ID_LIST} ${node-id} + ${bp-list} Get From Dictionary ${NODE_TO_BP_LIST} ${node-id} + Second Layer Loop ${node-id} ${tp-id-list} ${bp-list} len(${bp-list}) + END TC5_Query Te Subdomain Link [Documentation] Query the bier links in the te-domain 1 and te-subdomain 1. @@ -179,14 +182,15 @@ TC5_Delete Te Label TC6_Add Channel [Documentation] Add three channels to the datastore defined by bier-network-channel. - : FOR ${i} IN RANGE len(${CHANNEL_NAME_LIST}) - \ ${channel-name} Get From List ${CHANNEL_NAME_LIST} ${i} - \ ${src-ip} Get From List ${SRC_IP_LIST} ${i} - \ ${dst-group} Get From List ${DST_GROUP_LIST} ${i} - \ ${mapping} Create Dictionary TOPOLOGYID=${TOPOLOGY_ID} CHANNELNAME=${channel-name} SRCIP=${src-ip} DSTGROUP=${dst-group} - \ ... DOMAINID=${DOMAIN_ID_LIST[0]} SUBDOMAINID=${SUBDOMAIN_ID_LIST[0]} - \ ${resp} TemplatedRequests.Post_As_Json_Templated ${BIER_TE_VAR_FOLDER}/bier_channel_configuration/add_channel ${mapping} session - \ Verify_Response_As_Json_Templated ${resp} ${BIER_TE_VAR_FOLDER}/bier_channel_configuration success_response + FOR ${i} IN RANGE len(${CHANNEL_NAME_LIST}) + ${channel-name} Get From List ${CHANNEL_NAME_LIST} ${i} + ${src-ip} Get From List ${SRC_IP_LIST} ${i} + ${dst-group} Get From List ${DST_GROUP_LIST} ${i} + ${mapping} Create Dictionary TOPOLOGYID=${TOPOLOGY_ID} CHANNELNAME=${channel-name} SRCIP=${src-ip} DSTGROUP=${dst-group} + ... DOMAINID=${DOMAIN_ID_LIST[0]} SUBDOMAINID=${SUBDOMAIN_ID_LIST[0]} + ${resp} TemplatedRequests.Post_As_Json_Templated ${BIER_TE_VAR_FOLDER}/bier_channel_configuration/add_channel ${mapping} session + Verify_Response_As_Json_Templated ${resp} ${BIER_TE_VAR_FOLDER}/bier_channel_configuration success_response + END TC6_Get Channel [Documentation] Query the channels put into the datastore. diff --git a/csit/suites/capwap/basic/capwap_session.robot b/csit/suites/capwap/basic/capwap_session.robot index 0846142e1b..5fbfc5149c 100644 --- a/csit/suites/capwap/basic/capwap_session.robot +++ b/csit/suites/capwap/basic/capwap_session.robot @@ -33,9 +33,10 @@ Run Test Get Discovered WTP @{wtp_discovered} Get From Dictionary ${ac_Root} discovered-wtps ${expected_ip_addr} get simulated wtpip ${ODL_SYSTEM_IP} ${wtp_ip_list} Create List '' - : FOR ${wtp} IN @{wtp_discovered} - \ ${wtp_ip} Get From Dictionary ${wtp} ipv4-addr - \ Append to List ${wtp_ip_list} ${wtp_ip} + FOR ${wtp} IN @{wtp_discovered} + ${wtp_ip} Get From Dictionary ${wtp} ipv4-addr + Append to List ${wtp_ip_list} ${wtp_ip} + END Log ${wtp_ip_list} List Should Contain Value ${wtp_ip_list} ${expected_ip_addr} @@ -49,8 +50,9 @@ Run Test Get Specifc WTP ${result} TO JSON ${resp.content} @{wtp_discovered} Get From Dictionary ${result} discovered-wtps ${wtp_ip_list} Create List '' - : FOR ${wtp} IN @{wtp_discovered} - \ ${wtp_ip} Get From Dictionary ${wtp} ipv4-addr - \ Append to List ${wtp_ip_list} ${wtp_ip} + FOR ${wtp} IN @{wtp_discovered} + ${wtp_ip} Get From Dictionary ${wtp} ipv4-addr + Append to List ${wtp_ip_list} ${wtp_ip} + END Log ${wtp_ip_list} List Should Contain Value ${wtp_ip_list} ${expected_ip_addr} diff --git a/csit/suites/controller/Clustering_Datastore/buycar_failover.robot b/csit/suites/controller/Clustering_Datastore/buycar_failover.robot index 047cec7f1c..da6983664c 100644 --- a/csit/suites/controller/Clustering_Datastore/buycar_failover.robot +++ b/csit/suites/controller/Clustering_Datastore/buycar_failover.robot @@ -33,35 +33,39 @@ Add_Cars_To_Leader_And_Verify [Documentation] Add all needed cars to car Leader, verify on each member. ${car_items} = BuiltIn.Evaluate ${CARPEOPLE_ITEMS} * 4 TemplatedRequests.Put_As_Json_Templated folder=${VAR_DIR}/cars session=${car_leader_session} iterations=${car_items} - : FOR ${session} IN @{ClusterManagement__session_list} - \ BuiltIn.Wait_Until_Keyword_Succeeds 10s 2s TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/cars session=${session} - \ ... verify=True iterations=${car_items} + FOR ${session} IN @{ClusterManagement__session_list} + BuiltIn.Wait_Until_Keyword_Succeeds 10s 2s TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/cars session=${session} + ... verify=True iterations=${car_items} + END Add_People_To_First_Follower_And_Verify [Documentation] Add all needed people to people first Follower, verify on each member. ${people_items} = BuiltIn.Evaluate ${CARPEOPLE_ITEMS} * 4 CarPeople.Add_Several_People session=${people_first_follower_session} iterations=${people_items} - : FOR ${session} IN @{ClusterManagement__session_list} - \ BuiltIn.Wait_Until_Keyword_Succeeds 10s 2s TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/people session=${session} - \ ... verify=True iterations=${people_items} + FOR ${session} IN @{ClusterManagement__session_list} + BuiltIn.Wait_Until_Keyword_Succeeds 10s 2s TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/people session=${session} + ... verify=True iterations=${people_items} + END Buy_Cars_On_Leader_And_Verify [Documentation] Buy some cars on the leader member. ${iter_start} = BuiltIn.Evaluate 0 * ${CARPEOPLE_ITEMS} + 1 CarPeople.Buy_Several_Cars session=${car-people_leader_session} iterations=${CARPEOPLE_ITEMS} iter_start=${iter_start} ${total_iterations} = BuiltIn.Evaluate 1 * ${CARPEOPLE_ITEMS} - : FOR ${session} IN @{ClusterManagement__session_list} - \ BuiltIn.Wait_Until_Keyword_Succeeds 10s 2s TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/car-people session=${session} - \ ... verify=True iterations=${total_iterations} + FOR ${session} IN @{ClusterManagement__session_list} + BuiltIn.Wait_Until_Keyword_Succeeds 10s 2s TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/car-people session=${session} + ... verify=True iterations=${total_iterations} + END Buy_Cars_On_Follower_And_Verify [Documentation] Buy some cars on the first follower member. ${iter_start} = BuiltIn.Evaluate 1 * ${CARPEOPLE_ITEMS} + 1 CarPeople.Buy_Several_Cars session=${car-people_first_follower_session} iterations=${CARPEOPLE_ITEMS} iter_start=${iter_start} ${total_iterations} = BuiltIn.Evaluate 2 * ${CARPEOPLE_ITEMS} - : FOR ${session} IN @{ClusterManagement__session_list} - \ BuiltIn.Wait_Until_Keyword_Succeeds 10s 2s TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/car-people session=${session} - \ ... verify=True iterations=${total_iterations} + FOR ${session} IN @{ClusterManagement__session_list} + BuiltIn.Wait_Until_Keyword_Succeeds 10s 2s TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/car-people session=${session} + ... verify=True iterations=${total_iterations} + END Reboot_People_Leader [Documentation] Previous people Leader is rebooted. We should never stop the people first follower, this is where people are registered. @@ -74,18 +78,20 @@ Buy_Cars_On_Leader_After_Reboot_And_Verify ${iter_start} = BuiltIn.Evaluate 2 * ${CARPEOPLE_ITEMS} + 1 CarPeople.Buy_Several_Cars session=${car-people_leader_session} iterations=${CARPEOPLE_ITEMS} iter_start=${iter_start} ${total_iterations} = BuiltIn.Evaluate 3 * ${CARPEOPLE_ITEMS} - : FOR ${session} IN @{ClusterManagement__session_list} - \ BuiltIn.Wait_Until_Keyword_Succeeds 10s 2s TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/car-people session=${session} - \ ... verify=True iterations=${total_iterations} + FOR ${session} IN @{ClusterManagement__session_list} + BuiltIn.Wait_Until_Keyword_Succeeds 10s 2s TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/car-people session=${session} + ... verify=True iterations=${total_iterations} + END Buy_Cars_On_Follower_After_Reboot_And_Verify [Documentation] Buy some cars on the first follower member. ${iter_start} = BuiltIn.Evaluate 3 * ${CARPEOPLE_ITEMS} + 1 CarPeople.Buy_Several_Cars session=${car-people_first_follower_session} iterations=${CARPEOPLE_ITEMS} iter_start=${iter_start} ${total_iterations} = BuiltIn.Evaluate 4 * ${CARPEOPLE_ITEMS} - : FOR ${session} IN @{ClusterManagement__session_list} - \ BuiltIn.Wait_Until_Keyword_Succeeds 10s 2s TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/car-people session=${session} - \ ... verify=True iterations=${total_iterations} + FOR ${session} IN @{ClusterManagement__session_list} + BuiltIn.Wait_Until_Keyword_Succeeds 10s 2s TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/car-people session=${session} + ... verify=True iterations=${total_iterations} + END Delete_All_CarPeople [Documentation] DELETE car-people container. No verification beyond http status. diff --git a/csit/suites/controller/Clustering_Datastore/buycar_failover_isolation.robot b/csit/suites/controller/Clustering_Datastore/buycar_failover_isolation.robot index 637ef9d21a..1c873ba8f7 100644 --- a/csit/suites/controller/Clustering_Datastore/buycar_failover_isolation.robot +++ b/csit/suites/controller/Clustering_Datastore/buycar_failover_isolation.robot @@ -33,35 +33,39 @@ Add_Cars_To_Leader_And_Verify [Documentation] Add all needed cars to car Leader, verify on each member. ${car_items} = BuiltIn.Evaluate ${CARPEOPLE_ITEMS} * 4 TemplatedRequests.Put_As_Json_Templated folder=${VAR_DIR}/cars session=${car_leader_session} iterations=${car_items} - : FOR ${session} IN @{ClusterManagement__session_list} - \ BuiltIn.Wait_Until_Keyword_Succeeds 10s 2s TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/cars session=${session} - \ ... verify=True iterations=${car_items} + FOR ${session} IN @{ClusterManagement__session_list} + BuiltIn.Wait_Until_Keyword_Succeeds 10s 2s TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/cars session=${session} + ... verify=True iterations=${car_items} + END Add_People_To_First_Follower_And_Verify [Documentation] Add all needed people to people first Follower, verify on each member. ${people_items} = BuiltIn.Evaluate ${CARPEOPLE_ITEMS} * 4 CarPeople.Add_Several_People session=${people_first_follower_session} iterations=${people_items} - : FOR ${session} IN @{ClusterManagement__session_list} - \ BuiltIn.Wait_Until_Keyword_Succeeds 10s 2s TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/people session=${session} - \ ... verify=True iterations=${people_items} + FOR ${session} IN @{ClusterManagement__session_list} + BuiltIn.Wait_Until_Keyword_Succeeds 10s 2s TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/people session=${session} + ... verify=True iterations=${people_items} + END Buy_Cars_On_Leader_And_Verify [Documentation] Buy some cars on the leader member. ${iter_start} = BuiltIn.Evaluate 0 * ${CARPEOPLE_ITEMS} + 1 CarPeople.Buy_Several_Cars session=${car-people_leader_session} iterations=${CARPEOPLE_ITEMS} iter_start=${iter_start} ${total_iterations} = BuiltIn.Evaluate 1 * ${CARPEOPLE_ITEMS} - : FOR ${session} IN @{ClusterManagement__session_list} - \ BuiltIn.Wait_Until_Keyword_Succeeds 10s 2s TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/car-people session=${session} - \ ... verify=True iterations=${total_iterations} + FOR ${session} IN @{ClusterManagement__session_list} + BuiltIn.Wait_Until_Keyword_Succeeds 10s 2s TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/car-people session=${session} + ... verify=True iterations=${total_iterations} + END Buy_Cars_On_Follower_And_Verify [Documentation] Buy some cars on the first follower member. ${iter_start} = BuiltIn.Evaluate 1 * ${CARPEOPLE_ITEMS} + 1 CarPeople.Buy_Several_Cars session=${car-people_first_follower_session} iterations=${CARPEOPLE_ITEMS} iter_start=${iter_start} ${total_iterations} = BuiltIn.Evaluate 2 * ${CARPEOPLE_ITEMS} - : FOR ${session} IN @{ClusterManagement__session_list} - \ BuiltIn.Wait_Until_Keyword_Succeeds 10s 2s TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/car-people session=${session} - \ ... verify=True iterations=${total_iterations} + FOR ${session} IN @{ClusterManagement__session_list} + BuiltIn.Wait_Until_Keyword_Succeeds 10s 2s TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/car-people session=${session} + ... verify=True iterations=${total_iterations} + END Isolate_and_Rejoin_People_Leader [Documentation] Previous people Leader is isolated. We should never stop the people first follower, this is where people are registered. @@ -76,18 +80,20 @@ Buy_Cars_On_Leader_After_Rejoin_And_Verify ${iter_start} = BuiltIn.Evaluate 2 * ${CARPEOPLE_ITEMS} + 1 CarPeople.Buy_Several_Cars session=${car-people_leader_session} iterations=${CARPEOPLE_ITEMS} iter_start=${iter_start} ${total_iterations} = BuiltIn.Evaluate 3 * ${CARPEOPLE_ITEMS} - : FOR ${session} IN @{ClusterManagement__session_list} - \ BuiltIn.Wait_Until_Keyword_Succeeds 10s 2s TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/car-people session=${session} - \ ... verify=True iterations=${total_iterations} + FOR ${session} IN @{ClusterManagement__session_list} + BuiltIn.Wait_Until_Keyword_Succeeds 10s 2s TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/car-people session=${session} + ... verify=True iterations=${total_iterations} + END Buy_Cars_On_Follower_After_Rejoin_And_Verify [Documentation] Buy some cars on the first follower member. ${iter_start} = BuiltIn.Evaluate 3 * ${CARPEOPLE_ITEMS} + 1 CarPeople.Buy_Several_Cars session=${car-people_first_follower_session} iterations=${CARPEOPLE_ITEMS} iter_start=${iter_start} ${total_iterations} = BuiltIn.Evaluate 4 * ${CARPEOPLE_ITEMS} - : FOR ${session} IN @{ClusterManagement__session_list} - \ BuiltIn.Wait_Until_Keyword_Succeeds 10s 2s TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/car-people session=${session} - \ ... verify=True iterations=${total_iterations} + FOR ${session} IN @{ClusterManagement__session_list} + BuiltIn.Wait_Until_Keyword_Succeeds 10s 2s TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/car-people session=${session} + ... verify=True iterations=${total_iterations} + END Delete_All_CarPeople [Documentation] DELETE car-people container. No verification beyond http status. diff --git a/csit/suites/controller/Clustering_Datastore/car_failover_crud.robot b/csit/suites/controller/Clustering_Datastore/car_failover_crud.robot index 4deefc2efa..08ec6f1550 100644 --- a/csit/suites/controller/Clustering_Datastore/car_failover_crud.robot +++ b/csit/suites/controller/Clustering_Datastore/car_failover_crud.robot @@ -39,9 +39,10 @@ ${VAR_DIR} ${CURDIR}/../../../variables/carpeople/crud Add_Original_Cars_On_Old_Leader_And_Verify [Documentation] Add initial cars on car Leader. TemplatedRequests.Put_As_Json_Templated folder=${VAR_DIR}/cars session=${car_leader_session} iterations=${CAR_ITEMS} iter_start=${ORIGINAL_START_I} - : FOR ${session} IN @{ClusterManagement__session_list} - \ BuiltIn.Wait_Until_Keyword_Succeeds 10s 2s TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/cars session=${session} - \ ... verify=True iterations=${CAR_ITEMS} iter_start=${ORIGINAL_START_I} + FOR ${session} IN @{ClusterManagement__session_list} + BuiltIn.Wait_Until_Keyword_Succeeds 10s 2s TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/cars session=${session} + ... verify=True iterations=${CAR_ITEMS} iter_start=${ORIGINAL_START_I} + END Stop_Original_Car_Leader [Documentation] Stop the car Leader to cause a new leader to get elected. @@ -57,8 +58,9 @@ See_Original_Cars_On_New_Leader See_Original_Cars_On_New_Followers [Documentation] The same check on other existing member(s). - : FOR ${session} IN @{new_follower_sessions} - \ TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/cars session=${session} verify=True iterations=${CAR_ITEMS} iter_start=${ORIGINAL_START_I} + FOR ${session} IN @{new_follower_sessions} + TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/cars session=${session} verify=True iterations=${CAR_ITEMS} iter_start=${ORIGINAL_START_I} + END Delete_Original_Cars_On_New_Leader [Documentation] Delete cars on the new Leader. @@ -74,8 +76,9 @@ See_Leader_Cars_On_New_Leader See_Leader_Cars_On_New_Followers [Documentation] The same check on other existing members. - : FOR ${session} IN @{new_follower_sessions} - \ TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/cars session=${session} verify=True iterations=${CAR_ITEMS} iter_start=${LEADER_2NODE_START_I} + FOR ${session} IN @{new_follower_sessions} + TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/cars session=${session} verify=True iterations=${CAR_ITEMS} iter_start=${LEADER_2NODE_START_I} + END Delete_Leader_Cars_On_New_First_Follower [Documentation] Delete cars in new first Follower. @@ -91,8 +94,9 @@ See_Folower_Cars_On_New_Leader See_Follower_Cars_On_New_Followers [Documentation] The same check on other existing members. - : FOR ${session} IN @{new_follower_sessions} - \ TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/cars session=${session} verify=True iterations=${CAR_ITEMS} iter_start=${FOLLOWER_2NODE_START_I} + FOR ${session} IN @{new_follower_sessions} + TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/cars session=${session} verify=True iterations=${CAR_ITEMS} iter_start=${FOLLOWER_2NODE_START_I} + END Start_Old_Car_Leader [Documentation] Start the stopped member without deleting the persisted data. @@ -120,9 +124,10 @@ Set_Variables_For_Less_Nodes ${leader_session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${leader} BuiltIn.Set_Suite_Variable \${new_leader_session} ${leader_session} ${sessions} = BuiltIn.Create_List - : FOR ${follower_index} IN @{follower_list} - \ ${follower_session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${follower_index} - \ Collections.Append_To_List ${sessions} ${follower_session} + FOR ${follower_index} IN @{follower_list} + ${follower_session} = ClusterManagement.Resolve_Http_Session_For_Member member_index=${follower_index} + Collections.Append_To_List ${sessions} ${follower_session} + END BuiltIn.Set_Suite_Variable \${new_follower_sessions} ${sessions} ${first_follower_session} = Collections.Get_From_List ${sessions} 0 BuiltIn.Set_Suite_Variable \${new_first_follower_session} ${first_follower_session} diff --git a/csit/suites/controller/Clustering_Datastore/car_failover_crud_isolation.robot b/csit/suites/controller/Clustering_Datastore/car_failover_crud_isolation.robot index e3cbf8d842..297312f316 100644 --- a/csit/suites/controller/Clustering_Datastore/car_failover_crud_isolation.robot +++ b/csit/suites/controller/Clustering_Datastore/car_failover_crud_isolation.robot @@ -41,9 +41,10 @@ ${VAR_DIR} ${CURDIR}/../../../variables/carpeople/crud Add_Original_Cars_On_Old_Leader_And_Verify [Documentation] Add initial cars on car Leader. TemplatedRequests.Put_As_Json_Templated folder=${VAR_DIR}/cars session=${car_leader_session} iterations=${CAR_ITEMS} iter_start=${ORIGINAL_START_I} - : FOR ${session} IN @{ClusterManagement__session_list} - \ BuiltIn.Wait_Until_Keyword_Succeeds 10s 2s TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/cars session=${session} - \ ... verify=True iterations=${CAR_ITEMS} iter_start=${ORIGINAL_START_I} + FOR ${session} IN @{ClusterManagement__session_list} + BuiltIn.Wait_Until_Keyword_Succeeds 10s 2s TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/cars session=${session} + ... verify=True iterations=${CAR_ITEMS} iter_start=${ORIGINAL_START_I} + END Isolate_Original_Car_Leader [Documentation] Isolate the car Leader to cause a new leader to get elected. @@ -61,8 +62,9 @@ See_Original_Cars_On_New_Leader See_Original_Cars_On_New_Followers [Documentation] The same check on other existing member(s). - : FOR ${session} IN @{new_follower_sessions} - \ TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/cars session=${session} verify=True iterations=${CAR_ITEMS} iter_start=${ORIGINAL_START_I} + FOR ${session} IN @{new_follower_sessions} + TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/cars session=${session} verify=True iterations=${CAR_ITEMS} iter_start=${ORIGINAL_START_I} + END Delete_Original_Cars_On_New_Leader [Documentation] Delete cars on the new Leader. @@ -78,8 +80,9 @@ See_Leader_Cars_On_New_Leader See_Leader_Cars_On_New_Followers [Documentation] The same check on other existing members. - : FOR ${session} IN @{new_follower_sessions} - \ TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/cars session=${session} verify=True iterations=${CAR_ITEMS} iter_start=${LEADER_2NODE_START_I} + FOR ${session} IN @{new_follower_sessions} + TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/cars session=${session} verify=True iterations=${CAR_ITEMS} iter_start=${LEADER_2NODE_START_I} + END Delete_Leader_Cars_On_New_First_Follower [Documentation] Delete cars in new first Follower. @@ -95,8 +98,9 @@ See_Folower_Cars_On_New_Leader See_Follower_Cars_On_New_Followers [Documentation] The same check on other existing members. - : FOR ${session} IN @{new_follower_sessions} - \ TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/cars session=${session} verify=True iterations=${CAR_ITEMS} iter_start=${FOLLOWER_2NODE_START_I} + FOR ${session} IN @{new_follower_sessions} + TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/cars session=${session} verify=True iterations=${CAR_ITEMS} iter_start=${FOLLOWER_2NODE_START_I} + END Rejoin_Old_Car_Leader [Documentation] Rejoin the isolated member without deleting the persisted data. diff --git a/csit/suites/controller/Clustering_Datastore/car_outage_corners.robot b/csit/suites/controller/Clustering_Datastore/car_outage_corners.robot index 13782311c6..ef184f5f09 100644 --- a/csit/suites/controller/Clustering_Datastore/car_outage_corners.robot +++ b/csit/suites/controller/Clustering_Datastore/car_outage_corners.robot @@ -44,11 +44,12 @@ Stop_Majority_Of_The_Followers [Documentation] Stop half plus one car Follower members and set reviving followers down (otherwsise tipping followers cannot join cluster). ... Mark most of stopped members as explicitly down, to allow the surviving leader make progress. ClusterManagement.Stop_Members_From_List_Or_All member_index_list=${list_of_stopping} confirm=True - : FOR ${index} IN @{list_of_reviving} - \ ${data} OperatingSystem.Get File ${CLUSTER_DIR}/member_down.json - \ ${member_ip} = Collections.Get_From_Dictionary ${ClusterManagement__index_to_ip_mapping} ${index} - \ ${data} String.Replace String ${data} {member_ip} ${member_ip} - \ TemplatedRequests.Post_To_Uri uri=jolokia data=${data} content_type=${HEADERS} accept=${ACCEPT_EMPTY} session=${car_leader_session} + FOR ${index} IN @{list_of_reviving} + ${data} OperatingSystem.Get File ${CLUSTER_DIR}/member_down.json + ${member_ip} = Collections.Get_From_Dictionary ${ClusterManagement__index_to_ip_mapping} ${index} + ${data} String.Replace String ${data} {member_ip} ${member_ip} + TemplatedRequests.Post_To_Uri uri=jolokia data=${data} content_type=${HEADERS} accept=${ACCEPT_EMPTY} session=${car_leader_session} + END Attempt_To_Add_Cars_To_Leader [Documentation] Adding cars should fail, as majority of Followers are down. @@ -70,8 +71,9 @@ Add_Cars_On_Tipping_Follower See_Cars_On_Existing_Members [Documentation] On each up member: GET cars, should match the ones added on tipping Follower. - : FOR ${session} IN @{list_of_majority} - \ TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/cars session=${session} verify=True iterations=${CAR_ITEMS} iter_start=${MAJORITY_START_I} + FOR ${session} IN @{list_of_majority} + TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/cars session=${session} verify=True iterations=${CAR_ITEMS} iter_start=${MAJORITY_START_I} + END Start_Other_Followers [Documentation] Start other followers without persisted data. diff --git a/csit/suites/controller/Clustering_Datastore/car_persistence_recovery.robot b/csit/suites/controller/Clustering_Datastore/car_persistence_recovery.robot index 433e8afdf4..9a80b5b037 100644 --- a/csit/suites/controller/Clustering_Datastore/car_persistence_recovery.robot +++ b/csit/suites/controller/Clustering_Datastore/car_persistence_recovery.robot @@ -31,9 +31,10 @@ ${VAR_DIR} ${CURDIR}/../../../variables/carpeople/crud Add_Cars_On_Leader_And_Verify [Documentation] Single big PUT to datastore to add cars to car Leader. TemplatedRequests.Put_As_Json_Templated folder=${VAR_DIR}/cars session=${car_leader_session} iterations=${CAR_ITEMS} - : FOR ${session} IN @{ClusterManagement__session_list} - \ BuiltIn.Wait_Until_Keyword_Succeeds 10s 2s TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/cars session=${session} - \ ... verify=True iterations=${CAR_ITEMS} + FOR ${session} IN @{ClusterManagement__session_list} + BuiltIn.Wait_Until_Keyword_Succeeds 10s 2s TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/cars session=${session} + ... verify=True iterations=${CAR_ITEMS} + END Stop_All_Members [Documentation] Stop all controllers. @@ -53,8 +54,9 @@ See_Cars_On_Leader See_Cars_On_Followers [Documentation] The same check on other members. - : FOR ${session} IN @{car_follower_sessions} - \ TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/cars session=${session} verify=True iterations=${CAR_ITEMS} + FOR ${session} IN @{car_follower_sessions} + TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/cars session=${session} verify=True iterations=${CAR_ITEMS} + END Delete_Cars_On_Leader [Documentation] Delete cars on the new Leader. diff --git a/csit/suites/controller/Clustering_Datastore/carpeople_crud.robot b/csit/suites/controller/Clustering_Datastore/carpeople_crud.robot index d91d001f09..bfcf1cedd9 100644 --- a/csit/suites/controller/Clustering_Datastore/carpeople_crud.robot +++ b/csit/suites/controller/Clustering_Datastore/carpeople_crud.robot @@ -42,8 +42,9 @@ See_Added_Cars_On_Leader See_Added_Cars_On_Followers [Documentation] The same check on other members. - : FOR ${session} IN @{car_follower_sessions} - \ TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/cars session=${session} verify=True iterations=${CARPEOPLE_ITEMS} + FOR ${session} IN @{car_follower_sessions} + TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/cars session=${session} verify=True iterations=${CARPEOPLE_ITEMS} + END Add_People_To_First_Follower [Documentation] Add ${CARPEOPLE_ITEMS} people to people first Follower, loop of add-person. @@ -55,8 +56,9 @@ See_Added_People_On_Leader See_Added_People_On_Followers [Documentation] The same check on other members. - : FOR ${session} IN @{people_follower_sessions} - \ TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/people session=${session} verify=True iterations=${CARPEOPLE_ITEMS} + FOR ${session} IN @{people_follower_sessions} + TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/people session=${session} verify=True iterations=${CARPEOPLE_ITEMS} + END Buy_Cars_On_Leader [Documentation] Buy some cars on car-people Leader, loop of buy-car, ending segment of IDs. @@ -67,9 +69,10 @@ Buy_Cars_On_Leader Buy_Cars_On_Followers [Documentation] On each Follower buy corresponding ID segment of cars in buy-car loop. ${start_id} = BuiltIn.Set_Variable 1 - : FOR ${session} IN @{car-people_follower_sessions} - \ CarPeople.Buy_Several_Cars session=${session} iterations=${items_per_follower} iter_start=${start_id} - \ ${start_id} = BuiltIn.Evaluate ${start_id} + ${items_per_follower} + FOR ${session} IN @{car-people_follower_sessions} + CarPeople.Buy_Several_Cars session=${session} iterations=${items_per_follower} iter_start=${start_id} + ${start_id} = BuiltIn.Evaluate ${start_id} + ${items_per_follower} + END See_Added_CarPeople_On_Leader [Documentation] GET car-person mappings from Leader to see all entries. @@ -77,8 +80,9 @@ See_Added_CarPeople_On_Leader See_Added_CarPeople_On_Followers [Documentation] The same check on other members. - : FOR ${session} IN @{car-people_follower_sessions} - \ TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/car-people session=${session} verify=True iterations=${CARPEOPLE_ITEMS} + FOR ${session} IN @{car-people_follower_sessions} + TemplatedRequests.Get_As_Json_Templated folder=${VAR_DIR}/car-people session=${session} verify=True iterations=${CARPEOPLE_ITEMS} + END Delete_All_CarPeople_On_Leader [Documentation] DELETE car-people container. No verification beyond http status. diff --git a/csit/suites/controller/benchmark/dsbenchmark.robot b/csit/suites/controller/benchmark/dsbenchmark.robot index 9b88360317..2c70b92b87 100644 --- a/csit/suites/controller/benchmark/dsbenchmark.robot +++ b/csit/suites/controller/benchmark/dsbenchmark.robot @@ -360,13 +360,14 @@ Merge_Csv ${final_values}= BuiltIn.Set_variable ${Empty} @{csv_files}= OperatingSystem.List_Files_In_Directory . *${final_file} Collections.Sort_List ${csv_files} - : FOR ${file} IN @{csv_files} - \ BuiltIn.Log_To_Console ${file} - \ ${csv_content}= OperatingSystem.GetFile ${file} - \ ${column_names}= Get_Column_Names ${file} ${csv_content} - \ ${column_values}= String.Get_Line ${csv_content} 1 - \ ${final_columns}= BuiltIn.Set_Variable_If "${final_columns}"=="${Empty}" ${column_names} ${final_columns},${column_names} - \ ${final_values}= BuiltIn.Set_Variable_If "${final_values}"=="${Empty}" ${column_values} ${final_values},${column_values} + FOR ${file} IN @{csv_files} + BuiltIn.Log_To_Console ${file} + ${csv_content}= OperatingSystem.GetFile ${file} + ${column_names}= Get_Column_Names ${file} ${csv_content} + ${column_values}= String.Get_Line ${csv_content} 1 + ${final_columns}= BuiltIn.Set_Variable_If "${final_columns}"=="${Empty}" ${column_names} ${final_columns},${column_names} + ${final_values}= BuiltIn.Set_Variable_If "${final_values}"=="${Empty}" ${column_values} ${final_values},${column_values} + END ${content}= BuiltIn.Catenate SEPARATOR=${\n} ${final_columns} ${final_values} OperatingSystem.Create_File ${final_file} ${content} @@ -379,6 +380,7 @@ Get_Column_Names # now we have followers and FOL_ will be prepended to the column names @{columns} String.Split_String ${column_names} , ${final_columns} BuiltIn.Set_Variable ${Empty} - : FOR ${column} IN @{columns} - \ ${final_columns} BuiltIn.Set_Variable_If "${final_columns}"=="${Empty}" FOL_${column} ${final_columns},FOL_${column} + FOR ${column} IN @{columns} + ${final_columns} BuiltIn.Set_Variable_If "${final_columns}"=="${Empty}" FOL_${column} ${final_columns},FOL_${column} + END BuiltIn.Return_From_Keyword ${final_columns} diff --git a/csit/suites/controller/cluster_singleton/master_stability.robot b/csit/suites/controller/cluster_singleton/master_stability.robot index 27f6f004c5..1f4109cdec 100644 --- a/csit/suites/controller/cluster_singleton/master_stability.robot +++ b/csit/suites/controller/cluster_singleton/master_stability.robot @@ -62,5 +62,6 @@ Setup_Keyword Get_Node_Idx_To_Unregister [Documentation] Return the first non owner node from the stored candidate list. - : FOR ${index} IN @{cs_candidates} - \ BuiltIn.Return_From_Keyword_If "${index}" != "${cs_owner}" ${index} + FOR ${index} IN @{cs_candidates} + BuiltIn.Return_From_Keyword_If "${index}" != "${cs_owner}" ${index} + END diff --git a/csit/suites/controller/dom_data_broker/clean_leader_shutdown.robot b/csit/suites/controller/dom_data_broker/clean_leader_shutdown.robot index 4c089f73a8..5de9f0d1f5 100644 --- a/csit/suites/controller/dom_data_broker/clean_leader_shutdown.robot +++ b/csit/suites/controller/dom_data_broker/clean_leader_shutdown.robot @@ -28,7 +28,6 @@ Local_Leader_Shutdown Restart [Documentation] Restart odl - [Template] DdbCommons.Restart_Test_Templ Remote_Leader_Shutdown diff --git a/csit/suites/controller/dom_data_broker/clean_leader_shutdown_prefbasedshard.robot b/csit/suites/controller/dom_data_broker/clean_leader_shutdown_prefbasedshard.robot index 110ecc6214..553d2ec3e6 100644 --- a/csit/suites/controller/dom_data_broker/clean_leader_shutdown_prefbasedshard.robot +++ b/csit/suites/controller/dom_data_broker/clean_leader_shutdown_prefbasedshard.robot @@ -31,7 +31,6 @@ Local_Leader_Shutdown Restart [Documentation] Restart odl. [Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing - [Template] DdbCommons.Restart_Test_Templ [Teardown] SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed diff --git a/csit/suites/controller/dom_data_broker/client_isolation.robot b/csit/suites/controller/dom_data_broker/client_isolation.robot index d4a511001a..18c39aa935 100644 --- a/csit/suites/controller/dom_data_broker/client_isolation.robot +++ b/csit/suites/controller/dom_data_broker/client_isolation.robot @@ -28,7 +28,6 @@ Producer_On_Shard_Leader_Node_ChainedTx Restart1 [Documentation] Restart odl - [Template] DdbCommons.Restart_Test_Templ Producer_On_Shard_Leader_Node_SimpleTx @@ -37,7 +36,6 @@ Producer_On_Shard_Leader_Node_SimpleTx Restart2 [Documentation] Restart odl - [Template] DdbCommons.Restart_Test_Templ Producer_On_Shard_Non_Leader_Node_ChainedTx @@ -46,7 +44,6 @@ Producer_On_Shard_Non_Leader_Node_ChainedTx Restart3 [Documentation] Restart odl - [Template] DdbCommons.Restart_Test_Templ Producer_On_Shard_Non_Leader_Node_SimpleTx diff --git a/csit/suites/controller/dom_data_broker/client_isolation_prefbasedshard.robot b/csit/suites/controller/dom_data_broker/client_isolation_prefbasedshard.robot index d45c673099..838f8602e1 100644 --- a/csit/suites/controller/dom_data_broker/client_isolation_prefbasedshard.robot +++ b/csit/suites/controller/dom_data_broker/client_isolation_prefbasedshard.robot @@ -31,7 +31,6 @@ Producer_On_Shard_Leader_Node_Isolated_Transactions Restart1 [Documentation] Restart odl. [Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing - [Template] DdbCommons.Restart_Test_Templ [Teardown] SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed @@ -42,7 +41,6 @@ Producer_On_Shard_Leader_Node_Nonisolated_Transactions Restart2 [Documentation] Restart odl. [Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing - [Template] DdbCommons.Restart_Test_Templ [Teardown] SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed @@ -53,7 +51,6 @@ Producer_On_Shard_Non_Leader_Node_Isolated_Transactions Restart3 [Documentation] Restart odl [Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing - [Template] DdbCommons.Restart_Test_Templ [Teardown] SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed diff --git a/csit/suites/controller/dom_data_broker/ddb-sanity-module-based.robot b/csit/suites/controller/dom_data_broker/ddb-sanity-module-based.robot index 327997b5c2..a8c4d51608 100644 --- a/csit/suites/controller/dom_data_broker/ddb-sanity-module-based.robot +++ b/csit/suites/controller/dom_data_broker/ddb-sanity-module-based.robot @@ -37,8 +37,9 @@ ${MODULE_SHARD_PREFIX} prefix- Get_Shard_Role [Documentation] Get shard role. ${all_indices} = ClusterManagement.List_All_Indices - : FOR ${index} IN @{all_indices} - \ ${role} = ClusterAdmin.Get_Shard_Role ${index} ${SHARD_NAME} ${SHARD_TYPE} + FOR ${index} IN @{all_indices} + ${role} = ClusterAdmin.Get_Shard_Role ${index} ${SHARD_NAME} ${SHARD_TYPE} + END Subscribe_Listener_To_Leader [Documentation] Subscribe listener to leader. @@ -109,8 +110,9 @@ Write_Transactions_One_Node_Leader ${leader_ip_as_list} = ClusterManagement.Resolve_IP_Address_For_Members ${leader_idx_as_list} MdsalLowlevelPy.Start_Write_Transactions_On_Nodes ${leader_ip_as_list} ${leader_idx_as_list} ${MODULE_SHARD_PREFIX} ${DURATION} ${TRANSACTION_RATE_1K} chained_flag=${CHAINED_TX} ${resp_list} = MdsalLowlevelPy.Wait_For_Transactions - : FOR ${resp} IN @{resp_list} - \ TemplatedRequests.Check_Status_Code @{resp}[2] + FOR ${resp} IN @{resp_list} + TemplatedRequests.Check_Status_Code @{resp}[2] + END Write_Transactions_One_Node_Follower [Documentation] Write transactions. @@ -121,8 +123,9 @@ Write_Transactions_One_Node_Follower ${follower_ip_as_list} = ClusterManagement.Resolve_IP_Address_For_Members ${follower_idx_as_list} MdsalLowlevelPy.Start_Write_Transactions_On_Nodes ${follower_ip_as_list} ${follower_idx_as_list} ${MODULE_SHARD_PREFIX} ${DURATION} ${TRANSACTION_RATE_1K} chained_flag=${CHAINED_TX} ${resp_list} = MdsalLowlevelPy.Wait_For_Transactions - : FOR ${resp} IN @{resp_list} - \ TemplatedRequests.Check_Status_Code @{resp}[2] + FOR ${resp} IN @{resp_list} + TemplatedRequests.Check_Status_Code @{resp}[2] + END Write_Transactions_All_Nodes [Documentation] Write transactions. @@ -130,5 +133,6 @@ Write_Transactions_All_Nodes ${all_ip_list} = ClusterManagement.Resolve_IP_Address_For_Members ${all_indices} MdsalLowlevelPy.Start_Write_Transactions_On_Nodes ${all_ip_list} ${all_indices} ${MODULE_SHARD_PREFIX} ${DURATION} ${TRANSACTION_RATE_1K} chained_flag=${CHAINED_TX} ${resp_list} = MdsalLowlevelPy.Wait_For_Transactions - : FOR ${resp} IN @{resp_list} - \ TemplatedRequests.Check_Status_Code @{resp}[2] + FOR ${resp} IN @{resp_list} + TemplatedRequests.Check_Status_Code @{resp}[2] + END diff --git a/csit/suites/controller/dom_data_broker/ddb-sanity-prefix-based.robot b/csit/suites/controller/dom_data_broker/ddb-sanity-prefix-based.robot index bd563a09cc..0068d9464a 100644 --- a/csit/suites/controller/dom_data_broker/ddb-sanity-prefix-based.robot +++ b/csit/suites/controller/dom_data_broker/ddb-sanity-prefix-based.robot @@ -39,8 +39,9 @@ ${ID_PREFIX} prefix- Get_Prefix_Shard_Role [Documentation] Get prefix shard role. ${all_indices} = ClusterManagement.List_All_Indices - : FOR ${index} IN @{all_indices} - \ ${role} = ClusterAdmin.Get_Prefix_Shard_Role ${index} ${PREF_BASED_SHARD} ${SHARD_TYPE} + FOR ${index} IN @{all_indices} + ${role} = ClusterAdmin.Get_Prefix_Shard_Role ${index} ${PREF_BASED_SHARD} ${SHARD_TYPE} + END Subscribe_Listener_To_Leader [Documentation] Subscribe listener to leader. @@ -111,8 +112,9 @@ Produce_Transactions_One_Node_Leader ${leader_ip_as_list} = ClusterManagement.Resolve_IP_Address_For_Members ${leader_idx_as_list} MdsalLowlevelPy.Start_Produce_Transactions_On_Nodes ${leader_ip_as_list} ${leader_idx_as_list} ${ID_PREFIX} ${DURATION} ${TRANSACTION_RATE_1K} ${resp_list} = MdsalLowlevelPy.Wait_For_Transactions - : FOR ${resp} IN @{resp_list} - \ TemplatedRequests.Check_Status_Code @{resp}[2] + FOR ${resp} IN @{resp_list} + TemplatedRequests.Check_Status_Code @{resp}[2] + END Produce_Transactions_One_Node_Follower [Documentation] Produce transactions. @@ -123,8 +125,9 @@ Produce_Transactions_One_Node_Follower ${follower_ip_as_list} = ClusterManagement.Resolve_IP_Address_For_Members ${follower_idx_as_list} MdsalLowlevelPy.Start_Produce_Transactions_On_Nodes ${follower_ip_as_list} ${follower_idx_as_list} ${ID_PREFIX} ${DURATION} ${TRANSACTION_RATE_1K} ${resp_list} = MdsalLowlevelPy.Wait_For_Transactions - : FOR ${resp} IN @{resp_list} - \ TemplatedRequests.Check_Status_Code @{resp}[2] + FOR ${resp} IN @{resp_list} + TemplatedRequests.Check_Status_Code @{resp}[2] + END Produce_Transactions [Documentation] Produce transactions. @@ -132,5 +135,6 @@ Produce_Transactions ${all_ip_list} = ClusterManagement.Resolve_IP_Address_For_Members ${all_indices} MdsalLowlevelPy.Start_Produce_Transactions_On_Nodes ${all_ip_list} ${all_indices} ${ID_PREFIX} ${DURATION} ${TRANSACTION_RATE_1K} ${resp_list} = MdsalLowlevelPy.Wait_For_Transactions - : FOR ${resp} IN @{resp_list} - \ TemplatedRequests.Check_Status_Code @{resp}[2] + FOR ${resp} IN @{resp_list} + TemplatedRequests.Check_Status_Code @{resp}[2] + END diff --git a/csit/suites/controller/dom_data_broker/explicit_leader_movement.robot b/csit/suites/controller/dom_data_broker/explicit_leader_movement.robot index 99b0978dd9..9e22326d94 100644 --- a/csit/suites/controller/dom_data_broker/explicit_leader_movement.robot +++ b/csit/suites/controller/dom_data_broker/explicit_leader_movement.robot @@ -28,7 +28,6 @@ Local_To_Remote_Movement Restart1 [Documentation] Restart odl - [Template] DdbCommons.Restart_Test_Templ Remote_To_Remote_Movement @@ -37,7 +36,6 @@ Remote_To_Remote_Movement Restart2 [Documentation] Restart odl - [Template] DdbCommons.Restart_Test_Templ Remote_To_Local_Movement diff --git a/csit/suites/controller/dom_data_broker/explicit_leader_movement_prefbasedshard.robot b/csit/suites/controller/dom_data_broker/explicit_leader_movement_prefbasedshard.robot index 293dc84429..f3911f8e68 100644 --- a/csit/suites/controller/dom_data_broker/explicit_leader_movement_prefbasedshard.robot +++ b/csit/suites/controller/dom_data_broker/explicit_leader_movement_prefbasedshard.robot @@ -31,7 +31,6 @@ Local_To_Remote_Movement Restart1 [Documentation] Restart odl. [Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing - [Template] DdbCommons.Restart_Test_Templ [Teardown] SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed @@ -42,7 +41,6 @@ Remote_To_Remote_Movement Restart2 [Documentation] Restart odl. [Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing - [Template] DdbCommons.Restart_Test_Templ [Teardown] SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed diff --git a/csit/suites/controller/dom_data_broker/leader_isolation.robot b/csit/suites/controller/dom_data_broker/leader_isolation.robot index ebb1366b87..75fc8c978a 100644 --- a/csit/suites/controller/dom_data_broker/leader_isolation.robot +++ b/csit/suites/controller/dom_data_broker/leader_isolation.robot @@ -27,7 +27,6 @@ Healing_Within_Request_Timeout Restart [Documentation] Restart odl - [Template] DdbCommons.Restart_Test_Templ Healing_After_Request_Timeout diff --git a/csit/suites/controller/dom_data_broker/leader_isolation_prefbasedshard.robot b/csit/suites/controller/dom_data_broker/leader_isolation_prefbasedshard.robot index 4601c06ab4..8665a8c283 100644 --- a/csit/suites/controller/dom_data_broker/leader_isolation_prefbasedshard.robot +++ b/csit/suites/controller/dom_data_broker/leader_isolation_prefbasedshard.robot @@ -30,7 +30,6 @@ Healing_Within_Request_Timeout Restart [Documentation] Restart odl. [Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing - [Template] DdbCommons.Restart_Test_Templ [Teardown] SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed diff --git a/csit/suites/controller/dom_data_broker/listener_stability.robot b/csit/suites/controller/dom_data_broker/listener_stability.robot index 1188984318..5e3b2b00b1 100644 --- a/csit/suites/controller/dom_data_broker/listener_stability.robot +++ b/csit/suites/controller/dom_data_broker/listener_stability.robot @@ -27,7 +27,6 @@ Move_Leader_From_Listener_Local_To_Remote Restart_1 [Documentation] Restart odl. - [Template] DdbCommons.Restart_Test_Templ Move_Leader_From_Listener_Remote_To_Other_Remote @@ -36,7 +35,6 @@ Move_Leader_From_Listener_Remote_To_Other_Remote Restart_2 [Documentation] Restart odl. - [Template] DdbCommons.Restart_Test_Templ Move_Leader_From_Listener_Remote_To_Local diff --git a/csit/suites/controller/dom_data_broker/listener_stability_prefbasedshard.robot b/csit/suites/controller/dom_data_broker/listener_stability_prefbasedshard.robot index 46e6ba3dde..831fdcf20e 100644 --- a/csit/suites/controller/dom_data_broker/listener_stability_prefbasedshard.robot +++ b/csit/suites/controller/dom_data_broker/listener_stability_prefbasedshard.robot @@ -30,7 +30,6 @@ Move_Leader_From_Listener_Local_To_Remote Restart_1 [Documentation] Restart odl. [Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing - [Template] DdbCommons.Restart_Test_Templ [Teardown] SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed @@ -41,7 +40,6 @@ Move_Leader_From_Listener_Remote_To_Other_Remote Restart_2 [Documentation] Restart odl. [Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing - [Template] DdbCommons.Restart_Test_Templ [Teardown] SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed diff --git a/csit/suites/controller/dom_data_broker/restart_odl_with_tell_based_false.robot b/csit/suites/controller/dom_data_broker/restart_odl_with_tell_based_false.robot index f5b63a3f12..32d48a8c11 100644 --- a/csit/suites/controller/dom_data_broker/restart_odl_with_tell_based_false.robot +++ b/csit/suites/controller/dom_data_broker/restart_odl_with_tell_based_false.robot @@ -37,10 +37,11 @@ Start_All_And_Sync ClusterManagement.Start_Members_From_List_Or_All BuiltIn.Wait_Until_Keyword_Succeeds 60s 10s ClusterManagement.Run_Bash_Command_On_List_Or_All netstat -punta ${index_list} = List_Indices_Or_All - : FOR ${index} IN @{index_list} - \ ${output} = ClusterManagement.Check_Bash_Command_On_Member command=sudo netstat -punta | grep 2550 | grep LISTEN member_index=${index} - \ ${listening} = Get Match ${output} LISTEN - \ BuiltIn.Run Keyword If '${listening}' == 'None' ClusterManagement.Check_Bash_Command_On_Member command=pid=$(grep org.apache.karaf.main.Main | grep -v grep | tr -s ' ' | cut -f2 -d' '); sudo /usr/lib/jvm/java-1.8.0/bin/jstack -l ${pid} member_index=${index} + FOR ${index} IN @{index_list} + ${output} = ClusterManagement.Check_Bash_Command_On_Member command=sudo netstat -punta | grep 2550 | grep LISTEN member_index=${index} + ${listening} = Get Match ${output} LISTEN + BuiltIn.Run Keyword If '${listening}' == 'None' ClusterManagement.Check_Bash_Command_On_Member command=pid=$(grep org.apache.karaf.main.Main | grep -v grep | tr -s ' ' | cut -f2 -d' '); sudo /usr/lib/jvm/java-1.8.0/bin/jstack -l ${pid} member_index=${index} + END BuiltIn.Wait_Until_Keyword_Succeeds 60s 10s ShardStability.Shards_Stability_Get_Details ${DEFAULT_SHARD_LIST} verify_restconf=True *** Keywords *** diff --git a/csit/suites/controller/singleton_service/global_rpc_freeze.robot b/csit/suites/controller/singleton_service/global_rpc_freeze.robot index 15703efb55..fab66354d0 100644 --- a/csit/suites/controller/singleton_service/global_rpc_freeze.robot +++ b/csit/suites/controller/singleton_service/global_rpc_freeze.robot @@ -38,8 +38,9 @@ Rpc_Before_Freezing_On_Owner Rpc_Before_Freeze_On_Successors [Documentation] Run rpc on non owher cluster nodes. - : FOR ${idx} IN @{brt_successors} - \ Run_Rpc ${idx} + FOR ${idx} IN @{brt_successors} + Run_Rpc ${idx} + END Freeze_Current_Owner_Member [Documentation] Stop cluster node which is the owner. @@ -56,8 +57,9 @@ Verify_New_Basic_Rpc_Test_Owner_Elected Rpc_On_Remained_Cluster_Nodes [Documentation] Run rpc on remained cluster nodes. - : FOR ${idx} IN @{old_brt_successors} - \ BuiltIn.Wait_Until_Keyword_Succeeds 60s 5s Run_Rpc ${idx} + FOR ${idx} IN @{old_brt_successors} + BuiltIn.Wait_Until_Keyword_Succeeds 60s 5s Run_Rpc ${idx} + END Unfreeze_Frozen_Member [Documentation] Restart frozen node @@ -75,8 +77,9 @@ Rpc_After_Rejoin_On_Old_Owner Rpc_After_Rejoin_On_All [Documentation] Run rpc again on all nodes. Run_Rpc ${brt_owner} - : FOR ${idx} IN @{brt_successors} - \ Run_Rpc ${idx} + FOR ${idx} IN @{brt_successors} + Run_Rpc ${idx} + END *** Keywords *** Setup_Suite diff --git a/csit/suites/controller/singleton_service/global_rpc_isolate.robot b/csit/suites/controller/singleton_service/global_rpc_isolate.robot index 489544107c..9cde934609 100644 --- a/csit/suites/controller/singleton_service/global_rpc_isolate.robot +++ b/csit/suites/controller/singleton_service/global_rpc_isolate.robot @@ -39,8 +39,9 @@ Rpc_Before_Isolation_On_Owner Rpc_Before_Isolation_On_Successors [Documentation] Run rpc on non owher cluster nodes. - : FOR ${idx} IN @{brt_successors} - \ Run_Rpc ${idx} + FOR ${idx} IN @{brt_successors} + Run_Rpc ${idx} + END Isolate_Current_Owner_Member [Documentation] Isolating cluster node which is the owner. @@ -65,8 +66,9 @@ Rpc_On_Isolated_Node Rpc_On_Non_Isolated_Cluster_Nodes [Documentation] Run rpc on remained cluster nodes. - : FOR ${idx} IN @{old_brt_successors} - \ BuiltIn.Wait_Until_Keyword_Succeeds 60s 5s Run_Rpc ${idx} + FOR ${idx} IN @{old_brt_successors} + BuiltIn.Wait_Until_Keyword_Succeeds 60s 5s Run_Rpc ${idx} + END Rejoin_Isolated_Member [Documentation] Rejoin isolated node @@ -84,8 +86,9 @@ Rpc_After_Rejoin_On_Old_Owner Rpc_After_Rejoin_On_All [Documentation] Run rpc again on all nodes. Run_Rpc ${brt_owner} - : FOR ${idx} IN @{brt_successors} - \ Run_Rpc ${idx} + FOR ${idx} IN @{brt_successors} + Run_Rpc ${idx} + END *** Keywords *** Setup_Suite diff --git a/csit/suites/controller/singleton_service/global_rpc_kill.robot b/csit/suites/controller/singleton_service/global_rpc_kill.robot index 4dd5d9793d..764fb6c2a8 100644 --- a/csit/suites/controller/singleton_service/global_rpc_kill.robot +++ b/csit/suites/controller/singleton_service/global_rpc_kill.robot @@ -38,8 +38,9 @@ Rpc_Before_Stopping_On_Owner Rpc_Before_Stop_On_Successors [Documentation] Run rpc on non owher cluster nodes. - : FOR ${idx} IN @{brt_successors} - \ Run_Rpc ${idx} + FOR ${idx} IN @{brt_successors} + Run_Rpc ${idx} + END Stop_Current_Owner_Member [Documentation] Stop cluster node which is the owner. @@ -55,8 +56,9 @@ Verify_New_Basic_Rpc_Test_Owner_Elected Rpc_On_Remained_Cluster_Nodes [Documentation] Run rpc on remained cluster nodes. - : FOR ${idx} IN @{old_brt_successors} - \ BuiltIn.Wait_Until_Keyword_Succeeds 60s 5s Run_Rpc ${idx} + FOR ${idx} IN @{old_brt_successors} + BuiltIn.Wait_Until_Keyword_Succeeds 60s 5s Run_Rpc ${idx} + END Restart_Stopped_Member [Documentation] Restart stopped node @@ -78,8 +80,9 @@ Rpc_After_Rejoin_On_Old_Owner Rpc_After_Rejoin_On_All [Documentation] Run rpc again on all nodes. Run_Rpc ${brt_owner} - : FOR ${idx} IN @{brt_successors} - \ Run_Rpc ${idx} + FOR ${idx} IN @{brt_successors} + Run_Rpc ${idx} + END *** Keywords *** Setup_Suite diff --git a/csit/suites/distribution/karaf_sequence_install.robot b/csit/suites/distribution/karaf_sequence_install.robot index 537bd9a030..accd7c8339 100644 --- a/csit/suites/distribution/karaf_sequence_install.robot +++ b/csit/suites/distribution/karaf_sequence_install.robot @@ -35,6 +35,7 @@ Install_Features_One_By_One @{features} = XML.Get_Elements_Texts features.xml .feature[@name="${FEATURES_LIST_NAME}"]/feature Collections.Log_List ${features} KarafKeywords.Open_Controller_Karaf_Console_With_Timeout ${1} ${FEATURE_INSTALL_TIMEOUT} - : FOR ${feature} IN @{features} - \ KarafKeywords.Log_Message_To_Controller_Karaf Installing feature: ${feature} - \ KarafKeywords.Install_a_Feature_Using_Active_Connection ${feature} + FOR ${feature} IN @{features} + KarafKeywords.Log_Message_To_Controller_Karaf Installing feature: ${feature} + KarafKeywords.Install_a_Feature_Using_Active_Connection ${feature} + END diff --git a/csit/suites/dluxapps/yangman/502__yangman.robot b/csit/suites/dluxapps/yangman/502__yangman.robot index d9418df22b..9a030e8249 100644 --- a/csit/suites/dluxapps/yangman/502__yangman.robot +++ b/csit/suites/dluxapps/yangman/502__yangman.robot @@ -34,13 +34,14 @@ Verify Operations Presence In Operation Select Menu Select Each Operation And Verify That Code Mirrors Has Been Displayed Correctly ${operation_ids}= YangmanKeywords.Return List Of Operation IDs ${operation_names}= YangmanKeywords.Return List Of Operation Names - : FOR ${i} IN RANGE 0 len(${operation_ids}) - \ ${operation_id}= Collections.Get From List ${operation_ids} ${i} - \ ${operation_name}= Collections.Get From List ${operation_names} ${i} - \ YangmanKeywords.Expand Operation Select Menu And Select Operation ${operation_id} ${operation_name} - \ Run Keyword If "${operation_name}"=="PUT" or "${operation_name}"=="POST" BuiltIn.Run Keywords YangmanKeywords.Verify Sent Data CM Is Displayed - \ ... AND YangmanKeywords.Verify Received Data CM Is Displayed - \ Run Keyword If "${operation_name}"=="GET" or "${operation_name}"=="DELETE" YangmanKeywords.Verify Received Data CM Is Displayed + FOR ${i} IN RANGE 0 len(${operation_ids}) + ${operation_id}= Collections.Get From List ${operation_ids} ${i} + ${operation_name}= Collections.Get From List ${operation_names} ${i} + YangmanKeywords.Expand Operation Select Menu And Select Operation ${operation_id} ${operation_name} + Run Keyword If "${operation_name}"=="PUT" or "${operation_name}"=="POST" BuiltIn.Run Keywords YangmanKeywords.Verify Sent Data CM Is Displayed + ... AND YangmanKeywords.Verify Received Data CM Is Displayed + Run Keyword If "${operation_name}"=="GET" or "${operation_name}"=="DELETE" YangmanKeywords.Verify Received Data CM Is Displayed + END Verify Displaying And Hiding Of CMs When Selecting Show Data Checkboxes YangmanKeywords.Select Json View diff --git a/csit/suites/dluxapps/yangman/505__yangmam_modules_loading.robot b/csit/suites/dluxapps/yangman/505__yangmam_modules_loading.robot index bbc8cc2d06..981c9a0aab 100644 --- a/csit/suites/dluxapps/yangman/505__yangmam_modules_loading.robot +++ b/csit/suites/dluxapps/yangman/505__yangmam_modules_loading.robot @@ -44,81 +44,86 @@ Verify Each Loaded Module Is Expanded Expand Each Loaded Module [Arguments] ${number_of_modules_loaded} - : FOR ${index} IN RANGE 0 ${number_of_modules_loaded} - \ ${module_list_item_collapsed_indexed}= YangmanKeywords.Return Module List Item Collapsed Indexed ${index} - \ ${indexed_module_expander_icon}= YangmanKeywords.Return Indexed Module Expander Icon ${index} - \ ${status}= BuiltIn.Run Keyword And Return Status Selenium2Library.Wait Until Page Contains Element ${module_list_item_collapsed_indexed} - \ BuiltIn.Run Keyword If "${status}"=="True" GUIKeywords.Focus And Click Element ${indexed_module_expander_icon} - \ Selenium2Library.Wait Until Page Does Not Contain Element ${module_list_item_collapsed_indexed} + FOR ${index} IN RANGE 0 ${number_of_modules_loaded} + ${module_list_item_collapsed_indexed}= YangmanKeywords.Return Module List Item Collapsed Indexed ${index} + ${indexed_module_expander_icon}= YangmanKeywords.Return Indexed Module Expander Icon ${index} + ${status}= BuiltIn.Run Keyword And Return Status Selenium2Library.Wait Until Page Contains Element ${module_list_item_collapsed_indexed} + BuiltIn.Run Keyword If "${status}"=="True" GUIKeywords.Focus And Click Element ${indexed_module_expander_icon} + Selenium2Library.Wait Until Page Does Not Contain Element ${module_list_item_collapsed_indexed} + END Collapse Each Expanded Module [Arguments] ${number_of_modules_loaded} - : FOR ${index} IN RANGE 0 ${number_of_modules_loaded} - \ ${module_list_item_expanded_indexed}= YangmanKeywords.Return Module List Item Expanded Indexed ${index} - \ ${indexed_module_expander_icon}= YangmanKeywords.Return Indexed Module Expander Icon ${index} - \ ${status}= BuiltIn.Run Keyword And Return Status Selenium2Library.Wait Until Page Contains Element ${module_list_item_expanded_indexed} - \ BuiltIn.Run Keyword If "${status}"=="True" Run Keyword GUIKeywords.Focus And Click Element ${indexed_module_expander_icon} - \ Selenium2Library.Wait Until Page Does Not Contain Element ${module_list_item_expanded_indexed} + FOR ${index} IN RANGE 0 ${number_of_modules_loaded} + ${module_list_item_expanded_indexed}= YangmanKeywords.Return Module List Item Expanded Indexed ${index} + ${indexed_module_expander_icon}= YangmanKeywords.Return Indexed Module Expander Icon ${index} + ${status}= BuiltIn.Run Keyword And Return Status Selenium2Library.Wait Until Page Contains Element ${module_list_item_expanded_indexed} + BuiltIn.Run Keyword If "${status}"=="True" Run Keyword GUIKeywords.Focus And Click Element ${indexed_module_expander_icon} + Selenium2Library.Wait Until Page Does Not Contain Element ${module_list_item_expanded_indexed} + END Verify Each Loaded Module Contains Operational Or Config Or Operations [Arguments] ${number_of_modules_loaded} - : FOR ${index} IN RANGE 0 ${number_of_modules_loaded} - \ ${indexed_module_operations}= YangmanKeywords.Return Indexed Module Operations Label ${index} - \ ${indexed_module_operational}= YangmanKeywords.Return Indexed Module Operational Label ${index} - \ ${indexed_module_config}= YangmanKeywords.Return Indexed Module Config Label ${index} - \ ${contains_operational}= BuiltIn.Run Keyword And Return Status Selenium2Library.Page Should Contain Element ${indexed_module_operational} - \ ${contains_operations}= BuiltIn.Run Keyword And Return Status Selenium2Library.Page Should Contain Element ${indexed_module_operations} - \ ${contains_config}= BuiltIn.Run Keyword And Return Status Selenium2Library.Page Should Contain Element ${indexed_module_config} - \ @{states}= BuiltIn.Create List "${contains_operational}" "${contains_operations}" "${contains_config}" - \ Collections.List Should Contain Value ${states} "True" + FOR ${index} IN RANGE 0 ${number_of_modules_loaded} + ${indexed_module_operations}= YangmanKeywords.Return Indexed Module Operations Label ${index} + ${indexed_module_operational}= YangmanKeywords.Return Indexed Module Operational Label ${index} + ${indexed_module_config}= YangmanKeywords.Return Indexed Module Config Label ${index} + ${contains_operational}= BuiltIn.Run Keyword And Return Status Selenium2Library.Page Should Contain Element ${indexed_module_operational} + ${contains_operations}= BuiltIn.Run Keyword And Return Status Selenium2Library.Page Should Contain Element ${indexed_module_operations} + ${contains_config}= BuiltIn.Run Keyword And Return Status Selenium2Library.Page Should Contain Element ${indexed_module_config} + @{states}= BuiltIn.Create List "${contains_operational}" "${contains_operations}" "${contains_config}" + Collections.List Should Contain Value ${states} "True" + END Compare Module Name In Module List And Module Detail [Arguments] ${number_of_modules_loaded} - : FOR ${index} IN RANGE 0 ${number_of_modules_loaded} - \ ${indexed_module}= YangmanKeywords.Return Module List Indexed Module ${index} - \ ${indexed_module_operations}= YangmanKeywords.Return Indexed Module Operations Label ${index} - \ ${indexed_module_operational}= YangmanKeywords.Return Indexed Module Operational Label ${index} - \ ${indexed_module_config}= YangmanKeywords.Return Indexed Module Config Label ${index} - \ ${contains_operational}= BuiltIn.Run Keyword And Return Status Selenium2Library.Wait Until Page Contains Element ${indexed_module_operational} - \ ${contains_operations}= BuiltIn.Run Keyword And Return Status Selenium2Library.Wait Until Page Contains Element ${indexed_module_operations} - \ ${contains_config}= BuiltIn.Run Keyword And Return Status Selenium2Library.Wait Until Page Contains Element ${indexed_module_config} - \ ${module_list_module_name}= Selenium2Library.Get Text ${indexed_module}//p - \ BuiltIn.Run Keyword If "${contains_operations}"=="True" BuiltIn.Run Keywords GUIKeywords.Focus And Click Element ${indexed_module_operations} - \ ... AND Selenium2Library.Wait Until Page Contains Element ${MODULE_DETAIL_MODULE_NAME_LABEL} - \ ${module_detail_module_name}= BuiltIn.Run Keyword If "${contains_operations}"=="True" Selenium2Library.Get Text ${MODULE_DETAIL_MODULE_NAME_LABEL} - \ BuiltIn.Run Keyword If "${contains_operations}"=="True" BuiltIn.Run Keywords BuiltIn.Should Contain ${module_detail_module_name} ${module_list_module_name} - \ ... AND YangmanKeywords.Toggle Module Detail To Modules Or History Or Collections Tab - \ ... AND Selenium2Library.Wait Until Element Is Visible ${indexed_module_operations} - \ ${contains_operational}= BuiltIn.Run Keyword And Return Status Selenium2Library.Page Should Contain Element ${indexed_module_operational} - \ BuiltIn.Run Keyword If "${contains_operational}"=="True" BuiltIn.Run Keywords GUIKeywords.Focus And Click Element ${indexed_module_operational} - \ ... AND Selenium2Library.Wait Until Page Contains Element ${MODULE_DETAIL_MODULE_NAME_LABEL} - \ ${module_detail_module_name}= BuiltIn.Run Keyword If "${contains_operational}"=="True" Selenium2Library.Get Text ${MODULE_DETAIL_MODULE_NAME_LABEL} - \ BuiltIn.Run Keyword If "${contains_operational}"=="True" BuiltIn.Run Keywords BuiltIn.Should Contain ${module_detail_module_name} ${module_list_module_name} - \ ... AND YangmanKeywords.Toggle Module Detail To Modules Or History Or Collections Tab - \ ... AND Selenium2Library.Wait Until Element Is Visible ${indexed_module_operational} - \ ${contains_config}= BuiltIn.Run Keyword And Return Status Selenium2Library.Page Should Contain Element ${indexed_module_config} - \ BuiltIn.Run Keyword If "${contains_config}"=="True" BuiltIn.Run Keywords GUIKeywords.Focus And Click Element ${indexed_module_config} - \ ... AND Selenium2Library.Wait Until Page Contains Element ${MODULE_DETAIL_MODULE_NAME_LABEL} - \ ${module_detail_module_name}= BuiltIn.Run Keyword If "${contains_config}"=="True" Selenium2Library.Get Text ${MODULE_DETAIL_MODULE_NAME_LABEL} - \ BuiltIn.Run Keyword If "${contains_config}"=="True" BuiltIn.Run Keywords BuiltIn.Should Contain ${module_detail_module_name} ${module_list_module_name} - \ ... AND YangmanKeywords.Toggle Module Detail To Modules Or History Or Collections Tab - \ ... AND Selenium2Library.Wait Until Element Is Visible ${indexed_module_config} + FOR ${index} IN RANGE 0 ${number_of_modules_loaded} + ${indexed_module}= YangmanKeywords.Return Module List Indexed Module ${index} + ${indexed_module_operations}= YangmanKeywords.Return Indexed Module Operations Label ${index} + ${indexed_module_operational}= YangmanKeywords.Return Indexed Module Operational Label ${index} + ${indexed_module_config}= YangmanKeywords.Return Indexed Module Config Label ${index} + ${contains_operational}= BuiltIn.Run Keyword And Return Status Selenium2Library.Wait Until Page Contains Element ${indexed_module_operational} + ${contains_operations}= BuiltIn.Run Keyword And Return Status Selenium2Library.Wait Until Page Contains Element ${indexed_module_operations} + ${contains_config}= BuiltIn.Run Keyword And Return Status Selenium2Library.Wait Until Page Contains Element ${indexed_module_config} + ${module_list_module_name}= Selenium2Library.Get Text ${indexed_module}//p + BuiltIn.Run Keyword If "${contains_operations}"=="True" BuiltIn.Run Keywords GUIKeywords.Focus And Click Element ${indexed_module_operations} + ... AND Selenium2Library.Wait Until Page Contains Element ${MODULE_DETAIL_MODULE_NAME_LABEL} + ${module_detail_module_name}= BuiltIn.Run Keyword If "${contains_operations}"=="True" Selenium2Library.Get Text ${MODULE_DETAIL_MODULE_NAME_LABEL} + BuiltIn.Run Keyword If "${contains_operations}"=="True" BuiltIn.Run Keywords BuiltIn.Should Contain ${module_detail_module_name} ${module_list_module_name} + ... AND YangmanKeywords.Toggle Module Detail To Modules Or History Or Collections Tab + ... AND Selenium2Library.Wait Until Element Is Visible ${indexed_module_operations} + ${contains_operational}= BuiltIn.Run Keyword And Return Status Selenium2Library.Page Should Contain Element ${indexed_module_operational} + BuiltIn.Run Keyword If "${contains_operational}"=="True" BuiltIn.Run Keywords GUIKeywords.Focus And Click Element ${indexed_module_operational} + ... AND Selenium2Library.Wait Until Page Contains Element ${MODULE_DETAIL_MODULE_NAME_LABEL} + ${module_detail_module_name}= BuiltIn.Run Keyword If "${contains_operational}"=="True" Selenium2Library.Get Text ${MODULE_DETAIL_MODULE_NAME_LABEL} + BuiltIn.Run Keyword If "${contains_operational}"=="True" BuiltIn.Run Keywords BuiltIn.Should Contain ${module_detail_module_name} ${module_list_module_name} + ... AND YangmanKeywords.Toggle Module Detail To Modules Or History Or Collections Tab + ... AND Selenium2Library.Wait Until Element Is Visible ${indexed_module_operational} + ${contains_config}= BuiltIn.Run Keyword And Return Status Selenium2Library.Page Should Contain Element ${indexed_module_config} + BuiltIn.Run Keyword If "${contains_config}"=="True" BuiltIn.Run Keywords GUIKeywords.Focus And Click Element ${indexed_module_config} + ... AND Selenium2Library.Wait Until Page Contains Element ${MODULE_DETAIL_MODULE_NAME_LABEL} + ${module_detail_module_name}= BuiltIn.Run Keyword If "${contains_config}"=="True" Selenium2Library.Get Text ${MODULE_DETAIL_MODULE_NAME_LABEL} + BuiltIn.Run Keyword If "${contains_config}"=="True" BuiltIn.Run Keywords BuiltIn.Should Contain ${module_detail_module_name} ${module_list_module_name} + ... AND YangmanKeywords.Toggle Module Detail To Modules Or History Or Collections Tab + ... AND Selenium2Library.Wait Until Element Is Visible ${indexed_module_config} + END Click Operations Or Operational And Config Of All Modules And Verify Chosen Tab Is Selected [Arguments] ${number_of_modules_loaded} - : FOR ${index} IN RANGE 0 ${number_of_modules_loaded} - \ ${indexed_module_operations}= YangmanKeywords.Return Indexed Module Operations Label ${index} - \ ${indexed_module_operational}= YangmanKeywords.Return Indexed Module Operational Label ${index} - \ ${indexed_module_config}= YangmanKeywords.Return Indexed Module Config Label ${index} - \ ${contains_operational}= BuiltIn.Run Keyword And Return Status Selenium2Library.Wait Until Page Contains Element ${indexed_module_operational} - \ ${contains_operations}= BuiltIn.Run Keyword And Return Status Selenium2Library.Wait Until Page Contains Element ${indexed_module_operations} - \ ${contains_config}= BuiltIn.Run Keyword And Return Status Selenium2Library.Wait Until Page Contains Element ${indexed_module_config} - \ BuiltIn.Run Keyword If "${contains_operations}"=="True" Run Keywords YangmanKeywords.Click Indexed Module Operations To Load Module Detail Operations Tab ${index} - \ ... AND YangmanKeywords.Toggle Module Detail To Modules Or History Or Collections Tab - \ ... AND Selenium2Library.Wait Until Element Is Visible ${indexed_module_operations} - \ BuiltIn.Run Keyword If "${contains_operational}"=="True" BuiltIn.Run Keywords YangmanKeywords.Click Indexed Module Operational To Load Module Detail Operational Tab ${index} - \ ... AND YangmanKeywords.Toggle Module Detail To Modules Or History Or Collections Tab - \ ... AND Selenium2Library.Wait Until Element Is Visible ${indexed_module_operational} - \ BuiltIn.Run Keyword If "${contains_config}"=="True" BuiltIn.Run Keywords YangmanKeywords.Click Indexed Module Config To Load Module Detail Config Tab ${index} - \ ... AND YangmanKeywords.Toggle Module Detail To Modules Or History Or Collections Tab - \ ... AND Selenium2Library.Wait Until Element Is Visible ${indexed_module_config} + FOR ${index} IN RANGE 0 ${number_of_modules_loaded} + ${indexed_module_operations}= YangmanKeywords.Return Indexed Module Operations Label ${index} + ${indexed_module_operational}= YangmanKeywords.Return Indexed Module Operational Label ${index} + ${indexed_module_config}= YangmanKeywords.Return Indexed Module Config Label ${index} + ${contains_operational}= BuiltIn.Run Keyword And Return Status Selenium2Library.Wait Until Page Contains Element ${indexed_module_operational} + ${contains_operations}= BuiltIn.Run Keyword And Return Status Selenium2Library.Wait Until Page Contains Element ${indexed_module_operations} + ${contains_config}= BuiltIn.Run Keyword And Return Status Selenium2Library.Wait Until Page Contains Element ${indexed_module_config} + BuiltIn.Run Keyword If "${contains_operations}"=="True" Run Keywords YangmanKeywords.Click Indexed Module Operations To Load Module Detail Operations Tab ${index} + ... AND YangmanKeywords.Toggle Module Detail To Modules Or History Or Collections Tab + ... AND Selenium2Library.Wait Until Element Is Visible ${indexed_module_operations} + BuiltIn.Run Keyword If "${contains_operational}"=="True" BuiltIn.Run Keywords YangmanKeywords.Click Indexed Module Operational To Load Module Detail Operational Tab ${index} + ... AND YangmanKeywords.Toggle Module Detail To Modules Or History Or Collections Tab + ... AND Selenium2Library.Wait Until Element Is Visible ${indexed_module_operational} + BuiltIn.Run Keyword If "${contains_config}"=="True" BuiltIn.Run Keywords YangmanKeywords.Click Indexed Module Config To Load Module Detail Config Tab ${index} + ... AND YangmanKeywords.Toggle Module Detail To Modules Or History Or Collections Tab + ... AND Selenium2Library.Wait Until Element Is Visible ${indexed_module_config} + END diff --git a/csit/suites/genius/BFD_monitoring.robot b/csit/suites/genius/BFD_monitoring.robot index 2a65962bd0..b0a34dba77 100644 --- a/csit/suites/genius/BFD_monitoring.robot +++ b/csit/suites/genius/BFD_monitoring.robot @@ -76,9 +76,10 @@ BFD_TC05 Verify BFD tunnel monitoring interval can be changed. Wait Until Keyword Succeeds 30s 10s Utils.Check For Elements At URI ${OPERATIONAL_API}/itm-config:tunnel-monitor-interval/ ${Bfd_updated_value} Wait Until Keyword Succeeds 30s 10s Utils.Check For Elements At URI ${CONFIG_API}/itm-config:tunnel-monitor-interval/ ${Bfd_updated_value} Wait Until Keyword Succeeds 10s 2s Verify Config Ietf Interface Output ${INTERFACE_DS_MONI_TRUE} ${INTERFACE_DS_MONI_INT_5000} ${TUNNEL_MONI_PROTO} - : FOR ${tool_system_index} IN RANGE ${NUM_TOOLS_SYSTEM} - \ ${tun_names} Genius.Get Tunnels On OVS ${TOOLS_SYSTEM_ALL_CONN_IDS[${tool_system_index}]} - \ Verify ovs-vsctl Output For Each Tunnel ${tun_names} ${tool_system_index} + FOR ${tool_system_index} IN RANGE ${NUM_TOOLS_SYSTEM} + ${tun_names} Genius.Get Tunnels On OVS ${TOOLS_SYSTEM_ALL_CONN_IDS[${tool_system_index}]} + Verify ovs-vsctl Output For Each Tunnel ${tun_names} ${tool_system_index} + END BFD_TC06 Verify that the tunnel state goes to UNKNOWN when DPN is disconnected [Documentation] Verify that the tunnel state goes to UNKNOWN when DPN is disconnected @@ -141,7 +142,8 @@ Disable BFD And Verify Verify ovs-vsctl Output For Each Tunnel [Arguments] ${tun_names} ${tool_system_index} ${no of tunnels} = BuiltIn.Get Length ${tun_names} - : FOR ${each_tun} IN RANGE ${no of tunnels} - \ ${tun} Collections.Get From List ${tun_names} ${each_tun} - \ BuiltIn.Wait Until Keyword Succeeds 20 5 OVSDB.Verify Ovs-vsctl Output list interface ${tun} 5000 - \ ... ovs_system=@{TOOLS_SYSTEM_ALL_IPS}[${tool_system_index}] + FOR ${each_tun} IN RANGE ${no of tunnels} + ${tun} Collections.Get From List ${tun_names} ${each_tun} + BuiltIn.Wait Until Keyword Succeeds 20 5 OVSDB.Verify Ovs-vsctl Output list interface ${tun} 5000 + ... ovs_system=@{TOOLS_SYSTEM_ALL_IPS}[${tool_system_index}] + END diff --git a/csit/suites/genius/Configure_ITM.robot b/csit/suites/genius/Configure_ITM.robot index 074900781d..8cd4f351f4 100644 --- a/csit/suites/genius/Configure_ITM.robot +++ b/csit/suites/genius/Configure_ITM.robot @@ -42,9 +42,10 @@ Create and Verify VTEP -No Vlan Delete and Verify VTEP -No Vlan [Documentation] This Delete testcase , deletes the ITM tunnel created between 2 dpns. ${tunnel_list} = Genius.Get Tunnels List - : FOR ${dpn_id} IN @{DPN_ID_LIST} - \ CompareStream.Run_Keyword_If_Less_Than_Sodium Utils.Remove All Elements At URI And Verify ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/subnets/${SUBNET}%2F16/vteps/${dpn_id}/${port_name} - \ CompareStream.Run_Keyword_If_At_Least_Sodium Utils.Remove All Elements At URI And Verify ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/vteps/${dpn_id} + FOR ${dpn_id} IN @{DPN_ID_LIST} + CompareStream.Run_Keyword_If_Less_Than_Sodium Utils.Remove All Elements At URI And Verify ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/subnets/${SUBNET}%2F16/vteps/${dpn_id}/${port_name} + CompareStream.Run_Keyword_If_At_Least_Sodium Utils.Remove All Elements At URI And Verify ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/vteps/${dpn_id} + END ${output} = KarafKeywords.Issue Command On Karaf Console ${TEP_SHOW} BuiltIn.Should Not Contain ${output} ${itm_created[0]} Utils.Remove All Elements At URI And Verify ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/ @@ -61,14 +62,16 @@ Create and Verify VTEP IPv6 - No Vlan BuiltIn.Wait Until Keyword Succeeds 40 10 Get ITM IPV6 ${itm_created[0]} ${type} = BuiltIn.Set Variable odl-interface:tunnel-type-vxlan Genius.Update Dpn id list and get tunnels ${type} - : FOR ${dpn} IN @{DPN_ID_LIST} - \ BuiltIn.Wait Until Keyword Succeeds 40 5 Utils.Get Data From URI session ${CONFIG_API}/itm-state:dpn-endpoints/DPN-TEPs-info/${dpn}/ - \ ... headers=${ACCEPT_XML} + FOR ${dpn} IN @{DPN_ID_LIST} + BuiltIn.Wait Until Keyword Succeeds 40 5 Utils.Get Data From URI session ${CONFIG_API}/itm-state:dpn-endpoints/DPN-TEPs-info/${dpn}/ + ... headers=${ACCEPT_XML} + END BuiltIn.Wait Until Keyword Succeeds 40 10 OVS Verification Between IPV6 @{all_tunnels} = BuiltIn.Create List - : FOR ${conn_id} IN @{TOOLS_SYSTEM_ALL_CONN_IDS} - \ ${tun_names} = Genius.Get Tunnels On OVS ${conn_id} - \ Collections.Append To List ${all_tunnels} @{tun_names} + FOR ${conn_id} IN @{TOOLS_SYSTEM_ALL_CONN_IDS} + ${tun_names} = Genius.Get Tunnels On OVS ${conn_id} + Collections.Append To List ${all_tunnels} @{tun_names} + END @{network_topology_list} = BuiltIn.Create List @{all_tunnels} @{network_topology_list} = Collections.Append To List ${network_topology_list} ${Bridge} ${resp} = BuiltIn.Wait Until Keyword Succeeds 40 10 Get Network Topology with Tunnel ${OPERATIONAL_TOPO_API} ${network_topology_list} @@ -77,9 +80,10 @@ Delete and Verify VTEP IPv6 -No Vlan [Documentation] This Delete testcase , deletes the ITM tunnel created between 2 dpns. ${type} = BuiltIn.Set Variable odl-interface:tunnel-type-vxlan ${tunnel_list} = Genius.Get Tunnels List - : FOR ${dpn_id} IN @{DPN_ID_LIST} - \ CompareStream.Run_Keyword_If_Less_Than_Sodium Utils.Remove All Elements At URI And Verify ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/subnets/${SUBNET_IPV6}%2F16/vteps/${dpn_id}/${port_name} - \ CompareStream.Run_Keyword_If_At_Least_Sodium Utils.Remove All Elements At URI And Verify ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/vteps/${dpn_id} + FOR ${dpn_id} IN @{DPN_ID_LIST} + CompareStream.Run_Keyword_If_Less_Than_Sodium Utils.Remove All Elements At URI And Verify ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/subnets/${SUBNET_IPV6}%2F16/vteps/${dpn_id}/${port_name} + CompareStream.Run_Keyword_If_At_Least_Sodium Utils.Remove All Elements At URI And Verify ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/vteps/${dpn_id} + END ${output} = KarafKeywords.Issue Command On Karaf Console ${TEP_SHOW} BuiltIn.Should Not Contain ${output} ${itm_created[0]} BuiltIn.Run Keyword And Ignore Error Utils.Remove All Elements At URI And Verify ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/ @@ -104,9 +108,10 @@ Delete and Verify VTEP -Vlan [Documentation] This Delete testcase , deletes the ITM tunnel created between 2 dpns. ${type} = BuiltIn.Set Variable odl-interface:tunnel-type-vxlan ${tunnel_list} = Genius.Get Tunnels List - : FOR ${dpn_id} IN @{DPN_ID_LIST} - \ CompareStream.Run_Keyword_If_Less_Than_Sodium Utils.Remove All Elements At URI And Verify ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/subnets/${SUBNET}%2F16/vteps/${dpn_id}/${port_name} - \ CompareStream.Run_Keyword_If_At_Least_Sodium Utils.Remove All Elements At URI And Verify ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/vteps/${dpn_id} + FOR ${dpn_id} IN @{DPN_ID_LIST} + CompareStream.Run_Keyword_If_Less_Than_Sodium Utils.Remove All Elements At URI And Verify ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/subnets/${SUBNET}%2F16/vteps/${dpn_id}/${port_name} + CompareStream.Run_Keyword_If_At_Least_Sodium Utils.Remove All Elements At URI And Verify ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/vteps/${dpn_id} + END ${output} = KarafKeywords.Issue Command On Karaf Console ${TEP_SHOW} BuiltIn.Should Not Contain ${output} ${itm_created[0]} Utils.Remove All Elements At URI And Verify ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/ @@ -135,9 +140,10 @@ Delete VTEP -Vlan and gateway [Documentation] This testcase deletes the ITM tunnel created between 2 dpns. ${type} = BuiltIn.Set Variable odl-interface:tunnel-type-vxlan ${tunnel_list} = Genius.Get Tunnels List - : FOR ${dpn_id} IN @{DPN_ID_LIST} - \ CompareStream.Run_Keyword_If_Less_Than_Sodium Utils.Remove All Elements At URI And Verify ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/subnets/${SUBNET}%2F16/vteps/${dpn_id}/${port_name} - \ CompareStream.Run_Keyword_If_At_Least_Sodium Utils.Remove All Elements At URI And Verify ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/vteps/${dpn_id} + FOR ${dpn_id} IN @{DPN_ID_LIST} + CompareStream.Run_Keyword_If_Less_Than_Sodium Utils.Remove All Elements At URI And Verify ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/subnets/${SUBNET}%2F16/vteps/${dpn_id}/${port_name} + CompareStream.Run_Keyword_If_At_Least_Sodium Utils.Remove All Elements At URI And Verify ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/vteps/${dpn_id} + END ${output} = KarafKeywords.Issue Command On Karaf Console ${TEP_SHOW} BuiltIn.Should Not Contain ${output} ${itm_created[0]} Utils.Remove All Elements At URI And Verify ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/ @@ -170,8 +176,9 @@ Get ITM IPV6 OVS Verification Between IPV6 [Documentation] This keyword will verify tunnels available on ovs - : FOR ${tools_ip} IN @{TOOLS_SYSTEM_ALL_IPS} - \ Genius.Ovs Verification For Each Dpn ${tools_ip} ${TOOLS_SYSTEM_IPV6_LIST} + FOR ${tools_ip} IN @{TOOLS_SYSTEM_ALL_IPS} + Genius.Ovs Verification For Each Dpn ${tools_ip} ${TOOLS_SYSTEM_IPV6_LIST} + END Verify Network Topology [Documentation] This keyword will verify whether all tunnels and bridges are populated in network topology @@ -189,6 +196,7 @@ Verify Ietf Interface State Build Tools System IPV6 List [Documentation] Create a list of tools system ips with IPV6. @{TOOLS_SYSTEM_IPV6_LIST} = BuiltIn.Create List - : FOR ${tool_system_index} IN RANGE ${NUM_TOOLS_SYSTEM} - \ Collections.Append To List ${TOOLS_SYSTEM_IPV6_LIST} fd96:2a25:4ad3:3c7d:0:0:${tool_system_index}:1000 + FOR ${tool_system_index} IN RANGE ${NUM_TOOLS_SYSTEM} + Collections.Append To List ${TOOLS_SYSTEM_IPV6_LIST} fd96:2a25:4ad3:3c7d:0:0:${tool_system_index}:1000 + END BuiltIn.Set Suite Variable @{TOOLS_SYSTEM_IPV6_LIST} diff --git a/csit/suites/genius/ITM_Direct_Tunnels.robot b/csit/suites/genius/ITM_Direct_Tunnels.robot index 8743ee0bd7..06673592e0 100644 --- a/csit/suites/genius/ITM_Direct_Tunnels.robot +++ b/csit/suites/genius/ITM_Direct_Tunnels.robot @@ -59,9 +59,10 @@ Verify Tunnels By Enabling/Disabling BFD Delete and Verify VTEP [Documentation] This Delete testcase , deletes the ITM tunnel created between 2 dpns. ${tunnel_list} = Genius.Get Tunnels List - : FOR ${dpn_id} IN @{DPN_ID_LIST} - \ CompareStream.Run_Keyword_If_Less_Than_Sodium Utils.Remove All Elements At URI And Verify ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/subnets/${SUBNET}%2F16/vteps/${dpn_id}/${port_name} - \ CompareStream.Run_Keyword_If_At_Least_Sodium Utils.Remove All Elements At URI And Verify ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/vteps/${dpn_id} + FOR ${dpn_id} IN @{DPN_ID_LIST} + CompareStream.Run_Keyword_If_Less_Than_Sodium Utils.Remove All Elements At URI And Verify ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/subnets/${SUBNET}%2F16/vteps/${dpn_id}/${port_name} + CompareStream.Run_Keyword_If_At_Least_Sodium Utils.Remove All Elements At URI And Verify ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/vteps/${dpn_id} + END ${output} = KarafKeywords.Issue Command On Karaf Console ${TEP_SHOW} BuiltIn.Should Not Contain ${output} ${itm_created[0]} Utils.Remove All Elements At URI And Verify ${CONFIG_API}/itm:transport-zones/transport-zone/${itm_created[0]}/ @@ -96,8 +97,9 @@ Verify Tunnels By Enabling BFD [Documentation] Verify tunnel creation by enabling BFD monitoring. ${result} = BuiltIn.Run Keyword And Return Status Genius.Verify Tunnel Monitoring Status ${TUNNEL_MONITOR_ON} BuiltIn.Run Keyword If '${result}' == 'False' Enable_Tunnel_monitoring - : FOR ${tools_ip} IN @{TOOLS_SYSTEM_ALL_IPS} - \ Verify Tunnel State After OVS Restart ${tools_ip} + FOR ${tools_ip} IN @{TOOLS_SYSTEM_ALL_IPS} + Verify Tunnel State After OVS Restart ${tools_ip} + END Verify Tunnels By Disabling BFD [Documentation] Verify tunnel creation by disabling BFD monitoring. diff --git a/csit/suites/genius/ITM_Vtep_Auto_Tunnel.robot b/csit/suites/genius/ITM_Vtep_Auto_Tunnel.robot index 2b8317cf88..a24fdfe91e 100644 --- a/csit/suites/genius/ITM_Vtep_Auto_Tunnel.robot +++ b/csit/suites/genius/ITM_Vtep_Auto_Tunnel.robot @@ -35,11 +35,13 @@ ${TRANSPORTZONE_POST_URL} ${CONFIG_API}/itm:transport-zones Verify TEP in controller and transport zone in OVSDB table of compute nodes [Documentation] Set local ip in compute nodes and verify default transport zone tunnels are up in controller @{LOCAL_IPS} = BuiltIn.Create List - : FOR ${ip} IN @{TOOLS_SYSTEM_ALL_IPS} - \ ${localip} = Utils.Run Command On Remote System ${ip} ${SET_LOCAL_IP}${ip} - : FOR ${node_ip} IN @{TOOLS_SYSTEM_ALL_IPS} - \ ${ip} = OvsManager.Get OVS Local Ip ${node_ip} - \ Collections.Append To List ${LOCAL_IPS} ${ip} + FOR ${ip} IN @{TOOLS_SYSTEM_ALL_IPS} + ${localip} = Utils.Run Command On Remote System ${ip} ${SET_LOCAL_IP}${ip} + END + FOR ${node_ip} IN @{TOOLS_SYSTEM_ALL_IPS} + ${ip} = OvsManager.Get OVS Local Ip ${node_ip} + Collections.Append To List ${LOCAL_IPS} ${ip} + END BuiltIn.Set Suite Variable @{LOCAL_IPS} BuiltIn.Wait Until Keyword Succeeds 3x 10 sec Genius.Verify Tunnel Status as Up @@ -50,11 +52,13 @@ Verify TEPs with transport zone configured from OVS will be added to correspondi BuiltIn.Should Contain ${get_nohosted_data} ${TRANSPORT_ZONE} BuiltIn.Should Contain ${get_nohosted_data} @{DPN_ID_LIST}[0] Utils.Post Elements To URI From File ${TRANSPORTZONE_POST_URL} ${TZA_JSON} - : FOR ${node_number} IN RANGE 2 ${NUM_TOOLS_SYSTEM}+1 - \ Change Transport Zone In Compute ${TOOLS_SYSTEM_${node_number}_IP} ${TRANSPORT_ZONE} - : FOR ${node} IN @{TOOLS_SYSTEM_ALL_IPS} - \ ${output} = Utils.Run Command On Remote System ${node} ${GET_EXTERNAL_IDS} - \ BuiltIn.Should Contain ${output} ${TRANSPORT_ZONE} + FOR ${node_number} IN RANGE 2 ${NUM_TOOLS_SYSTEM}+1 + Change Transport Zone In Compute ${TOOLS_SYSTEM_${node_number}_IP} ${TRANSPORT_ZONE} + END + FOR ${node} IN @{TOOLS_SYSTEM_ALL_IPS} + ${output} = Utils.Run Command On Remote System ${node} ${GET_EXTERNAL_IDS} + BuiltIn.Should Contain ${output} ${TRANSPORT_ZONE} + END ${get_hosted_data} = BuiltIn.Wait Until Keyword Succeeds 3x 10 sec Utils.Get Data From URI session ${TRANSPORT_ZONE_ENDPOINT_URL}/${TRANSPORT_ZONE} BuiltIn.Should Contain ${get_hosted_data} ${TRANSPORT_ZONE} BuiltIn.Should Contain ${get_hosted_data} @{DPN_ID_LIST}[0] @@ -63,14 +67,16 @@ Verify TEPs with transport zone configured from OVS will be added to correspondi Verify other-config-key and transport zone value in controller operational datastore [Documentation] validate local_ip and transport-zone value from controller datastore and Verify value of external-id-key with transport_zone in Controller operational datastore ${controller-data} = Utils.Get Data From URI session ${GET_NETWORK_TOPOLOGY_URL} - : FOR ${node_ip} IN @{LOCAL_IPS} - \ BuiltIn.Should Contain ${controller-data} "other-config-value":"${node_ip}" + FOR ${node_ip} IN @{LOCAL_IPS} + BuiltIn.Should Contain ${controller-data} "other-config-value":"${node_ip}" + END BuiltIn.Should Contain ${controller-data} "external-id-value":"${TRANSPORT_ZONE}" Delete transport zone on OVS and check ovsdb update to controller [Documentation] To verify transport zone moves to default zone after deleting zone name in compute nodes - : FOR ${node} IN @{TOOLS_SYSTEM_ALL_IPS} - \ Utils.Run Command On Remote System ${node} ${DELETE_TRANSPORT_ZONE} + FOR ${node} IN @{TOOLS_SYSTEM_ALL_IPS} + Utils.Run Command On Remote System ${node} ${DELETE_TRANSPORT_ZONE} + END ${tep_show_output} = KarafKeywords.Issue Command On Karaf Console ${TEP_SHOW} BuiltIn.Should Contain ${tep_show_output} ${DEFAULT_TRANSPORT_ZONE} BuiltIn.Wait Until Keyword Succeeds 3x 10 sec Genius.Verify Tunnel Status as Up diff --git a/csit/suites/genius/OF_Tunnels.robot b/csit/suites/genius/OF_Tunnels.robot index 56388ca1c4..8508ec054d 100644 --- a/csit/suites/genius/OF_Tunnels.robot +++ b/csit/suites/genius/OF_Tunnels.robot @@ -63,8 +63,9 @@ Delete and Verify single OFT TEPs OFT Create Vteps using Auto Tunnels [Arguments] @{tools_ip_list} [Documentation] Create VTEPs for selected tools systems in ODL using Auto Tunnels. - : FOR ${tools_ip} IN @{tools_ip_list} - \ Utils.Run Command On Remote System And Log ${tools_ip} ${SET_LOCAL_IP}${tools_ip} + FOR ${tools_ip} IN @{tools_ip_list} + Utils.Run Command On Remote System And Log ${tools_ip} ${SET_LOCAL_IP}${tools_ip} + END OFT Verify Vteps Created [Arguments] ${dpn_id_list} ${tools_ip_list} @@ -79,48 +80,55 @@ OFT Verify Vteps Created BuiltIn.Wait Until Keyword Succeeds 60 5 Genius.Verify Tunnel Status As Up ${num_switches} BuiltIn.Wait Until Keyword Succeeds 40 10 OFT OVS Verify Tunnels Created @{tools_ip_list} ${tools_system_len} = BuiltIn.Get Length ${tools_ip_list} - : FOR ${tools_system_index} IN RANGE ${tools_system_len} - \ ${tun_ip_list} = BuiltIn.CreateList @{tools_ip_list} - \ Collections.Remove From List ${tun_ip_list} ${tools_system_index} - \ ${ports_output} = Utils.Run Command On Remote System And Log @{tools_ip_list}[${tools_system_index}] sudo ovs-ofctl -Oopenflow13 dump-ports-desc ${Bridge} - \ ${port_numbers} = String.Get Regexp Matches ${ports_output} (\\d+).of.* ${1} - \ BuiltIn.Wait Until Keyword Succeeds 40 10 OFT OVS Verify Ingress Flows Created per Switch @{tools_ip_list}[${tools_system_index}] ${tun_ip_list} - \ ... ${port_numbers} - \ BuiltIn.Wait Until Keyword Succeeds 40 10 OFT OVS Verify Egress Flows Created per Switch @{tools_ip_list}[${tools_system_index}] ${tun_ip_list} - \ ... ${port_numbers} + FOR ${tools_system_index} IN RANGE ${tools_system_len} + ${tun_ip_list} = BuiltIn.CreateList @{tools_ip_list} + Collections.Remove From List ${tun_ip_list} ${tools_system_index} + ${ports_output} = Utils.Run Command On Remote System And Log @{tools_ip_list}[${tools_system_index}] sudo ovs-ofctl -Oopenflow13 dump-ports-desc ${Bridge} + ${port_numbers} = String.Get Regexp Matches ${ports_output} (\\d+).of.* ${1} + BuiltIn.Wait Until Keyword Succeeds 40 10 OFT OVS Verify Ingress Flows Created per Switch @{tools_ip_list}[${tools_system_index}] ${tun_ip_list} + ... ${port_numbers} + BuiltIn.Wait Until Keyword Succeeds 40 10 OFT OVS Verify Egress Flows Created per Switch @{tools_ip_list}[${tools_system_index}] ${tun_ip_list} + ... ${port_numbers} + END OFT OVS Verify Tunnels Created [Arguments] @{tools_ip_list} [Documentation] Verify if tunnels are created in OVS for selected tools systems. - : FOR ${tools_ip} IN @{tools_ip_list} - \ ${output} = Utils.Run Command On Remote System And Log ${tools_ip} sudo ovs-vsctl show - \ BuiltIn.Should Contain X Times ${output} local_ip="${tools_ip}", remote_ip=flow ${1} + FOR ${tools_ip} IN @{tools_ip_list} + ${output} = Utils.Run Command On Remote System And Log ${tools_ip} sudo ovs-vsctl show + BuiltIn.Should Contain X Times ${output} local_ip="${tools_ip}", remote_ip=flow ${1} + END OFT OVS Verify Ingress Flows Created per Switch [Arguments] ${tools_ip} ${tun_src_list} ${port_numbers} [Documentation] Verify if Ingress flow rules are created in OVS for a given switch. ${flows_table0_output} = Utils.Run Command On Remote System And Log ${tools_ip} sudo ovs-ofctl -OOpenFlow13 dump-flows ${Bridge} ${FLOWS_FILTER_TABLE0} BuiltIn.Should Not Contain ${flows_table0_output} tun_src=${tools_ip}, - : FOR ${tun_src} IN @{tun_src_list} - \ BuiltIn.Should Contain ${flows_table0_output} tun_src=${tun_src}, - : FOR ${port_number} IN @{port_numbers} - \ BuiltIn.Should Contain ${flows_table0_output} in_port=${port_number} + FOR ${tun_src} IN @{tun_src_list} + BuiltIn.Should Contain ${flows_table0_output} tun_src=${tun_src}, + END + FOR ${port_number} IN @{port_numbers} + BuiltIn.Should Contain ${flows_table0_output} in_port=${port_number} + END OFT OVS Verify Egress Flows Created per Switch [Arguments] ${tools_ip} ${tun_dst_list} ${port_numbers} [Documentation] Verify if Egress flow rules are created in OVS for a given switch. ${flows_table95_output} = Utils.Run Command On Remote System And Log ${tools_ip} sudo ovs-ofctl -OOpenFlow13 dump-flows ${Bridge} ${FLOWS_FILTER_TABLE95} - : FOR ${tun_dst} IN @{tun_dst_list} - \ ${tun_dst_hex} = BuiltIn.Evaluate hex(struct.unpack('!I',socket.inet_aton('${tun_dst}'))[0]) modules=socket,struct - \ BuiltIn.Should Contain ${flows_table95_output} load:${tun_dst_hex}->NXM_NX_TUN_IPV4_DST[] - : FOR ${port_number} IN @{port_numbers} - \ BuiltIn.Should Contain ${flows_table95_output} output:${port_number} + FOR ${tun_dst} IN @{tun_dst_list} + ${tun_dst_hex} = BuiltIn.Evaluate hex(struct.unpack('!I',socket.inet_aton('${tun_dst}'))[0]) modules=socket,struct + BuiltIn.Should Contain ${flows_table95_output} load:${tun_dst_hex}->NXM_NX_TUN_IPV4_DST[] + END + FOR ${port_number} IN @{port_numbers} + BuiltIn.Should Contain ${flows_table95_output} output:${port_number} + END OFT Delete Vteps using Auto Tunnels [Arguments] @{tools_ip_list} [Documentation] Delete VTEPs for selected tools systems in ODL using Auto Tunnel. - : FOR ${tools_ip} IN @{tools_ip_list} - \ Utils.Run Command On Remote System And Log ${tools_ip} ${REMOVE_LOCAL_IP} + FOR ${tools_ip} IN @{tools_ip_list} + Utils.Run Command On Remote System And Log ${tools_ip} ${REMOVE_LOCAL_IP} + END OFT Verify Vteps Deleted [Arguments] ${dpn_id_list} ${tools_ip_list} @@ -130,27 +138,29 @@ OFT Verify Vteps Deleted BuiltIn.Run Keyword If ${existing_tep_len} > 0 BuiltIn.Wait Until Keyword Succeeds 60 5 Genius.Verify Tunnel Status As Up ${existing_tep_len} ${tep_show_output} = KarafKeywords.Issue Command On Karaf Console ${TEP_SHOW} ${tep_show_state_output} = KarafKeywords.Issue Command On Karaf Console ${TEP_SHOW_STATE} - : FOR ${tools_system_index} IN RANGE ${deleted_tep_len} - \ ${tep_show_state_output_1} = KarafKeywords.Issue Command On Karaf Console ${TEP_SHOW_STATE} - \ BuiltIn.Should Not Contain ${tep_show_output} @{tools_ip_list}[${tools_system_index}] - \ BuiltIn.Should Not Contain ${tep_show_state_output} @{tools_ip_list}[${tools_system_index}] - \ BuiltIn.Wait Until Keyword Succeeds 60 5 Utils.No Content From URI session ${CONFIG_API}/itm-state:dpn-endpoints/DPN-TEPs-info/@{dpn_id_list}[${tools_system_index}]/ - \ ${dst_dpn_id_list} = BuiltIn.Create List @{DPN_ID_LIST} - \ Collections.Remove From List ${dst_dpn_id_list} ${tools_system_index} - \ BuiltIn.Wait Until Keyword Succeeds 60 5 OFT Verify Vteps Deleted at Dpn Teps State per Interface @{dpn_id_list}[${tools_system_index}] ${dst_dpn_id_list} - \ ${ovs_vsctl_output} = BuiltIn.Wait Until Keyword Succeeds 40 10 Utils.Run Command On Remote System And Log @{tools_ip_list}[${tools_system_index}] - \ ... sudo ovs-vsctl show - \ BuiltIn.Should Not Contain ${ovs_vsctl_output} remote_ip=flow - \ BuiltIn.Wait Until Keyword Succeeds 40 10 OFT OVS Verify Ingress Flows Deleted per Switch @{tools_ip_list}[${tools_system_index}] - \ BuiltIn.Wait Until Keyword Succeeds 40 10 OFT OVS Verify Egress Flows Deleted per Switch @{tools_ip_list}[${tools_system_index}] + FOR ${tools_system_index} IN RANGE ${deleted_tep_len} + ${tep_show_state_output_1} = KarafKeywords.Issue Command On Karaf Console ${TEP_SHOW_STATE} + BuiltIn.Should Not Contain ${tep_show_output} @{tools_ip_list}[${tools_system_index}] + BuiltIn.Should Not Contain ${tep_show_state_output} @{tools_ip_list}[${tools_system_index}] + BuiltIn.Wait Until Keyword Succeeds 60 5 Utils.No Content From URI session ${CONFIG_API}/itm-state:dpn-endpoints/DPN-TEPs-info/@{dpn_id_list}[${tools_system_index}]/ + ${dst_dpn_id_list} = BuiltIn.Create List @{DPN_ID_LIST} + Collections.Remove From List ${dst_dpn_id_list} ${tools_system_index} + BuiltIn.Wait Until Keyword Succeeds 60 5 OFT Verify Vteps Deleted at Dpn Teps State per Interface @{dpn_id_list}[${tools_system_index}] ${dst_dpn_id_list} + ${ovs_vsctl_output} = BuiltIn.Wait Until Keyword Succeeds 40 10 Utils.Run Command On Remote System And Log @{tools_ip_list}[${tools_system_index}] + ... sudo ovs-vsctl show + BuiltIn.Should Not Contain ${ovs_vsctl_output} remote_ip=flow + BuiltIn.Wait Until Keyword Succeeds 40 10 OFT OVS Verify Ingress Flows Deleted per Switch @{tools_ip_list}[${tools_system_index}] + BuiltIn.Wait Until Keyword Succeeds 40 10 OFT OVS Verify Egress Flows Deleted per Switch @{tools_ip_list}[${tools_system_index}] + END OFT Verify Vteps Deleted at Dpn Teps State per Interface [Arguments] ${src_dpn_id} ${dst_dpn_id_list} [Documentation] Verify if vteps are deleted for all src-dst intf pair at dpn-teps-state in ODL for a given src intf. - : FOR ${dst_dpn_id} IN @{dst_dpn_id_list} - \ ${status} = BuiltIn.Run Keyword And Return Status Genius.Get Tunnel ${src_dpn_id} ${dst_dpn_id} odl-interface:tunnel-type-vxlan - \ ... dpn-teps-state - \ BuiltIn.Should Be True ${status} == ${False} + FOR ${dst_dpn_id} IN @{dst_dpn_id_list} + ${status} = BuiltIn.Run Keyword And Return Status Genius.Get Tunnel ${src_dpn_id} ${dst_dpn_id} odl-interface:tunnel-type-vxlan + ... dpn-teps-state + BuiltIn.Should Be True ${status} == ${False} + END OFT OVS Verify Ingress Flows Deleted per Switch [Arguments] ${tools_ip} @@ -168,17 +178,19 @@ OF Tunnels Start Suite [Documentation] Start suite for OF Tunnels. ClusterManagement.ClusterManagement_Setup ClusterManagement.Stop_Members_From_List_Or_All - : FOR ${controller_index} IN RANGE ${NUM_ODL_SYSTEM} - \ Run Command On Remote System And Log ${ODL_SYSTEM_${controller_index+1}_IP} sed -i -- 's/false/true/g' ${GENIUS_IFM_CONFIG_FLAG} - \ Run Command On Remote System And Log ${ODL_SYSTEM_${controller_index+1}_IP} sed -i -- 's/false/true/g' ${GENIUS_ITM_CONFIG_FLAG} + FOR ${controller_index} IN RANGE ${NUM_ODL_SYSTEM} + Run Command On Remote System And Log ${ODL_SYSTEM_${controller_index+1}_IP} sed -i -- 's/false/true/g' ${GENIUS_IFM_CONFIG_FLAG} + Run Command On Remote System And Log ${ODL_SYSTEM_${controller_index+1}_IP} sed -i -- 's/false/true/g' ${GENIUS_ITM_CONFIG_FLAG} + END ClusterManagement.Start_Members_From_List_Or_All Genius Suite Setup OF Tunnels Stop Suite [Documentation] Stop suite for OF Tunnels. - : FOR ${controller_index} IN RANGE ${NUM_ODL_SYSTEM} - \ Run Command On Remote System And Log ${ODL_SYSTEM_${controller_index+1}_IP} sed -i -- 's/true/false/g' ${GENIUS_IFM_CONFIG_FLAG} - \ Run Command On Remote System And Log ${ODL_SYSTEM_${controller_index+1}_IP} sed -i -- 's/true/false/g' ${GENIUS_ITM_CONFIG_FLAG} + FOR ${controller_index} IN RANGE ${NUM_ODL_SYSTEM} + Run Command On Remote System And Log ${ODL_SYSTEM_${controller_index+1}_IP} sed -i -- 's/true/false/g' ${GENIUS_IFM_CONFIG_FLAG} + Run Command On Remote System And Log ${ODL_SYSTEM_${controller_index+1}_IP} sed -i -- 's/true/false/g' ${GENIUS_ITM_CONFIG_FLAG} + END ClusterManagement.Stop_Members_From_List_Or_All ClusterManagement.Start_Members_From_List_Or_All Genius Suite Teardown diff --git a/csit/suites/groupbasedpolicy/GBP/3-node/__init__.robot b/csit/suites/groupbasedpolicy/GBP/3-node/__init__.robot index e296ab0363..a131607b13 100644 --- a/csit/suites/groupbasedpolicy/GBP/3-node/__init__.robot +++ b/csit/suites/groupbasedpolicy/GBP/3-node/__init__.robot @@ -18,19 +18,21 @@ Setup Everything Create Session session http://${ODL}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS} Wait Until Keyword Succeeds 10x 30 s Get Data From URI session ${OF_OVERLAY_CONFIG_PATH} headers=${headers} Delete All Sessions - : FOR ${GBP} IN @{GBPs} - \ ConnUtils.Connect and Login ${GBP} timeout=${timeout} - \ ${stderr} SSHLibrary.Execute Command virtualenv --system-site-packages ${VE_DIR} return_stdout=False return_stderr=True return_rc=False - \ Should Be Empty ${stderr} - \ SSHLibrary.Put File ${CURDIR}/../../common_scripts/* ${VM_HOME_FOLDER}${/}${VM_SCRIPTS_FOLDER}/ mode=0755 - \ ${stdout} ${stderr} ${rc} ConnUtils.Execute in VE pip freeze | grep ipaddr -q || pip install ipaddr timeout=${timeout} - \ Should Be Equal As Numbers ${rc} 0 - \ SSHLibrary.Close Connection + FOR ${GBP} IN @{GBPs} + ConnUtils.Connect and Login ${GBP} timeout=${timeout} + ${stderr} SSHLibrary.Execute Command virtualenv --system-site-packages ${VE_DIR} return_stdout=False return_stderr=True return_rc=False + Should Be Empty ${stderr} + SSHLibrary.Put File ${CURDIR}/../../common_scripts/* ${VM_HOME_FOLDER}${/}${VM_SCRIPTS_FOLDER}/ mode=0755 + ${stdout} ${stderr} ${rc} ConnUtils.Execute in VE pip freeze | grep ipaddr -q || pip install ipaddr timeout=${timeout} + Should Be Equal As Numbers ${rc} 0 + SSHLibrary.Close Connection + END Init Variables Teardown Everything Log stop_suite_in_3_node - : FOR ${GBP} IN @{GBPs} - \ ConnUtils.Connect and Login ${GBP} timeout=${timeout} - \ SSHLibrary.Execute Command sudo rm -rf ${VM_SCRIPTS_FOLDER} - \ SSHLibrary.Close Connection + FOR ${GBP} IN @{GBPs} + ConnUtils.Connect and Login ${GBP} timeout=${timeout} + SSHLibrary.Execute Command sudo rm -rf ${VM_SCRIPTS_FOLDER} + SSHLibrary.Close Connection + END diff --git a/csit/suites/groupbasedpolicy/GBP/3-node/gbp1/001_set_odl.robot b/csit/suites/groupbasedpolicy/GBP/3-node/gbp1/001_set_odl.robot index 35bbda1016..a7609a2c00 100644 --- a/csit/suites/groupbasedpolicy/GBP/3-node/gbp1/001_set_odl.robot +++ b/csit/suites/groupbasedpolicy/GBP/3-node/gbp1/001_set_odl.robot @@ -23,8 +23,9 @@ Put Tunnels Register Endpoints [Documentation] Endpoints registration @{endpoint_files} = OperatingSystem.List Files In Directory ${ENDPOINTS_GBP1_DIR} vethl*.*json absolute - : FOR ${endpoint_file} IN @{endpoint_files} - \ Post Elements To URI From File ${ENDPOINT_REG_PATH} ${endpoint_file} ${HEADERS_YANG_JSON} + FOR ${endpoint_file} IN @{endpoint_files} + Post Elements To URI From File ${ENDPOINT_REG_PATH} ${endpoint_file} ${HEADERS_YANG_JSON} + END Put Tenant [Documentation] Send GBP policy to ODL diff --git a/csit/suites/groupbasedpolicy/GBP/3-node/gbp1/999_teardown.robot b/csit/suites/groupbasedpolicy/GBP/3-node/gbp1/999_teardown.robot index 787df6b029..fb0b4677b8 100644 --- a/csit/suites/groupbasedpolicy/GBP/3-node/gbp1/999_teardown.robot +++ b/csit/suites/groupbasedpolicy/GBP/3-node/gbp1/999_teardown.robot @@ -13,5 +13,6 @@ ${timeout} 10s *** Test Cases *** Teardown Suite Log Teardown suite in gbp1 - : FOR ${GBP} IN @{GBPs} - \ GBP_3node.Teardown Node ${GBP} ${CURDIR} timeout=${timeout} + FOR ${GBP} IN @{GBPs} + GBP_3node.Teardown Node ${GBP} ${CURDIR} timeout=${timeout} + END diff --git a/csit/suites/groupbasedpolicy/GBP/3-node/gbp2-multitenant/001_set_odl.robot b/csit/suites/groupbasedpolicy/GBP/3-node/gbp2-multitenant/001_set_odl.robot index e8a8a17886..8e4e6dd10c 100644 --- a/csit/suites/groupbasedpolicy/GBP/3-node/gbp2-multitenant/001_set_odl.robot +++ b/csit/suites/groupbasedpolicy/GBP/3-node/gbp2-multitenant/001_set_odl.robot @@ -23,8 +23,9 @@ Put Tunnels Register Endpoints [Documentation] Endpoints registration @{endpoint_files} = OperatingSystem.List Files In Directory ${ENDPOINTS_GBP2_DIR} vethl*.*json absolute - : FOR ${endpoint_file} IN @{endpoint_files} - \ Post Elements To URI From File ${ENDPOINT_REG_PATH} ${endpoint_file} ${HEADERS_YANG_JSON} + FOR ${endpoint_file} IN @{endpoint_files} + Post Elements To URI From File ${ENDPOINT_REG_PATH} ${endpoint_file} ${HEADERS_YANG_JSON} + END Put Tenants [Documentation] Send GBP policy to ODL diff --git a/csit/suites/groupbasedpolicy/GBP/3-node/gbp2-multitenant/999_teardown.robot b/csit/suites/groupbasedpolicy/GBP/3-node/gbp2-multitenant/999_teardown.robot index f9c8d0ebca..8d66abeb3b 100644 --- a/csit/suites/groupbasedpolicy/GBP/3-node/gbp2-multitenant/999_teardown.robot +++ b/csit/suites/groupbasedpolicy/GBP/3-node/gbp2-multitenant/999_teardown.robot @@ -13,5 +13,6 @@ ${timeout} 10s *** Test Cases *** Teardown Suite Log Teardown suite in gbp1 - : FOR ${GBP} IN @{GBPs} - \ GBP_3node.Teardown Node ${GBP} ${CURDIR} timeout=${timeout} + FOR ${GBP} IN @{GBPs} + GBP_3node.Teardown Node ${GBP} ${CURDIR} timeout=${timeout} + END diff --git a/csit/suites/groupbasedpolicy/GBPSFC/6-node/GBPSFC_6node.robot b/csit/suites/groupbasedpolicy/GBPSFC/6-node/GBPSFC_6node.robot index 8500214771..1686c56754 100644 --- a/csit/suites/groupbasedpolicy/GBPSFC/6-node/GBPSFC_6node.robot +++ b/csit/suites/groupbasedpolicy/GBPSFC/6-node/GBPSFC_6node.robot @@ -43,6 +43,7 @@ Teardown Node Setup Nodes [Arguments] ${GBPSFCs} ${init_scripts_dir} ${sw_index} Set Variable 0 - : FOR ${GBPSFC} IN @{GBPSFCs} - \ Setup Node ${GBPSFC} ${sw_index} ${init_scripts_dir} timeout=10s - \ ${sw_index} Evaluate ${sw_index} + 1 + FOR ${GBPSFC} IN @{GBPSFCs} + Setup Node ${GBPSFC} ${sw_index} ${init_scripts_dir} timeout=10s + ${sw_index} Evaluate ${sw_index} + 1 + END diff --git a/csit/suites/groupbasedpolicy/GBPSFC/6-node/__init__.robot b/csit/suites/groupbasedpolicy/GBPSFC/6-node/__init__.robot index 8ebb7c4d27..27f85830dd 100644 --- a/csit/suites/groupbasedpolicy/GBPSFC/6-node/__init__.robot +++ b/csit/suites/groupbasedpolicy/GBPSFC/6-node/__init__.robot @@ -18,21 +18,23 @@ Setup Everything Create Session session http://${ODL}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS} Wait Until Keyword Succeeds 10x 30 s Get Data From URI session ${OF_OVERLAY_CONFIG_PATH} headers=${headers} Delete All Sessions - : FOR ${GBPSFC} IN @{GBPSFCs} - \ ConnUtils.Connect and Login ${GBPSFC} timeout=${timeout} - \ # TODO if something extra needs to be installed, please do it in virt-env - \ ${stderr} SSHLibrary.Execute Command virtualenv --system-site-packages ${VE_DIR} return_stdout=False return_stderr=True return_rc=False - \ Should Be Empty ${stderr} - \ SSHLibrary.Put File ${CURDIR}/../../common_scripts/* ${VM_HOME_FOLDER}${/}${VM_SCRIPTS_FOLDER}/ mode=0755 - \ ${stdout} ${stderr} ${rc} ConnUtils.Execute in VE pip freeze | grep ipaddr -q || pip install ipaddr timeout=${timeout} - \ Should Be Equal As Numbers ${rc} 0 - \ SSHLibrary.Close Connection + FOR ${GBPSFC} IN @{GBPSFCs} + ConnUtils.Connect and Login ${GBPSFC} timeout=${timeout} + # TODO if something extra needs to be installed, please do it in virt-env + ${stderr} SSHLibrary.Execute Command virtualenv --system-site-packages ${VE_DIR} return_stdout=False return_stderr=True return_rc=False + Should Be Empty ${stderr} + SSHLibrary.Put File ${CURDIR}/../../common_scripts/* ${VM_HOME_FOLDER}${/}${VM_SCRIPTS_FOLDER}/ mode=0755 + ${stdout} ${stderr} ${rc} ConnUtils.Execute in VE pip freeze | grep ipaddr -q || pip install ipaddr timeout=${timeout} + Should Be Equal As Numbers ${rc} 0 + SSHLibrary.Close Connection + END Set ODL Variables Teardown Everything [Documentation] Clearing remote VM - removing copied scripts. Log stop_suite_in_6_node - : FOR ${GBPSFC} IN @{GBPSFCs} - \ ConnUtils.Connect and Login ${GBPSFC} timeout=${timeout} - \ SSHLibrary.Execute Command sudo rm -rf ${VM_HOME_FOLDER}${/}${VM_SCRIPTS_FOLDER} - \ SSHLibrary.Close Connection + FOR ${GBPSFC} IN @{GBPSFCs} + ConnUtils.Connect and Login ${GBPSFC} timeout=${timeout} + SSHLibrary.Execute Command sudo rm -rf ${VM_HOME_FOLDER}${/}${VM_SCRIPTS_FOLDER} + SSHLibrary.Close Connection + END diff --git a/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-asymmetric-chain/010_set_odl.robot b/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-asymmetric-chain/010_set_odl.robot index ff88a0d7bc..61746484f3 100644 --- a/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-asymmetric-chain/010_set_odl.robot +++ b/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-asymmetric-chain/010_set_odl.robot @@ -60,7 +60,8 @@ Put Tenant Register Endpoints [Documentation] Endpoints registration @{endpoint_files} = OperatingSystem.List Files In Directory ${ENDPOINTS_ASYMM_DIR} vethl*.*json absolute - : FOR ${endpoint_file} IN @{endpoint_files} - \ Post Elements To URI From File ${ENDPOINT_REG_PATH} ${endpoint_file} ${HEADERS_YANG_JSON} + FOR ${endpoint_file} IN @{endpoint_files} + Post Elements To URI From File ${ENDPOINT_REG_PATH} ${endpoint_file} ${HEADERS_YANG_JSON} + END ${resp} RequestsLibrary.Get Request session ${ENDPOINTS_OPER_PATH} Log ${resp.content} diff --git a/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-asymmetric-chain/999_teardown.robot b/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-asymmetric-chain/999_teardown.robot index 6bd5a996d2..86d9de2d6e 100644 --- a/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-asymmetric-chain/999_teardown.robot +++ b/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-asymmetric-chain/999_teardown.robot @@ -12,5 +12,6 @@ ${timeout} 10s *** Test Cases *** Teardown Suite Log Teardown suite in asymetric-chain - : FOR ${GBPSFC} IN @{GBPSFCs} - \ GBPSFC_6node.Teardown Node ${GBPSFC} ${CURDIR} timeout=${timeout} + FOR ${GBPSFC} IN @{GBPSFCs} + GBPSFC_6node.Teardown Node ${GBPSFC} ${CURDIR} timeout=${timeout} + END diff --git a/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/010_set_odl.robot b/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/010_set_odl.robot index 20778b0877..18ea63ba30 100644 --- a/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/010_set_odl.robot +++ b/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/010_set_odl.robot @@ -60,7 +60,8 @@ Put Tenant Register Endpoints [Documentation] Endpoints registration @{endpoint_files} = OperatingSystem.List Files In Directory ${ENDPOINTS_SYMM_DIR} vethl*.*json absolute - : FOR ${endpoint_file} IN @{endpoint_files} - \ Post Elements To URI From File ${ENDPOINT_REG_PATH} ${endpoint_file} ${HEADERS_YANG_JSON} + FOR ${endpoint_file} IN @{endpoint_files} + Post Elements To URI From File ${ENDPOINT_REG_PATH} ${endpoint_file} ${HEADERS_YANG_JSON} + END ${resp} RequestsLibrary.Get Request session ${ENDPOINTS_OPER_PATH} Log ${resp.content} diff --git a/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/999_teardown.robot b/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/999_teardown.robot index c2bf1d770f..2c386c2b31 100644 --- a/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/999_teardown.robot +++ b/csit/suites/groupbasedpolicy/GBPSFC/6-node/demo-symmetric-chain/999_teardown.robot @@ -12,5 +12,6 @@ ${timeout} 10s *** Test Cases *** Teardown Suite Log Teardown suite in symetric-chain - : FOR ${GBPSFC} IN @{GBPSFCs} - \ GBPSFC_6node.Teardown Node ${GBPSFC} ${CURDIR} timeout=${timeout} + FOR ${GBPSFC} IN @{GBPSFCs} + GBPSFC_6node.Teardown Node ${GBPSFC} ${CURDIR} timeout=${timeout} + END diff --git a/csit/suites/groupbasedpolicy/GBPSXP/ep_provider_renderer_part.robot b/csit/suites/groupbasedpolicy/GBPSXP/ep_provider_renderer_part.robot index 94f06286e4..da8ef1c514 100644 --- a/csit/suites/groupbasedpolicy/GBPSXP/ep_provider_renderer_part.robot +++ b/csit/suites/groupbasedpolicy/GBPSXP/ep_provider_renderer_part.robot @@ -68,32 +68,36 @@ Setup_Http_And_Netconf ${run_netconf_testtool_manually} BuiltIn.Get_Variable_Value ${run_netconf_testtool_manually} ${False} ${logfile} Utils.Get_Log_File_Name testtool BuiltIn.Run_Keyword_If ${run_netconf_testtool_manually} BuiltIn.Set_Suite_Variable ${testtool_log} ${logfile} - : FOR ${ssh_session} IN @{TOOLS_SESSIONS} - \ SSHKeywords.Restore_Current_Ssh_Connection_From_Index ${ssh_session} - \ BuiltIn.Run_Keyword_Unless ${run_netconf_testtool_manually} Install_And_Start_Testtool device-count=1 debug=false schemas=${IOS_XE_SCHEMAS_FOLDER} - \ ... mdsal=true + FOR ${ssh_session} IN @{TOOLS_SESSIONS} + SSHKeywords.Restore_Current_Ssh_Connection_From_Index ${ssh_session} + BuiltIn.Run_Keyword_Unless ${run_netconf_testtool_manually} Install_And_Start_Testtool device-count=1 debug=false schemas=${IOS_XE_SCHEMAS_FOLDER} + ... mdsal=true + END Teardown_Http_And_Netconf [Documentation] Close http session, close ssh session to tools, stop netconf-testtool - : FOR ${ssh_session} IN @{TOOLS_SESSIONS} - \ BuiltIn.Log ${ssh_session} - \ SSHKeywords.Restore_Current_Ssh_Connection_From_Index ${ssh_session} - \ Stop_Testtool + FOR ${ssh_session} IN @{TOOLS_SESSIONS} + BuiltIn.Log ${ssh_session} + SSHKeywords.Restore_Current_Ssh_Connection_From_Index ${ssh_session} + Stop_Testtool + END gbpsxp.Teardown_Ssh_Tooling ${TOOLS_SESSIONS} RequestsLibrary.Delete_All_Sessions Prepare_Renderer_Prerequisities [Documentation] Prepare sfc configurations, connect netconf device - : FOR ${INDEX} IN RANGE 0 2 - \ BuiltIn.Log ${INDEX} - \ ${netconf_node_configuration_json} Utils.Json_Parse_From_File ${NETCONF_CONFIG_IOSXE_NODE_FILE} - \ ${netconf_node_configuration} gbpsxp.Replace_Netconf_Node_Host ${netconf_node_configuration_json} ${IOS_XE_NODE_NAMES[${INDEX}]} ${IOS_XE_IP[${INDEX}]} - \ BuiltIn.Log ${netconf_node_configuration} level=DEBUG - \ Utils.Add_Elements_To_URI_And_Verify ${NETCONF_CONFIG_URI}/node/${IOS_XE_NODE_NAMES[${INDEX}]} ${netconf_node_configuration} - : FOR ${INDEX} IN RANGE 0 2 - \ BuiltIn.Log ${INDEX} - \ BuiltIn.Wait_Until_Keyword_Succeeds 30 2 Check_Netconf_Node_Status session ${NETCONF_OPERATIONAL_URI}/node/${IOS_XE_NODE_NAMES[${INDEX}]} - \ BuiltIn.Wait_Until_Keyword_Succeeds 10x 3s TemplatedRequests.Get_From_Uri ${NETCONF_CONFIG_URI}/node/${IOS_XE_NODE_NAMES[${INDEX}]}/yang-ext:mount session=session + FOR ${INDEX} IN RANGE 0 2 + BuiltIn.Log ${INDEX} + ${netconf_node_configuration_json} Utils.Json_Parse_From_File ${NETCONF_CONFIG_IOSXE_NODE_FILE} + ${netconf_node_configuration} gbpsxp.Replace_Netconf_Node_Host ${netconf_node_configuration_json} ${IOS_XE_NODE_NAMES[${INDEX}]} ${IOS_XE_IP[${INDEX}]} + BuiltIn.Log ${netconf_node_configuration} level=DEBUG + Utils.Add_Elements_To_URI_And_Verify ${NETCONF_CONFIG_URI}/node/${IOS_XE_NODE_NAMES[${INDEX}]} ${netconf_node_configuration} + END + FOR ${INDEX} IN RANGE 0 2 + BuiltIn.Log ${INDEX} + BuiltIn.Wait_Until_Keyword_Succeeds 30 2 Check_Netconf_Node_Status session ${NETCONF_OPERATIONAL_URI}/node/${IOS_XE_NODE_NAMES[${INDEX}]} + BuiltIn.Wait_Until_Keyword_Succeeds 10x 3s TemplatedRequests.Get_From_Uri ${NETCONF_CONFIG_URI}/node/${IOS_XE_NODE_NAMES[${INDEX}]}/yang-ext:mount session=session + END Utils.Add_Elements_To_URI_From_File ${SERVICE_FUNCTIONS_URI} ${SFC_SERVICE_FUNCTIONS_FILE} &{ip_mgmt_map} BuiltIn.Create_Dictionary SFF1=${TOOLS_SYSTEM_2_IP} SFF2=${TOOLS_SYSTEM_IP} ${sfc_sf_forwarders_json} Utils.Json_Parse_From_File ${SFC_SF_FORWARDERS_FILE} @@ -117,11 +121,13 @@ Wipe_Clean_Renderer_Policy_Cohort BuiltIn.Run_Keyword_And_Ignore_Error Utils.Remove_All_Elements_If_Exist ${SERVICE_FUNCTION_PATHS_URI} BuiltIn.Run_Keyword_And_Ignore_Error Utils.Remove_All_Elements_If_Exist ${GBP_RENDERER_CONFIG_URI} # clean netconf-device config (behind mountpoint) and disconnect by removing it from DS/config - : FOR ${ios_xe_node_name} IN @{IOS_XE_NODE_NAMES} - \ BuiltIn.Run_Keyword_And_Ignore_Error Utils.Remove_All_Elements_If_Exist ${NETCONF_CONFIG_URI}/node/${ios_xe_node_name}/${MOUNTPOINT_IOSXE_SUFFIX} - \ BuiltIn.Run_Keyword_And_Ignore_Error Utils.Remove_All_Elements_If_Exist ${NETCONF_CONFIG_URI}/node/${ios_xe_node_name} - : FOR ${ios_xe_node_name} IN @{IOS_XE_NODE_NAMES} - \ BuiltIn.Wait_Until_Keyword_Succeeds 5 1 Utils.No_Content_From_URI session ${NETCONF_OPERATIONAL_URI}/node/${ios_xe_node_name} + FOR ${ios_xe_node_name} IN @{IOS_XE_NODE_NAMES} + BuiltIn.Run_Keyword_And_Ignore_Error Utils.Remove_All_Elements_If_Exist ${NETCONF_CONFIG_URI}/node/${ios_xe_node_name}/${MOUNTPOINT_IOSXE_SUFFIX} + BuiltIn.Run_Keyword_And_Ignore_Error Utils.Remove_All_Elements_If_Exist ${NETCONF_CONFIG_URI}/node/${ios_xe_node_name} + END + FOR ${ios_xe_node_name} IN @{IOS_XE_NODE_NAMES} + BuiltIn.Wait_Until_Keyword_Succeeds 5 1 Utils.No_Content_From_URI session ${NETCONF_OPERATIONAL_URI}/node/${ios_xe_node_name} + END BuiltIn.Run_Keyword_And_Ignore_Error Utils.Remove_All_Elements_If_Exist ${SXP_EP_PROVIDER_CONFIG_URI} BuiltIn.Run_Keyword_And_Ignore_Error Utils.Remove_All_Elements_If_Exist ${GBP_TENANT_CONFIG_URI} diff --git a/csit/suites/iotdm/basic/010_PrimitveParameters.robot b/csit/suites/iotdm/basic/010_PrimitveParameters.robot index 48d2c68a9d..e8ecd69a83 100644 --- a/csit/suites/iotdm/basic/010_PrimitveParameters.robot +++ b/csit/suites/iotdm/basic/010_PrimitveParameters.robot @@ -76,21 +76,23 @@ ${rt_contentInstance} 4 ... rcn=1, 2, 3, 0 is legal # TODO: check with TS-0004: 7.5.2 Elements contained in the Content primitive parameter ${attr} = Set Variable "api":"jb","apn":"jb2","or":"http://hey/you","rr":true - : FOR ${rcn} IN \ 1 2 3 + FOR ${rcn} IN \ 1 2 3 ... 0 - \ ${r} = Create Resource With Command ${iserver} InCSE1 ${rt_ae} rcn=${rcn} - \ ... ${attr},"rn":"AeName${rcn}" + ${r} = Create Resource With Command ${iserver} InCSE1 ${rt_ae} rcn=${rcn} + ... ${attr},"rn":"AeName${rcn}" + END 1.10.2 REQ: Create: With Result Content parameter - illegal [Documentation] NEGATIVE: Tests Create REQ with Result Content parameter set to illegal values. ... rcn=4, 5, 6, 7 is illegal # TODO: check with TS-0004: 7.5.2 Elements contained in the Content primitive parameter ${attr} = Set Variable "api":"jb","apn":"jb2","or":"http://hey/you","rr":true - : FOR ${rcn} IN 4 5 6 7 - \ ${error} = Run Keyword And Expect Error * Create Resource With Command ${iserver} InCSE1 - \ ... ${rt_ae} rcn=${rcn} ${attr} - \ Should Start with ${error} Cannot create this resource [400] - \ Should Contain ${error} rcn + FOR ${rcn} IN 4 5 6 7 + ${error} = Run Keyword And Expect Error * Create Resource With Command ${iserver} InCSE1 + ... ${rt_ae} rcn=${rcn} ${attr} + Should Start with ${error} Cannot create this resource [400] + Should Contain ${error} rcn + END 1.11 REQ: Create: With Event Category parameter [Documentation] Tests Create REQ with Event Category parameter @@ -176,20 +178,22 @@ ${rt_contentInstance} 4 [Documentation] Tests Retrieve REQ with Result Content parameter set to legal values. ... rcn=1, 4, 5, 6 null is legal # TODO: check with TS-0004: 7.5.2 Elements contained in the Content primitive parameter - : FOR ${rcn} IN \ 1 4 5 + FOR ${rcn} IN \ 1 4 5 ... 6 - \ ${r} = Retrieve Resource With Command ${iserver} InCSE1/AE1 rcn=${rcn} - # when rcn=7 can be retrieved + ${r} = Retrieve Resource With Command ${iserver} InCSE1/AE1 rcn=${rcn} + # when rcn=7 can be retrieved + END 2.10.2 REQ: Retrieve: With Result Content parameter - illegal [Documentation] NEGATIVE: Tests Retrieve REQ with Result Content parameter set to illegal values. ... rcn=0, 2, 3 is illegal # TODO: check with TS-0004: 7.5.2 Elements contained in the Content primitive parameter - : FOR ${rcn} IN 0 2 3 - \ ${error} = Run Keyword And Expect Error * Retrieve Resource With Command ${iserver} InCSE1/AE1 - \ ... rcn=${rcn} - \ Should Start with ${error} Cannot retrieve this resource [400] - \ Should Contain ${error} rcn + FOR ${rcn} IN 0 2 3 + ${error} = Run Keyword And Expect Error * Retrieve Resource With Command ${iserver} InCSE1/AE1 + ... rcn=${rcn} + Should Start with ${error} Cannot retrieve this resource [400] + Should Contain ${error} rcn + END 2.11 REQ: Retrieve: With Event Category parameter [Documentation] Tests Retrieve REQ with Event Category parameter @@ -472,21 +476,23 @@ ${rt_contentInstance} 4 ... rcn=1, 0/ null is legal # TODO: check with TS-0004: 7.5.2 Elements contained in the Content primitive parameter ${attr} = Set Variable "or":"http://hey/you" - : FOR ${rcn} IN \ 0 1 5 + FOR ${rcn} IN \ 0 1 5 ... 6 - \ ${r} = Update Resource With Command ${iserver} InCSE1/AE1 ${rt_ae} rcn=${rcn} - \ ... ${attr} + ${r} = Update Resource With Command ${iserver} InCSE1/AE1 ${rt_ae} rcn=${rcn} + ... ${attr} + END 3.10.2 REQ: Update: With Result Content parameter - illegal [Documentation] NEGATIVE: Tests Update REQ with Result Content parameter set to illegal values. ... rcn=2, 3, 7 is illegal # TODO: check with TS-0004: 7.5.2 Elements contained in the Content primitive parameter ${attr} = Set Variable "or":"http://hey/you" - : FOR ${rcn} IN 2 3 4 7 - \ ${error} = Run Keyword And Expect Error * Update Resource With Command ${iserver} InCSE1/AE1 - \ ... ${rt_ae} rcn=${rcn} ${attr} - \ Should Start with ${error} Cannot update this resource [400] - \ Should Contain ${error} rcn + FOR ${rcn} IN 2 3 4 7 + ${error} = Run Keyword And Expect Error * Update Resource With Command ${iserver} InCSE1/AE1 + ... ${rt_ae} rcn=${rcn} ${attr} + Should Start with ${error} Cannot update this resource [400] + Should Contain ${error} rcn + END 3.11 REQ: Update: With Event Category parameter [Documentation] Tests Update REQ with Event Category parameter @@ -703,11 +709,12 @@ ${rt_contentInstance} 4 ... rcn=2, 3, 4, 5, 6, 7 is illegal # TODO: check with TS-0004: 7.5.2 Elements contained in the Content primitive parameter ${attr} = Set Variable "or":"http://hey/you" - : FOR ${rcn} IN 2 3 4 7 - \ ${error} = Run Keyword And Expect Error * Delete Resource With Command ${iserver} InCSE1/AE1 - \ ... rcn=${rcn} - \ Should Start with ${error} Cannot delete this resource [400] - \ Should Contain ${error} rcn + FOR ${rcn} IN 2 3 4 7 + ${error} = Run Keyword And Expect Error * Delete Resource With Command ${iserver} InCSE1/AE1 + ... rcn=${rcn} + Should Start with ${error} Cannot delete this resource [400] + Should Contain ${error} rcn + END 4.10.2 REQ: Delete: With Result Content parameter - illegal [Documentation] NEGATIVE: Tests Delete REQ with Result Content parameter set to illegal values. diff --git a/csit/suites/iotdm/basic/022_ResourceAttributesContentInstance.robot b/csit/suites/iotdm/basic/022_ResourceAttributesContentInstance.robot index 307840990e..7493ec23d4 100644 --- a/csit/suites/iotdm/basic/022_ResourceAttributesContentInstance.robot +++ b/csit/suites/iotdm/basic/022_ResourceAttributesContentInstance.robot @@ -214,8 +214,9 @@ Delete the ContenInstance 2.33 ${attr} = Set Variable "mni":1,"rn":"Container3" ${r}= Create Resource ${iserver} InCSE1 ${rt_container} ${attr} ${container} = Location ${r} - : FOR ${INDEX} IN RANGE 1 100 - \ Latest Con Test ${container} + FOR ${INDEX} IN RANGE 1 100 + Latest Con Test ${container} + END Delete the test Container1 [Documentation] Delete the test Container1 diff --git a/csit/suites/iotdm/basic/091_ResourceHierarchyDelete.robot b/csit/suites/iotdm/basic/091_ResourceHierarchyDelete.robot index bbe27a604c..e7c550c90f 100644 --- a/csit/suites/iotdm/basic/091_ResourceHierarchyDelete.robot +++ b/csit/suites/iotdm/basic/091_ResourceHierarchyDelete.robot @@ -222,16 +222,19 @@ ${rt_contentInstance} 4 ${container3} = Location ${r} Response Is Correct ${r} ${attr} = Set Variable "cnf": "1","or": "http://hey/you","con":"101" - : FOR ${conName} IN conIn1 conIn2 conIn3 - \ ${r} = Create Resource ${iserver} ${container1} ${rt_contentInstance} ${attr},"rn":${conName} - \ Response Is Correct ${r} - : FOR ${conName} IN conIn1 conIn2 conIn3 - \ ${r} = Create Resource ${iserver} ${container2} ${rt_contentInstance} ${attr},"rn":${conName} - \ Response Is Correct ${r} - : FOR ${conName} IN conIn1 conIn2 conIn3 - \ ${r} = Create Resource ${iserver} ${container3} ${rt_contentInstance} ${attr},"rn":${conName} - \ Response Is Correct ${r} - # ----------- Delete the parent AE -------------- + FOR ${conName} IN conIn1 conIn2 conIn3 + ${r} = Create Resource ${iserver} ${container1} ${rt_contentInstance} ${attr},"rn":${conName} + Response Is Correct ${r} + END + FOR ${conName} IN conIn1 conIn2 conIn3 + ${r} = Create Resource ${iserver} ${container2} ${rt_contentInstance} ${attr},"rn":${conName} + Response Is Correct ${r} + END + FOR ${conName} IN conIn1 conIn2 conIn3 + ${r} = Create Resource ${iserver} ${container3} ${rt_contentInstance} ${attr},"rn":${conName} + Response Is Correct ${r} + # ----------- Delete the parent AE -------------- + END ${r} = Delete Resource ${iserver} InCSE1/AE1 Response Is Correct ${r} # Delete the resource that does not exist/has been deleted should return error @@ -362,16 +365,19 @@ ${rt_contentInstance} 4 ${container3} = Location ${r} Response Is Correct ${r} ${attr} = Set Variable "cnf": "1","or": "http://hey/you","con":"101" - : FOR ${conName} IN conIn1 conIn2 conIn3 - \ ${r} = Create Resource ${iserver} ${container1} ${rt_contentInstance} ${attr},"rn":${conName} - \ Response Is Correct ${r} - : FOR ${conName} IN conIn1 conIn2 conIn3 - \ ${r} = Create Resource ${iserver} ${container2} ${rt_contentInstance} ${attr},"rn":${conName} - \ Response Is Correct ${r} - : FOR ${conName} IN conIn1 conIn2 conIn3 - \ ${r} = Create Resource ${iserver} ${container3} ${rt_contentInstance} ${attr},"rn":${conName} - \ Response Is Correct ${r} - # ----------- Delete the parent Container -------------- + FOR ${conName} IN conIn1 conIn2 conIn3 + ${r} = Create Resource ${iserver} ${container1} ${rt_contentInstance} ${attr},"rn":${conName} + Response Is Correct ${r} + END + FOR ${conName} IN conIn1 conIn2 conIn3 + ${r} = Create Resource ${iserver} ${container2} ${rt_contentInstance} ${attr},"rn":${conName} + Response Is Correct ${r} + END + FOR ${conName} IN conIn1 conIn2 conIn3 + ${r} = Create Resource ${iserver} ${container3} ${rt_contentInstance} ${attr},"rn":${conName} + Response Is Correct ${r} + # ----------- Delete the parent Container -------------- + END ${r} = Delete Resource ${iserver} InCSE1/Con1 Response Is Correct ${r} # Delete the resource that does not exist/has been deleted should return error diff --git a/csit/suites/l2switch/Inventory_Scalability_OF13/010__restconf_inventory.robot b/csit/suites/l2switch/Inventory_Scalability_OF13/010__restconf_inventory.robot index 391af75233..47ab13cea0 100644 --- a/csit/suites/l2switch/Inventory_Scalability_OF13/010__restconf_inventory.robot +++ b/csit/suites/l2switch/Inventory_Scalability_OF13/010__restconf_inventory.robot @@ -45,27 +45,31 @@ Check Every Nodes [Arguments] ${numnodes} ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT} Should Be Equal As Strings ${resp.status_code} 200 - : FOR ${IND} IN RANGE 1 ${numnodes+1} - \ Should Contain ${resp.content} openflow:${IND} + FOR ${IND} IN RANGE 1 ${numnodes+1} + Should Contain ${resp.content} openflow:${IND} + END Check Every Nodes Stats [Arguments] ${numnodes} - : FOR ${IND} IN RANGE 1 ${numnodes+1} - \ ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/node/openflow:${IND} - \ Log ${resp.content} - \ Should Be Equal As Strings ${resp.status_code} 200 - \ Should Contain ${resp.content} flow-capable-node-connector-statistics - \ Should Contain ${resp.content} flow-table-statistics + FOR ${IND} IN RANGE 1 ${numnodes+1} + ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/node/openflow:${IND} + Log ${resp.content} + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain ${resp.content} flow-capable-node-connector-statistics + Should Contain ${resp.content} flow-table-statistics + END Check Every Nodes Nodeconnector [Arguments] ${numnodes} - : FOR ${IND} IN RANGE 2 ${numnodes+1} - \ ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/node/openflow:${IND} - \ Log ${resp.content} - \ Should Be Equal As Strings ${resp.status_code} 200 - \ Check conn loop ${TOPO_TREE_FANOUT+1} ${IND} ${resp.content} + FOR ${IND} IN RANGE 2 ${numnodes+1} + ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/node/openflow:${IND} + Log ${resp.content} + Should Be Equal As Strings ${resp.status_code} 200 + Check conn loop ${TOPO_TREE_FANOUT+1} ${IND} ${resp.content} + END Check conn loop [Arguments] ${arg} ${outerind} ${content} - : FOR ${var} IN RANGE 1 ${arg+1} - \ Should Contain ${content} openflow:${outerind}:${var} + FOR ${var} IN RANGE 1 ${arg+1} + Should Contain ${content} openflow:${outerind}:${var} + END diff --git a/csit/suites/l2switch/Maximum_Hosts/010__finding_max_hosts.robot b/csit/suites/l2switch/Maximum_Hosts/010__finding_max_hosts.robot index a6e73176ca..0927e55e0b 100644 --- a/csit/suites/l2switch/Maximum_Hosts/010__finding_max_hosts.robot +++ b/csit/suites/l2switch/Maximum_Hosts/010__finding_max_hosts.robot @@ -23,11 +23,12 @@ Find Max Supported Hosts ${start}= BuiltIn.Convert to Integer ${MIN_HOSTS} ${stop}= BuiltIn.Convert to Integer ${MAX_HOSTS} ${step}= BuiltIn.Convert to Integer ${STEP_HOSTS} - : FOR ${hosts} IN RANGE ${start} ${stop+1} ${step} - \ ${status} ${error_message} ${host_discover_time} WorkflowsL2switch.Workflow Single Switch Multiple Hosts ${hosts} - \ BuiltIn.Exit For Loop If '${status}' == 'FAIL' - \ ${maximum_hosts}= BuiltIn.Set variable ${hosts} - \ ${discover_time}= BuiltIn.Set Variable ${host_discover_time} + FOR ${hosts} IN RANGE ${start} ${stop+1} ${step} + ${status} ${error_message} ${host_discover_time} WorkflowsL2switch.Workflow Single Switch Multiple Hosts ${hosts} + BuiltIn.Exit For Loop If '${status}' == 'FAIL' + ${maximum_hosts}= BuiltIn.Set variable ${hosts} + ${discover_time}= BuiltIn.Set Variable ${host_discover_time} + END BuiltIn.Log to console ${\n} BuiltIn.Log To Console Execution stopped because: ${error_message} BuiltIn.Log To Console Max Hosts: ${maximum_hosts} diff --git a/csit/suites/mdsal/binding_v1/binding-parent.robot b/csit/suites/mdsal/binding_v1/binding-parent.robot index e3a200fca3..463bd54b85 100644 --- a/csit/suites/mdsal/binding_v1/binding-parent.robot +++ b/csit/suites/mdsal/binding_v1/binding-parent.robot @@ -97,9 +97,10 @@ Add_Autorelease_Profile SSHLibrary.Get_File settings.xml ${root} = XML.Parse_Xml settings.xml ${profiles} = Xml.Get_Elements ${root} xpath=profiles/profile - : FOR ${profile} IN @{profiles} - \ ${id} = XML.Get_Element_Text ${profile} xpath=id - \ BuiltIn.Exit_For_Loop_If "${id}" == "opendaylight-release" + FOR ${profile} IN @{profiles} + ${id} = XML.Get_Element_Text ${profile} xpath=id + BuiltIn.Exit_For_Loop_If "${id}" == "opendaylight-release" + END BuiltIn.Should_Be_Equal_As_Strings ${id} opendaylight-release ${profile} = Xml.Copy_Element ${profile} XML.Set_Element_Text ${profile} opendaylight-autorelease xpath=id diff --git a/csit/suites/netconf/ready/netconfready.robot b/csit/suites/netconf/ready/netconfready.robot index b372dff67b..782dfb884f 100644 --- a/csit/suites/netconf/ready/netconfready.robot +++ b/csit/suites/netconf/ready/netconfready.robot @@ -155,8 +155,9 @@ Set_Netconf_Connector Check_Netconf_Topology_Ready [Documentation] Verifies the netconf readiness for every odl node. - : FOR ${idx} IN @{ClusterManagement__member_index_list} - \ Verify_Netconf_Topology_Ready_For_Node ${idx} + FOR ${idx} IN @{ClusterManagement__member_index_list} + Verify_Netconf_Topology_Ready_For_Node ${idx} + END Verify_Netconf_Topology_Ready_For_Node [Arguments] ${node_index} @@ -166,10 +167,11 @@ Verify_Netconf_Topology_Ready_For_Node Configure_Netconf_Device ${DEVICE_NAME} ${session} ${ODL_SYSTEM_${node_index}_IP} &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} Wait_Netconf_Device_Mounted ${DEVICE_NAME} ${session} ${mapping} - : FOR ${idx} IN @{ClusterManagement__member_index_list} - \ ${mod_session}= ClusterManagement.Resolve_Http_Session_For_Member member_index=${idx} - \ BuiltIn.Wait_Until_Keyword_Succeeds 5x 3s TemplatedRequests.Get_As_Xml_Templated ${NETCONF_FOLDER}${/}netconf-state mapping=${mapping} - \ ... session=${mod_session} + FOR ${idx} IN @{ClusterManagement__member_index_list} + ${mod_session}= ClusterManagement.Resolve_Http_Session_For_Member member_index=${idx} + BuiltIn.Wait_Until_Keyword_Succeeds 5x 3s TemplatedRequests.Get_As_Xml_Templated ${NETCONF_FOLDER}${/}netconf-state mapping=${mapping} + ... session=${mod_session} + END [Teardown] Remove_Netconf_Device ${DEVICE_NAME} ${session} Configure_Netconf_Device diff --git a/csit/suites/netconf/scale/getmulti.robot b/csit/suites/netconf/scale/getmulti.robot index 88984ad23c..0af1d4ceba 100644 --- a/csit/suites/netconf/scale/getmulti.robot +++ b/csit/suites/netconf/scale/getmulti.robot @@ -55,8 +55,9 @@ Issue_Requests_On_Devices SSHLibrary.Open_Connection ${TOOLS_SYSTEM_IP} SSHKeywords.Flexible_Mininet_Login SSHLibrary.Write python getter.py --odladdress=${ODL_SYSTEM_IP} --count=${DEVICE_COUNT} --name=${device_name_base} --workers=${WORKER_COUNT} - : FOR ${number} IN RANGE 1 ${DEVICE_COUNT}+1 - \ Read_Python_Tool_Operation_Result ${number} + FOR ${number} IN RANGE 1 ${DEVICE_COUNT}+1 + Read_Python_Tool_Operation_Result ${number} + END SSHLibrary.Read_Until_Prompt SSHLibrary.Close_Connection SSHKeywords.Restore Current SSH Connection From Index ${current_ssh_connection.index} diff --git a/csit/suites/netconf/scale/max_devices.robot b/csit/suites/netconf/scale/max_devices.robot index 7d85edd921..a17826f41f 100644 --- a/csit/suites/netconf/scale/max_devices.robot +++ b/csit/suites/netconf/scale/max_devices.robot @@ -46,27 +46,28 @@ Find Max Netconf Devices ${stop} = BuiltIn.Convert to Integer ${MAX_DEVICE_COUNT} ${increment} = BuiltIn.Convert to Integer ${DEVICE_INCREMENT} Run Keyword And Ignore Error CheckJVMResource.Get JVM Memory - : FOR ${devices} IN RANGE ${start} ${stop+1} ${increment} - \ ${timeout} = BuiltIn.Evaluate ${devices}*${TIMEOUT_FACTOR} - \ Log To Console Starting Iteration with ${devices} devices - \ Run Keyword If "${INSTALL_TESTTOOL}"=="True" NetconfKeywords.Install_And_Start_Testtool device-count=${devices} - \ ... ELSE NetconfKeywords.Start_Testtool ${TESTTOOL_EXECUTABLE} device-count=${devices} - \ ${status} ${result} = Run Keyword And Ignore Error NetconfKeywords.Perform_Operation_On_Each_Device Configure_Device timeout=${timeout} - \ Exit For Loop If '${status}' == 'FAIL' - \ ${status} ${result} = Run Keyword And Ignore Error NetconfKeywords.Perform_Operation_On_Each_Device Wait_Connected timeout=${timeout} - \ Exit For Loop If '${status}' == 'FAIL' - \ ${status} ${result} = Run Keyword And Ignore Error Issue_Requests_On_Devices ${TOOLS_SYSTEM_IP} ${devices} - \ ... ${NUM_WORKERS} - \ Exit For Loop If '${status}' == 'FAIL' - \ ${status} ${result} = Run Keyword And Ignore Error NetconfKeywords.Perform_Operation_On_Each_Device Wait_Connected timeout=${timeout} - \ Exit For Loop If '${status}' == 'FAIL' - \ ${status} ${result} = Run Keyword And Ignore Error NetconfKeywords.Perform_Operation_On_Each_Device Deconfigure_Device timeout=${timeout} - \ Exit For Loop If '${status}' == 'FAIL' - \ ${status} ${result} = Run Keyword And Ignore Error NetconfKeywords.Perform_Operation_On_Each_Device Check_Device_Deconfigured timeout=${timeout} - \ Exit For Loop If '${status}' == 'FAIL' - \ ${maximum_devices} = Set Variable ${devices} - \ Run Keyword And Ignore Error CheckJVMResource.Get JVM Memory - \ NetconfKeywords.Stop_Testtool + FOR ${devices} IN RANGE ${start} ${stop+1} ${increment} + ${timeout} = BuiltIn.Evaluate ${devices}*${TIMEOUT_FACTOR} + Log To Console Starting Iteration with ${devices} devices + Run Keyword If "${INSTALL_TESTTOOL}"=="True" NetconfKeywords.Install_And_Start_Testtool device-count=${devices} + ... ELSE NetconfKeywords.Start_Testtool ${TESTTOOL_EXECUTABLE} device-count=${devices} + ${status} ${result} = Run Keyword And Ignore Error NetconfKeywords.Perform_Operation_On_Each_Device Configure_Device timeout=${timeout} + Exit For Loop If '${status}' == 'FAIL' + ${status} ${result} = Run Keyword And Ignore Error NetconfKeywords.Perform_Operation_On_Each_Device Wait_Connected timeout=${timeout} + Exit For Loop If '${status}' == 'FAIL' + ${status} ${result} = Run Keyword And Ignore Error Issue_Requests_On_Devices ${TOOLS_SYSTEM_IP} ${devices} + ... ${NUM_WORKERS} + Exit For Loop If '${status}' == 'FAIL' + ${status} ${result} = Run Keyword And Ignore Error NetconfKeywords.Perform_Operation_On_Each_Device Wait_Connected timeout=${timeout} + Exit For Loop If '${status}' == 'FAIL' + ${status} ${result} = Run Keyword And Ignore Error NetconfKeywords.Perform_Operation_On_Each_Device Deconfigure_Device timeout=${timeout} + Exit For Loop If '${status}' == 'FAIL' + ${status} ${result} = Run Keyword And Ignore Error NetconfKeywords.Perform_Operation_On_Each_Device Check_Device_Deconfigured timeout=${timeout} + Exit For Loop If '${status}' == 'FAIL' + ${maximum_devices} = Set Variable ${devices} + Run Keyword And Ignore Error CheckJVMResource.Get JVM Memory + NetconfKeywords.Stop_Testtool + END [Teardown] Run Keywords NetconfKeywords.Stop_Testtool ... AND Collect_Data_Points ${maximum_devices} ... AND Run Keyword And Ignore Error CheckJVMResource.Get JVM Memory @@ -85,8 +86,9 @@ Issue_Requests_On_Devices SSHLibrary.Open_Connection ${client_ip} SSHKeywords.Flexible_Mininet_Login SSHLibrary.Write python getter.py --odladdress=${ODL_SYSTEM_IP} --count=${expected_count} --name=${device_name_base} --workers=${worker_count} - : FOR ${number} IN RANGE 1 ${expected_count}+1 - \ Read_Python_Tool_Operation_Result ${number} + FOR ${number} IN RANGE 1 ${expected_count}+1 + Read_Python_Tool_Operation_Result ${number} + END SSHLibrary.Read_Until_Prompt SSHLibrary.Close_Connection SSHKeywords.Restore Current SSH Connection From Index ${current_ssh_connection.index} diff --git a/csit/suites/netvirt/elan/elan.robot b/csit/suites/netvirt/elan/elan.robot index 784cdafd68..b416174081 100644 --- a/csit/suites/netvirt/elan/elan.robot +++ b/csit/suites/netvirt/elan/elan.robot @@ -44,10 +44,12 @@ Verify Datapath for Single ELAN with Multiple DPN Verify Datapath After OVS Restart [Documentation] Verify datapath after OVS restart - : FOR ${ip} IN @{OS_CMP_IPS} - \ OVSDB.Restart OVSDB ${ip} - : FOR ${ip} IN @{OS_CMP_IPS} - \ BuiltIn.Wait Until Keyword Succeeds 30s 10s OVSDB.Verify OVS Reports Connected tools_system=${ip} + FOR ${ip} IN @{OS_CMP_IPS} + OVSDB.Restart OVSDB ${ip} + END + FOR ${ip} IN @{OS_CMP_IPS} + BuiltIn.Wait Until Keyword Succeeds 30s 10s OVSDB.Verify OVS Reports Connected tools_system=${ip} + END ${smac_cn1} = BuiltIn.Create List @{NET_1_MACS}[0] ${smac_cn2} = BuiltIn.Create List @{NET_1_MACS}[1] BuiltIn.Wait Until Keyword Succeeds 60s 10s Verify Flows Are Present For ELAN Service ${OS_CMP1_IP} ${smac_cn1} ${NET_1_MACS} @@ -76,8 +78,9 @@ Verify Datapath After Recreate VM Instance Delete All elan_net_1 VM And Verify Flow Table Updated [Documentation] Verify Flow table after all VM instance deleted - : FOR ${vm} IN @{NET_1_VMS} - \ OpenStackOperations.Delete Vm Instance ${vm} + FOR ${vm} IN @{NET_1_VMS} + OpenStackOperations.Delete Vm Instance ${vm} + END Verify Flows Are Removed For ELAN Service On All compute Nodes ${NET_1_MACS} Verify Datapath for Multiple ELAN with Multiple DPN @@ -163,13 +166,15 @@ Verify Flows Are Present For ELAN Service BuiltIn.Should Contain ${flow_output} table=${ELAN_SMACTABLE} ${smac_output} = String.Get Lines Containing String ${flow_output} table=${ELAN_SMACTABLE} Builtin.Log ${smac_output} - : FOR ${smac} IN @{smacs} - \ ${resp} = BuiltIn.Should Contain ${smac_output} ${smac} + FOR ${smac} IN @{smacs} + ${resp} = BuiltIn.Should Contain ${smac_output} ${smac} + END BuiltIn.Should Contain ${flow_output} table=${ELAN_DMACTABLE} ${dmac_output} = String.Get Lines Containing String ${flow_output} table=${ELAN_DMACTABLE} Builtin.Log ${dmac_output} - : FOR ${dmac} IN @{dmacs} - \ ${resp} = BuiltIn.Should Contain ${dmac_output} ${dmac} + FOR ${dmac} IN @{dmacs} + ${resp} = BuiltIn.Should Contain ${dmac_output} ${dmac} + END BuiltIn.Should Contain ${flow_output} table=${ELAN_UNKNOWNMACTABLE} ${smac_output} = String.Get Lines Containing String ${flow_output} table=${ELAN_UNKNOWNMACTABLE} Builtin.Log ${smac_output} @@ -180,15 +185,18 @@ Verify Flows Are Removed For ELAN Service BuiltIn.Should Contain ${flow_output} table=${ELAN_SMACTABLE} ${smac_output} = String.Get Lines Containing String ${flow_output} table=${ELAN_SMACTABLE} Builtin.Log ${smac_output} - : FOR ${smac} IN @{smacs} - \ ${resp} = BuiltIn.Should Not Contain ${smac_output} ${smac} + FOR ${smac} IN @{smacs} + ${resp} = BuiltIn.Should Not Contain ${smac_output} ${smac} + END BuiltIn.Should Contain ${flow_output} table=${ELAN_DMACTABLE} ${dmac_output} = String.Get Lines Containing String ${flow_output} table=${ELAN_DMACTABLE} Builtin.Log ${dmac_output} - : FOR ${dmac} IN @{smacs} - \ ${resp} = BuiltIn.Should Not Contain ${dmac_output} ${dmac} + FOR ${dmac} IN @{smacs} + ${resp} = BuiltIn.Should Not Contain ${dmac_output} ${dmac} + END Verify Flows Are Removed For ELAN Service On All compute Nodes [Arguments] ${smacs} - : FOR ${ip} IN @{OS_CMP_IPS} - \ BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Removed For ELAN Service ${ip} ${smacs} + FOR ${ip} IN @{OS_CMP_IPS} + BuiltIn.Wait Until Keyword Succeeds 30s 10s Verify Flows Are Removed For ELAN Service ${ip} ${smacs} + END diff --git a/csit/suites/netvirt/elan/elan_service_recovery.robot b/csit/suites/netvirt/elan/elan_service_recovery.robot index 769f8c0242..14b9829af5 100644 --- a/csit/suites/netvirt/elan/elan_service_recovery.robot +++ b/csit/suites/netvirt/elan/elan_service_recovery.robot @@ -81,18 +81,20 @@ Suite Setup Create Neutron Ports [Documentation] Create required number of ports under previously created subnets - : FOR ${index} IN RANGE 0 ${NUM_OF_PORTS_PER_HOST} - \ OpenStackOperations.Create Port ${REQ_NETWORK} @{PORT_LIST}[${index}] sg=${SECURITY_GROUP} - \ OpenStackOperations.Create Port ${REQ_NETWORK} @{PORT_LIST}[${index + 2}] sg=${SECURITY_GROUP} + FOR ${index} IN RANGE 0 ${NUM_OF_PORTS_PER_HOST} + OpenStackOperations.Create Port ${REQ_NETWORK} @{PORT_LIST}[${index}] sg=${SECURITY_GROUP} + OpenStackOperations.Create Port ${REQ_NETWORK} @{PORT_LIST}[${index + 2}] sg=${SECURITY_GROUP} + END @{PORT_MAC_ADDR} = OpenStackOperations.Get Ports MacAddr ${PORT_LIST} BuiltIn.Set Suite Variable @{PORT_MAC_ADDR} Create Nova VMs [Arguments] ${num_of_vms_per_dpn} [Documentation] Create Vm instances on compute nodes - : FOR ${index} IN RANGE 0 ${num_of_vms_per_dpn} - \ OpenStackOperations.Create Vm Instance With Port On Compute Node @{PORT_LIST}[${index}] @{NET_1_VMS}[${index}] ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP} - \ OpenStackOperations.Create Vm Instance With Port On Compute Node @{PORT_LIST}[${index + 2}] @{NET_2_VMS}[${index}] ${OS_CMP2_HOSTNAME} sg=${SECURITY_GROUP} + FOR ${index} IN RANGE 0 ${num_of_vms_per_dpn} + OpenStackOperations.Create Vm Instance With Port On Compute Node @{PORT_LIST}[${index}] @{NET_1_VMS}[${index}] ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP} + OpenStackOperations.Create Vm Instance With Port On Compute Node @{PORT_LIST}[${index + 2}] @{NET_2_VMS}[${index}] ${OS_CMP2_HOSTNAME} sg=${SECURITY_GROUP} + END @{NET_1_VM_IPS} ${NET_1_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_1_VMS} @{NET_2_VM_IPS} ${NET_2_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_2_VMS} BuiltIn.Should Not Contain ${NET_1_VM_IPS} None diff --git a/csit/suites/netvirt/host_route/host_route_handling.robot b/csit/suites/netvirt/host_route/host_route_handling.robot index 8daf5d2687..6b9b36bdda 100644 --- a/csit/suites/netvirt/host_route/host_route_handling.robot +++ b/csit/suites/netvirt/host_route/host_route_handling.robot @@ -37,9 +37,10 @@ Verify creation of host route via openstack subnet create option [Documentation] Creating subnet host route via openstack cli and verifying in controller and openstack. OpenStackOperations.Create SubNet @{NETWORKS}[0] @{SUBNETS}[0] @{SUBNET_CIDR}[0]${PREFIX24} --host-route destination=@{SUBNET_CIDR}[2]${PREFIX24},gateway=${NON_NEUTRON_NEXTHOP} ${SUBNET_GW_IP} BuiltIn.Create List - : FOR ${subnet} IN @{SUBNETS} - \ ${ip} = OpenStackOperations.Get Subnet Gateway Ip ${subnet} - \ Collections.Append To List ${SUBNET_GW_IP} ${ip} + FOR ${subnet} IN @{SUBNETS} + ${ip} = OpenStackOperations.Get Subnet Gateway Ip ${subnet} + Collections.Append To List ${SUBNET_GW_IP} ${ip} + END BuiltIn.Set Suite Variable ${SUBNET_GW_IP} ${elements} = BuiltIn.Create List "destination":"@{SUBNET_CIDR}[2]${PREFIX24}","nexthop":"${NON_NEUTRON_NEXTHOP}" BuiltIn.Wait Until Keyword Succeeds 30s 5s Utils.Check For Elements At URI ${SUBNETWORK_URL} ${elements} @@ -101,16 +102,18 @@ Suite Setup [Documentation] Creates initial setup. VpnOperations.Basic Suite Setup OpenStackOperations.Create Allow All SecurityGroup ${SECURITY_GROUP} - : FOR ${network} IN @{NETWORKS} - \ OpenStackOperations.Create Network ${network} - : FOR ${i} IN RANGE 1 4 - \ OpenStackOperations.Create SubNet @{NETWORKS}[${i}] @{SUBNETS}[${i}] @{SUBNET_CIDR}[${i}]${PREFIX24} - \ OpenStackOperations.Create Port @{NETWORKS}[${i}] @{PORTS}[${i}] sg=${SECURITY_GROUP} allowed_address_pairs=${ALLOWED_ADDRESS_PAIR} - \ OpenStackOperations.Create Vm Instance With Port On Compute Node @{PORTS}[${i}] @{NETWORK_${i+1}_VMS}[0] ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP} - \ OpenStackOperations.Create Port @{NETWORKS}[${i}] @{PORTS}[${i+3}] sg=${SECURITY_GROUP} allowed_address_pairs=${ALLOWED_ADDRESS_PAIR} - \ OpenStackOperations.Create Vm Instance With Port On Compute Node @{PORTS}[${i+3}] @{NETWORK_${i+1}_VMS}[1] ${OS_CMP2_HOSTNAME} sg=${SECURITY_GROUP} - \ OpenStackOperations.Create Port @{NETWORKS}[${i}] @{GATEWAY_PORTS}[${i}] sg=${SECURITY_GROUP} allowed_address_pairs=${ALLOWED_ADDRESS_PAIR} - \ OpenStackOperations.Create Port @{NETWORKS}[${i}] @{GATEWAY_PORTS}[${i+3}] sg=${SECURITY_GROUP} allowed_address_pairs=${ALLOWED_ADDRESS_PAIR} + FOR ${network} IN @{NETWORKS} + OpenStackOperations.Create Network ${network} + END + FOR ${i} IN RANGE 1 4 + OpenStackOperations.Create SubNet @{NETWORKS}[${i}] @{SUBNETS}[${i}] @{SUBNET_CIDR}[${i}]${PREFIX24} + OpenStackOperations.Create Port @{NETWORKS}[${i}] @{PORTS}[${i}] sg=${SECURITY_GROUP} allowed_address_pairs=${ALLOWED_ADDRESS_PAIR} + OpenStackOperations.Create Vm Instance With Port On Compute Node @{PORTS}[${i}] @{NETWORK_${i+1}_VMS}[0] ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP} + OpenStackOperations.Create Port @{NETWORKS}[${i}] @{PORTS}[${i+3}] sg=${SECURITY_GROUP} allowed_address_pairs=${ALLOWED_ADDRESS_PAIR} + OpenStackOperations.Create Vm Instance With Port On Compute Node @{PORTS}[${i+3}] @{NETWORK_${i+1}_VMS}[1] ${OS_CMP2_HOSTNAME} sg=${SECURITY_GROUP} + OpenStackOperations.Create Port @{NETWORKS}[${i}] @{GATEWAY_PORTS}[${i}] sg=${SECURITY_GROUP} allowed_address_pairs=${ALLOWED_ADDRESS_PAIR} + OpenStackOperations.Create Port @{NETWORKS}[${i}] @{GATEWAY_PORTS}[${i+3}] sg=${SECURITY_GROUP} allowed_address_pairs=${ALLOWED_ADDRESS_PAIR} + END @{NETWORK_2_VM_IPS} ${NETWORK_2_DHCP_IP} = OpenStackOperations.Get VM IPs @{NETWORK_2_VMS} BuiltIn.Set Suite Variable @{NETWORK_2_VM_IPS} @{NETWORK_3_VM_IPS} ${NETWORK_3_DHCP_IP} = OpenStackOperations.Get VM IPs @{NETWORK_3_VMS} @@ -124,12 +127,14 @@ Verify Hostroutes In Subnet [Arguments] ${subnet_name} @{elements} [Documentation] Show subnet with openstack request and verifies given hostroute in subnet. ${output} = OpenStackOperations.Show SubNet ${subnet_name} - : FOR ${element} IN @{elements} - \ BuiltIn.Should Match Regexp ${output} ${element} + FOR ${element} IN @{elements} + BuiltIn.Should Match Regexp ${output} ${element} + END Verify No Hostroutes In Subnet [Arguments] ${subnet_name} @{elements} [Documentation] Show subnet with openstack request and verifies no given hostroute in subnet. ${output} = OpenStackOperations.Show SubNet ${subnet_name} - : FOR ${element} IN @{elements} - \ BuiltIn.Should Not Match Regexp ${output} ${element} + FOR ${element} IN @{elements} + BuiltIn.Should Not Match Regexp ${output} ${element} + END diff --git a/csit/suites/netvirt/l2l3_gatewaymac_arp.robot b/csit/suites/netvirt/l2l3_gatewaymac_arp.robot index 2829a26d6a..0e3a880a1d 100644 --- a/csit/suites/netvirt/l2l3_gatewaymac_arp.robot +++ b/csit/suites/netvirt/l2l3_gatewaymac_arp.robot @@ -136,33 +136,38 @@ Suite Setup Create Neutron Networks [Arguments] ${NUM_OF_NETWORK} [Documentation] Create required number of networks - : FOR ${NET} IN @{REQ_NETWORKS} - \ OpenStackOperations.Create Network ${NET} + FOR ${NET} IN @{REQ_NETWORKS} + OpenStackOperations.Create Network ${NET} + END BuiltIn.Wait Until Keyword Succeeds 3s 1s Utils.Check For Elements At URI ${NETWORK_URL} ${REQ_NETWORKS} Create Neutron Subnets [Arguments] ${NUM_OF_NETWORK} [Documentation] Create required number of subnets for previously created networks - : FOR ${index} IN RANGE 0 ${NUM_OF_NETWORK} - \ OpenStackOperations.Create SubNet ${REQ_NETWORKS[${index}]} ${REQ_SUBNETS[${index}]} ${REQ_SUBNET_CIDR[${index}]} + FOR ${index} IN RANGE 0 ${NUM_OF_NETWORK} + OpenStackOperations.Create SubNet ${REQ_NETWORKS[${index}]} ${REQ_SUBNETS[${index}]} ${REQ_SUBNET_CIDR[${index}]} + END BuiltIn.Wait Until Keyword Succeeds 3s 1s Utils.Check For Elements At URI ${SUBNETWORK_URL} ${REQ_SUBNETS} Create Neutron Ports [Documentation] Create required number of ports under previously created subnets - : FOR ${index} IN RANGE 0 ${NUM_OF_PORTS_PER_HOST} - \ OpenStackOperations.Create Port @{REQ_NETWORKS}[${index}] @{PORT_LIST}[${index}] sg=${SECURITY_GROUP} - \ OpenStackOperations.Create Port @{REQ_NETWORKS}[${index}] @{PORT_LIST}[${index + 2}] sg=${SECURITY_GROUP} + FOR ${index} IN RANGE 0 ${NUM_OF_PORTS_PER_HOST} + OpenStackOperations.Create Port @{REQ_NETWORKS}[${index}] @{PORT_LIST}[${index}] sg=${SECURITY_GROUP} + OpenStackOperations.Create Port @{REQ_NETWORKS}[${index}] @{PORT_LIST}[${index + 2}] sg=${SECURITY_GROUP} + END BuiltIn.Wait Until Keyword Succeeds 3s 1s Utils.Check For Elements At URI ${PORT_URL} ${PORT_LIST} Create Nova VMs [Arguments] ${NUM_OF_VMS_PER_DPN} [Documentation] Create Vm instances on compute nodes - : FOR ${index} IN RANGE 0 ${NUM_OF_VMS_PER_DPN} - \ OpenStackOperations.Create Vm Instance With Port On Compute Node ${PORT_LIST[${index}]} ${VM_NAMES[${index}]} ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP} + FOR ${index} IN RANGE 0 ${NUM_OF_VMS_PER_DPN} + OpenStackOperations.Create Vm Instance With Port On Compute Node ${PORT_LIST[${index}]} ${VM_NAMES[${index}]} ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP} + END ${start} = Evaluate ${index}+1 ${NUM_OF_VMS_PER_DPN} = Evaluate ${start}+${NUM_OF_VMS_PER_DPN} - : FOR ${index} IN RANGE ${start} ${NUM_OF_VMS_PER_DPN} - \ OpenStackOperations.Create Vm Instance With Port On Compute Node ${PORT_LIST[${index}]} ${VM_NAMES[${index}]} ${OS_CMP2_HOSTNAME} sg=${SECURITY_GROUP} + FOR ${index} IN RANGE ${start} ${NUM_OF_VMS_PER_DPN} + OpenStackOperations.Create Vm Instance With Port On Compute Node ${PORT_LIST[${index}]} ${VM_NAMES[${index}]} ${OS_CMP2_HOSTNAME} sg=${SECURITY_GROUP} + END @{NET_1_VM_IPS} ${NET_1_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_1_VMS} @{NET_2_VM_IPS} ${NET_2_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_2_VMS} BuiltIn.Set Suite Variable @{NET_1_VM_IPS} @@ -190,12 +195,14 @@ Create Setup Add Interfaces To Routers [Documentation] Add Multiple Interfaces to Router and Verify - : FOR ${INTERFACE} IN @{REQ_SUBNETS} - \ OpenStackOperations.Add Router Interface ${REQ_ROUTER} ${INTERFACE} + FOR ${INTERFACE} IN @{REQ_SUBNETS} + OpenStackOperations.Add Router Interface ${REQ_ROUTER} ${INTERFACE} + END ${interface_output} = OpenStackOperations.Show Router Interface ${REQ_ROUTER} - : FOR ${INTERFACE} IN @{REQ_SUBNETS} - \ ${subnet_id} = OpenStackOperations.Get Subnet Id ${INTERFACE} - \ BuiltIn.Should Contain ${interface_output} ${subnet_id} + FOR ${INTERFACE} IN @{REQ_SUBNETS} + ${subnet_id} = OpenStackOperations.Get Subnet Id ${INTERFACE} + BuiltIn.Should Contain ${interface_output} ${subnet_id} + END Verify Flows Are Present For ARP [Arguments] ${arp_op_code} ${additional_args}=${EMPTY} diff --git a/csit/suites/netvirt/l3vpn_bgp/l3vpn_bgp_multipath_maxpath_cli.robot b/csit/suites/netvirt/l3vpn_bgp/l3vpn_bgp_multipath_maxpath_cli.robot index c919a1750f..403016c745 100644 --- a/csit/suites/netvirt/l3vpn_bgp/l3vpn_bgp_multipath_maxpath_cli.robot +++ b/csit/suites/netvirt/l3vpn_bgp/l3vpn_bgp_multipath_maxpath_cli.robot @@ -51,27 +51,32 @@ Verify ODL supports CLI for multipath configuration (enable/disable multipath) Verify CSC supports CLI for max path configuration [Documentation] Verify CSC supports CLI for max path configuration - : FOR ${idx} IN RANGE ${START_VALUE} ${NUM_OF_DCGW} - \ VpnOperations.VPN Create L3VPN name=@{VPN_NAME}[${idx}] vpnid=@{VPN_ID}[${idx}] rd=@{L3VPN_RD_IRT_ERT}[${idx}] exportrt=@{L3VPN_RD_IRT_ERT}[${idx}] importrt=@{L3VPN_RD_IRT_ERT}[${idx}] + FOR ${idx} IN RANGE ${START_VALUE} ${NUM_OF_DCGW} + VpnOperations.VPN Create L3VPN name=@{VPN_NAME}[${idx}] vpnid=@{VPN_ID}[${idx}] rd=@{L3VPN_RD_IRT_ERT}[${idx}] exportrt=@{L3VPN_RD_IRT_ERT}[${idx}] importrt=@{L3VPN_RD_IRT_ERT}[${idx}] + END VpnOperations.Verify L3VPN On ODL @{VPN_ID} - : FOR ${dcgw} IN @{DCGW_IP_LIST} - \ BgpOperations.Create L3VPN on DCGW ${dcgw} ${AS_ID} @{VPN_NAME}[0] @{DCGW_RD_IRT_ERT}[0] - \ BgpOperations.Verify L3VPN On DCGW ${dcgw} @{VPN_NAME}[0] @{DCGW_RD_IRT_ERT}[0] - : FOR ${idx} IN RANGE ${START_VALUE} ${NUM_OF_DCGW} - \ Configure Maxpath @{MAX_PATH_LIST}[2] @{DCGW_RD_IRT_ERT}[${idx}] - \ BuiltIn.Wait Until Keyword Succeeds 10s 2s Verify Maxpath @{MAX_PATH_LIST}[2] @{DCGW_RD_IRT_ERT}[${idx}] + FOR ${dcgw} IN @{DCGW_IP_LIST} + BgpOperations.Create L3VPN on DCGW ${dcgw} ${AS_ID} @{VPN_NAME}[0] @{DCGW_RD_IRT_ERT}[0] + BgpOperations.Verify L3VPN On DCGW ${dcgw} @{VPN_NAME}[0] @{DCGW_RD_IRT_ERT}[0] + END + FOR ${idx} IN RANGE ${START_VALUE} ${NUM_OF_DCGW} + Configure Maxpath @{MAX_PATH_LIST}[2] @{DCGW_RD_IRT_ERT}[${idx}] + BuiltIn.Wait Until Keyword Succeeds 10s 2s Verify Maxpath @{MAX_PATH_LIST}[2] @{DCGW_RD_IRT_ERT}[${idx}] + END BuiltIn.Wait Until Keyword Succeeds 60s 10s BgpOperations.Check BGP VPNv4 Nbr On ODL ${NUM_OF_DCGW} False Verify max-path error message with invalid inputs [Documentation] Verify max path error message while configuring maxpath with invalid range VpnOperations.VPN Create L3VPN name=@{VPN_NAME}[0] vpnid=@{VPN_ID}[0] rd=@{L3VPN_RD_IRT_ERT}[0] exportrt=@{L3VPN_RD_IRT_ERT}[0] importrt=@{L3VPN_RD_IRT_ERT}[0] VpnOperations.Verify L3VPN On ODL @{VPN_ID}[0] - : FOR ${dcgw} IN @{DCGW_IP_LIST} - \ BgpOperations.Create L3VPN on DCGW ${dcgw} ${AS_ID} @{VPN_NAME}[0] @{DCGW_RD_IRT_ERT}[0] - \ BgpOperations.Verify L3VPN On DCGW ${dcgw} @{VPN_NAME}[0] @{DCGW_RD_IRT_ERT}[0] - : FOR ${invalid} IN @{MAX_PATH_INVALID_LIST} - \ Configure Maxpath ${invalid} @{DCGW_RD_IRT_ERT}[0] - \ BuiltIn.Wait Until Keyword Succeeds 10s 2s Verify Maxpath ${invalid} @{DCGW_RD_IRT_ERT}[0] + FOR ${dcgw} IN @{DCGW_IP_LIST} + BgpOperations.Create L3VPN on DCGW ${dcgw} ${AS_ID} @{VPN_NAME}[0] @{DCGW_RD_IRT_ERT}[0] + BgpOperations.Verify L3VPN On DCGW ${dcgw} @{VPN_NAME}[0] @{DCGW_RD_IRT_ERT}[0] + END + FOR ${invalid} IN @{MAX_PATH_INVALID_LIST} + Configure Maxpath ${invalid} @{DCGW_RD_IRT_ERT}[0] + BuiltIn.Wait Until Keyword Succeeds 10s 2s Verify Maxpath ${invalid} @{DCGW_RD_IRT_ERT}[0] + END BuiltIn.Wait Until Keyword Succeeds 60s 10s BgpOperations.Check BGP VPNv4 Nbr On ODL ${NUM_OF_DCGW} False Verify ODL supports dynamic configuration changes for max path value @@ -79,35 +84,40 @@ Verify ODL supports dynamic configuration changes for max path value VpnOperations.VPN Create L3VPN name=@{VPN_NAME}[0] vpnid=@{VPN_ID}[0] rd=@{L3VPN_RD_IRT_ERT}[0] exportrt=@{L3VPN_RD_IRT_ERT}[0] importrt=@{L3VPN_RD_IRT_ERT}[0] VpnOperations.Verify L3VPN On ODL @{VPN_ID}[0] VpnOperations.Associate VPN to Router routerid=@{router_id_list}[0] vpnid=@{VPN_ID}[0] - : FOR ${dcgw} IN @{DCGW_IP_LIST} - \ BgpOperations.Create L3VPN on DCGW ${dcgw} ${AS_ID} @{VPN_NAME}[0] @{DCGW_RD_IRT_ERT}[0] - \ BgpOperations.Verify L3VPN On DCGW ${dcgw} @{VPN_NAME}[0] @{DCGW_RD_IRT_ERT}[0] + FOR ${dcgw} IN @{DCGW_IP_LIST} + BgpOperations.Create L3VPN on DCGW ${dcgw} ${AS_ID} @{VPN_NAME}[0] @{DCGW_RD_IRT_ERT}[0] + BgpOperations.Verify L3VPN On DCGW ${dcgw} @{VPN_NAME}[0] @{DCGW_RD_IRT_ERT}[0] + END Configure Maxpath @{MAX_PATH_LIST}[2] @{DCGW_RD_IRT_ERT}[0] BuiltIn.Wait Until Keyword Succeeds 10s 2s Verify Maxpath @{MAX_PATH_LIST}[2] @{DCGW_RD_IRT_ERT}[0] - : FOR ${idx} IN RANGE ${START_VALUE} ${NUM_OF_DCGW} - \ BgpOperations.Add Routes On DCGW @{DCGW_IP_LIST}[${idx}] @{DCGW_RD_IRT_ERT}[0] @{NETWORK_IP}[0] @{LABEL}[${idx}] + FOR ${idx} IN RANGE ${START_VALUE} ${NUM_OF_DCGW} + BgpOperations.Add Routes On DCGW @{DCGW_IP_LIST}[${idx}] @{DCGW_RD_IRT_ERT}[0] @{NETWORK_IP}[0] @{LABEL}[${idx}] + END BuiltIn.Wait Until Keyword Succeeds 60s 10s BgpOperations.Check BGP VPNv4 Nbr On ODL ${NUM_OF_DCGW} BuiltIn.Wait Until Keyword Succeeds 60s 10s Verify Routing Entry On ODL @{DCGW_RD_IRT_ERT}[0] @{NETWORK_IP}[0] @{NUM_OF_ROUTES}[2] BuiltIn.Wait Until Keyword Succeeds 30s 5s Verify FIB Entry On ODL @{NETWORK_IP}[0] @{NUM_OF_ROUTES}[2] - : FOR ${index} IN RANGE 0 3 - \ Configure Maxpath @{MAX_PATH_LIST}[${index}] @{DCGW_RD_IRT_ERT}[0] - \ BuiltIn.Wait Until Keyword Succeeds 10s 2s Verify Maxpath @{MAX_PATH_LIST}[${index}] @{DCGW_RD_IRT_ERT}[0] - \ BuiltIn.Wait Until Keyword Succeeds 60s 10s Verify Routing Entry On ODL @{DCGW_RD_IRT_ERT}[0] @{NETWORK_IP}[0] - \ ... @{NUM_OF_ROUTES}[2] - \ BuiltIn.Wait Until Keyword Succeeds 60s 10s Verify FIB Entry On ODL @{NETWORK_IP}[0] @{NUM_OF_ROUTES}[${index}] + FOR ${index} IN RANGE 0 3 + Configure Maxpath @{MAX_PATH_LIST}[${index}] @{DCGW_RD_IRT_ERT}[0] + BuiltIn.Wait Until Keyword Succeeds 10s 2s Verify Maxpath @{MAX_PATH_LIST}[${index}] @{DCGW_RD_IRT_ERT}[0] + BuiltIn.Wait Until Keyword Succeeds 60s 10s Verify Routing Entry On ODL @{DCGW_RD_IRT_ERT}[0] @{NETWORK_IP}[0] + ... @{NUM_OF_ROUTES}[2] + BuiltIn.Wait Until Keyword Succeeds 60s 10s Verify FIB Entry On ODL @{NETWORK_IP}[0] @{NUM_OF_ROUTES}[${index}] + END Verify that ECMP path gets withdrawn by QBGP after disabling multipath [Documentation] Verify that ECMP path gets withdrawn by QBGP after disabling multipath by setting multipath value to 1 VpnOperations.VPN Create L3VPN name=@{VPN_NAME}[0] vpnid=@{VPN_ID}[0] rd=@{L3VPN_RD_IRT_ERT}[0] exportrt=@{L3VPN_RD_IRT_ERT}[0] importrt=@{L3VPN_RD_IRT_ERT}[0] VpnOperations.Verify L3VPN On ODL @{VPN_ID}[0] VpnOperations.Associate VPN to Router routerid=@{router_id_list}[0] vpnid=@{VPN_ID}[0] - : FOR ${dcgw} IN @{DCGW_IP_LIST} - \ BgpOperations.Create L3VPN on DCGW ${dcgw} ${AS_ID} @{VPN_NAME}[0] @{DCGW_RD_IRT_ERT}[0] - \ BgpOperations.Verify L3VPN On DCGW ${dcgw} @{VPN_NAME}[0] @{DCGW_RD_IRT_ERT}[0] + FOR ${dcgw} IN @{DCGW_IP_LIST} + BgpOperations.Create L3VPN on DCGW ${dcgw} ${AS_ID} @{VPN_NAME}[0] @{DCGW_RD_IRT_ERT}[0] + BgpOperations.Verify L3VPN On DCGW ${dcgw} @{VPN_NAME}[0] @{DCGW_RD_IRT_ERT}[0] + END Configure Maxpath @{MAX_PATH_LIST}[2] @{DCGW_RD_IRT_ERT}[0] BuiltIn.Wait Until Keyword Succeeds 10s 2s Verify Maxpath @{MAX_PATH_LIST}[2] @{DCGW_RD_IRT_ERT}[0] - : FOR ${idx} IN RANGE ${START_VALUE} ${NUM_OF_DCGW} - \ BgpOperations.Add Routes On DCGW @{DCGW_IP_LIST}[${idx}] @{DCGW_RD_IRT_ERT}[0] @{NETWORK_IP}[0] @{LABEL}[${idx}] + FOR ${idx} IN RANGE ${START_VALUE} ${NUM_OF_DCGW} + BgpOperations.Add Routes On DCGW @{DCGW_IP_LIST}[${idx}] @{DCGW_RD_IRT_ERT}[0] @{NETWORK_IP}[0] @{LABEL}[${idx}] + END BuiltIn.Wait Until Keyword Succeeds 60s 10s BgpOperations.Check BGP VPNv4 Nbr On ODL ${NUM_OF_DCGW} BuiltIn.Wait Until Keyword Succeeds 60s 10s Verify Routing Entry On ODL @{DCGW_RD_IRT_ERT}[0] @{NETWORK_IP}[0] @{NUM_OF_ROUTES}[2] BuiltIn.Wait Until Keyword Succeeds 30s 5s Verify FIB Entry On ODL @{NETWORK_IP}[0] @{NUM_OF_ROUTES}[2] @@ -131,46 +141,55 @@ Stop Suite Test Cleanup [Documentation] Posttest case cleanup - : FOR ${l3vpn_rd} IN @{DCGW_RD_IRT_ERT} - \ Configure Maxpath @{MAX_PATH_LIST}[0] ${l3vpn_rd} - : FOR ${vpn} IN @{VPN_ID} - \ BuiltIn.Run Keyword And Ignore Error VpnOperations.VPN Delete L3VPN vpnid=${vpn} - : FOR ${dcgw} IN @{DCGW_IP_LIST} - \ BuiltIn.Run Keyword And Ignore Error BgpOperations.Delete L3VPN on DCGW ${dcgw} ${AS_ID} ${VPN_NAME} + FOR ${l3vpn_rd} IN @{DCGW_RD_IRT_ERT} + Configure Maxpath @{MAX_PATH_LIST}[0] ${l3vpn_rd} + END + FOR ${vpn} IN @{VPN_ID} + BuiltIn.Run Keyword And Ignore Error VpnOperations.VPN Delete L3VPN vpnid=${vpn} + END + FOR ${dcgw} IN @{DCGW_IP_LIST} + BuiltIn.Run Keyword And Ignore Error BgpOperations.Delete L3VPN on DCGW ${dcgw} ${AS_ID} ${VPN_NAME} + END Create Setup [Documentation] Starting BGP process on each DCGW and ODL ... Verifying BGP neighbor session status ... Creating 3 networks, 3 subnets, one router - : FOR ${dcgw} IN @{DCGW_IP_LIST} - \ BgpOperations.Start Quagga Processes On DCGW ${dcgw} + FOR ${dcgw} IN @{DCGW_IP_LIST} + BgpOperations.Start Quagga Processes On DCGW ${dcgw} + END BgpOperations.Start Quagga Processes On ODL ${ODL_SYSTEM_IP} KarafKeywords.Issue Command On Karaf Console ${BGP_CONFIG_SERVER_CMD} BgpOperations.Create BGP Configuration On ODL localas=${AS_ID} routerid=${ODL_SYSTEM_IP} - : FOR ${dcgw} IN @{DCGW_IP_LIST} - \ BgpOperations.AddNeighbor To BGP Configuration On ODL remoteas=${AS_ID} neighborAddr=${dcgw} - \ ${output} = BgpOperations.Get BGP Configuration On ODL session - \ BuiltIn.Should Contain ${output} ${dcgw} - \ BgpOperations.Configure BGP And Add Neighbor On DCGW ${dcgw} ${AS_ID} ${dcgw} ${ODL_SYSTEM_IP} @{VPN_NAME}[0] - \ ... @{DCGW_RD_IRT_ERT}[0] @{NETWORK_IP}[0] - \ BuiltIn.Wait Until Keyword Succeeds 120s 20s BgpOperations.Verify BGP Neighbor Status On Quagga ${dcgw} ${ODL_SYSTEM_IP} - : FOR ${network} IN @{NETWORKS} - \ OpenStackOperations.Create Network ${network} + FOR ${dcgw} IN @{DCGW_IP_LIST} + BgpOperations.AddNeighbor To BGP Configuration On ODL remoteas=${AS_ID} neighborAddr=${dcgw} + ${output} = BgpOperations.Get BGP Configuration On ODL session + BuiltIn.Should Contain ${output} ${dcgw} + BgpOperations.Configure BGP And Add Neighbor On DCGW ${dcgw} ${AS_ID} ${dcgw} ${ODL_SYSTEM_IP} @{VPN_NAME}[0] + ... @{DCGW_RD_IRT_ERT}[0] @{NETWORK_IP}[0] + BuiltIn.Wait Until Keyword Succeeds 120s 20s BgpOperations.Verify BGP Neighbor Status On Quagga ${dcgw} ${ODL_SYSTEM_IP} + END + FOR ${network} IN @{NETWORKS} + OpenStackOperations.Create Network ${network} + END BuiltIn.Wait Until Keyword Succeeds 10s 2s Utils.Check For Elements At URI ${NETWORK_URL} ${NETWORKS} - : FOR ${index} IN RANGE 0 3 - \ OpenStackOperations.Create SubNet @{NETWORKS}[${index}] @{SUBNETS}[${index}] @{SUBNET_CIDR}[${index}] + FOR ${index} IN RANGE 0 3 + OpenStackOperations.Create SubNet @{NETWORKS}[${index}] @{SUBNETS}[${index}] @{SUBNET_CIDR}[${index}] + END BuiltIn.Wait Until Keyword Succeeds 10s 2s Utils.Check For Elements At URI ${SUBNETWORK_URL} ${SUBNETS} ${router_id_list} BuiltIn.Create List @{EMPTY} - : FOR ${router} IN @{ROUTERS} - \ OpenStackOperations.Create Router ${router} - \ ${router_id} = OpenStackOperations.Get Router Id ${router} - \ Collections.Append To List ${router_id_list} ${router_id} + FOR ${router} IN @{ROUTERS} + OpenStackOperations.Create Router ${router} + ${router_id} = OpenStackOperations.Get Router Id ${router} + Collections.Append To List ${router_id_list} ${router_id} + END BuiltIn.Set Suite Variable ${router_id_list} - : FOR ${index} IN RANGE 0 3 - \ OpenStackOperations.Add Router Interface @{ROUTERS}[${index}] @{SUBNETS}[${index}] - \ ${output} = OpenStackOperations.Show Router Interface @{ROUTERS}[${index}] - \ ${subnet_id} = OpenStackOperations.Get Subnet Id @{SUBNETS}[${index}] - \ BuiltIn.Should Contain ${output} ${subnet_id} + FOR ${index} IN RANGE 0 3 + OpenStackOperations.Add Router Interface @{ROUTERS}[${index}] @{SUBNETS}[${index}] + ${output} = OpenStackOperations.Show Router Interface @{ROUTERS}[${index}] + ${subnet_id} = OpenStackOperations.Get Subnet Id @{SUBNETS}[${index}] + BuiltIn.Should Contain ${output} ${subnet_id} + END Configure Multipath On ODL [Arguments] ${setting} diff --git a/csit/suites/netvirt/l3vpn_bgp/multi_vpn_bgp.robot b/csit/suites/netvirt/l3vpn_bgp/multi_vpn_bgp.robot index 33736479e4..5d554d82f4 100644 --- a/csit/suites/netvirt/l3vpn_bgp/multi_vpn_bgp.robot +++ b/csit/suites/netvirt/l3vpn_bgp/multi_vpn_bgp.robot @@ -70,8 +70,9 @@ Verify Route Update In Bgp For Routes With Default Route And Various Prefix Leng BuiltIn.Wait Until Keyword Succeeds 30s 10s Utils.Check For Elements At URI ${FIB_ENTRY_URL} ${SUBNET_CIDRS} OpenStackOperations.Create Network ${NET} ${length} = BuiltIn.Get Length ${REQ_SUBNETS_PREFIX} - : FOR ${idx} IN RANGE ${length} - \ OpenStackOperations.Create SubNet ${NET} @{REQ_SUBNETS_PREFIX}[${idx}] @{REQ_PREFIXLENGTHS}[${idx}] + FOR ${idx} IN RANGE ${length} + OpenStackOperations.Create SubNet ${NET} @{REQ_SUBNETS_PREFIX}[${idx}] @{REQ_PREFIXLENGTHS}[${idx}] + END BuiltIn.Wait Until Keyword Succeeds 3s 1s Utils.Check For Elements At URI ${SUBNETWORK_URL} ${REQ_SUBNETS_PREFIX} ${net_id} = OpenStackOperations.Get Net Id ${NET} VpnOperations.Associate L3VPN To Network networkid=${net_id} vpnid=@{VPN_INSTANCE_IDS}[0] @@ -84,9 +85,10 @@ Verify Route Update In Bgp For Routes With Default Route And Various Prefix Leng Verification Of Route Download With Three Vpns In SE And Qbgp With One-One Export Import Route Target [Documentation] Check the datapath traffic with one-one export import route target with three vpns. Create Multiple L3VPN @{NETWORKS}[0] ${3} - : FOR ${index} IN RANGE 0 ${NUM_OF_L3VPN} - \ BgpOperations.Configure BGP And Add Neighbor On DCGW ${DCGW_SYSTEM_IP} ${AS_ID} ${DCGW_SYSTEM_IP} ${ODL_SYSTEM_IP} @{VPN_NAMES}[${index}] - \ ... @{DCGW_RD}[${index}] @{LOOPBACK_IPS}[${index}] + FOR ${index} IN RANGE 0 ${NUM_OF_L3VPN} + BgpOperations.Configure BGP And Add Neighbor On DCGW ${DCGW_SYSTEM_IP} ${AS_ID} ${DCGW_SYSTEM_IP} ${ODL_SYSTEM_IP} @{VPN_NAMES}[${index}] + ... @{DCGW_RD}[${index}] @{LOOPBACK_IPS}[${index}] + END VpnOperations.Associate L3VPNs To Networks ${VPN_INSTANCE_IDS} ${NETWORKS} ${fib_values} = BuiltIn.Create List @{NET_1_VM_IPS} @{NET_2_VM_IPS} @{NET_3_VM_IPS} @{SUBNET_CIDRS} @{LOOPBACK_IPS} BuiltIn.Wait Until Keyword Succeeds 30s 10s Utils.Check For Elements At URI ${FIB_ENTRY_URL} ${fib_values} @@ -111,11 +113,13 @@ Verification Of Route Download With Three Vpns In SE And Qbgp With One-One Expor Verification Of Route Download With Three Vpns In SE And Qbgp With One-Many Export Import Route Target [Documentation] Check the datapath traffic with one-many export import route target with three vpns. VpnOperations.VPN Create L3VPN vpnid=@{VPN_INSTANCE_IDS}[0] name=@{VPN_NAMES}[0] rd=@{RDS}[0] exportrt=${CREATE_RT} importrt=@{RDS}[0] - : FOR ${index} IN RANGE 1 ${NUM_OF_L3VPN} - \ VpnOperations.VPN Create L3VPN vpnid=@{VPN_INSTANCE_IDS}[${index}] name=@{VPN_NAMES}[${index}] rd=@{RDS}[${index}] exportrt=@{RDS}[${index}] importrt=${RT_LIST_${index}} - : FOR ${index} IN RANGE 0 ${NUM_OF_L3VPN} - \ BgpOperations.Configure BGP And Add Neighbor On DCGW ${DCGW_SYSTEM_IP} ${AS_ID} ${DCGW_SYSTEM_IP} ${ODL_SYSTEM_IP} @{VPN_NAMES}[${index}] - \ ... @{DCGW_RD}[${index}] @{LOOPBACK_IPS}[${index}] + FOR ${index} IN RANGE 1 ${NUM_OF_L3VPN} + VpnOperations.VPN Create L3VPN vpnid=@{VPN_INSTANCE_IDS}[${index}] name=@{VPN_NAMES}[${index}] rd=@{RDS}[${index}] exportrt=@{RDS}[${index}] importrt=${RT_LIST_${index}} + END + FOR ${index} IN RANGE 0 ${NUM_OF_L3VPN} + BgpOperations.Configure BGP And Add Neighbor On DCGW ${DCGW_SYSTEM_IP} ${AS_ID} ${DCGW_SYSTEM_IP} ${ODL_SYSTEM_IP} @{VPN_NAMES}[${index}] + ... @{DCGW_RD}[${index}] @{LOOPBACK_IPS}[${index}] + END ${networks} = BuiltIn.Create List @{NETWORKS}[0] @{NETWORKS}[1] VpnOperations.Associate L3VPNs To Networks ${VPN_INSTANCE_IDS} ${networks} ${fib_values} = BuiltIn.Create List @{NET_1_VM_IPS} @{NET_2_VM_IPS} @{SUBNET_CIDRS}[0] @{SUBNET_CIDRS}[1] @@ -127,11 +131,13 @@ Verification Of Route Download With Three Vpns In SE And Qbgp With One-Many Expo Verification Of Route Download With Three Vpns In SE And Qbgp With Many-One Export Import Route Target [Documentation] Check the datapath traffic with many-one export import route target with three vpns. VpnOperations.VPN Create L3VPN vpnid=@{VPN_INSTANCE_IDS}[0] name=@{VPN_NAMES}[0] rd=@{RDS}[0] exportrt=@{RDS}[0] importrt=${CREATE_RT} - : FOR ${index} IN RANGE 1 ${NUM_OF_L3VPN} - \ VpnOperations.VPN Create L3VPN vpnid=@{VPN_INSTANCE_IDS}[${index}] name=@{VPN_NAMES}[${index}] rd=@{RDS}[${index}] exportrt=${RT_LIST_${index}} importrt=@{RDS}[${index}] - : FOR ${index} IN RANGE 0 ${NUM_OF_L3VPN} - \ BgpOperations.Configure BGP And Add Neighbor On DCGW ${DCGW_SYSTEM_IP} ${AS_ID} ${DCGW_SYSTEM_IP} ${ODL_SYSTEM_IP} @{VPN_NAMES}[${index}] - \ ... @{DCGW_RD}[${index}] @{LOOPBACK_IPS}[${index}] + FOR ${index} IN RANGE 1 ${NUM_OF_L3VPN} + VpnOperations.VPN Create L3VPN vpnid=@{VPN_INSTANCE_IDS}[${index}] name=@{VPN_NAMES}[${index}] rd=@{RDS}[${index}] exportrt=${RT_LIST_${index}} importrt=@{RDS}[${index}] + END + FOR ${index} IN RANGE 0 ${NUM_OF_L3VPN} + BgpOperations.Configure BGP And Add Neighbor On DCGW ${DCGW_SYSTEM_IP} ${AS_ID} ${DCGW_SYSTEM_IP} ${ODL_SYSTEM_IP} @{VPN_NAMES}[${index}] + ... @{DCGW_RD}[${index}] @{LOOPBACK_IPS}[${index}] + END ${networks} = BuiltIn.Create List @{NETWORKS}[0] @{NETWORKS}[1] VpnOperations.Associate L3VPNs To Networks ${VPN_INSTANCE_IDS} ${networks} ${fib_values} = BuiltIn.Create List @{NET_1_VM_IPS} @{NET_2_VM_IPS} @{SUBNET_CIDRS}[0] @{SUBNET_CIDRS}[1] @@ -142,11 +148,13 @@ Verification Of Route Download With Three Vpns In SE And Qbgp With Many-One Expo Verification Of Route Download With Three Vpns In SE And Qbgp With Many-Many Export Import Route Target [Documentation] Check the datapath traffic with many-many export import route target with three vpns. - : FOR ${index} IN RANGE 0 ${NUM_OF_L3VPN} - \ VpnOperations.VPN Create L3VPN vpnid=@{VPN_INSTANCE_IDS}[${index}] name=@{VPN_NAMES}[${index}] rd=@{RDS}[${index}] exportrt=${CREATE_RT} importrt=${CREATE_RT} - : FOR ${index} IN RANGE 0 ${NUM_OF_L3VPN} - \ BgpOperations.Configure BGP And Add Neighbor On DCGW ${DCGW_SYSTEM_IP} ${AS_ID} ${DCGW_SYSTEM_IP} ${ODL_SYSTEM_IP} @{VPN_NAMES}[${index}] - \ ... @{DCGW_RD}[${index}] @{LOOPBACK_IPS}[${index}] + FOR ${index} IN RANGE 0 ${NUM_OF_L3VPN} + VpnOperations.VPN Create L3VPN vpnid=@{VPN_INSTANCE_IDS}[${index}] name=@{VPN_NAMES}[${index}] rd=@{RDS}[${index}] exportrt=${CREATE_RT} importrt=${CREATE_RT} + END + FOR ${index} IN RANGE 0 ${NUM_OF_L3VPN} + BgpOperations.Configure BGP And Add Neighbor On DCGW ${DCGW_SYSTEM_IP} ${AS_ID} ${DCGW_SYSTEM_IP} ${ODL_SYSTEM_IP} @{VPN_NAMES}[${index}] + ... @{DCGW_RD}[${index}] @{LOOPBACK_IPS}[${index}] + END ${networks} = BuiltIn.Create List @{NETWORKS}[0] @{NETWORKS}[1] VpnOperations.Associate L3VPNs To Networks ${VPN_INSTANCE_IDS} ${networks} ${fib_values} = BuiltIn.Create List @{NET_1_VM_IPS} @{NET_2_VM_IPS} @{SUBNET_CIDRS}[0] @{SUBNET_CIDRS}[1] @@ -174,32 +182,37 @@ Create Setup Create Nova VMs VpnOperations.VPN Create L3VPN vpnid=@{VPN_INSTANCE_IDS}[0] name=@{VPN_NAMES}[0] rd=@{RDS}[0] exportrt=@{RDS}[0] importrt=@{RDS}[0] VpnOperations.Verify L3VPN On ODL @{VPN_INSTANCE_IDS}[0] - : FOR ${network} IN @{NETWORKS} - \ ${network_id} = OpenStackOperations.Get Net Id ${network} - \ VpnOperations.Associate L3VPN To Network networkid=${network_id} vpnid=@{VPN_INSTANCE_IDS}[0] + FOR ${network} IN @{NETWORKS} + ${network_id} = OpenStackOperations.Get Net Id ${network} + VpnOperations.Associate L3VPN To Network networkid=${network_id} vpnid=@{VPN_INSTANCE_IDS}[0] + END Create BGP Config On ODL Create BGP Config On DCGW Create External Tunnel Endpoint Create Neutron Networks [Documentation] Create required number of networks - : FOR ${NET} IN @{NETWORKS} - \ OpenStackOperations.Create Network ${NET} + FOR ${NET} IN @{NETWORKS} + OpenStackOperations.Create Network ${NET} + END BuiltIn.Wait Until Keyword Succeeds 3s 1s Utils.Check For Elements At URI ${NETWORK_URL} ${NETWORKS} Create Neutron Subnets [Documentation] Create required number of subnets for previously created networks ${num_of_networks} = BuiltIn.Get Length ${NETWORKS} - : FOR ${index} IN RANGE 0 ${num_of_networks} - \ OpenStackOperations.Create SubNet @{NETWORKS}[${index}] @{SUBNETS}[${index}] @{SUBNET_CIDRS}[${index}] + FOR ${index} IN RANGE 0 ${num_of_networks} + OpenStackOperations.Create SubNet @{NETWORKS}[${index}] @{SUBNETS}[${index}] @{SUBNET_CIDRS}[${index}] + END BuiltIn.Wait Until Keyword Succeeds 3s 1s Utils.Check For Elements At URI ${SUBNETWORK_URL} ${SUBNETS} Create Neutron Ports [Documentation] Create required number of ports under previously created subnets - : FOR ${index} IN RANGE 0 ${NUM_OF_PORTS_PER_HOST} - \ OpenStackOperations.Create Port @{NETWORKS}[${index}] @{PORTS_HOST1}[${index}] sg=@{SECURITY_GROUP}[0] - : FOR ${index} IN RANGE 0 ${NUM_OF_PORTS_PER_HOST} - \ OpenStackOperations.Create Port @{NETWORKS}[${index}] @{PORTS_HOST2}[${index}] sg=@{SECURITY_GROUP}[0] + FOR ${index} IN RANGE 0 ${NUM_OF_PORTS_PER_HOST} + OpenStackOperations.Create Port @{NETWORKS}[${index}] @{PORTS_HOST1}[${index}] sg=@{SECURITY_GROUP}[0] + END + FOR ${index} IN RANGE 0 ${NUM_OF_PORTS_PER_HOST} + OpenStackOperations.Create Port @{NETWORKS}[${index}] @{PORTS_HOST2}[${index}] sg=@{SECURITY_GROUP}[0] + END OpenStackOperations.Create Port @{NETWORKS}[0] @{PORTS_HOST1}[3] @{SECURITY_GROUP}[1] OpenStackOperations.Create Port @{NETWORKS}[1] @{PORTS_HOST1}[4] @{SECURITY_GROUP}[1] OpenStackOperations.Create Port @{NETWORKS}[1] @{PORTS_HOST2}[3] @{SECURITY_GROUP}[1] @@ -208,10 +221,12 @@ Create Neutron Ports Create Nova VMs [Documentation] Create Vm instances on compute nodes - : FOR ${index} IN RANGE 0 ${NUM_OF_VMS_PER_HOST} - \ OpenStackOperations.Create Vm Instance With Port On Compute Node @{PORTS_HOST1}[${index}] @{VMS_HOST1}[${index}] ${OS_CMP1_HOSTNAME} sg=@{SECURITY_GROUP}[0] - : FOR ${index} IN RANGE 0 ${NUM_OF_VMS_PER_HOST} - \ OpenStackOperations.Create Vm Instance With Port On Compute Node @{PORTS_HOST2}[${index}] @{VMS_HOST2}[${index}] ${OS_CMP2_HOSTNAME} sg=@{SECURITY_GROUP}[0] + FOR ${index} IN RANGE 0 ${NUM_OF_VMS_PER_HOST} + OpenStackOperations.Create Vm Instance With Port On Compute Node @{PORTS_HOST1}[${index}] @{VMS_HOST1}[${index}] ${OS_CMP1_HOSTNAME} sg=@{SECURITY_GROUP}[0] + END + FOR ${index} IN RANGE 0 ${NUM_OF_VMS_PER_HOST} + OpenStackOperations.Create Vm Instance With Port On Compute Node @{PORTS_HOST2}[${index}] @{VMS_HOST2}[${index}] ${OS_CMP2_HOSTNAME} sg=@{SECURITY_GROUP}[0] + END OpenStackOperations.Create Vm Instance With Port On Compute Node @{PORTS_HOST1}[3] @{VMS_HOST1}[3] ${OS_CMP1_HOSTNAME} sg=@{SECURITY_GROUP}[1] OpenStackOperations.Create Vm Instance With Port On Compute Node @{PORTS_HOST1}[4] @{VMS_HOST1}[4] ${OS_CMP1_HOSTNAME} sg=@{SECURITY_GROUP}[1] OpenStackOperations.Create Vm Instance With Port On Compute Node @{PORTS_HOST2}[3] @{VMS_HOST2}[3] ${OS_CMP2_HOSTNAME} sg=@{SECURITY_GROUP}[1] @@ -253,10 +268,11 @@ Create BGP Config On DCGW Create Multiple L3VPN [Arguments] ${network} ${num_of_l3vpns} [Documentation] Creates multiple L3VPNs and then verify the same - : FOR ${index} IN RANGE 0 ${num_of_l3vpns} - \ BuiltIn.Wait Until Keyword Succeeds 40s 10s VpnOperations.VPN Create L3VPN vpnid=@{VPN_INSTANCE_IDS}[${index}] name=@{VPN_NAMES}[${index}] - \ ... rd=@{RDS}[${index}] exportrt=@{RDS}[${index}] importrt=@{RDS}[${index}] - \ VpnOperations.Verify L3VPN On ODL @{VPN_INSTANCE_IDS}[${index}] + FOR ${index} IN RANGE 0 ${num_of_l3vpns} + BuiltIn.Wait Until Keyword Succeeds 40s 10s VpnOperations.VPN Create L3VPN vpnid=@{VPN_INSTANCE_IDS}[${index}] name=@{VPN_NAMES}[${index}] + ... rd=@{RDS}[${index}] exportrt=@{RDS}[${index}] importrt=@{RDS}[${index}] + VpnOperations.Verify L3VPN On ODL @{VPN_INSTANCE_IDS}[${index}] + END Security Group Rule with Remote SG [Arguments] ${sec_grp} diff --git a/csit/suites/netvirt/ofpunt_path/openflow_punt_path_protection.robot b/csit/suites/netvirt/ofpunt_path/openflow_punt_path_protection.robot index 8f9ca29143..6c56ca61b3 100644 --- a/csit/suites/netvirt/ofpunt_path/openflow_punt_path_protection.robot +++ b/csit/suites/netvirt/ofpunt_path/openflow_punt_path_protection.robot @@ -51,48 +51,53 @@ ${GARP_REG} 0x101 Verify default punt timeout values and flows [Documentation] Verify default time out for subnet route, SNAT and ARP in respective defualt openflow tables ${snat_napt_switch_ip} = Get NAPT Switch IP From DPID @{ROUTERS}[1] - : FOR ${index} IN RANGE 0 3 - \ BuiltIn.Wait Until Keyword Succeeds 120s 20s OVSDB.Verify Dump Flows For Specific Table ${snat_napt_switch_ip} @{OF_PUNT_TABLES}[${index}] - \ ... True ${EMPTY} learn(table=@{OF_PUNT_TABLES}[${index}],hard_timeout=@{ORIGINAL_TIMEOUTS}[${index}] + FOR ${index} IN RANGE 0 3 + BuiltIn.Wait Until Keyword Succeeds 120s 20s OVSDB.Verify Dump Flows For Specific Table ${snat_napt_switch_ip} @{OF_PUNT_TABLES}[${index}] + ... True ${EMPTY} learn(table=@{OF_PUNT_TABLES}[${index}],hard_timeout=@{ORIGINAL_TIMEOUTS}[${index}] + END Set punt timeout to zero and verify flows [Documentation] Verify default flows in OVS for subnet route, SNAT and ARP after the changing the default punt timeout value to zero. ... Default subnet route, SNAT and ARP should get deleted after changing default timeout value to zero - : FOR ${index} IN RANGE 0 3 - \ Change Hard Timeout Value In XML File @{FILES_PATH}[${index}] @{ORIGINAL_TIMEOUTS}[${index}] ${0} - \ Verify Punt Values In XML File @{FILES_PATH}[${index}] ${0} + FOR ${index} IN RANGE 0 3 + Change Hard Timeout Value In XML File @{FILES_PATH}[${index}] @{ORIGINAL_TIMEOUTS}[${index}] ${0} + Verify Punt Values In XML File @{FILES_PATH}[${index}] ${0} + END ClusterManagement.Stop_Members_From_List_Or_All ClusterManagement.Start_Members_From_List_Or_All ${snat_napt_switch_ip} = Get NAPT Switch IP From DPID @{ROUTERS}[1] BuiltIn.Wait Until Keyword Succeeds 120s 20s OVSDB.Check OVS OpenFlow Connections ${OS_CMP1_IP} 2 - : FOR ${index} IN RANGE 0 3 - \ OVSDB.Verify Dump Flows For Specific Table ${snat_napt_switch_ip} @{OF_PUNT_TABLES}[${index}] False ${EMPTY} learn(table=@{OF_PUNT_TABLES}[${index}],hard_timeout=@{ORIGINAL_TIMEOUTS}[${index}] + FOR ${index} IN RANGE 0 3 + OVSDB.Verify Dump Flows For Specific Table ${snat_napt_switch_ip} @{OF_PUNT_TABLES}[${index}] False ${EMPTY} learn(table=@{OF_PUNT_TABLES}[${index}],hard_timeout=@{ORIGINAL_TIMEOUTS}[${index}] + END Set punt timeout to combination of valid ranges and verfiy flows [Documentation] Verify the default flow in OVS for subnet route, SNAT and ARP after the changing the default value to different set of values. ... Default subnet route, SNAT and ARP flows should get changed after changing default timeout value to different set of values Set Original TimeOut In Xml ${0} - : FOR ${index} IN RANGE 0 3 - \ Change Hard Timeout Value In XML File @{FILES_PATH}[${index}] @{ORIGINAL_TIMEOUTS}[${index}] @{VALID_TIMEOUTS}[0] - \ Verify Punt Values In XML File @{FILES_PATH}[${index}] @{VALID_TIMEOUTS}[0] + FOR ${index} IN RANGE 0 3 + Change Hard Timeout Value In XML File @{FILES_PATH}[${index}] @{ORIGINAL_TIMEOUTS}[${index}] @{VALID_TIMEOUTS}[0] + Verify Punt Values In XML File @{FILES_PATH}[${index}] @{VALID_TIMEOUTS}[0] + END ${count} = BuiltIn.Get length ${VALID_TIMEOUTS} - : FOR ${index} IN RANGE 1 ${count} - \ Change Hard Timeout Value In XML File @{FILES_PATH}[0] @{VALID_TIMEOUTS}[${index - 1}] @{VALID_TIMEOUTS}[${index}] - \ Verify Punt Values In XML File @{FILES_PATH}[0] @{VALID_TIMEOUTS}[${index}] - \ Change Hard Timeout Value In XML File @{FILES_PATH}[1] @{VALID_TIMEOUTS}[${index - 1}] @{VALID_TIMEOUTS}[${index}] - \ Verify Punt Values In XML File @{FILES_PATH}[1] @{VALID_TIMEOUTS}[${index}] - \ Change Hard Timeout Value In XML File @{FILES_PATH}[2] @{VALID_TIMEOUTS}[${index - 1}] @{VALID_TIMEOUTS}[${index}] - \ Verify Punt Values In XML File @{FILES_PATH}[2] @{VALID_TIMEOUTS}[${index}] - \ ClusterManagement.Stop_Members_From_List_Or_All - \ ClusterManagement.Start_Members_From_List_Or_All - \ BuiltIn.Wait Until Keyword Succeeds 120s 20s OVSDB.Check OVS OpenFlow Connections ${OS_CMP1_IP} 2 - \ ${snat_napt_switch_ip} = Get NAPT Switch IP From DPID @{ROUTERS}[1] - \ BuiltIn.Wait Until Keyword Succeeds 120s 5s OVSDB.Verify Dump Flows For Specific Table ${OS_COMPUTE_1_IP} ${L3_PUNT_TABLE} - \ ... True ${EMPTY} learn(table=${L3_PUNT_TABLE},hard_timeout=@{VALID_TIMEOUTS}[${index}] - \ BuiltIn.Wait Until Keyword Succeeds 120s 5s OVSDB.Verify Dump Flows For Specific Table ${OS_COMPUTE_1_IP} ${ARP_PUNT_TABLE} - \ ... True ${EMPTY} learn(table=${ARP_PUNT_TABLE},hard_timeout=@{VALID_TIMEOUTS}[${index}] - \ BuiltIn.Wait Until Keyword Succeeds 180s 5s OVSDB.Verify Dump Flows For Specific Table ${snat_napt_switch_ip} ${SNAT_PUNT_TABLE} - \ ... True ${EMPTY} learn(table=${SNAT_PUNT_TABLE},hard_timeout=@{VALID_TIMEOUTS}[${index}] + FOR ${index} IN RANGE 1 ${count} + Change Hard Timeout Value In XML File @{FILES_PATH}[0] @{VALID_TIMEOUTS}[${index - 1}] @{VALID_TIMEOUTS}[${index}] + Verify Punt Values In XML File @{FILES_PATH}[0] @{VALID_TIMEOUTS}[${index}] + Change Hard Timeout Value In XML File @{FILES_PATH}[1] @{VALID_TIMEOUTS}[${index - 1}] @{VALID_TIMEOUTS}[${index}] + Verify Punt Values In XML File @{FILES_PATH}[1] @{VALID_TIMEOUTS}[${index}] + Change Hard Timeout Value In XML File @{FILES_PATH}[2] @{VALID_TIMEOUTS}[${index - 1}] @{VALID_TIMEOUTS}[${index}] + Verify Punt Values In XML File @{FILES_PATH}[2] @{VALID_TIMEOUTS}[${index}] + ClusterManagement.Stop_Members_From_List_Or_All + ClusterManagement.Start_Members_From_List_Or_All + BuiltIn.Wait Until Keyword Succeeds 120s 20s OVSDB.Check OVS OpenFlow Connections ${OS_CMP1_IP} 2 + ${snat_napt_switch_ip} = Get NAPT Switch IP From DPID @{ROUTERS}[1] + BuiltIn.Wait Until Keyword Succeeds 120s 5s OVSDB.Verify Dump Flows For Specific Table ${OS_COMPUTE_1_IP} ${L3_PUNT_TABLE} + ... True ${EMPTY} learn(table=${L3_PUNT_TABLE},hard_timeout=@{VALID_TIMEOUTS}[${index}] + BuiltIn.Wait Until Keyword Succeeds 120s 5s OVSDB.Verify Dump Flows For Specific Table ${OS_COMPUTE_1_IP} ${ARP_PUNT_TABLE} + ... True ${EMPTY} learn(table=${ARP_PUNT_TABLE},hard_timeout=@{VALID_TIMEOUTS}[${index}] + BuiltIn.Wait Until Keyword Succeeds 180s 5s OVSDB.Verify Dump Flows For Specific Table ${snat_napt_switch_ip} ${SNAT_PUNT_TABLE} + ... True ${EMPTY} learn(table=${SNAT_PUNT_TABLE},hard_timeout=@{VALID_TIMEOUTS}[${index}] + END Set Original TimeOut In Xml @{VALID_TIMEOUTS}[4] Verify learnt flow for subnet route flow table @@ -100,9 +105,10 @@ Verify learnt flow for subnet route flow table ... Send subnet route traffic using Ping with packet count 5. ... Punt the first packet to controller and add new rule to stop pipeline processing. ... Check packet count before and after traffic for both(defualt and learnt tables). - : FOR ${index} IN RANGE 0 3 - \ Change Hard Timeout Value In XML File @{FILES_PATH}[${index}] @{ORIGINAL_TIMEOUTS}[${index}] @{VALID_TIMEOUTS}[0] - \ Verify Punt Values In XML File @{FILES_PATH}[${index}] @{VALID_TIMEOUTS}[0] + FOR ${index} IN RANGE 0 3 + Change Hard Timeout Value In XML File @{FILES_PATH}[${index}] @{ORIGINAL_TIMEOUTS}[${index}] @{VALID_TIMEOUTS}[0] + Verify Punt Values In XML File @{FILES_PATH}[${index}] @{VALID_TIMEOUTS}[0] + END ClusterManagement.Stop_Members_From_List_Or_All ClusterManagement.Start_Members_From_List_Or_All BuiltIn.Wait Until Keyword Succeeds 120s 20s OVSDB.Check OVS OpenFlow Connections ${OS_CMP1_IP} 2 @@ -256,40 +262,47 @@ Verify resync subnet route, SNAT and ARP route flow tables after disconnect and Suite Setup [Documentation] Create common setup related to openflow punt path protection VpnOperations.Basic Suite Setup - : FOR ${network} IN @{NETWORKS} - \ OpenStackOperations.Create Network ${network} + FOR ${network} IN @{NETWORKS} + OpenStackOperations.Create Network ${network} + END OpenStackOperations.Create Network ${EXT_NETWORKS} additional_args=--external --provider-network-type gre ${elements} = BuiltIn.Create List ${EXT_NETWORKS} ${count} = BuiltIn.Get length ${SUBNETS} - : FOR ${index} IN RANGE 0 ${count} - \ OpenStackOperations.Create SubNet @{NETWORKS}[${index}] @{SUBNETS}[${index}] @{SUBNETS_CIDR}[${index}] + FOR ${index} IN RANGE 0 ${count} + OpenStackOperations.Create SubNet @{NETWORKS}[${index}] @{SUBNETS}[${index}] @{SUBNETS_CIDR}[${index}] + END OpenStackOperations.Create SubNet ${EXT_NETWORKS} ${EXT_SUBNETS} ${EXT_SUBNETS_CIDR} additional_args=--no-dhcp - : FOR ${router} IN @{ROUTERS} - \ OpenStackOperations.Create Router ${router} - \ ${router_id} = OpenStackOperations.Get Router Id ${router} - \ Collections.Append To List ${ROUTERS_ID} ${router_id} + FOR ${router} IN @{ROUTERS} + OpenStackOperations.Create Router ${router} + ${router_id} = OpenStackOperations.Get Router Id ${router} + Collections.Append To List ${ROUTERS_ID} ${router_id} + END BuiltIn.Set Suite Variable @{ROUTERS_ID} - : FOR ${index} IN RANGE 0 2 - \ OpenStackOperations.Add Router Interface @{ROUTERS}[0] @{SUBNETS}[${index}] + FOR ${index} IN RANGE 0 2 + OpenStackOperations.Add Router Interface @{ROUTERS}[0] @{SUBNETS}[${index}] + END OpenStackOperations.Add Router Interface @{ROUTERS}[1] @{SUBNETS}[2] OpenStackOperations.Create And Configure Security Group ${SECURITY_GROUP} ${ext_net} = BuiltIn.Create List ${EXT_NETWORKS} ${NETWORKS_ALL} = Collections.Combine Lists ${NETWORKS} ${ext_net} - : FOR ${index} IN RANGE 0 3 - \ OpenStackOperations.Create Port @{NETWORKS_ALL}[${index}] @{PORT_LIST}[${index + ${index}}] sg=${SECURITY_GROUP} - \ OpenStackOperations.Create Port @{NETWORKS_ALL}[${index}] @{PORT_LIST}[${index + ${index + 1}}] sg=${SECURITY_GROUP} + FOR ${index} IN RANGE 0 3 + OpenStackOperations.Create Port @{NETWORKS_ALL}[${index}] @{PORT_LIST}[${index + ${index}}] sg=${SECURITY_GROUP} + OpenStackOperations.Create Port @{NETWORKS_ALL}[${index}] @{PORT_LIST}[${index + ${index + 1}}] sg=${SECURITY_GROUP} + END OpenStackOperations.Create Port @{NETWORKS}[0] @{EXTRA_PORTS}[0] sg=${SECURITY_GROUP} additional_args=--allowed-address ip-address=0.0.0.0 --fixed-ip subnet=@{SUBNETS}[0],ip-address=@{EXTRA_NW_IP}[0] OpenStackOperations.Create Port @{NETWORKS}[1] @{EXTRA_PORTS}[1] sg=${SECURITY_GROUP} additional_args=--allowed-address ip-address=0.0.0.0 --fixed-ip subnet=@{SUBNETS}[1],ip-address=@{EXTRA_NW_IP}[1] - : FOR ${index} IN RANGE 0 3 - \ OpenStackOperations.Create Vm Instance With Port On Compute Node @{PORT_LIST}[${index + ${index}}] @{VM_LIST}[${index + ${index}}] ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP} - \ OpenStackOperations.Create Vm Instance With Port On Compute Node @{PORT_LIST}[${index + ${index + 1}}] @{VM_LIST}[${index + ${index + 1}}] ${OS_CMP2_HOSTNAME} sg=${SECURITY_GROUP} + FOR ${index} IN RANGE 0 3 + OpenStackOperations.Create Vm Instance With Port On Compute Node @{PORT_LIST}[${index + ${index}}] @{VM_LIST}[${index + ${index}}] ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP} + OpenStackOperations.Create Vm Instance With Port On Compute Node @{PORT_LIST}[${index + ${index + 1}}] @{VM_LIST}[${index + ${index + 1}}] ${OS_CMP2_HOSTNAME} sg=${SECURITY_GROUP} + END @{VM_IPS} ${dhcp_ip} = OpenStackOperations.Get VM IPs @{VM_LIST} BuiltIn.Set Suite Variable ${VM_IPS} OpenStackOperations.Show Debugs @{VM_LIST} BuiltIn.Should Not Contain ${VM_IPS} None BuiltIn.Should Not Contain ${dhcp_ip} None - : FOR ${index} IN RANGE 0 2 - \ VpnOperations.VPN Create L3VPN name=@{VPN_NAME}[${index}] vpnid=@{VPN_ID}[${index}] rd=@{L3VPN_RD_IRT_ERT}[${index}] exportrt=@{L3VPN_RD_IRT_ERT}[${index}] importrt=@{L3VPN_RD_IRT_ERT}[${index}] + FOR ${index} IN RANGE 0 2 + VpnOperations.VPN Create L3VPN name=@{VPN_NAME}[${index}] vpnid=@{VPN_ID}[${index}] rd=@{L3VPN_RD_IRT_ERT}[${index}] exportrt=@{L3VPN_RD_IRT_ERT}[${index}] importrt=@{L3VPN_RD_IRT_ERT}[${index}] + END VpnOperations.Associate VPN to Router routerid=@{ROUTERS_ID}[0] vpnid=@{VPN_ID}[0] ${network_id} = OpenStackOperations.Get Net Id ${EXT_NETWORKS} VpnOperations.Associate L3VPN To Network networkid=${network_id} vpnid=@{VPN_ID}[1] @@ -300,9 +313,10 @@ Suite Setup Set Original TimeOut In Xml [Arguments] ${hard_timeout} [Documentation] Set default timeout in XML for all the punt files - : FOR ${index} IN RANGE 0 3 - \ Change Hard Timeout Value In XML File @{FILES_PATH}[${index}] ${hard_timeout} @{ORIGINAL_TIMEOUTS}[${index}] - \ Verify Punt Values In XML File @{FILES_PATH}[${index}] @{ORIGINAL_TIMEOUTS}[${index}] + FOR ${index} IN RANGE 0 3 + Change Hard Timeout Value In XML File @{FILES_PATH}[${index}] ${hard_timeout} @{ORIGINAL_TIMEOUTS}[${index}] + Verify Punt Values In XML File @{FILES_PATH}[${index}] @{ORIGINAL_TIMEOUTS}[${index}] + END ClusterManagement.Stop_Members_From_List_Or_All ClusterManagement.Start_Members_From_List_Or_All BuiltIn.Wait Until Keyword Succeeds 120s 20s OVSDB.Check OVS OpenFlow Connections ${OS_CMP1_IP} 2 @@ -321,15 +335,18 @@ Change Hard Timeout Value In XML File Create Dictionary For DPN ID And Compute IP Mapping For All DPNS [Documentation] Creating dictionary for DPN ID and compute IP mapping - : FOR ${ip} IN @{OS_ALL_IPS} - \ ${dpnid} OVSDB.Get DPID ${ip} - \ Collections.Append To List ${DPN_IDS} ${dpnid} + FOR ${ip} IN @{OS_ALL_IPS} + ${dpnid} OVSDB.Get DPID ${ip} + Collections.Append To List ${DPN_IDS} ${dpnid} + END ${DPN_TO_COMPUTE_IP} = BuiltIn.Create Dictionary ${count} = BuiltIn.Get length ${OS_ALL_IPS} - : FOR ${index} IN RANGE 0 ${count} - \ Collections.Set To Dictionary ${DPN_TO_COMPUTE_IP} @{DPN_IDS}[${index}] @{OS_ALL_IPS}[${index}] - : FOR ${dp_id} IN @{DPN_IDS} - \ Collections.Dictionary Should Contain Key ${DPN_TO_COMPUTE_IP} ${dp_id} + FOR ${index} IN RANGE 0 ${count} + Collections.Set To Dictionary ${DPN_TO_COMPUTE_IP} @{DPN_IDS}[${index}] @{OS_ALL_IPS}[${index}] + END + FOR ${dp_id} IN @{DPN_IDS} + Collections.Dictionary Should Contain Key ${DPN_TO_COMPUTE_IP} ${dp_id} + END BuiltIn.Set Suite Variable ${DPN_TO_COMPUTE_IP} Get SNAT NAPT Switch DPID diff --git a/csit/suites/netvirt/snatdnat/snat_dnat.robot b/csit/suites/netvirt/snatdnat/snat_dnat.robot index 1df6cb23c2..c13ec7bb1b 100644 --- a/csit/suites/netvirt/snatdnat/snat_dnat.robot +++ b/csit/suites/netvirt/snatdnat/snat_dnat.robot @@ -139,16 +139,18 @@ Create Setup Create Neutron Networks [Documentation] Create required number of networks - : FOR ${NET} IN @{NETWORKS} - \ OpenStackOperations.Create Network ${NET} + FOR ${NET} IN @{NETWORKS} + OpenStackOperations.Create Network ${NET} + END OpenStackOperations.Create Network @{EXTERNAL_NETWORKS}[0] --external --provider-network-type ${NETWORK_TYPE} BuiltIn.Wait Until Keyword Succeeds 3s 1s Utils.Check For Elements At URI ${NETWORK_URL} ${NETWORKS} Create Neutron Subnets [Documentation] Create required number of subnets for previously created networks ${num_of_networks} = BuiltIn.Get Length ${NETWORKS} - : FOR ${index} IN RANGE 0 ${num_of_networks} - \ OpenStackOperations.Create SubNet @{NETWORKS}[${index}] @{SUBNETS}[${index}] @{SUBNET_CIDRS}[${index}] + FOR ${index} IN RANGE 0 ${num_of_networks} + OpenStackOperations.Create SubNet @{NETWORKS}[${index}] @{SUBNETS}[${index}] @{SUBNET_CIDRS}[${index}] + END BuiltIn.Wait Until Keyword Succeeds 3s 1s Utils.Check For Elements At URI ${SUBNETWORK_URL} ${SUBNETS} Create Neutron Ports diff --git a/csit/suites/netvirt/subnet_routing/subnet_routing_and_multicast.robot b/csit/suites/netvirt/subnet_routing/subnet_routing_and_multicast.robot index eded6a40ab..7d3befff83 100644 --- a/csit/suites/netvirt/subnet_routing/subnet_routing_and_multicast.robot +++ b/csit/suites/netvirt/subnet_routing/subnet_routing_and_multicast.robot @@ -115,14 +115,16 @@ Verify The Subnet Route For Multiple Subnets On Multi Vswitch Topology Verify The Subnet Route When The Network Is Removed From The Vpn [Documentation] Dissociate vpn from the network and verify the subnet route - : FOR ${network} IN @{NETWORKS} - \ ${network_id} = OpenStackOperations.Get Net Id ${network} - \ VpnOperations.Dissociate L3VPN From Networks networkid=${network_id} vpnid=${VPN_INSTANCE_ID} + FOR ${network} IN @{NETWORKS} + ${network_id} = OpenStackOperations.Get Net Id ${network} + VpnOperations.Dissociate L3VPN From Networks networkid=${network_id} vpnid=${VPN_INSTANCE_ID} + END ${vm_ip_list} = BuiltIn.Create List @{NET_1_VM_IPS} @{NET_2_VM_IPS} @{NET_3_VM_IPS} Utils.Check For Elements Not At URI ${FIB_ENTRY_URL} ${vm_ip_list} - : FOR ${network} IN @{NETWORKS} - \ ${network_id} = OpenStackOperations.Get Net Id ${network} - \ VpnOperations.Associate L3VPN To Network networkid=${network_id} vpnid=${VPN_INSTANCE_ID} + FOR ${network} IN @{NETWORKS} + ${network_id} = OpenStackOperations.Get Net Id ${network} + VpnOperations.Associate L3VPN To Network networkid=${network_id} vpnid=${VPN_INSTANCE_ID} + END Utils.Check For Elements At URI ${FIB_ENTRY_URL} ${vm_ip_list} Verify Ping between Inter Intra And Enterprise host @@ -154,9 +156,10 @@ Create Setup Create Nova VMs Create Sub Interfaces And Verify Create L3VPN - : FOR ${network} IN @{NETWORKS} - \ ${network_id} = OpenStackOperations.Get Net Id ${network} - \ VpnOperations.Associate L3VPN To Network networkid=${network_id} vpnid=${VPN_INSTANCE_ID} + FOR ${network} IN @{NETWORKS} + ${network_id} = OpenStackOperations.Get Net Id ${network} + VpnOperations.Associate L3VPN To Network networkid=${network_id} vpnid=${VPN_INSTANCE_ID} + END Create BGP Config On ODL Create BGP Config On DCGW BuiltIn.Wait Until Keyword Succeeds 60s 10s VpnOperations.Verify Tunnel Status as UP @@ -169,15 +172,17 @@ Create Setup Create Neutron Networks [Documentation] Create required number of networks - : FOR ${net} IN @{NETWORKS} - \ OpenStackOperations.Create Network ${net} + FOR ${net} IN @{NETWORKS} + OpenStackOperations.Create Network ${net} + END BuiltIn.Wait Until Keyword Succeeds 3s 1s Utils.Check For Elements At URI ${NETWORK_URL} ${NETWORKS} Create Neutron Subnets [Arguments] ${num_of_network} ${additional_args}=${EMPTY} ${verbose}=TRUE [Documentation] Create required number of subnets for previously created networks - : FOR ${index} IN RANGE 0 ${num_of_network} - \ OpenStackOperations.Create SubNet @{NETWORKS}[${index}] @{SUBNETS}[${index}] @{SUBNET_CIDR}[${index}] + FOR ${index} IN RANGE 0 ${num_of_network} + OpenStackOperations.Create SubNet @{NETWORKS}[${index}] @{SUBNETS}[${index}] @{SUBNET_CIDR}[${index}] + END BuiltIn.Wait Until Keyword Succeeds 3s 1s Utils.Check For Elements At URI ${SUBNETWORK_URL} ${SUBNETS} Create Neutron Ports @@ -185,22 +190,26 @@ Create Neutron Ports ${allowed_address_pairs_args1} = BuiltIn.Set Variable --allowed-address ip-address=@{EXTRA_NW_SUBNET}[0] --allowed-address ip-address=@{EXTRA_NW_SUBNET}[1] ${allowed_address_pairs_args2} = BuiltIn.Set Variable --allowed-address ip-address=@{EXTRA_NW_SUBNET}[1] --allowed-address ip-address=@{EXTRA_NW_SUBNET}[2] ${allowed_address_pairs_args3} = BuiltIn.Set Variable --allowed-address ip-address=@{EXTRA_NW_SUBNET}[2] --allowed-address ip-address=@{EXTRA_NW_SUBNET}[0] - : FOR ${index} IN RANGE 0 ${NUM_OF_PORTS_PER_NETWORK} - \ OpenStackOperations.Create Port @{NETWORKS}[0] @{NET_1_PORTS}[${index}] sg=${SECURITY_GROUP} additional_args=${allowed_address_pairs_args1} - : FOR ${index} IN RANGE 0 ${NUM_OF_PORTS_PER_NETWORK} - \ OpenStackOperations.Create Port @{NETWORKS}[1] @{NET_2_PORTS}[${index}] sg=${SECURITY_GROUP} additional_args=${allowed_address_pairs_args2} - : FOR ${index} IN RANGE 0 ${NUM_OF_PORTS_PER_NETWORK} - \ OpenStackOperations.Create Port @{NETWORKS}[2] @{NET_3_PORTS}[${index}] sg=${SECURITY_GROUP} additional_args=${allowed_address_pairs_args3} + FOR ${index} IN RANGE 0 ${NUM_OF_PORTS_PER_NETWORK} + OpenStackOperations.Create Port @{NETWORKS}[0] @{NET_1_PORTS}[${index}] sg=${SECURITY_GROUP} additional_args=${allowed_address_pairs_args1} + END + FOR ${index} IN RANGE 0 ${NUM_OF_PORTS_PER_NETWORK} + OpenStackOperations.Create Port @{NETWORKS}[1] @{NET_2_PORTS}[${index}] sg=${SECURITY_GROUP} additional_args=${allowed_address_pairs_args2} + END + FOR ${index} IN RANGE 0 ${NUM_OF_PORTS_PER_NETWORK} + OpenStackOperations.Create Port @{NETWORKS}[2] @{NET_3_PORTS}[${index}] sg=${SECURITY_GROUP} additional_args=${allowed_address_pairs_args3} + END Create Nova VMs [Documentation] Create Vm instances on compute nodes - : FOR ${index} IN RANGE 0 2 - \ OpenStackOperations.Create Vm Instance With Port On Compute Node @{NET_1_PORTS}[${index}] @{NET_1_VMS}[${index}] ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP} - \ OpenStackOperations.Create Vm Instance With Port On Compute Node @{NET_1_PORTS}[${index+2}] @{NET_1_VMS}[${index+2}] ${OS_CMP2_HOSTNAME} sg=${SECURITY_GROUP} - \ OpenStackOperations.Create Vm Instance With Port On Compute Node @{NET_2_PORTS}[${index}] @{NET_2_VMS}[${index}] ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP} - \ OpenStackOperations.Create Vm Instance With Port On Compute Node @{NET_2_PORTS}[${index+2}] @{NET_2_VMS}[${index+2}] ${OS_CMP2_HOSTNAME} sg=${SECURITY_GROUP} - \ OpenStackOperations.Create Vm Instance With Port On Compute Node @{NET_3_PORTS}[${index}] @{NET_3_VMS}[${index}] ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP} - \ OpenStackOperations.Create Vm Instance With Port On Compute Node @{NET_3_PORTS}[${index+2}] @{NET_3_VMS}[${index+2}] ${OS_CMP2_HOSTNAME} sg=${SECURITY_GROUP} + FOR ${index} IN RANGE 0 2 + OpenStackOperations.Create Vm Instance With Port On Compute Node @{NET_1_PORTS}[${index}] @{NET_1_VMS}[${index}] ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP} + OpenStackOperations.Create Vm Instance With Port On Compute Node @{NET_1_PORTS}[${index+2}] @{NET_1_VMS}[${index+2}] ${OS_CMP2_HOSTNAME} sg=${SECURITY_GROUP} + OpenStackOperations.Create Vm Instance With Port On Compute Node @{NET_2_PORTS}[${index}] @{NET_2_VMS}[${index}] ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP} + OpenStackOperations.Create Vm Instance With Port On Compute Node @{NET_2_PORTS}[${index+2}] @{NET_2_VMS}[${index+2}] ${OS_CMP2_HOSTNAME} sg=${SECURITY_GROUP} + OpenStackOperations.Create Vm Instance With Port On Compute Node @{NET_3_PORTS}[${index}] @{NET_3_VMS}[${index}] ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP} + OpenStackOperations.Create Vm Instance With Port On Compute Node @{NET_3_PORTS}[${index+2}] @{NET_3_VMS}[${index+2}] ${OS_CMP2_HOSTNAME} sg=${SECURITY_GROUP} + END @{NET_1_VM_IPS} ${NET1_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_1_VMS} @{NET_2_VM_IPS} ${NET2_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_2_VMS} @{NET_3_VM_IPS} ${NET3_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_3_VMS} diff --git a/csit/suites/netvirt/upgrade/upgrade.robot b/csit/suites/netvirt/upgrade/upgrade.robot index 5733edd0a4..6b307cf2a9 100644 --- a/csit/suites/netvirt/upgrade/upgrade.robot +++ b/csit/suites/netvirt/upgrade/upgrade.robot @@ -42,11 +42,12 @@ Stop ODL Disconnect OVS [Documentation] Delete OVS manager, controller and groups and tun ports - : FOR ${node} IN @{OS_ALL_IPS} - \ OVSDB.Delete OVS Manager ${node} - \ OVSDB.Delete OVS Controller ${node} - \ OVSDB.Delete Groups On Bridge ${node} ${INTEGRATION_BRIDGE} - \ OVSDB.Delete Ports On Bridge By Type ${node} ${INTEGRATION_BRIDGE} ${TYPE} + FOR ${node} IN @{OS_ALL_IPS} + OVSDB.Delete OVS Manager ${node} + OVSDB.Delete OVS Controller ${node} + OVSDB.Delete Groups On Bridge ${node} ${INTEGRATION_BRIDGE} + OVSDB.Delete Ports On Bridge By Type ${node} ${INTEGRATION_BRIDGE} ${TYPE} + END Wipe Local Data [Documentation] Delete data/, journal/, snapshots/ @@ -67,18 +68,20 @@ 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 - : FOR ${node} IN @{OS_ALL_IPS} - \ ${dpnid} = OVSDB.Get DPID ${node} - \ ${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} + FOR ${node} IN @{OS_ALL_IPS} + ${dpnid} = OVSDB.Get DPID ${node} + ${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} + 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 @@ -100,19 +103,23 @@ Suite Setup Create Resources [Documentation] Create 2 VXLAN networks, subnets with 2 VMs each and a router. Ping all 4 VMs. - : FOR ${net} IN @{NETWORKS} - \ OpenStackOperations.Create Network ${net} + FOR ${net} IN @{NETWORKS} + OpenStackOperations.Create Network ${net} + END OpenStackOperations.Create SubNet @{NETWORKS}[0] @{SUBNETS}[0] @{SUBNETS_RANGE}[0] OpenStackOperations.Create SubNet @{NETWORKS}[1] @{SUBNETS}[1] @{SUBNETS_RANGE}[1] OpenStackOperations.Create Allow All SecurityGroup ${SECURITY_GROUP} OpenStackOperations.Create Nano Flavor - : FOR ${vm} IN @{NET_1_VMS} - \ OpenStackOperations.Create Vm Instance On Compute Node @{NETWORKS}[0] ${vm} ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP} - : FOR ${vm} IN @{NET_2_VMS} - \ OpenStackOperations.Create Vm Instance On Compute Node @{NETWORKS}[1] ${vm} ${OS_CMP2_HOSTNAME} sg=${SECURITY_GROUP} + FOR ${vm} IN @{NET_1_VMS} + OpenStackOperations.Create Vm Instance On Compute Node @{NETWORKS}[0] ${vm} ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP} + END + FOR ${vm} IN @{NET_2_VMS} + OpenStackOperations.Create Vm Instance On Compute Node @{NETWORKS}[1] ${vm} ${OS_CMP2_HOSTNAME} sg=${SECURITY_GROUP} + END OpenStackOperations.Create Router ${ROUTER} - : FOR ${interface} IN @{SUBNETS} - \ OpenStackOperations.Add Router Interface ${ROUTER} ${interface} + FOR ${interface} IN @{SUBNETS} + OpenStackOperations.Add Router Interface ${ROUTER} ${interface} + END @{NET1_VM_IPS} ${NET1_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_1_VMS} @{NET2_VM_IPS} ${NET2_DHCP_IP} = OpenStackOperations.Get VM IPs @{NET_2_VMS} BuiltIn.Set Suite Variable @{NET1_VM_IPS} @@ -133,8 +140,9 @@ Check Resource Connectivity Check OVS Nodes Have Egress Flows [Documentation] Loop over all openstack nodes to ensure they have the proper flows installed. - : FOR ${node} IN @{OS_ALL_IPS} - \ Does OVS Have Multiple Egress Flows ${node} + FOR ${node} IN @{OS_ALL_IPS} + Does OVS Have Multiple Egress Flows ${node} + END Does OVS Have Multiple Egress Flows [Arguments] ${ip} @@ -153,12 +161,13 @@ 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 + 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 diff --git a/csit/suites/netvirt/vpnservice/arp_learning.robot b/csit/suites/netvirt/vpnservice/arp_learning.robot index 9dfa1ee239..4981533fae 100644 --- a/csit/suites/netvirt/vpnservice/arp_learning.robot +++ b/csit/suites/netvirt/vpnservice/arp_learning.robot @@ -139,18 +139,22 @@ Suite Setup ... Create a Neutron Router and associate subnet1 and subnet2. ... Create an L3VPN instance and associate the L3VPN instance to the neutron router. VpnOperations.Basic Suite Setup - : FOR ${network} IN @{NETWORKS} - \ OpenStackOperations.Create Network ${network} + FOR ${network} IN @{NETWORKS} + OpenStackOperations.Create Network ${network} + END ${neutron_networks} = OpenStackOperations.List Networks - : FOR ${network} IN @{NETWORKS} - \ BuiltIn.Should Contain ${neutron_networks} ${network} + FOR ${network} IN @{NETWORKS} + BuiltIn.Should Contain ${neutron_networks} ${network} + END ${NET_ID} = OpenStackOperations.Get Net Id @{NETWORKS}[0] BuiltIn.Set Suite Variable ${NET_ID} - : FOR ${i} IN RANGE 0 3 - \ OpenStackOperations.Create SubNet @{NETWORKS}[${i}] @{SUBNETS}[${i}] @{SUBNET_CIDRS}[${i}] + FOR ${i} IN RANGE 0 3 + OpenStackOperations.Create SubNet @{NETWORKS}[${i}] @{SUBNETS}[${i}] @{SUBNET_CIDRS}[${i}] + END ${neutron_subnets} = OpenStackOperations.List Subnets - : FOR ${subnet} IN @{SUBNETS} - \ BuiltIn.Should Contain ${neutron_subnets} ${subnet} + FOR ${subnet} IN @{SUBNETS} + BuiltIn.Should Contain ${neutron_subnets} ${subnet} + END OpenStackOperations.Create Allow All SecurityGroup ${SECURITY_GROUP} OpenStackOperations.Create Port @{NETWORKS}[0] @{PORTS}[0] sg=${SECURITY_GROUP} allowed_address_pairs=@{EXTRA_NW_IP} OpenStackOperations.Create Port @{NETWORKS}[0] @{PORTS}[1] sg=${SECURITY_GROUP} allowed_address_pairs=@{EXTRA_NW_IP} @@ -243,13 +247,15 @@ Verify Flows Are Present @{vm_ips} = BuiltIn.Create List @{NET_1_VM_IPS} @{NET_2_VM_IPS} @{NET_3_VM_IPS} ${resp} = Should Match regexp ${flow_output} table=0.*goto_table:36 ${resp} = Should Match regexp ${flow_output} table=0.*goto_table:17 - : FOR ${ip} IN @{vm_ips} - \ ${resp} = Should Match regexp ${flow_output} table=21.*nw_dst=${ip} + FOR ${ip} IN @{vm_ips} + ${resp} = Should Match regexp ${flow_output} table=21.*nw_dst=${ip} + END Verify Flows Are Present On All Compute Nodes [Documentation] Verify Flows Are Present On All Compute Nodes - : FOR ${ip} IN @{OS_CMP_IPS} - \ BuiltIn.Wait Until Keyword Succeeds 10s 2s Verify Flows Are Present ${ip} + FOR ${ip} IN @{OS_CMP_IPS} + BuiltIn.Wait Until Keyword Succeeds 10s 2s Verify Flows Are Present ${ip} + END Verify Ping To Sub Interface [Arguments] ${sub_interface_ip} diff --git a/csit/suites/netvirt/vpnservice/vpn_basic.robot b/csit/suites/netvirt/vpnservice/vpn_basic.robot index 9279c999b9..896776e1f5 100644 --- a/csit/suites/netvirt/vpnservice/vpn_basic.robot +++ b/csit/suites/netvirt/vpnservice/vpn_basic.robot @@ -53,8 +53,9 @@ Create Router BuiltIn.Wait Until Keyword Succeeds 3s 1s Utils.Check For Elements At URI ${ROUTER_URL} ${router_list} Add Interfaces To Router - : FOR ${interface} IN @{SUBNETS} - \ OpenStackOperations.Add Router Interface ${ROUTER} ${interface} + FOR ${interface} IN @{SUBNETS} + OpenStackOperations.Add Router Interface ${ROUTER} ${interface} + END ${interface_output} = OpenStackOperations.Show Router Interface ${ROUTER} ${GWMAC_ADDRS} ${GWIP_ADDRS} = VpnOperations.Get Gateway MAC And IP Address ${ROUTER} BuiltIn.Set Suite Variable ${GWMAC_ADDRS} @@ -175,14 +176,16 @@ Verify L3VPN Datapath With Router Dissociation When Interfaces are Added To Rout Remove Router Interfaces And Check L3_Datapath Traffic Across Networks ${router_id} = OpenStackOperations.Get Router Id ${ROUTER} - : FOR ${INTERFACE} IN @{SUBNETS} - \ OpenStackOperations.Remove Interface ${ROUTER} ${INTERFACE} - \ OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[0] @{NET_1_VM_IPS}[0] ${NET_1_VM_IPS} - \ OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[0] @{NET_1_VM_IPS}[0] ${NET_2_VM_IPS} ping_should_succeed=False + FOR ${INTERFACE} IN @{SUBNETS} + OpenStackOperations.Remove Interface ${ROUTER} ${INTERFACE} + OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[0] @{NET_1_VM_IPS}[0] ${NET_1_VM_IPS} + OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[0] @{NET_1_VM_IPS}[0] ${NET_2_VM_IPS} ping_should_succeed=False + END ${interface_output} = OpenStackOperations.Show Router Interface ${ROUTER} - : FOR ${INTERFACE} IN @{SUBNETS} - \ ${subnet_id} = OpenStackOperations.Get Subnet Id ${INTERFACE} - \ BuiltIn.Should Not Contain ${interface_output} ${subnet_id} + FOR ${INTERFACE} IN @{SUBNETS} + ${subnet_id} = OpenStackOperations.Get Subnet Id ${INTERFACE} + BuiltIn.Should Not Contain ${interface_output} ${subnet_id} + END Delete Router Delete Router ${ROUTER} diff --git a/csit/suites/netvirt/vpnservice/vpn_basic_dualstack_one_router.robot b/csit/suites/netvirt/vpnservice/vpn_basic_dualstack_one_router.robot index c3c6f08958..5d4962018f 100644 --- a/csit/suites/netvirt/vpnservice/vpn_basic_dualstack_one_router.robot +++ b/csit/suites/netvirt/vpnservice/vpn_basic_dualstack_one_router.robot @@ -63,12 +63,14 @@ Create Router Add Router Ports [Documentation] Add created subnets to router. - : FOR ${PORT} IN @{SUBNETS4} - \ OpenStackOperations.Add Router Interface ${ROUTER} ${PORT} + FOR ${PORT} IN @{SUBNETS4} + OpenStackOperations.Add Router Interface ${ROUTER} ${PORT} + END ${interface_output} = OpenStackOperations.Show Router Interface ${ROUTER} ${GW1_MAC_ADDRS} ${GW_IPV4_ADDRS} = VpnOperations.Get Gateway MAC And IP Address ${ROUTER} - : FOR ${PORT} IN @{SUBNETS6} - \ OpenStackOperations.Add Router Interface ${ROUTER} ${PORT} + FOR ${PORT} IN @{SUBNETS6} + OpenStackOperations.Add Router Interface ${ROUTER} ${PORT} + END ${interface_output} = OpenStackOperations.Show Router Interface ${ROUTER} ${GW2_MAC_ADDRS} ${GW_IPV6_ADDRS} = VpnOperations.Get Gateway MAC And IP Address ${ROUTER} ${IP6_REGEX} ${GW_MAC_ADDRS} = BuiltIn.Create List @{GW1_MAC_ADDRS} @{GW2_MAC_ADDRS} @@ -84,8 +86,9 @@ Check L3_Datapath Traffic Across Networks With Router @{tcpdump_conn_ids} = OpenStackOperations.Start Packet Capture On Nodes tcpdump_vpn_ds ${EMPTY} @{OS_ALL_IPS} ${vm_instances} = BuiltIn.Create List @{NET_1_VM_IPV4} @{NET_2_VM_IPV4} @{NET_1_VM_IPV6} @{NET_2_VM_IPV6} BuiltIn.Wait Until Keyword Succeeds 30s 5s Utils.Check For Elements At URI ${FIB_ENTRY_URL} ${vm_instances} - : FOR ${VM} IN ${vm_instances} - \ BuiltIn.Wait Until Keyword Succeeds 30s 5s VpnOperations.Verify Flows Are Present For L3VPN ${OS_CMP1_IP} ${VM} + FOR ${VM} IN ${vm_instances} + BuiltIn.Wait Until Keyword Succeeds 30s 5s VpnOperations.Verify Flows Are Present For L3VPN ${OS_CMP1_IP} ${VM} + END BuiltIn.Wait Until Keyword Succeeds 30s 5s VpnOperations.Verify GWMAC Entry On ODL ${GW_MAC_ADDRS} Verify GWMAC Flow Entry On Flow Table On All Compute Nodes BuiltIn.Log L3 Datapath test across the networks using router @@ -102,21 +105,23 @@ Check L3_Datapath Traffic Across Networks With Router Add Multiple Extra Routes And Check Datapath Before L3VPN Creation [Documentation] Add multiple extra routes and check data path before L3VPN creation. BuiltIn.Log Add extraroutes to VM - : FOR ${extra_ip} IN @{EXTRA_NW_IPV4} - \ ${cmd} = BuiltIn.Catenate sudo ip addr add ${extra_ip}/24 dev eth0 - \ OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[0] @{NET_1_VM_IPV4}[0] ${cmd} - \ ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[0] @{NET_1_VM_IPV4}[0] ip a - \ BuiltIn.Should Contain ${output} ${extra_ip}/24 + FOR ${extra_ip} IN @{EXTRA_NW_IPV4} + ${cmd} = BuiltIn.Catenate sudo ip addr add ${extra_ip}/24 dev eth0 + OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[0] @{NET_1_VM_IPV4}[0] ${cmd} + ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[0] @{NET_1_VM_IPV4}[0] ip a + BuiltIn.Should Contain ${output} ${extra_ip}/24 + END ${ext_rt1} = BuiltIn.Set Variable destination=@{EXTRA_NW_SUBNET_IPV4}[0],gateway=@{NET_1_VM_IPV4}[0] ${ext_rt2} = BuiltIn.Set Variable destination=@{EXTRA_NW_SUBNET_IPV4}[1],gateway=@{NET_1_VM_IPV4}[0] ${cmd} = BuiltIn.Catenate ${RT_OPTIONS} ${ext_rt1} ${RT_OPTIONS} ${ext_rt2} OpenStackOperations.Update Router ${ROUTER} ${cmd} OpenStackOperations.Show Router ${ROUTER} - : FOR ${extra_ip} IN @{EXTRA_NW_IPV6} - \ ${cmd} = BuiltIn.Catenate sudo ip -6 addr add ${extra_ip}/64 dev eth0 - \ OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[0] @{NET_1_VM_IPV6}[0] ${cmd} - \ ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[0] @{NET_1_VM_IPV6}[0] ip -6 a - \ BuiltIn.Should Contain ${output} ${extra_ip}/64 + FOR ${extra_ip} IN @{EXTRA_NW_IPV6} + ${cmd} = BuiltIn.Catenate sudo ip -6 addr add ${extra_ip}/64 dev eth0 + OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[0] @{NET_1_VM_IPV6}[0] ${cmd} + ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[0] @{NET_1_VM_IPV6}[0] ip -6 a + BuiltIn.Should Contain ${output} ${extra_ip}/64 + END ${ext_rt3} = BuiltIn.Set Variable destination=@{EXTRA_NW_SUBNET_IPV6}[0],gateway=@{NET_1_VM_IPV6}[0] ${ext_rt4} = BuiltIn.Set Variable destination=@{EXTRA_NW_SUBNET_IPV6}[1],gateway=@{NET_1_VM_IPV6}[0] ${cmd} = BuiltIn.Catenate ${RT_OPTIONS} ${ext_rt3} ${RT_OPTIONS} ${ext_rt4} @@ -125,20 +130,22 @@ Add Multiple Extra Routes And Check Datapath Before L3VPN Creation BuiltIn.Log Verify FIB table ${vm_ips} = BuiltIn.Create List @{EXTRA_NW_SUBNET_IPV4} @{EXTRA_NW_SUBNET_IPV6} BuiltIn.Wait Until Keyword Succeeds 30s 5s Utils.Check For Elements At URI ${FIB_ENTRY_URL} ${vm_ips} - : FOR ${extra_ip} IN @{EXTRA_NW_IPV4} - \ ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[0] ${NET_1_VM_IPV4[1]} ping -c 3 ${extra_ip} - \ BuiltIn.Should Contain ${output} 64 bytes - \ ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[1] ${NET_2_VM_IPV4[0]} ping -c 3 ${extra_ip} - \ BuiltIn.Should Contain ${output} 64 bytes - \ ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[1] ${NET_2_VM_IPV4[1]} ping -c 3 ${extra_ip} - \ BuiltIn.Should Contain ${output} 64 bytes - : FOR ${extra_ip} IN @{EXTRA_NW_IPV6} - \ ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[0] ${NET_1_VM_IPV6[1]} ping6 -c 3 ${extra_ip} - \ BuiltIn.Should Contain ${output} 64 bytes - \ ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[1] ${NET_2_VM_IPV6[0]} ping6 -c 3 ${extra_ip} - \ BuiltIn.Should Contain ${output} 64 bytes - \ ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[1] ${NET_2_VM_IPV6[1]} ping6 -c 3 ${extra_ip} - \ BuiltIn.Should Contain ${output} 64 bytes + FOR ${extra_ip} IN @{EXTRA_NW_IPV4} + ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[0] ${NET_1_VM_IPV4[1]} ping -c 3 ${extra_ip} + BuiltIn.Should Contain ${output} 64 bytes + ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[1] ${NET_2_VM_IPV4[0]} ping -c 3 ${extra_ip} + BuiltIn.Should Contain ${output} 64 bytes + ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[1] ${NET_2_VM_IPV4[1]} ping -c 3 ${extra_ip} + BuiltIn.Should Contain ${output} 64 bytes + END + FOR ${extra_ip} IN @{EXTRA_NW_IPV6} + ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[0] ${NET_1_VM_IPV6[1]} ping6 -c 3 ${extra_ip} + BuiltIn.Should Contain ${output} 64 bytes + ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[1] ${NET_2_VM_IPV6[0]} ping6 -c 3 ${extra_ip} + BuiltIn.Should Contain ${output} 64 bytes + ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[1] ${NET_2_VM_IPV6[1]} ping6 -c 3 ${extra_ip} + BuiltIn.Should Contain ${output} 64 bytes + END Delete And Recreate Extra Route [Documentation] Delete IPv4 and IPv6 extra routes and recreate it. @@ -212,8 +219,9 @@ Delete IPv6 Subnet And Check IPv4 datapath OpenStackOperations.Update Router ${ROUTER} ${RT_CLEAR} OpenStackOperations.Show Router ${ROUTER} BuiltIn.Log Delete IPv6 subnet - : FOR ${PORT} IN @{SUBNETS6} - \ Remove Interface ${ROUTER} ${PORT} + FOR ${PORT} IN @{SUBNETS6} + Remove Interface ${ROUTER} ${PORT} + END BuiltIn.Log Test L2 datapath ${output} = OpenStackOperations.Execute Command on VM Instance @{NETWORKS}[0] ${NET_1_VM_IPV4[0]} ping -I ${NET_1_VM_IPV4[0]} -c 3 ${NET_1_VM_IPV4[1]} BuiltIn.Should Contain ${output} 64 bytes @@ -240,12 +248,13 @@ Delete Router And Router Interfaces With L3VPN ${resp} = VpnOperations.VPN Get L3VPN vpnid=${VPN_INSTANCE_ID[0]} BuiltIn.Should Contain ${resp} ${router_id} # Delete Interface - : FOR ${iface} IN @{SUBNETS4} - \ Remove Interface ${ROUTER} ${iface} - \ ${subnet_id} = Get Subnet Id ${iface} - \ ${rt_port_list} = OpenStackOperations.Show Router Interface ${ROUTER} - \ BuiltIn.Should Not Contain ${rt_port_list} ${subnet_id} - # Delete Router and Interface to the subnets. + FOR ${iface} IN @{SUBNETS4} + Remove Interface ${ROUTER} ${iface} + ${subnet_id} = Get Subnet Id ${iface} + ${rt_port_list} = OpenStackOperations.Show Router Interface ${ROUTER} + BuiltIn.Should Not Contain ${rt_port_list} ${subnet_id} + # Delete Router and Interface to the subnets. + END Delete Router ${ROUTER} ${router_output} = OpenStackOperations.List Routers BuiltIn.Should Not Contain ${router_output} ${ROUTER} @@ -364,11 +373,12 @@ Suite Setup ${NET_1_VM_IPV6} = OpenStackOperations.Collect VM IPv6 SLAAC Addresses false ${NET_1_VM_INSTANCES} @{NETWORKS}[0] ${prefix_net10} ${NET_2_VM_IPV6} = OpenStackOperations.Collect VM IPv6 SLAAC Addresses false ${NET_2_VM_INSTANCES} @{NETWORKS}[1] ${prefix_net20} ${LOOP_COUNT} Get Length ${NET_1_VM_INSTANCES} - : FOR ${index} IN RANGE 0 ${LOOP_COUNT} - \ ${status} ${message} Run Keyword And Ignore Error BuiltIn.Should Not Contain ${NET_1_VM_IPV6}[${index}] None - \ Run Keyword If '${status}' == 'FAIL' Write Commands Until Prompt nova console-log @{NET_1_VM_INSTANCES}[${index}] 30s - \ ${status} ${message} Run Keyword And Ignore Error BuiltIn.Should Not Contain ${NET_2_VM_IPV6}[${index}] None - \ Run Keyword If '${status}' == 'FAIL' Write Commands Until Prompt nova console-log @{NET_2_VM_INSTANCES}[${index}] 30s + FOR ${index} IN RANGE 0 ${LOOP_COUNT} + ${status} ${message} Run Keyword And Ignore Error BuiltIn.Should Not Contain ${NET_1_VM_IPV6}[${index}] None + Run Keyword If '${status}' == 'FAIL' Write Commands Until Prompt nova console-log @{NET_1_VM_INSTANCES}[${index}] 30s + ${status} ${message} Run Keyword And Ignore Error BuiltIn.Should Not Contain ${NET_2_VM_IPV6}[${index}] None + Run Keyword If '${status}' == 'FAIL' Write Commands Until Prompt nova console-log @{NET_2_VM_INSTANCES}[${index}] 30s + END BuiltIn.Set Suite Variable ${NET_1_VM_IPV4} BuiltIn.Set Suite Variable ${NET_2_VM_IPV4} BuiltIn.Set Suite Variable ${NET_1_VM_IPV6} @@ -397,9 +407,10 @@ Verify GWMAC Flow Entry On Flow Table BuiltIn.Should Contain ${flow_output} table=${GWMAC_TABLE} ${gwmac_table} = Get Lines Containing String ${flow_output} table=${GWMAC_TABLE} # Verify GWMAC address present in table ${L3_TABLE} - : FOR ${macAdd} IN @{GW_MAC_ADDRS} - \ BuiltIn.Should Contain ${gwmac_table} dl_dst=${macAdd} actions=goto_table:${L3_TABLE} - # Verify Miss entry + FOR ${macAdd} IN @{GW_MAC_ADDRS} + BuiltIn.Should Contain ${gwmac_table} dl_dst=${macAdd} actions=goto_table:${L3_TABLE} + # Verify Miss entry + END BuiltIn.Should Contain ${gwmac_table} actions=resubmit(,17) # Verify ARP_CHECK_TABLE - ${ARP_CHECK_TABLE} ${arpchk_table} = Get Lines Containing String ${flow_output} table=${ARP_CHECK_TABLE} @@ -409,14 +420,16 @@ Verify GWMAC Flow Entry On Flow Table BuiltIn.Should Contain ${flow_output} table=${IPV6_TABLE} ${icmp_ipv6_flows} = Get Lines Containing String ${flow_output} icmp_type=${ICMP_TYPE} # Verify IPv6 icmp_type=135 - : FOR ${ip_addr} IN @{GW_IPV6_ADDRS} - \ ${rule} = BuiltIn.Set Variable icmp_type=${ICMP_TYPE},icmp_code=0,nd_target=${ip_addr} actions=CONTROLLER:65535 - \ BuiltIn.Should Match Regexp ${icmp_ipv6_flows} ${rule} + FOR ${ip_addr} IN @{GW_IPV6_ADDRS} + ${rule} = BuiltIn.Set Variable icmp_type=${ICMP_TYPE},icmp_code=0,nd_target=${ip_addr} actions=CONTROLLER:65535 + BuiltIn.Should Match Regexp ${icmp_ipv6_flows} ${rule} + END VpnOperations.Verify ARP REQUEST in groupTable ${group_output} ${groupID[1]} # Verify ARP_RESPONSE_TABLE - ${ARP_RESPONSE_TABLE} BuiltIn.Should Contain ${flow_output} table=${ARP_RESPONSE_TABLE} ${arpResponder_table} = Get Lines Containing String ${flow_output} table=${ARP_RESPONSE_TABLE} BuiltIn.Should Contain ${arpResponder_table} priority=0 actions=drop - : FOR ${macAdd} ${ipAdd} IN ZIP ${GW1_MAC_ADDRS} ${GW_IPV4_ADDRS} - \ ${ARP_RESPONSE_IP_MAC_REGEX} = BuiltIn.Set Variable arp_tpa=${ipAdd},arp_op=1 actions=.*,set_field:${macAdd}->eth_src - \ BuiltIn.Should Match Regexp ${arpResponder_table} ${ARP_RESPONSE_IP_MAC_REGEX} + FOR ${macAdd} ${ipAdd} IN ZIP ${GW1_MAC_ADDRS} ${GW_IPV4_ADDRS} + ${ARP_RESPONSE_IP_MAC_REGEX} = BuiltIn.Set Variable arp_tpa=${ipAdd},arp_op=1 actions=.*,set_field:${macAdd}->eth_src + BuiltIn.Should Match Regexp ${arpResponder_table} ${ARP_RESPONSE_IP_MAC_REGEX} + END diff --git a/csit/suites/netvirt/vpnservice/vpn_basic_dualstack_subnet_routing.robot b/csit/suites/netvirt/vpnservice/vpn_basic_dualstack_subnet_routing.robot index 4994db789e..eca25521ad 100644 --- a/csit/suites/netvirt/vpnservice/vpn_basic_dualstack_subnet_routing.robot +++ b/csit/suites/netvirt/vpnservice/vpn_basic_dualstack_subnet_routing.robot @@ -77,10 +77,12 @@ Configure Extra IPv4/IPv6 Addresss On Interface For Subnet Routing [Documentation] Extra IPv4/IPv6 Address configuration on Interfaces ${VM_IPV6} = BuiltIn.Create List @{net_1_vm_ipv6}[0] @{net_1_vm_ipv6}[1] @{net_2_vm_ipv6}[0] @{net_2_vm_ipv6}[1] ${VM_IPV4} = BuiltIn.Create List @{net_1_vm_ipv4}[0] @{net_1_vm_ipv4}[1] @{net_2_vm_ipv4}[0] @{net_2_vm_ipv4}[1] - : FOR ${index} IN RANGE 0 ${LOOP_COUNT} - \ OpenStackOperations.Execute Command on VM Instance @{network_list}[${index}] @{VM_IPV6}[${index}] sudo ip -6 addr add @{EXTRA_NW_IPV6}[${index}]/64 dev eth0; sudo ifconfig eth0 allmulti; ip -6 a - : FOR ${index} IN RANGE 0 ${LOOP_COUNT} - \ OpenStackOperations.Execute Command on VM Instance @{network_list}[${index}] @{VM_IPV4}[${index}] sudo ifconfig eth0:1 @{EXTRA_NW_IPV4}[${index}] netmask 255.255.255.0 up; ip a + FOR ${index} IN RANGE 0 ${LOOP_COUNT} + OpenStackOperations.Execute Command on VM Instance @{network_list}[${index}] @{VM_IPV6}[${index}] sudo ip -6 addr add @{EXTRA_NW_IPV6}[${index}]/64 dev eth0; sudo ifconfig eth0 allmulti; ip -6 a + END + FOR ${index} IN RANGE 0 ${LOOP_COUNT} + OpenStackOperations.Execute Command on VM Instance @{network_list}[${index}] @{VM_IPV4}[${index}] sudo ifconfig eth0:1 @{EXTRA_NW_IPV4}[${index}] netmask 255.255.255.0 up; ip a + END BuiltIn.Set Suite Variable ${VM_IPV6} BuiltIn.Set Suite Variable ${VM_IPV4} BuiltIn.Should Not Contain ${VM_IPV6} None @@ -111,46 +113,56 @@ Associate L3VPN Again To Routers and verify traffic Delete the configured extra IPv4/IPv6 Addresss and verify traffic [Documentation] Delete IPv4/IPv6 Address configuration on Interfaces and verify traffic - : FOR ${index} IN RANGE 0 ${LOOP_COUNT} - \ OpenStackOperations.Execute Command on VM Instance @{network_list}[${index}] @{VM_IPV6}[${index}] sudo ip -6 addr del @{EXTRA_NW_IPV6}[${index}]/64 dev eth0 - : FOR ${index} IN RANGE 0 ${LOOP_COUNT} - \ OpenStackOperations.Execute Command on VM Instance @{network_list}[${index}] @{VM_IPV4}[${index}] sudo ifconfig eth0:1 down + FOR ${index} IN RANGE 0 ${LOOP_COUNT} + OpenStackOperations.Execute Command on VM Instance @{network_list}[${index}] @{VM_IPV6}[${index}] sudo ip -6 addr del @{EXTRA_NW_IPV6}[${index}]/64 dev eth0 + END + FOR ${index} IN RANGE 0 ${LOOP_COUNT} + OpenStackOperations.Execute Command on VM Instance @{network_list}[${index}] @{VM_IPV4}[${index}] sudo ifconfig eth0:1 down + END BuiltIn.Wait Until Keyword Succeeds 10x 30s Verify Ipv4 Data No Traffic BuiltIn.Wait Until Keyword Succeeds 10x 30s Verify Ipv6 Data No Traffic BuiltIn.Wait Until Keyword Succeeds 10x 40s Verify Table 21 for No VPN Routes Configure Again Extra IPv4/IPv6 Addresss On Interface For Subnet Routing [Documentation] Extra IPv4/IPv6 Address configuration on Interfaces - : FOR ${index} IN RANGE 0 ${LOOP_COUNT} - \ OpenStackOperations.Execute Command on VM Instance @{network_list}[${index}] @{VM_IPV6}[${index}] sudo ip -6 addr add @{EXTRA_NW_IPV6}[${index}]/64 dev eth0; sudo ifconfig eth0 allmulti; ip -6 a - : FOR ${index} IN RANGE 0 ${LOOP_COUNT} - \ OpenStackOperations.Execute Command on VM Instance @{network_list}[${index}] @{VM_IPV4}[${index}] sudo ifconfig eth0:1 @{EXTRA_NW_IPV4}[${index}] netmask 255.255.255.0 up; ip a + FOR ${index} IN RANGE 0 ${LOOP_COUNT} + OpenStackOperations.Execute Command on VM Instance @{network_list}[${index}] @{VM_IPV6}[${index}] sudo ip -6 addr add @{EXTRA_NW_IPV6}[${index}]/64 dev eth0; sudo ifconfig eth0 allmulti; ip -6 a + END + FOR ${index} IN RANGE 0 ${LOOP_COUNT} + OpenStackOperations.Execute Command on VM Instance @{network_list}[${index}] @{VM_IPV4}[${index}] sudo ifconfig eth0:1 @{EXTRA_NW_IPV4}[${index}] netmask 255.255.255.0 up; ip a + END BuiltIn.Wait Until Keyword Succeeds 10x 30s Verify Ipv4 Data Traffic BuiltIn.Wait Until Keyword Succeeds 10x 30s Verify Ipv6 Data Traffic Remove Interface From Router And Verify Traffic [Documentation] Remove subnet from router and check data path verification ${router_id} = OpenStackOperations.Get Router Id ${ROUTER} - : FOR ${interface} IN @{SUBNETS4} - \ OpenStackOperations.Remove Interface ${ROUTER} ${INTERFACE} + FOR ${interface} IN @{SUBNETS4} + OpenStackOperations.Remove Interface ${ROUTER} ${INTERFACE} + END ${interface_output} = OpenStackOperations.Show Router Interface ${ROUTER} - : FOR ${interface} IN @{SUBNETS6} - \ OpenStackOperations.Remove Interface ${ROUTER} ${INTERFACE} + FOR ${interface} IN @{SUBNETS6} + OpenStackOperations.Remove Interface ${ROUTER} ${INTERFACE} + END ${interface_output} = OpenStackOperations.Show Router Interface ${ROUTER} - : FOR ${interface} IN @{SUBNETS4} - \ ${subnet_id} = OpenStackOperations.Get Subnet Id ${INTERFACE} - \ BuiltIn.Should Not Contain ${interface_output} ${subnet_id} - : FOR ${interface} IN @{SUBNETS6} - \ ${subnet_id} = OpenStackOperations.Get Subnet Id ${INTERFACE} - \ BuiltIn.Should Not Contain ${interface_output} ${subnet_id} + FOR ${interface} IN @{SUBNETS4} + ${subnet_id} = OpenStackOperations.Get Subnet Id ${INTERFACE} + BuiltIn.Should Not Contain ${interface_output} ${subnet_id} + END + FOR ${interface} IN @{SUBNETS6} + ${subnet_id} = OpenStackOperations.Get Subnet Id ${INTERFACE} + BuiltIn.Should Not Contain ${interface_output} ${subnet_id} + END BuiltIn.Wait Until Keyword Succeeds 10x 30s Verify Ipv4 Data No Traffic Add Interface To Router And Verify Traffic [Documentation] Add interface router to again and check data path verification - : FOR ${interface} IN @{SUBNETS4} - \ OpenStackOperations.Add Router Interface ${ROUTER} ${interface} - : FOR ${interface} IN @{SUBNETS6} - \ OpenStackOperations.Add Router Interface ${ROUTER} ${interface} + FOR ${interface} IN @{SUBNETS4} + OpenStackOperations.Add Router Interface ${ROUTER} ${interface} + END + FOR ${interface} IN @{SUBNETS6} + OpenStackOperations.Add Router Interface ${ROUTER} ${interface} + END BuiltIn.Wait Until Keyword Succeeds 10x 60s Verify Ipv4 Data Traffic BuiltIn.Wait Until Keyword Succeeds 10x 60s Verify Ipv6 Data Traffic @@ -196,18 +208,21 @@ Suite Setup OpenStackOperations.Create Router ${ROUTER} @{router_list} = BuiltIn.Create List ${ROUTER} BuiltIn.Wait Until Keyword Succeeds 3s 1s Utils.Check For Elements At URI ${ROUTER_URL} ${router_list} - : FOR ${port} IN @{SUBNETS4} - \ OpenStackOperations.Add Router Interface ${ROUTER} ${port} + FOR ${port} IN @{SUBNETS4} + OpenStackOperations.Add Router Interface ${ROUTER} ${port} + END ${interface_output} = OpenStackOperations.Show Router Interface ${ROUTER} - : FOR ${port} IN @{SUBNETS6} - \ OpenStackOperations.Add Router Interface ${ROUTER} ${port} + FOR ${port} IN @{SUBNETS6} + OpenStackOperations.Add Router Interface ${ROUTER} ${port} + END ${interface_output} = OpenStackOperations.Show Router Interface ${ROUTER} Create Allow All SecurityGroup ${SECURITY_GROUP} IPv4 True ${allowed_address_pairs_args} = BuiltIn.Set Variable --allowed-address ip-address=@{EXTRA_NW_SUBNET_IPV4}[0] --allowed-address ip-address=@{EXTRA_NW_SUBNET_IPV4}[1] --allowed-address ip-address=@{EXTRA_NW_SUBNET_IPV6}[0] --allowed-address ip-address=@{EXTRA_NW_SUBNET_IPV6}[1] ${network_list} = BuiltIn.Create List @{NETWORKS}[0] @{NETWORKS}[0] @{NETWORKS}[1] @{NETWORKS}[1] BuiltIn.Set Suite Variable ${network_list} - : FOR ${index} IN RANGE 0 ${LOOP_COUNT} - \ OpenStackOperations.Create Port @{network_list}[${index}] @{PORTS}[${index}] sg=${SECURITY_GROUP} additional_args=${allowed_address_pairs_args} + FOR ${index} IN RANGE 0 ${LOOP_COUNT} + OpenStackOperations.Create Port @{network_list}[${index}] @{PORTS}[${index}] sg=${SECURITY_GROUP} additional_args=${allowed_address_pairs_args} + END BuiltIn.Wait Until Keyword Succeeds 3s 1s Utils.Check For Elements At URI ${PORT_URL} ${PORTS} OpenStackOperations.Update Port @{PORTS}[0] additional_args=--name ${UPDATE_PORT} ${output} = Show Port ${UPDATE_PORT} @@ -235,11 +250,12 @@ Suite Setup ${net_1_vm_ipv6} = OpenStackOperations.Collect VM IPv6 SLAAC Addresses false ${NET_1_VMS} @{NETWORKS}[0] ${prefix_net10} ${net_2_vm_ipv6} = OpenStackOperations.Collect VM IPv6 SLAAC Addresses false ${NET_2_VMS} @{NETWORKS}[1] ${prefix_net20} ${loop_count} Get Length ${NET_1_VMS} - : FOR ${index} IN RANGE 0 ${loop_count} - \ ${status} ${message} Run Keyword And Ignore Error BuiltIn.Should Not Contain ${net_1_vm_ipv6}[${index}] None - \ Run Keyword If '${status}' == 'FAIL' Write Commands Until Prompt nova console-log @{NET_1_VMS}[${index}] 30s - \ ${status} ${message} Run Keyword And Ignore Error BuiltIn.Should Not Contain ${net_2_vm_ipv6}[${index}] None - \ Run Keyword If '${status}' == 'FAIL' Write Commands Until Prompt nova console-log @{NET_2_VMS}[${index}] 30s + FOR ${index} IN RANGE 0 ${loop_count} + ${status} ${message} Run Keyword And Ignore Error BuiltIn.Should Not Contain ${net_1_vm_ipv6}[${index}] None + Run Keyword If '${status}' == 'FAIL' Write Commands Until Prompt nova console-log @{NET_1_VMS}[${index}] 30s + ${status} ${message} Run Keyword And Ignore Error BuiltIn.Should Not Contain ${net_2_vm_ipv6}[${index}] None + Run Keyword If '${status}' == 'FAIL' Write Commands Until Prompt nova console-log @{NET_2_VMS}[${index}] 30s + END BuiltIn.Set Suite Variable ${net_1_vm_ipv4} BuiltIn.Set Suite Variable ${net_2_vm_ipv4} BuiltIn.Set Suite Variable ${net_1_vm_ipv6} @@ -340,16 +356,20 @@ Verify Ipv6 Data No Traffic BuiltIn.Should Contain ${output} ${NO_PING_REGEXP} Verify Table 21 for VPN Routes - : FOR ${index} IN RANGE 0 ${LOOP_COUNT} - \ OVSDB.Verify Dump Flows For Specific Table ${OS_CMP1_IP} ${TABLE_NO_21} True ${EMPTY} ipv6_dst=@{EXTRA_NW_IPV6}[${index}] - : FOR ${index} IN RANGE 0 ${LOOP_COUNT} - \ OVSDB.Verify Dump Flows For Specific Table ${OS_CMP1_IP} ${TABLE_NO_21} True ${EMPTY} ipv6_dst=@{EXTRA_NW_IPV4}[${index}] + FOR ${index} IN RANGE 0 ${LOOP_COUNT} + OVSDB.Verify Dump Flows For Specific Table ${OS_CMP1_IP} ${TABLE_NO_21} True ${EMPTY} ipv6_dst=@{EXTRA_NW_IPV6}[${index}] + END + FOR ${index} IN RANGE 0 ${LOOP_COUNT} + OVSDB.Verify Dump Flows For Specific Table ${OS_CMP1_IP} ${TABLE_NO_21} True ${EMPTY} ipv6_dst=@{EXTRA_NW_IPV4}[${index}] + END Verify Table 21 for No VPN Routes - : FOR ${index} IN RANGE 0 ${LOOP_COUNT} - \ OVSDB.Verify Dump Flows For Specific Table ${OS_CMP1_IP} ${TABLE_NO_21} False ${EMPTY} ipv6_dst=@{EXTRA_NW_IPV6}[${index}] - : FOR ${index} IN RANGE 0 ${LOOP_COUNT} - \ OVSDB.Verify Dump Flows For Specific Table ${OS_CMP1_IP} ${TABLE_NO_21} False ${EMPTY} ipv6_dst=@{EXTRA_NW_IPV4}[${index}] + FOR ${index} IN RANGE 0 ${LOOP_COUNT} + OVSDB.Verify Dump Flows For Specific Table ${OS_CMP1_IP} ${TABLE_NO_21} False ${EMPTY} ipv6_dst=@{EXTRA_NW_IPV6}[${index}] + END + FOR ${index} IN RANGE 0 ${LOOP_COUNT} + OVSDB.Verify Dump Flows For Specific Table ${OS_CMP1_IP} ${TABLE_NO_21} False ${EMPTY} ipv6_dst=@{EXTRA_NW_IPV4}[${index}] + END Suite Teardown [Documentation] Delete the setup diff --git a/csit/suites/netvirt/vpnservice/vpn_basic_ipv6.robot b/csit/suites/netvirt/vpnservice/vpn_basic_ipv6.robot index 18da4b48a5..74a7b8c4f4 100644 --- a/csit/suites/netvirt/vpnservice/vpn_basic_ipv6.robot +++ b/csit/suites/netvirt/vpnservice/vpn_basic_ipv6.robot @@ -138,12 +138,14 @@ Delete Router And Router Interfaces With L3VPN VpnOperations.Associate VPN to Router routerid=${router_id} vpnid=@{VPN_INSTANCE_IDS}[0] ${resp} = VpnOperations.VPN Get L3VPN vpnid=@{VPN_INSTANCE_IDS}[0] BuiltIn.Should Contain ${resp} ${router_id} - : FOR ${INTERFACE} IN @{SUBNETS} - \ OpenStackOperations.Remove Interface ${ROUTER} ${INTERFACE} + FOR ${INTERFACE} IN @{SUBNETS} + OpenStackOperations.Remove Interface ${ROUTER} ${INTERFACE} + END ${interface_output} = OpenStackOperations.Show Router Interface ${ROUTER} - : FOR ${INTERFACE} IN @{SUBNETS} - \ ${subnet_id} = OpenStackOperations.Get Subnet Id ${INTERFACE} - \ BuiltIn.Should Not Contain ${interface_output} ${subnet_id} + FOR ${INTERFACE} IN @{SUBNETS} + ${subnet_id} = OpenStackOperations.Get Subnet Id ${INTERFACE} + BuiltIn.Should Not Contain ${interface_output} ${subnet_id} + END OpenStackOperations.Delete Router ${ROUTER} ${router_output} = OpenStackOperations.List Routers BuiltIn.Should Not Contain ${router_output} ${ROUTER} @@ -216,12 +218,14 @@ Suite Setup OpenStackOperations.Create Router ${ROUTER} ${router_list} = BuiltIn.Create List ${ROUTER} BuiltIn.Wait Until Keyword Succeeds 3s 1s Utils.Check For Elements At URI ${ROUTER_URL} ${router_list} - : FOR ${interface} IN @{SUBNETS} - \ OpenStackOperations.Add Router Interface ${ROUTER} ${interface} + FOR ${interface} IN @{SUBNETS} + OpenStackOperations.Add Router Interface ${ROUTER} ${interface} + END ${interface_output} = OpenStackOperations.Show Router Interface ${ROUTER} - : FOR ${interface} IN @{SUBNETS} - \ ${subnet_id} = OpenStackOperations.Get Subnet Id ${interface} - \ BuiltIn.Should Contain ${interface_output} ${subnet_id} + FOR ${interface} IN @{SUBNETS} + ${subnet_id} = OpenStackOperations.Get Subnet Id ${interface} + BuiltIn.Should Contain ${interface_output} ${subnet_id} + END ${GWMAC_ADDRS} ${GWIP_ADDRS} = VpnOperations.Get Gateway MAC And IP Address ${ROUTER} ${IP6_REGEX} BuiltIn.Set Suite Variable ${GWMAC_ADDRS} BuiltIn.Set Suite Variable ${GWIP_ADDRS} @@ -241,8 +245,9 @@ Suite Setup OpenStackOperations.Create Vm Instance With Port On Compute Node @{PORTS}[2] @{NET_2_VMS}[0] ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP} OpenStackOperations.Create Vm Instance With Port On Compute Node @{PORTS}[3] @{NET_2_VMS}[1] ${OS_CMP2_HOSTNAME} sg=${SECURITY_GROUP} ${vms}= BuiltIn.Create List @{NET_1_VMS} @{NET_2_VMS} - : FOR ${vm} IN @{vms} - \ OpenStackOperations.Poll VM Is ACTIVE ${vm} + FOR ${vm} IN @{vms} + OpenStackOperations.Poll VM Is ACTIVE ${vm} + END BuiltIn.Wait Until Keyword Succeeds 30s 10s Wait For Routes To Propogate ${NETWORKS} ${SUBNET_CIDRS} ${prefix_net10} = Replace String @{SUBNET_CIDRS}[0] ::/64 (:[a-f0-9]{,4}){,4} ${status} ${message} Run Keyword And Ignore Error BuiltIn.Wait Until Keyword Succeeds 3x 60s OpenStackOperations.Collect VM IPv6 SLAAC Addresses @@ -255,9 +260,10 @@ Suite Setup ${VM_INSTANCES} = Collections.Combine Lists ${NET_1_VMS} ${NET_2_VMS} ${VM_IPS}= Collections.Combine Lists ${VM_IP_NET10} ${VM_IP_NET20} ${LOOP_COUNT} BuiltIn.Get Length ${NET_1_VMS} - : FOR ${index} IN RANGE 0 ${LOOP_COUNT} - \ ${status} ${message} Run Keyword And Ignore Error BuiltIn.Should Not Contain ${VM_IPS}[${index}] None - \ Run Keyword If '${status}' == 'FAIL' OpenStack CLI openstack console log show @{VM_INSTANCES}[${index}] 30s + FOR ${index} IN RANGE 0 ${LOOP_COUNT} + ${status} ${message} Run Keyword And Ignore Error BuiltIn.Should Not Contain ${VM_IPS}[${index}] None + Run Keyword If '${status}' == 'FAIL' OpenStack CLI openstack console log show @{VM_INSTANCES}[${index}] 30s + END OpenStackOperations.Copy DHCP Files From Control Node BuiltIn.Set Suite Variable ${VM_IP_NET10} BuiltIn.Set Suite Variable ${VM_IP_NET20} diff --git a/csit/suites/nic/basic/010_Restconf_OK.robot b/csit/suites/nic/basic/010_Restconf_OK.robot index 14bf14ad9a..ceb27292e7 100644 --- a/csit/suites/nic/basic/010_Restconf_OK.robot +++ b/csit/suites/nic/basic/010_Restconf_OK.robot @@ -30,26 +30,30 @@ Get Controller Modules Should Contain ${resp.content} ietf-restconf Verify REST Command Add, Update and Remove - : FOR ${intent} IN @{all_intents_bad} - \ ${intent_id}= REST Add Intent @{intent} - \ Append To List ${all_intents_ids} ${intent_id} + FOR ${intent} IN @{all_intents_bad} + ${intent_id}= REST Add Intent @{intent} + Append To List ${all_intents_ids} ${intent_id} + END ${resp}= REST Get List of Intents - : FOR ${intent_id} IN @{all_intents_ids} - \ Should Contain ${resp} ${intent_id} + FOR ${intent_id} IN @{all_intents_ids} + Should Contain ${resp} ${intent_id} + END ${size}= Get Length ${all_intents_correct} - : FOR ${index} IN RANGE ${size} - \ ${intent}= Get From List ${all_intents_correct} ${index} - \ ${intent_id}= Get From List ${all_intents_ids} ${index} - \ REST Update Intent By Id ${intent_id} @{intent} - \ ${intent_from}= Get From List ${intent} 0 - \ ${intent_to}= Get From List ${intent} 1 - \ ${intent_permission}= Get From List ${intent} 2 - \ ${resp}= REST Get Intent From Id ${intent_id} - \ Should Contain ${resp} ${intent_from} - \ Should Contain ${resp} ${intent_to} - \ Should Contain ${resp} ${intent_permission} - : FOR ${id} IN @{all_intents_ids} - \ REST Delete Intent By Id ${id} + FOR ${index} IN RANGE ${size} + ${intent}= Get From List ${all_intents_correct} ${index} + ${intent_id}= Get From List ${all_intents_ids} ${index} + REST Update Intent By Id ${intent_id} @{intent} + ${intent_from}= Get From List ${intent} 0 + ${intent_to}= Get From List ${intent} 1 + ${intent_permission}= Get From List ${intent} 2 + ${resp}= REST Get Intent From Id ${intent_id} + Should Contain ${resp} ${intent_from} + Should Contain ${resp} ${intent_to} + Should Contain ${resp} ${intent_permission} + END + FOR ${id} IN @{all_intents_ids} + REST Delete Intent By Id ${id} + END *** Keywords *** REST Get List of Intents diff --git a/csit/suites/nic/cli/console.robot b/csit/suites/nic/cli/console.robot index 5e17592678..e6b4a8256b 100644 --- a/csit/suites/nic/cli/console.robot +++ b/csit/suites/nic/cli/console.robot @@ -41,26 +41,31 @@ Verify NIC Command Add and Remove ... until the intent:add command is available for the test case to be run. [Tags] NIC Wait Until Keyword Succeeds 1 min 5 sec Verify Intent:Add Command is Available - : FOR ${intent} IN @{all_intents} - \ ${id}= Add Intent @{intent} - \ Append To List ${all_intents_ids} ${id} + FOR ${intent} IN @{all_intents} + ${id}= Add Intent @{intent} + Append To List ${all_intents_ids} ${id} + END ${size}= Get Length ${all_intents} - : FOR ${index} IN RANGE ${size} - \ ${intent}= Get From List ${all_intents} ${index} - \ ${intent_id}= Get From List ${all_intents_ids} ${index} - \ Verify Intent Added ${intent_id} ${intent} + FOR ${index} IN RANGE ${size} + ${intent}= Get From List ${all_intents} ${index} + ${intent_id}= Get From List ${all_intents_ids} ${index} + Verify Intent Added ${intent_id} ${intent} + END ${output}= Issue Command On Karaf Console intent:compile ${size}= Get Length ${all_intent_validations} - : FOR ${index} IN RANGE ${size} - \ ${compiled_intent_validation}= Get From List ${all_intent_validations} ${index} - \ ${intent_validation_line}= Get Lines Containing String ${output} ${compiled_intent_validation} - \ ${policy}= Get From List ${all_intent_validations_policies} ${index} - \ Should Contain ${intent_validation_line} ${policy} - : FOR ${intent_id} IN @{all_intents_ids} - \ Remove Intent ${intent_id} + FOR ${index} IN RANGE ${size} + ${compiled_intent_validation}= Get From List ${all_intent_validations} ${index} + ${intent_validation_line}= Get Lines Containing String ${output} ${compiled_intent_validation} + ${policy}= Get From List ${all_intent_validations_policies} ${index} + Should Contain ${intent_validation_line} ${policy} + END + FOR ${intent_id} IN @{all_intents_ids} + Remove Intent ${intent_id} + END ${output}= Issue Command On Karaf Console intent:list -c - : FOR ${intent_id} IN @{all_intents_ids} - \ Should Not Contain ${output} ${id} + FOR ${intent_id} IN @{all_intents_ids} + Should Not Contain ${output} ${id} + END *** Keywords *** Setup NIC Console Environment diff --git a/csit/suites/ocpplugin/scalability/010__ocp_scalability.robot b/csit/suites/ocpplugin/scalability/010__ocp_scalability.robot index 0b4b992284..e02da4a075 100644 --- a/csit/suites/ocpplugin/scalability/010__ocp_scalability.robot +++ b/csit/suites/ocpplugin/scalability/010__ocp_scalability.robot @@ -33,7 +33,8 @@ Get param from emulators [Documentation] OCPPLUGIN get param [Tags] OCPPLUGIN get ${NODE_AMOUNT}= Convert To Integer ${NODE_AMOUNT} - : FOR ${NODE_NUM} IN RANGE 1 ${NODE_AMOUNT+1} - \ ${resp} Post Request session ${REST_GET_PARAM} data={"input":{"nodeId":"ocp:TST-${NODE_NUM}","objId":"ALL","paramName":"ALL"}} - \ Should Be Equal As Strings ${resp.status_code} 200 + FOR ${NODE_NUM} IN RANGE 1 ${NODE_AMOUNT+1} + ${resp} Post Request session ${REST_GET_PARAM} data={"input":{"nodeId":"ocp:TST-${NODE_NUM}","objId":"ALL","paramName":"ALL"}} + Should Be Equal As Strings ${resp.status_code} 200 + END Stop Emulator And Exit ${mininet_conn_id} diff --git a/csit/suites/openflowplugin/Bug_Validation/6917.robot b/csit/suites/openflowplugin/Bug_Validation/6917.robot index 8a57782d47..beb7a06a50 100644 --- a/csit/suites/openflowplugin/Bug_Validation/6917.robot +++ b/csit/suites/openflowplugin/Bug_Validation/6917.robot @@ -17,8 +17,9 @@ ${iteration} 4 *** Test Cases *** Add Delete Same Flow [Documentation] Iterate on add and delete flow until alien ID is found in Operational Datastore. - : FOR ${i} IN RANGE ${iteration} - \ Run Keyword And Continue On Failure Add And Delete Flow f21.xml + FOR ${i} IN RANGE ${iteration} + Run Keyword And Continue On Failure Add And Delete Flow f21.xml + END [Teardown] Report_Failure_Due_To_Bug 6917 Add Multiple Flows diff --git a/csit/suites/openflowplugin/Bundlebased_Reconciliation/010_bundle_resync.robot b/csit/suites/openflowplugin/Bundlebased_Reconciliation/010_bundle_resync.robot index 739dac28cd..e76ed9ba7b 100644 --- a/csit/suites/openflowplugin/Bundlebased_Reconciliation/010_bundle_resync.robot +++ b/csit/suites/openflowplugin/Bundlebased_Reconciliation/010_bundle_resync.robot @@ -54,14 +54,17 @@ TC02_Reconcilation check with new switch added TC03_Reconciliation check by pushing group dependent flows [Documentation] Verify the Bundle based reconciliation by pushing multiple group dependent flows ${switch_idx} OVSDB.Get DPID ${TOOLS_SYSTEM_2_IP} - : FOR ${index} IN RANGE 1 3 - \ Push Groups Via Restcall ${switch_idx} ${index} - : FOR ${index} IN RANGE 1 6 - \ Push Flow Via Restcall ${switch_idx} ${FLOWFILE[${index}]} - \ Set Test Variable ${flowbody[${index}]} ${data} + FOR ${index} IN RANGE 1 3 + Push Groups Via Restcall ${switch_idx} ${index} + END + FOR ${index} IN RANGE 1 6 + Push Flow Via Restcall ${switch_idx} ${FLOWFILE[${index}]} + Set Test Variable ${flowbody[${index}]} ${data} + END Utils.Run Command On Remote System ${TOOLS_SYSTEM_2_IP} sudo service openvswitch-switch restart - : FOR ${index} IN RANGE 1 6 - \ Wait Until Keyword Succeeds 5s 1s FlowLib.Check Operational Flow ${True} ${flowbody[${index}]} + FOR ${index} IN RANGE 1 6 + Wait Until Keyword Succeeds 5s 1s FlowLib.Check Operational Flow ${True} ${flowbody[${index}]} + END Log Check if flows are pushed as bundle messages ${Resyncdone_msg}= BuiltIn.Set Variable "Completing bundle based reconciliation for device ID:${switch_idx}" Check_Karaf_Log_Message_Count ${Resyncdone_msg} 2 diff --git a/csit/suites/openflowplugin/Clustered_Reconciliation/010_Group_Flows.robot b/csit/suites/openflowplugin/Clustered_Reconciliation/010_Group_Flows.robot index 1a7a771c12..dd5df5a25a 100644 --- a/csit/suites/openflowplugin/Clustered_Reconciliation/010_Group_Flows.robot +++ b/csit/suites/openflowplugin/Clustered_Reconciliation/010_Group_Flows.robot @@ -133,9 +133,10 @@ Check Flows After Owner Reconnect In Switch Check Switches Generate Slave Connection [Documentation] Check switches are connected to new Slave. ${original_master}= BuiltIn.Set Variable ${ODL_SYSTEM_${original_owner}_IP} - : FOR ${switch} IN RANGE 1 ${switches+1} - \ BuiltIn.Wait Until Keyword Succeeds 50s 1s OvsManager.Should Be Slave s${switch} ${original_master} - \ ... update_data=${True} + FOR ${switch} IN RANGE 1 ${switches+1} + BuiltIn.Wait Until Keyword Succeeds 50s 1s OvsManager.Should Be Slave s${switch} ${original_master} + ... update_data=${True} + END Disconnect Mininet From Successor [Documentation] Disconnect mininet from the Successor. @@ -200,9 +201,10 @@ Check No Switches After Disconnect Check Switch Is Not Connected [Documentation] Check switch s1 is not connected to any controller. - : FOR ${index} IN @{cluster_index_list} - \ BuiltIn.Wait Until Keyword Succeeds 10s 1s OvsManager.Should Be Disconnected s1 ${ODL_SYSTEM_${index}_IP} - \ ... update_data=${True} + FOR ${index} IN @{cluster_index_list} + BuiltIn.Wait Until Keyword Succeeds 10s 1s OvsManager.Should Be Disconnected s1 ${ODL_SYSTEM_${index}_IP} + ... update_data=${True} + END Reconnect Mininet To Cluster [Documentation] Reconnect mininet to cluster by removing Iptables drop rules that were used to disconnect @@ -380,10 +382,11 @@ Add Groups And Flows On Member [Arguments] ${iter}=1 ${member_index}=1 [Documentation] Add ${ITER} groups type 1 & 2 and flows in every switch. ${session} = Resolve_Http_Session_For_Member member_index=${member_index} - : FOR ${switch} IN RANGE 1 ${switches+1} - \ TemplatedRequests.Post As Json Templated folder=${VAR_DIR}/add-group-1 mapping={"SWITCH":"${switch}"} session=${session} iterations=${iter} - \ TemplatedRequests.Post As Json Templated folder=${VAR_DIR}/add-group-2 mapping={"SWITCH":"${switch}"} session=${session} iterations=${iter} - \ TemplatedRequests.Post As Json Templated folder=${VAR_DIR}/add-flow mapping={"SWITCH":"${switch}"} session=${session} iterations=${iter} + FOR ${switch} IN RANGE 1 ${switches+1} + TemplatedRequests.Post As Json Templated folder=${VAR_DIR}/add-group-1 mapping={"SWITCH":"${switch}"} session=${session} iterations=${iter} + TemplatedRequests.Post As Json Templated folder=${VAR_DIR}/add-group-2 mapping={"SWITCH":"${switch}"} session=${session} iterations=${iter} + TemplatedRequests.Post As Json Templated folder=${VAR_DIR}/add-flow mapping={"SWITCH":"${switch}"} session=${session} iterations=${iter} + END Add Single Group And Flow On Member [Arguments] ${member_index}=1 @@ -394,10 +397,11 @@ Remove Single Group And Flow On Member [Arguments] ${member_index}=1 [Documentation] Remove 1 group 1&2 and 1 flow in every switch. ${session} = Resolve_Http_Session_For_Member member_index=${member_index} - : FOR ${switch} IN RANGE 1 ${switches+1} - \ RequestsLibrary.Delete Request ${session} ${CONFIG_NODES_API}/node/openflow:${switch}/table/0/flow/1 - \ RequestsLibrary.Delete Request ${session} ${CONFIG_NODES_API}/node/openflow:${switch}/group/1 - \ RequestsLibrary.Delete Request ${session} ${CONFIG_NODES_API}/node/openflow:${switch}/group/1000 + FOR ${switch} IN RANGE 1 ${switches+1} + RequestsLibrary.Delete Request ${session} ${CONFIG_NODES_API}/node/openflow:${switch}/table/0/flow/1 + RequestsLibrary.Delete Request ${session} ${CONFIG_NODES_API}/node/openflow:${switch}/group/1 + RequestsLibrary.Delete Request ${session} ${CONFIG_NODES_API}/node/openflow:${switch}/group/1000 + END Check Flow Stats Are Not Frozen [Arguments] ${member_index}=1 ${period_in_seconds}=5 diff --git a/csit/suites/openflowplugin/Clustering/010__Cluster_HA_Owner_Failover.robot b/csit/suites/openflowplugin/Clustering/010__Cluster_HA_Owner_Failover.robot index 481419f257..720e4441cc 100644 --- a/csit/suites/openflowplugin/Clustering/010__Cluster_HA_Owner_Failover.robot +++ b/csit/suites/openflowplugin/Clustering/010__Cluster_HA_Owner_Failover.robot @@ -31,9 +31,10 @@ Check Entity Owner Status And Find Owner and Successor Before Fail Reconnect Extra Switches To Successors And Check OVS Connections [Documentation] Connect switches s2 and s3 to successor instances. ${controller_opt} = BuiltIn.Set Variable - : FOR ${index} IN @{original_successor_list} - \ ${controller_opt} = BuiltIn.Catenate ${controller_opt} ${SPACE}tcp:${ODL_SYSTEM_${index}_IP}:${ODL_OF_PORT} - \ Log ${controller_opt} + FOR ${index} IN @{original_successor_list} + ${controller_opt} = BuiltIn.Catenate ${controller_opt} ${SPACE}tcp:${ODL_SYSTEM_${index}_IP}:${ODL_OF_PORT} + Log ${controller_opt} + END OVSDB.Set Controller In OVS Bridge ${TOOLS_SYSTEM_IP} s2 ${controller_opt} OVSDB.Set Controller In OVS Bridge ${TOOLS_SYSTEM_IP} s3 ${controller_opt} BuiltIn.Wait Until Keyword Succeeds 10s 1s OVSDB.Check OVS OpenFlow Connections ${TOOLS_SYSTEM_IP} 7 diff --git a/csit/suites/openflowplugin/Clustering/020__Cluster_HA_Owner_Restart.robot b/csit/suites/openflowplugin/Clustering/020__Cluster_HA_Owner_Restart.robot index 820b2a8b51..e2602263c1 100644 --- a/csit/suites/openflowplugin/Clustering/020__Cluster_HA_Owner_Restart.robot +++ b/csit/suites/openflowplugin/Clustering/020__Cluster_HA_Owner_Restart.robot @@ -31,9 +31,10 @@ Check Entity Owner Status And Find Owner and Successor Before Stop Reconnect Extra Switches To Successors And Check OVS Connections [Documentation] Connect switches s2 and s3 to successor instances. ${controller_opt} = BuiltIn.Set Variable - : FOR ${index} IN @{original_successor_list} - \ ${controller_opt} = BuiltIn.Catenate ${controller_opt} ${SPACE}tcp:${ODL_SYSTEM_${index}_IP}:${ODL_OF_PORT} - \ Log ${controller_opt} + FOR ${index} IN @{original_successor_list} + ${controller_opt} = BuiltIn.Catenate ${controller_opt} ${SPACE}tcp:${ODL_SYSTEM_${index}_IP}:${ODL_OF_PORT} + Log ${controller_opt} + END OVSDB.Set Controller In OVS Bridge ${TOOLS_SYSTEM_IP} s2 ${controller_opt} OVSDB.Set Controller In OVS Bridge ${TOOLS_SYSTEM_IP} s3 ${controller_opt} BuiltIn.Wait Until Keyword Succeeds 10s 1s OVSDB.Check OVS OpenFlow Connections ${TOOLS_SYSTEM_IP} 7 diff --git a/csit/suites/openflowplugin/Clustering_Bulkomatic/040__Cluster_Current_Term_Verification_3Node_Cluster.robot b/csit/suites/openflowplugin/Clustering_Bulkomatic/040__Cluster_Current_Term_Verification_3Node_Cluster.robot index f0bf8f0bc2..41a2778529 100644 --- a/csit/suites/openflowplugin/Clustering_Bulkomatic/040__Cluster_Current_Term_Verification_3Node_Cluster.robot +++ b/csit/suites/openflowplugin/Clustering_Bulkomatic/040__Cluster_Current_Term_Verification_3Node_Cluster.robot @@ -62,12 +62,13 @@ Current Term Comparison Before And After Addition Of Flow Delete and Add ten percent of the flows for 5 iterations [Documentation] Performeing 5 iterations for Delete and Add ten Percentage of the flows - : FOR ${index} IN RANGE 1 6 - \ Log ${index} - \ BulkomaticKeywords.Delete Bulk Flow In Node ${temp_json_config_del_ten_percent} ${Follower_Node_1} ${operation_timeout} - \ BulkomaticKeywords.Get Bulk Flow And Verify Count In Cluster ${temp_json_config_get} ${operation_timeout} ${flow_count_after_del_ten_percent} ${Inventory_Leader_List} - \ BulkomaticKeywords.Add Bulk Flow In Node ${temp_json_config_add_ten_percent} ${Follower_Node_1} ${operation_timeout} - \ BulkomaticKeywords.Get Bulk Flow And Verify Count In Cluster ${temp_json_config_get} ${operation_timeout} ${flow_count_after_add} ${Inventory_Leader_List} + FOR ${index} IN RANGE 1 6 + Log ${index} + BulkomaticKeywords.Delete Bulk Flow In Node ${temp_json_config_del_ten_percent} ${Follower_Node_1} ${operation_timeout} + BulkomaticKeywords.Get Bulk Flow And Verify Count In Cluster ${temp_json_config_get} ${operation_timeout} ${flow_count_after_del_ten_percent} ${Inventory_Leader_List} + BulkomaticKeywords.Add Bulk Flow In Node ${temp_json_config_add_ten_percent} ${Follower_Node_1} ${operation_timeout} + BulkomaticKeywords.Get Bulk Flow And Verify Count In Cluster ${temp_json_config_get} ${operation_timeout} ${flow_count_after_add} ${Inventory_Leader_List} + END Current Term Verification After Continuous Deletion and Addition Of Flows for 5 iterations [Documentation] Verifying current term for Leader Node after continuous deletion and addition of ten percent of the flows diff --git a/csit/suites/openflowplugin/EntityOwnership/010_Switch_Disconnect.robot b/csit/suites/openflowplugin/EntityOwnership/010_Switch_Disconnect.robot index 9c24afe6e3..806569d3f6 100644 --- a/csit/suites/openflowplugin/EntityOwnership/010_Switch_Disconnect.robot +++ b/csit/suites/openflowplugin/EntityOwnership/010_Switch_Disconnect.robot @@ -46,9 +46,10 @@ Start Suite SSHLibrary.Read Until mininet> ${cntls_list} BuiltIn.Create List ${ODL_SYSTEM_1_IP} ${ODL_SYSTEM_2_IP} ${ODL_SYSTEM_3_IP} ${switch_list} BuiltIn.Create List - : FOR ${i} IN RANGE 0 ${SWITCHES} - \ ${sid}= BuiltIn.Evaluate ${i}+1 - \ Collections.Append To List ${switch_list} s${sid} + FOR ${i} IN RANGE 0 ${SWITCHES} + ${sid}= BuiltIn.Evaluate ${i}+1 + Collections.Append To List ${switch_list} s${sid} + END BuiltIn.Set Suite Variable ${active_member} 1 OvsManager.Setup Clustered Controller For Switches ${switch_list} ${cntls_list} BuiltIn.Wait Until Keyword Succeeds 10s 1s ClusterOpenFlow.Verify Switch Connections Running On Member ${SWITCHES} 1 @@ -60,11 +61,12 @@ End Suite Check All Switches Connected To All Cluster Nodes [Documentation] Verifies all switches are connected to all cluster nodes OvsManager.Get Ovsdb Data - : FOR ${i} IN RANGE 0 ${SWITCHES} - \ ${sid}= BuiltIn.Evaluate ${i}+1 - \ OvsManager.Should Be Connected s${sid} ${ODL_SYSTEM_1_IP} update_data=${False} - \ OvsManager.Should Be Connected s${sid} ${ODL_SYSTEM_2_IP} update_data=${False} - \ OvsManager.Should Be Connected s${sid} ${ODL_SYSTEM_3_IP} update_data=${False} + FOR ${i} IN RANGE 0 ${SWITCHES} + ${sid}= BuiltIn.Evaluate ${i}+1 + OvsManager.Should Be Connected s${sid} ${ODL_SYSTEM_1_IP} update_data=${False} + OvsManager.Should Be Connected s${sid} ${ODL_SYSTEM_2_IP} update_data=${False} + OvsManager.Should Be Connected s${sid} ${ODL_SYSTEM_3_IP} update_data=${False} + END Reconnecting Switch Scenario [Arguments] ${switch_name} diff --git a/csit/suites/openflowplugin/EntityOwnership/020_Cluster_Node_Failure.robot b/csit/suites/openflowplugin/EntityOwnership/020_Cluster_Node_Failure.robot index e5c460211e..a841f29f6a 100644 --- a/csit/suites/openflowplugin/EntityOwnership/020_Cluster_Node_Failure.robot +++ b/csit/suites/openflowplugin/EntityOwnership/020_Cluster_Node_Failure.robot @@ -46,9 +46,10 @@ Start Suite SSHLibrary.Read Until mininet> ${cntls_list} BuiltIn.Create List ${ODL_SYSTEM_1_IP} ${ODL_SYSTEM_2_IP} ${ODL_SYSTEM_3_IP} ${switch_list} BuiltIn.Create List - : FOR ${i} IN RANGE 0 ${SWITCHES} - \ ${sid}= BuiltIn.Evaluate ${i}+1 - \ Collections.Append To List ${switch_list} s${sid} + FOR ${i} IN RANGE 0 ${SWITCHES} + ${sid}= BuiltIn.Evaluate ${i}+1 + Collections.Append To List ${switch_list} s${sid} + END BuiltIn.Set Suite Variable ${active_member} 1 OvsManager.Setup Clustered Controller For Switches ${switch_list} ${cntls_list} BuiltIn.Wait Until Keyword Succeeds 10s 1s ClusterOpenFlow.Verify Switch Connections Running On Member ${SWITCHES} 1 @@ -60,11 +61,12 @@ End Suite Check All Switches Connected To All Cluster Nodes [Documentation] Verifies all switches are connected to all cluster nodes OvsManager.Get Ovsdb Data - : FOR ${i} IN RANGE 0 ${SWITCHES} - \ ${sid}= BuiltIn.Evaluate ${i}+1 - \ OvsManager.Should Be Connected s${sid} ${ODL_SYSTEM_1_IP} update_data=${False} - \ OvsManager.Should Be Connected s${sid} ${ODL_SYSTEM_2_IP} update_data=${False} - \ OvsManager.Should Be Connected s${sid} ${ODL_SYSTEM_3_IP} update_data=${False} + FOR ${i} IN RANGE 0 ${SWITCHES} + ${sid}= BuiltIn.Evaluate ${i}+1 + OvsManager.Should Be Connected s${sid} ${ODL_SYSTEM_1_IP} update_data=${False} + OvsManager.Should Be Connected s${sid} ${ODL_SYSTEM_2_IP} update_data=${False} + OvsManager.Should Be Connected s${sid} ${ODL_SYSTEM_3_IP} update_data=${False} + END Restarting Karaf Scenario [Arguments] ${switch_name} diff --git a/csit/suites/openflowplugin/EntityOwnership/030_Cluster_Sync_Problems.robot b/csit/suites/openflowplugin/EntityOwnership/030_Cluster_Sync_Problems.robot index 0688791d4f..f2c6ffbe68 100644 --- a/csit/suites/openflowplugin/EntityOwnership/030_Cluster_Sync_Problems.robot +++ b/csit/suites/openflowplugin/EntityOwnership/030_Cluster_Sync_Problems.robot @@ -34,9 +34,10 @@ Start Mininet To All Nodes SSHLibrary.Read Until mininet> ${cntls_list} BuiltIn.Create List ${ODL_SYSTEM_1_IP} ${ODL_SYSTEM_2_IP} ${ODL_SYSTEM_3_IP} ${switch_list} BuiltIn.Create List - : FOR ${i} IN RANGE 0 ${SWITCHES} - \ ${sid}= BuiltIn.Evaluate ${i}+1 - \ Collections.Append To List ${switch_list} s${sid} + FOR ${i} IN RANGE 0 ${SWITCHES} + ${sid}= BuiltIn.Evaluate ${i}+1 + Collections.Append To List ${switch_list} s${sid} + END BuiltIn.Set Suite Variable ${active_member} 1 OvsManager.Setup Clustered Controller For Switches ${switch_list} ${cntls_list} BuiltIn.Wait Until Keyword Succeeds 15s 1s ClusterOpenFlow.Verify Switch Connections Running On Member ${SWITCHES} 1 @@ -72,11 +73,12 @@ End Suite Check All Switches Connected To All Cluster Nodes [Documentation] Verifies all switches are connected to all cluster nodes OvsManager.Get Ovsdb Data - : FOR ${i} IN RANGE 0 ${SWITCHES} - \ ${sid}= BuiltIn.Evaluate ${i}+1 - \ OvsManager.Should Be Connected s${sid} ${ODL_SYSTEM_1_IP} update_data=${False} - \ OvsManager.Should Be Connected s${sid} ${ODL_SYSTEM_2_IP} update_data=${False} - \ OvsManager.Should Be Connected s${sid} ${ODL_SYSTEM_3_IP} update_data=${False} + FOR ${i} IN RANGE 0 ${SWITCHES} + ${sid}= BuiltIn.Evaluate ${i}+1 + OvsManager.Should Be Connected s${sid} ${ODL_SYSTEM_1_IP} update_data=${False} + OvsManager.Should Be Connected s${sid} ${ODL_SYSTEM_2_IP} update_data=${False} + OvsManager.Should Be Connected s${sid} ${ODL_SYSTEM_3_IP} update_data=${False} + END Isolating Node Scenario [Arguments] ${switch_name} diff --git a/csit/suites/openflowplugin/Flows_Additional_TCs/Stat_Manager_extended/010_SM_add_upd_del_flows.robot b/csit/suites/openflowplugin/Flows_Additional_TCs/Stat_Manager_extended/010_SM_add_upd_del_flows.robot index 71e3169ebe..3dcdc6ad5b 100644 --- a/csit/suites/openflowplugin/Flows_Additional_TCs/Stat_Manager_extended/010_SM_add_upd_del_flows.robot +++ b/csit/suites/openflowplugin/Flows_Additional_TCs/Stat_Manager_extended/010_SM_add_upd_del_flows.robot @@ -33,11 +33,12 @@ ${switch_name} s${switch_idx} Test Add Flows Group 0 [Documentation] Add all flows and waits for SM to collect data [Template] NONE - : FOR ${flowfile} IN @{flowlist0} - \ Log ${flowfile} - \ Create Flow Variables For Suite From XML File ${XmlsDir}/${flowfile} - \ Run Keyword And Continue On Failure Add Flow Via Restconf ${switch_idx} ${table_id} ${data} - # Lets wait for ofp to collect stats + FOR ${flowfile} IN @{flowlist0} + Log ${flowfile} + Create Flow Variables For Suite From XML File ${XmlsDir}/${flowfile} + Run Keyword And Continue On Failure Add Flow Via Restconf ${switch_idx} ${table_id} ${data} + # Lets wait for ofp to collect stats + END ${flows}= Get Length ${flowlist0} Wait Until Keyword Succeeds 30s 2s FlowLib.Check Flow Stats Are Available openflow:1 ${flows} # Show switch content (for debug purposes if needed) @@ -218,11 +219,12 @@ Test Is Flow 550 Added Test Update Flows Group 0 [Documentation] Update all flows and waits for SM to collect data [Template] NONE - : FOR ${flowfile} IN @{flowlist0} - \ Log ${flowfile} - \ Create Flow Variables For Suite From XML File ${XmlsDir}/${flowfile} - \ Run Keyword And Continue On Failure Update Flow Via Restconf ${switch_idx} ${table_id} ${flow_id} ${upddata} - # Lets wait for ofp to collect stats + FOR ${flowfile} IN @{flowlist0} + Log ${flowfile} + Create Flow Variables For Suite From XML File ${XmlsDir}/${flowfile} + Run Keyword And Continue On Failure Update Flow Via Restconf ${switch_idx} ${table_id} ${flow_id} ${upddata} + # Lets wait for ofp to collect stats + END Sleep ${flow_update_time} # Show switch content (for debug purposes if needed) Write dpctl dump-flows -O OpenFlow13 @@ -402,11 +404,12 @@ Test Is Flow 550 Updated Test Delete Flows Group 0 [Documentation] Delete all flows and waits for SM to collect data [Template] NONE - : FOR ${flowfile} IN @{flowlist0} - \ Log ${flowfile} - \ Create Flow Variables For Suite From XML File ${XmlsDir}/${flowfile} - \ Run Keyword And Continue On Failure Delete Flow Via Restconf ${switch_idx} ${table_id} ${flow_id} - # Lets wait for ofp to collect stats + FOR ${flowfile} IN @{flowlist0} + Log ${flowfile} + Create Flow Variables For Suite From XML File ${XmlsDir}/${flowfile} + Run Keyword And Continue On Failure Delete Flow Via Restconf ${switch_idx} ${table_id} ${flow_id} + # Lets wait for ofp to collect stats + END Sleep ${flow_update_time} # Show switch content (for debug purposes if needed) Write dpctl dump-flows -O OpenFlow13 diff --git a/csit/suites/openflowplugin/Flows_Additional_TCs/Stat_Manager_extended/020_SM_sal_add_upd_del_flows.robot b/csit/suites/openflowplugin/Flows_Additional_TCs/Stat_Manager_extended/020_SM_sal_add_upd_del_flows.robot index a99cb3fa61..fc18e17222 100644 --- a/csit/suites/openflowplugin/Flows_Additional_TCs/Stat_Manager_extended/020_SM_sal_add_upd_del_flows.robot +++ b/csit/suites/openflowplugin/Flows_Additional_TCs/Stat_Manager_extended/020_SM_sal_add_upd_del_flows.robot @@ -32,11 +32,12 @@ ${switch_name} s${switch_idx} Test Add Flows Group 0 [Documentation] Add all flows and waits for SM to collect data [Template] NONE - : FOR ${flowfile} IN @{flowlist0} - \ Log ${flowfile} - \ Create Flow Variables For Suite From XML File ${XmlsDir}/${flowfile} - \ Run Keyword And Continue On Failure Add Flow Via RPC ${switch_idx} ${xmlroot} - # Lets wait for ofp to collect stats + FOR ${flowfile} IN @{flowlist0} + Log ${flowfile} + Create Flow Variables For Suite From XML File ${XmlsDir}/${flowfile} + Run Keyword And Continue On Failure Add Flow Via RPC ${switch_idx} ${xmlroot} + # Lets wait for ofp to collect stats + END ${flows}= Get Length ${flowlist0} Wait Until Keyword Succeeds 30s 2s FlowLib.Check Flow Stats Are Available openflow:1 ${flows} # Show switch content (for debug purposes if needed) @@ -193,11 +194,12 @@ Test Is Flow 220 Added Test Update Flows Group 0 [Documentation] Update all flows and waits for SM to collect data [Template] NONE - : FOR ${flowfile} IN @{flowlist0} - \ Log ${flowfile} - \ Create Flow Variables For Suite From XML File ${XmlsDir}/${flowfile} - \ Run Keyword And Continue On Failure Update Flow Via RPC ${switch_idx} ${data} ${upddata} - # Lets wait for ofp to collect stats + FOR ${flowfile} IN @{flowlist0} + Log ${flowfile} + Create Flow Variables For Suite From XML File ${XmlsDir}/${flowfile} + Run Keyword And Continue On Failure Update Flow Via RPC ${switch_idx} ${data} ${upddata} + # Lets wait for ofp to collect stats + END Sleep ${flow_update_time} # Show switch content (for debug purposes if needed) Write dpctl dump-flows -O OpenFlow13 @@ -356,11 +358,12 @@ Test Is Flow 220 Updated Test Delete Flows Group 0 [Documentation] Delete all flows and waits for SM to collect data [Template] NONE - : FOR ${flowfile} IN @{flowlist0} - \ Log ${flowfile} - \ Create Flow Variables For Suite From XML File ${XmlsDir}/${flowfile} - \ Run Keyword And Continue On Failure Delete Flow Via RPC ${switch_idx} ${xmlroot} - # Lets wait for ofp to collect stats + FOR ${flowfile} IN @{flowlist0} + Log ${flowfile} + Create Flow Variables For Suite From XML File ${XmlsDir}/${flowfile} + Run Keyword And Continue On Failure Delete Flow Via RPC ${switch_idx} ${xmlroot} + # Lets wait for ofp to collect stats + END Sleep ${flow_update_time} # Show switch content (for debug purposes if needed) Write dpctl dump-flows -O OpenFlow13 diff --git a/csit/suites/openflowplugin/Flows_Stats_OF13/010__SM_add_upd_del_flows.robot b/csit/suites/openflowplugin/Flows_Stats_OF13/010__SM_add_upd_del_flows.robot index 1303005a4e..0569e32435 100644 --- a/csit/suites/openflowplugin/Flows_Stats_OF13/010__SM_add_upd_del_flows.robot +++ b/csit/suites/openflowplugin/Flows_Stats_OF13/010__SM_add_upd_del_flows.robot @@ -20,10 +20,11 @@ ${switch_name} s${switch_idx} *** Test Cases *** Test Add Flows [Documentation] Add all flows and waits for SM to collect data - : FOR ${flowfile} IN @{xml_files} - \ Log ${flowfile} - \ Init Flow Variables ${flowfile} - \ Run Keyword And Continue On Failure Add Flow + FOR ${flowfile} IN @{xml_files} + Log ${flowfile} + Init Flow Variables ${flowfile} + Run Keyword And Continue On Failure Add Flow + END Test Is Flow 1 Added [Documentation] Checks if flow is configured and operational @@ -105,10 +106,11 @@ Test Is Flow 24 Added Test Delete Flows [Documentation] Delete all flows and waits for SM to collect data - : FOR ${flowfile} IN @{xml_files} - \ Log ${flowfile} - \ Init Flow Variables ${flowfile} - \ Run Keyword And Continue On Failure Delete Flow + FOR ${flowfile} IN @{xml_files} + Log ${flowfile} + Init Flow Variables ${flowfile} + Run Keyword And Continue On Failure Delete Flow + END Test Is Flow 1 Deleted [Documentation] Checks if flow is not configured and operational @@ -255,10 +257,11 @@ Delete Flow Delete All Flows [Documentation] Deletes all flows - : FOR ${flowfile} IN @{xml_files} - \ Log ${flowfile} - \ Init Flow Variables ${flowfile} - \ Delete Flow + FOR ${flowfile} IN @{xml_files} + Log ${flowfile} + Init Flow Variables ${flowfile} + Delete Flow + END Initialization Phase [Documentation] Initiate tcp connection with controller diff --git a/csit/suites/openflowplugin/Inventory_Scalability_OF10/010__restconf_inventory.robot b/csit/suites/openflowplugin/Inventory_Scalability_OF10/010__restconf_inventory.robot index 391af75233..47ab13cea0 100644 --- a/csit/suites/openflowplugin/Inventory_Scalability_OF10/010__restconf_inventory.robot +++ b/csit/suites/openflowplugin/Inventory_Scalability_OF10/010__restconf_inventory.robot @@ -45,27 +45,31 @@ Check Every Nodes [Arguments] ${numnodes} ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT} Should Be Equal As Strings ${resp.status_code} 200 - : FOR ${IND} IN RANGE 1 ${numnodes+1} - \ Should Contain ${resp.content} openflow:${IND} + FOR ${IND} IN RANGE 1 ${numnodes+1} + Should Contain ${resp.content} openflow:${IND} + END Check Every Nodes Stats [Arguments] ${numnodes} - : FOR ${IND} IN RANGE 1 ${numnodes+1} - \ ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/node/openflow:${IND} - \ Log ${resp.content} - \ Should Be Equal As Strings ${resp.status_code} 200 - \ Should Contain ${resp.content} flow-capable-node-connector-statistics - \ Should Contain ${resp.content} flow-table-statistics + FOR ${IND} IN RANGE 1 ${numnodes+1} + ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/node/openflow:${IND} + Log ${resp.content} + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain ${resp.content} flow-capable-node-connector-statistics + Should Contain ${resp.content} flow-table-statistics + END Check Every Nodes Nodeconnector [Arguments] ${numnodes} - : FOR ${IND} IN RANGE 2 ${numnodes+1} - \ ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/node/openflow:${IND} - \ Log ${resp.content} - \ Should Be Equal As Strings ${resp.status_code} 200 - \ Check conn loop ${TOPO_TREE_FANOUT+1} ${IND} ${resp.content} + FOR ${IND} IN RANGE 2 ${numnodes+1} + ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/node/openflow:${IND} + Log ${resp.content} + Should Be Equal As Strings ${resp.status_code} 200 + Check conn loop ${TOPO_TREE_FANOUT+1} ${IND} ${resp.content} + END Check conn loop [Arguments] ${arg} ${outerind} ${content} - : FOR ${var} IN RANGE 1 ${arg+1} - \ Should Contain ${content} openflow:${outerind}:${var} + FOR ${var} IN RANGE 1 ${arg+1} + Should Contain ${content} openflow:${outerind}:${var} + END diff --git a/csit/suites/openflowplugin/Inventory_Scalability_OF13/010__restconf_inventory.robot b/csit/suites/openflowplugin/Inventory_Scalability_OF13/010__restconf_inventory.robot index 391af75233..47ab13cea0 100644 --- a/csit/suites/openflowplugin/Inventory_Scalability_OF13/010__restconf_inventory.robot +++ b/csit/suites/openflowplugin/Inventory_Scalability_OF13/010__restconf_inventory.robot @@ -45,27 +45,31 @@ Check Every Nodes [Arguments] ${numnodes} ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT} Should Be Equal As Strings ${resp.status_code} 200 - : FOR ${IND} IN RANGE 1 ${numnodes+1} - \ Should Contain ${resp.content} openflow:${IND} + FOR ${IND} IN RANGE 1 ${numnodes+1} + Should Contain ${resp.content} openflow:${IND} + END Check Every Nodes Stats [Arguments] ${numnodes} - : FOR ${IND} IN RANGE 1 ${numnodes+1} - \ ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/node/openflow:${IND} - \ Log ${resp.content} - \ Should Be Equal As Strings ${resp.status_code} 200 - \ Should Contain ${resp.content} flow-capable-node-connector-statistics - \ Should Contain ${resp.content} flow-table-statistics + FOR ${IND} IN RANGE 1 ${numnodes+1} + ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/node/openflow:${IND} + Log ${resp.content} + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain ${resp.content} flow-capable-node-connector-statistics + Should Contain ${resp.content} flow-table-statistics + END Check Every Nodes Nodeconnector [Arguments] ${numnodes} - : FOR ${IND} IN RANGE 2 ${numnodes+1} - \ ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/node/openflow:${IND} - \ Log ${resp.content} - \ Should Be Equal As Strings ${resp.status_code} 200 - \ Check conn loop ${TOPO_TREE_FANOUT+1} ${IND} ${resp.content} + FOR ${IND} IN RANGE 2 ${numnodes+1} + ${resp} RequestsLibrary.Get Request session ${REST_CONTEXT}/node/openflow:${IND} + Log ${resp.content} + Should Be Equal As Strings ${resp.status_code} 200 + Check conn loop ${TOPO_TREE_FANOUT+1} ${IND} ${resp.content} + END Check conn loop [Arguments] ${arg} ${outerind} ${content} - : FOR ${var} IN RANGE 1 ${arg+1} - \ Should Contain ${content} openflow:${outerind}:${var} + FOR ${var} IN RANGE 1 ${arg+1} + Should Contain ${content} openflow:${outerind}:${var} + END diff --git a/csit/suites/openflowplugin/Longevity/010__longevity_test.robot b/csit/suites/openflowplugin/Longevity/010__longevity_test.robot index 631eecc7e7..4955b353c2 100644 --- a/csit/suites/openflowplugin/Longevity/010__longevity_test.robot +++ b/csit/suites/openflowplugin/Longevity/010__longevity_test.robot @@ -24,12 +24,13 @@ Longevity Test ${max_duration}= DateTime.Convert Time ${TEST_LENGTH} number ${start_time}= DateTime.Get Current Date # This loop is not infinite, so going "sufficiently large" for now. - : FOR ${i} IN RANGE 1 65536 - \ ${status} ${error_message} ${topology_discover_time} WorkflowsOpenFlow.Workflow Full Mesh Topology ${switches} ${SUSTAIN_TIME} - \ ${current_time}= DateTime.Get Current Date - \ ${duration}= DateTime.Subtract Date From Date ${current_time} ${start_time} number - \ Exit For Loop If '${status}' == 'FAIL' - \ Exit For Loop If ${duration} > ${max_duration} + FOR ${i} IN RANGE 1 65536 + ${status} ${error_message} ${topology_discover_time} WorkflowsOpenFlow.Workflow Full Mesh Topology ${switches} ${SUSTAIN_TIME} + ${current_time}= DateTime.Get Current Date + ${duration}= DateTime.Subtract Date From Date ${current_time} ${start_time} number + Exit For Loop If '${status}' == 'FAIL' + Exit For Loop If ${duration} > ${max_duration} + END ${duration_compact}= DateTime.Convert Time ${duration} compact Log to console ${\n} Log To Console Execution stopped because: ${error_message} diff --git a/csit/suites/openflowplugin/Maximum_Links/010__finding_max_links.robot b/csit/suites/openflowplugin/Maximum_Links/010__finding_max_links.robot index 13df49e876..8eae612c18 100644 --- a/csit/suites/openflowplugin/Maximum_Links/010__finding_max_links.robot +++ b/csit/suites/openflowplugin/Maximum_Links/010__finding_max_links.robot @@ -19,11 +19,12 @@ Find Max Links ${error_message}= Set Variable Fail initializing suite ${maximum_links}= Set Variable ${0} ${discover_time}= Set Variable 0 - : FOR ${switches} IN @{SWITCH_LIST} - \ ${status} ${error_message} ${topology_discover_time} WorkflowsOpenFlow.Workflow Full Mesh Topology ${switches} - \ Exit For Loop If '${status}' == 'FAIL' - \ ${maximum_links}= Evaluate ${switches} * ${switches-1} - \ ${discover_time}= Set Variable ${topology_discover_time} + FOR ${switches} IN @{SWITCH_LIST} + ${status} ${error_message} ${topology_discover_time} WorkflowsOpenFlow.Workflow Full Mesh Topology ${switches} + Exit For Loop If '${status}' == 'FAIL' + ${maximum_links}= Evaluate ${switches} * ${switches-1} + ${discover_time}= Set Variable ${topology_discover_time} + END Log to console ${\n} Log To Console Execution stopped because: ${error_message} Log To Console Max Links: ${maximum_links} diff --git a/csit/suites/openflowplugin/Maximum_Switches/010__finding_max_switches.robot b/csit/suites/openflowplugin/Maximum_Switches/010__finding_max_switches.robot index 8b01bcf073..74ee2ebf50 100644 --- a/csit/suites/openflowplugin/Maximum_Switches/010__finding_max_switches.robot +++ b/csit/suites/openflowplugin/Maximum_Switches/010__finding_max_switches.robot @@ -23,11 +23,12 @@ Find Max Switches ${start}= Convert to Integer ${MIN_SWITCHES} ${stop}= Convert to Integer ${MAX_SWITCHES} ${step}= Convert to Integer ${STEP_SWITCHES} - : FOR ${switches} IN RANGE ${start} ${stop+1} ${step} - \ ${status} ${error_message} ${topology_discover_time} WorkflowsOpenFlow.Workflow Linear Topology ${switches} - \ Exit For Loop If '${status}' == 'FAIL' - \ ${maximum_switches}= Set variable ${switches} - \ ${discover_time}= Set Variable ${topology_discover_time} + FOR ${switches} IN RANGE ${start} ${stop+1} ${step} + ${status} ${error_message} ${topology_discover_time} WorkflowsOpenFlow.Workflow Linear Topology ${switches} + Exit For Loop If '${status}' == 'FAIL' + ${maximum_switches}= Set variable ${switches} + ${discover_time}= Set Variable ${topology_discover_time} + END Log to console ${\n} Log To Console Execution stopped because: ${error_message} Log To Console Max Switches: ${maximum_switches} diff --git a/csit/suites/openflowplugin/Maximum_Switches/020__find_max_switches.robot b/csit/suites/openflowplugin/Maximum_Switches/020__find_max_switches.robot index b2adbc7759..cd1e8e7fb4 100644 --- a/csit/suites/openflowplugin/Maximum_Switches/020__find_max_switches.robot +++ b/csit/suites/openflowplugin/Maximum_Switches/020__find_max_switches.robot @@ -22,11 +22,12 @@ Find Max Switches ${init_sw} Convert to Integer ${init_sw} ${max_sw} Convert to Integer ${max_sw} ${step_sw} Convert to Integer ${step_sw} - : FOR ${exp_sw} IN RANGE ${init_sw} ${max_sw+1} ${step_sw} - \ BuiltIn.Wait Until Keyword Succeeds 120s 1s Verify Switches Connected ${exp_sw} - \ ${max_found}= Set Variable ${exp_sw} - \ Set Suite variable ${max_found} - \ Add Switches 10 + FOR ${exp_sw} IN RANGE ${init_sw} ${max_sw+1} ${step_sw} + BuiltIn.Wait Until Keyword Succeeds 120s 1s Verify Switches Connected ${exp_sw} + ${max_found}= Set Variable ${exp_sw} + Set Suite variable ${max_found} + Add Switches 10 + END [Teardown] Log Store Max Found *** Keywords *** diff --git a/csit/suites/openflowplugin/Performance/010_Cbench.robot b/csit/suites/openflowplugin/Performance/010_Cbench.robot index 8b554136cb..2113232748 100644 --- a/csit/suites/openflowplugin/Performance/010_Cbench.robot +++ b/csit/suites/openflowplugin/Performance/010_Cbench.robot @@ -78,8 +78,9 @@ Run Cbench And Log Results @{result_name_list}= Split String ${results_list[5]} / @{result_value_list}= Split String ${results_list[7]} / ${num_stats}= Get Length ${result_name_list} - : FOR ${i} IN RANGE 0 ${num_stats} - \ Log ${result_name_list[${i}]} :: ${result_value_list[${i}]} + FOR ${i} IN RANGE 0 ${num_stats} + Log ${result_name_list[${i}]} :: ${result_value_list[${i}]} + END ${min}= Set Variable ${result_value_list[${0}]} ${max}= Set Variable ${result_value_list[${1}]} ${average}= Set Variable ${result_value_list[${2}]} diff --git a/csit/suites/openflowplugin/Reconciliation/010_Group_Flows.robot b/csit/suites/openflowplugin/Reconciliation/010_Group_Flows.robot index 33cb93ede2..772f4a8a71 100644 --- a/csit/suites/openflowplugin/Reconciliation/010_Group_Flows.robot +++ b/csit/suites/openflowplugin/Reconciliation/010_Group_Flows.robot @@ -18,18 +18,21 @@ ${VAR_DIR} ${CURDIR}/../../../variables/openflowplugin *** Test Cases *** Add Group 1 In Every Switch [Documentation] Add ${ITER} groups of type 1 in every switch. - : FOR ${switch} IN RANGE 1 ${switches+1} - \ TemplatedRequests.Post As Json Templated folder=${VAR_DIR}/add-group-1 mapping={"SWITCH":"${switch}"} session=session iterations=${iter} + FOR ${switch} IN RANGE 1 ${switches+1} + TemplatedRequests.Post As Json Templated folder=${VAR_DIR}/add-group-1 mapping={"SWITCH":"${switch}"} session=session iterations=${iter} + END Add Group 2 In Every Switch [Documentation] Add ${ITER} groups of type 2 in every switch. - : FOR ${switch} IN RANGE 1 ${switches+1} - \ TemplatedRequests.Post As Json Templated folder=${VAR_DIR}/add-group-2 mapping={"SWITCH":"${switch}"} session=session iterations=${iter} + FOR ${switch} IN RANGE 1 ${switches+1} + TemplatedRequests.Post As Json Templated folder=${VAR_DIR}/add-group-2 mapping={"SWITCH":"${switch}"} session=session iterations=${iter} + END Add Flow to Group 2 In Every Switch [Documentation] Add ${ITER} flows to group type 2 in every switch. - : FOR ${switch} IN RANGE 1 ${switches+1} - \ TemplatedRequests.Post As Json Templated folder=${VAR_DIR}/add-flow mapping={"SWITCH":"${switch}"} session=session iterations=${ITER} + FOR ${switch} IN RANGE 1 ${switches+1} + TemplatedRequests.Post As Json Templated folder=${VAR_DIR}/add-flow mapping={"SWITCH":"${switch}"} session=session iterations=${ITER} + END Start Mininet Linear [Documentation] Start Mininet Linear with ${SWITCHES} switches. @@ -69,10 +72,11 @@ Check Linear Topology After Mininet Reconnects Remove Flows And Groups After Mininet Reconnects [Documentation] Remove some groups and flows while network is down. - : FOR ${switch} IN RANGE 1 ${switches+1} - \ RequestsLibrary.Delete Request session ${CONFIG_NODES_API}/node/openflow:${switch}/table/0/flow/1 - \ RequestsLibrary.Delete Request session ${CONFIG_NODES_API}/node/openflow:${switch}/group/1 - \ RequestsLibrary.Delete Request session ${CONFIG_NODES_API}/node/openflow:${switch}/group/1000 + FOR ${switch} IN RANGE 1 ${switches+1} + RequestsLibrary.Delete Request session ${CONFIG_NODES_API}/node/openflow:${switch}/table/0/flow/1 + RequestsLibrary.Delete Request session ${CONFIG_NODES_API}/node/openflow:${switch}/group/1 + RequestsLibrary.Delete Request session ${CONFIG_NODES_API}/node/openflow:${switch}/group/1000 + END Check Flows In Operational DS After Mininet Reconnects [Documentation] Check Flows after mininet starts. diff --git a/csit/suites/openstack/clustering/ha_l2.robot b/csit/suites/openstack/clustering/ha_l2.robot index fd3456c4ac..7f4a91bf40 100644 --- a/csit/suites/openstack/clustering/ha_l2.robot +++ b/csit/suites/openstack/clustering/ha_l2.robot @@ -220,13 +220,15 @@ No Ping For Deleted Vm Delete Vm Instances In net_1 [Documentation] Delete Vm instances using instance names in network_1. - : FOR ${vm} IN @{NET_1_VMS} - \ OpenStackOperations.Delete Vm Instance ${vm} + FOR ${vm} IN @{NET_1_VMS} + OpenStackOperations.Delete Vm Instance ${vm} + END Delete Vm Instances In net_2 [Documentation] Delete Vm instances using instance names in network_2. - : FOR ${vm} IN @{NET_2_VMS} - \ OpenStackOperations.Delete Vm Instance ${vm} + FOR ${vm} IN @{NET_2_VMS} + OpenStackOperations.Delete Vm Instance ${vm} + END Delete Sub Networks In net_1 [Documentation] Delete Sub Nets for the Networks with neutron request. @@ -238,8 +240,9 @@ Delete Sub Networks In net_2 Delete Networks [Documentation] Delete Networks with neutron request. - : FOR ${network} IN @{NETWORKS} - \ OpenStackOperations.Delete Network ${network} + FOR ${network} IN @{NETWORKS} + OpenStackOperations.Delete Network ${network} + END Delete Security Group [Documentation] Delete security groups with neutron request diff --git a/csit/suites/openstack/clustering/ha_l3.robot b/csit/suites/openstack/clustering/ha_l3.robot index 6f3229f592..9b810bb705 100644 --- a/csit/suites/openstack/clustering/ha_l3.robot +++ b/csit/suites/openstack/clustering/ha_l3.robot @@ -44,8 +44,9 @@ Take Down Leader Of Default Shard Create Networks [Documentation] Create Network with neutron request. - : FOR ${NetworkElement} IN @{NETWORKS} - \ OpenStackOperations.Create Network ${NetworkElement} + FOR ${NetworkElement} IN @{NETWORKS} + OpenStackOperations.Create Network ${NetworkElement} + END Create Subnets For net_1 [Documentation] Create Sub Nets for the Networks with neutron request. @@ -118,8 +119,9 @@ Create Router router_3 Add Interfaces To Router [Documentation] Add Interfaces - : FOR ${interface} IN @{SUBNETS} - \ OpenStackOperations.Add Router Interface @{ROUTERS}[2] ${interface} + FOR ${interface} IN @{SUBNETS} + OpenStackOperations.Add Router Interface @{ROUTERS}[2] ${interface} + END Verify Created Routers [Documentation] Check created routers using northbound rest calls @@ -264,18 +266,21 @@ Connectivity Tests From Vm Instance3 In net_2 after recovering all nodes Delete Vm Instances In net_1 [Documentation] Delete Vm instances using instance names in net_1. - : FOR ${vm} IN @{NET_1_VMS} - \ OpenStackOperations.Delete Vm Instance ${vm} + FOR ${vm} IN @{NET_1_VMS} + OpenStackOperations.Delete Vm Instance ${vm} + END Delete Vm Instances In net_2 [Documentation] Delete Vm instances using instance names in net_2. - : FOR ${vm} IN @{NET_2_VMS} - \ OpenStackOperations.Delete Vm Instance ${vm} + FOR ${vm} IN @{NET_2_VMS} + OpenStackOperations.Delete Vm Instance ${vm} + END Delete Router Interfaces [Documentation] Remove Interface to the subnets. - : FOR ${interface} IN @{SUBNETS} - \ OpenStackOperations.Remove Interface @{ROUTERS}[2] ${interface} + FOR ${interface} IN @{SUBNETS} + OpenStackOperations.Remove Interface @{ROUTERS}[2] ${interface} + END Delete Routers [Documentation] Delete Router and Interface to the subnets. @@ -298,8 +303,9 @@ Delete Sub Network In net_2 Delete Networks [Documentation] Delete Networks with neutron request. - : FOR ${network} IN @{NETWORKS} - \ OpenStackOperations.Delete Network ${network} + FOR ${network} IN @{NETWORKS} + OpenStackOperations.Delete Network ${network} + END Delete Security Group [Documentation] Delete security groups with neutron request diff --git a/csit/suites/openstack/clustering/ha_l3_block_port.robot b/csit/suites/openstack/clustering/ha_l3_block_port.robot index 283e02b537..07c6a8fc64 100644 --- a/csit/suites/openstack/clustering/ha_l3_block_port.robot +++ b/csit/suites/openstack/clustering/ha_l3_block_port.robot @@ -34,8 +34,9 @@ Create All Controller Sessions Create Networks [Documentation] Create Network with neutron request. - : FOR ${network} IN @{NETWORKS} - \ OpenStackOperations.Create Network ${network} + FOR ${network} IN @{NETWORKS} + OpenStackOperations.Create Network ${network} + END Create Subnets For net_1 [Documentation] Create Sub Nets for the Networks with neutron request. @@ -104,8 +105,9 @@ Create Router router_3 Add Interfaces To Router [Documentation] Add Interfaces - : FOR ${interface} IN @{SUBNETS} - \ OpenStackOperations.Add Router Interface @{ROUTERS}[2] ${interface} + FOR ${interface} IN @{SUBNETS} + OpenStackOperations.Add Router Interface @{ROUTERS}[2] ${interface} + END Verify Created Routers [Documentation] Check created routers using northbound rest calls @@ -215,18 +217,21 @@ Allow Port On ODL3 Again Delete Vm Instances In net_1 [Documentation] Delete Vm instances using instance names in net_1. - : FOR ${vm} IN @{NET_1_VMS} - \ OpenStackOperations.Delete Vm Instance ${vm} + FOR ${vm} IN @{NET_1_VMS} + OpenStackOperations.Delete Vm Instance ${vm} + END Delete Vm Instances In net_2 [Documentation] Delete Vm instances using instance names in net_2. - : FOR ${vm} IN @{NET_2_VMS} - \ OpenStackOperations.Delete Vm Instance ${vm} + FOR ${vm} IN @{NET_2_VMS} + OpenStackOperations.Delete Vm Instance ${vm} + END Delete Router Interfaces [Documentation] Remove Interface to the subnets. - : FOR ${interface} IN @{SUBNETS} - \ OpenStackOperations.Remove Interface @{ROUTERS}[2] ${interface} + FOR ${interface} IN @{SUBNETS} + OpenStackOperations.Remove Interface @{ROUTERS}[2] ${interface} + END Delete Routers [Documentation] Delete Router and Interface to the subnets. @@ -249,8 +254,9 @@ Delete Sub Network In net_2 Delete Networks [Documentation] Delete Networks with neutron request. - : FOR ${network} IN @{NETWORKS} - \ OpenStackOperations.Delete Network ${network} + FOR ${network} IN @{NETWORKS} + OpenStackOperations.Delete Network ${network} + END Delete Security Group [Documentation] Delete security groups with neutron request diff --git a/csit/suites/openstack/connectivity/external_network.robot b/csit/suites/openstack/connectivity/external_network.robot index 1320d11f50..57f4795467 100644 --- a/csit/suites/openstack/connectivity/external_network.robot +++ b/csit/suites/openstack/connectivity/external_network.robot @@ -178,11 +178,13 @@ Ping External Network PNF from Vm Instance 2 After Floating IP Removal *** Keywords *** Suite Setup OpenStackOperations.OpenStack Suite Setup - : FOR ${network} IN @{NETWORKS} - \ OpenStackOperations.Create Network ${network} - : FOR ${network} ${subnet} ${cidr} IN ZIP ${NETWORKS} ${SUBNETS} + FOR ${network} IN @{NETWORKS} + OpenStackOperations.Create Network ${network} + END + FOR ${network} ${subnet} ${cidr} IN ZIP ${NETWORKS} ${SUBNETS} ... ${SUBNET_CIDRS} - \ OpenStackOperations.Create SubNet ${network} ${subnet} ${cidr} + OpenStackOperations.Create SubNet ${network} ${subnet} ${cidr} + END OpenStackOperations.Create Allow All SecurityGroup ${SECURITY_GROUP} OpenStackOperations.Create Vm Instance On Compute Node @{NETWORKS}[0] @{NET1_FIP_VMS}[0] ${OS_CMP1_HOSTNAME} sg=${SECURITY_GROUP} OpenStackOperations.Create Vm Instance On Compute Node @{NETWORKS}[0] @{NET1_FIP_VMS}[1] ${OS_CMP2_HOSTNAME} sg=${SECURITY_GROUP} @@ -205,15 +207,19 @@ Suite Setup OpenStackOperations.Create Network ${EXTERNAL_NET_NAME} --provider-network-type flat --provider-physical-network ${PUBLIC_PHYSICAL_NETWORK} OpenStackOperations.Update Network ${EXTERNAL_NET_NAME} --external OpenStackOperations.Create Subnet ${EXTERNAL_NET_NAME} ${EXTERNAL_SUBNET_NAME} ${EXTERNAL_SUBNET} --gateway ${EXTERNAL_GATEWAY} --allocation-pool ${EXTERNAL_SUBNET_ALLOCATION_POOL} - : FOR ${router} IN @{ROUTERS} - \ OpenStackOperations.Create Router ${router} - : FOR ${router} ${interface} IN ZIP ${ROUTERS} ${SUBNETS} - \ OpenStackOperations.Add Router Interface ${router} ${interface} - : FOR ${router} IN @{ROUTERS} - \ OpenStackOperations.Add Router Gateway ${router} ${EXTERNAL_NET_NAME} + FOR ${router} IN @{ROUTERS} + OpenStackOperations.Create Router ${router} + END + FOR ${router} ${interface} IN ZIP ${ROUTERS} ${SUBNETS} + OpenStackOperations.Add Router Interface ${router} ${interface} + END + FOR ${router} IN @{ROUTERS} + OpenStackOperations.Add Router Gateway ${router} ${EXTERNAL_NET_NAME} + END ${data} Utils.Get Data From URI 1 ${NEUTRON_ROUTERS_API} BuiltIn.Log ${data} - : FOR ${router} IN @{ROUTERS} - \ Should Contain ${data} ${router} + FOR ${router} IN @{ROUTERS} + Should Contain ${data} ${router} + END OpenStackOperations.Show Debugs @{NET1_FIP_VMS} @{NET1_SNAT_VMS} @{NET2_SNAT_VMS} OpenStackOperations.Get Suite Debugs diff --git a/csit/suites/openstack/connectivity/l3.robot b/csit/suites/openstack/connectivity/l3.robot index afb69d2dd1..64f421c221 100644 --- a/csit/suites/openstack/connectivity/l3.robot +++ b/csit/suites/openstack/connectivity/l3.robot @@ -98,20 +98,23 @@ Connectivity Tests From Vm Instance3 In net_2 Delete Vm Instances In net_1 [Documentation] Delete Vm instances using instance names in net_1. [Tags] NON_GATE - : FOR ${vm} IN @{NET_1_VMS} - \ OpenStackOperations.Delete Vm Instance ${vm} + FOR ${vm} IN @{NET_1_VMS} + OpenStackOperations.Delete Vm Instance ${vm} + END Delete Vm Instances In net_2 [Documentation] Delete Vm instances using instance names in net_2. [Tags] NON_GATE - : FOR ${vm} IN @{NET_2_VMS} - \ OpenStackOperations.Delete Vm Instance ${vm} + FOR ${vm} IN @{NET_2_VMS} + OpenStackOperations.Delete Vm Instance ${vm} + END Delete Vm Instances In net_3 [Documentation] Delete Vm instances using instance names in net_3. [Tags] NON_GATE - : FOR ${vm} IN @{NET_3_VMS} - \ OpenStackOperations.Delete Vm Instance ${vm} + FOR ${vm} IN @{NET_3_VMS} + OpenStackOperations.Delete Vm Instance ${vm} + END Create Vm Instances For net_4 [Documentation] Create VM instances using flavor and image names for a network. @@ -203,7 +206,8 @@ Suite Setup BuiltIn.Should Not Contain ${NET_2_L3_DHCP_IP} None BuiltIn.Should Not Contain ${NET_3_L3_DHCP_IP} None OpenStackOperations.Create Router @{ROUTER}[0] - : FOR ${interface} IN @{SUBNETS_1} - \ OpenStackOperations.Add Router Interface @{ROUTER}[0] ${interface} + FOR ${interface} IN @{SUBNETS_1} + OpenStackOperations.Add Router Interface @{ROUTER}[0] ${interface} + END OpenStackOperations.Show Debugs @{NET_1_VMS} @{NET_2_VMS} @{NET_3_VMS} OpenStackOperations.Get Suite Debugs diff --git a/csit/suites/openstack/connectivity/live_migration.robot b/csit/suites/openstack/connectivity/live_migration.robot index 93096e2a6e..e8293f68c3 100644 --- a/csit/suites/openstack/connectivity/live_migration.robot +++ b/csit/suites/openstack/connectivity/live_migration.robot @@ -35,8 +35,9 @@ Migrate Instance And Verify Connectivity While Migration And After ${vm_host_before_migration} = OpenStackOperations.Get Hypervisor Host Of Vm @{NET_1_VMS}[0] OpenStackOperations.Server Live Migrate @{NET_1_VMS}[0] ${vm_list} = BuiltIn.Create List @{NET_1_VMS}[0] - : FOR ${vm} IN @{vm_list} - \ BuiltIn.Wait Until Keyword Succeeds 6x 20s OpenStackOperations.Check If Migration Is Complete ${vm} + FOR ${vm} IN @{vm_list} + BuiltIn.Wait Until Keyword Succeeds 6x 20s OpenStackOperations.Check If Migration Is Complete ${vm} + END ${vm_host_after_migration} = OpenStackOperations.Get Hypervisor Host Of Vm @{NET_1_VMS}[0] BuiltIn.Run Keyword If "${OPENSTACK_TOPO}" == "1cmb-0ctl-0cmp" BuiltIn.Should Match ${vm_host_after_migration} ${vm_host_before_migration} ... ELSE BuiltIn.Should Not Match ${vm_host_after_migration} ${vm_host_before_migration} diff --git a/csit/suites/openstack/connectivity/security_group.robot b/csit/suites/openstack/connectivity/security_group.robot index d9f45f5a17..6e80d092dc 100644 --- a/csit/suites/openstack/connectivity/security_group.robot +++ b/csit/suites/openstack/connectivity/security_group.robot @@ -71,8 +71,9 @@ Create Router OpenStackOperations.Create Router ${ROUTER} Add Interfaces To Router - : FOR ${interface} IN @{SUBNETS} - \ OpenStackOperations.Add Router Interface ${ROUTER} ${interface} + FOR ${interface} IN @{SUBNETS} + OpenStackOperations.Add Router Interface ${ROUTER} ${interface} + END Ping From Vm Instance1 To Vm Instance3 [Documentation] Login to the vm instance and test some operations @@ -95,8 +96,9 @@ Add Additional Security Group To VMs #TODO Remove this after the Newton jobs are removed, Openstack CLI with Newton lacks support to configure rule with remote_ip_prefix OpenStackOperations.Neutron Security Group Rule Create additional-sg direction=ingress protocol=icmp remote_ip_prefix=${NET_1_DHCP_IP}/32 OpenStackOperations.Neutron Security Group Show additional-sg - : FOR ${vm} IN @{NET_1_VMS} - \ OpenStackOperations.Add Security Group To VM ${vm} additional-sg + FOR ${vm} IN @{NET_1_VMS} + OpenStackOperations.Add Security Group To VM ${vm} additional-sg + END Ping From DHCP To Vm Instance1 [Documentation] Check reachability of vm instances by pinging to them from DHCP. @@ -161,8 +163,9 @@ Repeat Ping From Vm Instance2 To Vm Instance1 With Additional SG Removed From Vm OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[0] @{NET_1_VM_IPS}[1] ${vm_ips} Remove Router Interfaces - : FOR ${interface} IN @{SUBNETS} - \ OpenStackOperations.Remove Interface ${ROUTER} ${interface} + FOR ${interface} IN @{SUBNETS} + OpenStackOperations.Remove Interface ${ROUTER} ${interface} + END Delete Router OpenStackOperations.Delete Router ${ROUTER} @@ -178,8 +181,9 @@ Repeat Ping From Vm Instance2 To Vm Instance1 With Router Removed OpenStackOperations.Test Operations From Vm Instance @{NETWORKS}[0] @{NET_1_VM_IPS}[1] ${vm_ips} Delete Vm Instances In net_2 - : FOR ${vm} IN @{NET_2_VMS} - \ OpenStackOperations.Delete Vm Instance ${vm} + FOR ${vm} IN @{NET_2_VMS} + OpenStackOperations.Delete Vm Instance ${vm} + END Repeat Ping From Vm Instance1 To Vm Instance2 With net_2 VM Deleted [Documentation] Login to the vm instance and test some operations diff --git a/csit/suites/openstack/extensions/sfc.robot b/csit/suites/openstack/extensions/sfc.robot index 5bc2e19419..b7f85783d7 100644 --- a/csit/suites/openstack/extensions/sfc.robot +++ b/csit/suites/openstack/extensions/sfc.robot @@ -276,18 +276,21 @@ Delete Configurations ... of the Suite Teardown, all steps will be attempted. This prevents robot framework from bailing ... on the rest of a test case if one step intermittently has trouble and fails. The goal is to attempt ... to leave the test environment as clean as possible upon completion of this suite. - : FOR ${vm} IN @{NET_1_VMS} - \ OpenStackOperations.Delete Vm Instance ${vm} + FOR ${vm} IN @{NET_1_VMS} + OpenStackOperations.Delete Vm Instance ${vm} + END OpenStackOperations.Delete SFC Port Chain SFPSYM OpenStackOperations.Delete SFC Port Pair Group SFPPG1 OpenStackOperations.Delete SFC Port Pair SFPP1 OpenStackOperations.Delete SFC Flow Classifier FC_101_103 OpenStackOperations.Delete SFC Flow Classifier FC_SYM - : FOR ${port} IN @{PORTS} - \ OpenStackOperations.Delete Port ${port} + FOR ${port} IN @{PORTS} + OpenStackOperations.Delete Port ${port} + END OpenStackOperations.Delete SubNet l2_subnet_1 - : FOR ${network} IN @{NETWORKS} - \ OpenStackOperations.Delete Network ${network} + FOR ${network} IN @{NETWORKS} + OpenStackOperations.Delete Network ${network} + END OpenStackOperations.Delete SecurityGroup ${SECURITY_GROUP} *** Keywords *** @@ -309,8 +312,9 @@ Create Basic Networks OpenStackOperations.Get Suite Debugs Create Ports For Testing - : FOR ${port} IN @{PORTS} - \ OpenStackOperations.Create Port @{NETWORKS}[0] ${port} sg=${SECURITY_GROUP} + FOR ${port} IN @{PORTS} + OpenStackOperations.Create Port @{NETWORKS}[0] ${port} sg=${SECURITY_GROUP} + END OpenStackOperations.Update Port p1in additional_args=--no-security-group OpenStackOperations.Update Port p1in additional_args=--disable-port-security OpenStackOperations.Update Port p1out additional_args=--no-security-group diff --git a/csit/suites/openstack/securitygroup/acl.robot b/csit/suites/openstack/securitygroup/acl.robot index 3021594fa7..9f6c839e5a 100644 --- a/csit/suites/openstack/securitygroup/acl.robot +++ b/csit/suites/openstack/securitygroup/acl.robot @@ -67,9 +67,10 @@ Verify ARP request generated from Spoofed IP for the VM Verify ARP request generated from Spoofed MAC for the VM [Documentation] Verifying ARP resquest generated for Spoofed MAC with Valid IP and Validate the ARP packet drop at the VM Egress Table ${count} = String.Get Line Count ${ARP_CONFIG} - : FOR ${index} IN RANGE 0 ${count} - \ ${cmd} = String.Get Line ${ARP_CONFIG} ${index} - \ ${output} = OpenStackOperations.Execute Command on VM Instance @{REQ_NETWORKS}[1] @{VM_IP_DPN1}[1] ${cmd} + FOR ${index} IN RANGE 0 ${count} + ${cmd} = String.Get Line ${ARP_CONFIG} ${index} + ${output} = OpenStackOperations.Execute Command on VM Instance @{REQ_NETWORKS}[1] @{VM_IP_DPN1}[1] ${cmd} + END ${get_pkt_count_before_arp} = OvsManager.Get Packet Count From Table ${OS_CMP1_IP} ${INTEGRATION_BRIDGE} table=@{DEFAULT_FLOW_TABLES}[15] | grep ${VM1_METADATA}.*${ARP_SHA} ${get_arp_drop_pkt_before} = OvsManager.Get Packet Count From Table ${OS_CMP1_IP} ${INTEGRATION_BRIDGE} table=@{DEFAULT_FLOW_TABLES}[15] | grep ${ARP}.*${TABLE} ${arping_cli} = BuiltIn.Set Variable sudo arping -I eth0 -c ${PACKET_COUNT} \ ${RANDOM_IP} @@ -116,16 +117,19 @@ Create Setup OpenStackOperations.Neutron Security Group Rule Create @{SECURITY_GROUP}[0] direction=egress port_range_max=65535 port_range_min=1 protocol=tcp remote-ip=0.0.0.0/0 OpenStackOperations.Create Vm Instance With Ports On Compute Node @{PORTS}[0] @{PORTS}[1] @{VM_NAMES}[0] ${OS_CMP1_HOSTNAME} flavor=m1.tiny sg=@{SECURITY_GROUP}[0] OpenStackOperations.Create Vm Instance With Ports On Compute Node @{PORTS}[2] @{PORTS}[3] @{VM_NAMES}[1] ${OS_CMP2_HOSTNAME} flavor=m1.tiny sg=@{SECURITY_GROUP}[0] - : FOR ${vm} IN @{VM_NAMES} - \ OpenStackOperations.Poll VM Is ACTIVE ${vm} + FOR ${vm} IN @{VM_NAMES} + OpenStackOperations.Poll VM Is ACTIVE ${vm} + END @{VM_IP_DPN1} = BuiltIn.Wait Until Keyword Succeeds 300 sec 15 sec OpenStackOperations.Get All VM IP Addresses ${OS_CMP1_CONN_ID} @{VM_NAMES}[0] @{VM_IP_DPN2} = BuiltIn.Wait Until Keyword Succeeds 300 sec 15 sec OpenStackOperations.Get All VM IP Addresses ${OS_CMP2_CONN_ID} @{VM_NAMES}[1] BuiltIn.Set Suite Variable @{VM_IP_DPN1} BuiltIn.Set Suite Variable @{VM_IP_DPN2} - : FOR ${ip} IN @{VM_IP_DPN1} - \ BuiltIn.Should Not Contain ${ip} None - : FOR ${ip} IN @{VM_IP_DPN2} - \ BuiltIn.Should Not Contain ${ip} None + FOR ${ip} IN @{VM_IP_DPN1} + BuiltIn.Should Not Contain ${ip} None + END + FOR ${ip} IN @{VM_IP_DPN2} + BuiltIn.Should Not Contain ${ip} None + END ${VM1_PORT} = Get VMs OVS Port Number ${OS_CMP1_IP} @{PORTS}[0] ${VM1_METADATA} = OVSDB.Get Port Metadata ${OS_CMP1_IP} ${VM1_PORT} BuiltIn.Set Suite Variable ${VM1_METADATA} diff --git a/csit/suites/openstack/securitygroup/security_group_l3bcast.robot b/csit/suites/openstack/securitygroup/security_group_l3bcast.robot index 4da29402af..4a7a1ad7c2 100644 --- a/csit/suites/openstack/securitygroup/security_group_l3bcast.robot +++ b/csit/suites/openstack/securitygroup/security_group_l3bcast.robot @@ -38,7 +38,7 @@ ${SUBNET1_BCAST_IP} 55.0.0.255 ${SUBNET2_BCAST_IP} 56.0.0.255 ${ENABLE_BCAST} echo 0 | sudo tee /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts -*** Test case *** +*** Test Case *** Verify Network Broadcast traffic between the VMs hosted in Single Network [Documentation] This TC is to verify Network Broadcast traffic between the VMs hosted in Same Network on same/different compute node ${pkt_check} = BuiltIn.Set Variable If "${OPENSTACK_TOPO}" == "1cmb-0ctl-0cmp" 10 5 @@ -80,24 +80,30 @@ Start Suite OpenStackOperations.Get Suite Debugs Create Setup - : FOR ${network} IN @{NETWORKS} - \ OpenStackOperations.Create Network ${network} - : FOR ${i} IN RANGE len(${NETWORKS}) - \ OpenStackOperations.Create SubNet @{NETWORKS}[${i}] @{SUBNETS}[${i}] @{SUBNET_CIDRS}[${i}] + FOR ${network} IN @{NETWORKS} + OpenStackOperations.Create Network ${network} + END + FOR ${i} IN RANGE len(${NETWORKS}) + OpenStackOperations.Create SubNet @{NETWORKS}[${i}] @{SUBNETS}[${i}] @{SUBNET_CIDRS}[${i}] + END OpenStackOperations.Create Allow All SecurityGroup @{SECURITY_GROUP}[0] OpenStackOperations.Create Router ${ROUTER} - : FOR ${interface} IN @{SUBNETS} - \ OpenStackOperations.Add Router Interface ${ROUTER} ${interface} - : FOR ${port_net1} IN @{NET_1_PORTS} - \ OpenStackOperations.Create Port @{NETWORKS}[0] ${port_net1} sg=@{SECURITY_GROUP}[0] - : FOR ${port_net2} IN @{NET_2_PORTS} - \ OpenStackOperations.Create Port @{NETWORKS}[1] ${port_net2} sg=@{SECURITY_GROUP}[0] + FOR ${interface} IN @{SUBNETS} + OpenStackOperations.Add Router Interface ${ROUTER} ${interface} + END + FOR ${port_net1} IN @{NET_1_PORTS} + OpenStackOperations.Create Port @{NETWORKS}[0] ${port_net1} sg=@{SECURITY_GROUP}[0] + END + FOR ${port_net2} IN @{NET_2_PORTS} + OpenStackOperations.Create Port @{NETWORKS}[1] ${port_net2} sg=@{SECURITY_GROUP}[0] + END @{ports} = BuiltIn.Create List @{NET_1_PORTS}[0] @{NET_1_PORTS}[1] @{NET_1_PORTS}[2] @{NET_2_PORTS}[0] @{NET_2_PORTS}[1] @{vms} = BuiltIn.Create List @{NET_1_VMS}[0] @{NET_1_VMS}[1] @{NET_1_VMS}[2] @{NET_2_VMS}[0] @{NET_2_VMS}[1] @{nodes} = BuiltIn.Create List ${OS_CMP1_HOSTNAME} ${OS_CMP1_HOSTNAME} ${OS_CMP2_HOSTNAME} ${OS_CMP1_HOSTNAME} ${OS_CMP2_HOSTNAME} - : FOR ${port} ${vm} ${node} IN ZIP ${ports} ${vms} + FOR ${port} ${vm} ${node} IN ZIP ${ports} ${vms} ... ${nodes} - \ OpenStackOperations.Create Vm Instance With Port On Compute Node ${port} ${vm} ${node} sg=@{SECURITY_GROUP}[0] + OpenStackOperations.Create Vm Instance With Port On Compute Node ${port} ${vm} ${node} sg=@{SECURITY_GROUP}[0] + END @{vms} = Collections.Combine Lists ${NET_1_VMS} ${NET_2_VMS} @{VM_IPS} = OpenStackOperations.Get VM IPs @{vms} BuiltIn.Should Not Contain ${VM_IPS} None @@ -148,9 +154,10 @@ Get Submetadata ${cmd2} = Utils.Run Command On Remote System And Log ${OS_CMP2_IP} ${DUMP_FLOW} | grep ${EGRESS_LPORT_DISPATCHER_TABLE} | grep write_metadata: ${output2} = String.Get Regexp Matches ${cmd2} reg6=(\\w+) 1 ${metalist} = Collections.Combine Lists ${output1} ${output2} - : FOR ${meta} IN @{metalist} - \ ${metadata_check_status} = Run Keyword And Return Status should contain ${vm_metadata} ${meta} - \ Return From Keyword if ${metadata_check_status} == True ${meta} + FOR ${meta} IN @{metalist} + ${metadata_check_status} = Run Keyword And Return Status should contain ${vm_metadata} ${meta} + Return From Keyword if ${metadata_check_status} == True ${meta} + END Verify L3Broadcast With Antispoofing Table [Arguments] ${OS_COMPUTE_IP} ${EGRESS_ACL_TABLE} ${BCAST_IP} ${vm_ip} ${subnet_var} ${ping_response}='pingsuccess' diff --git a/csit/suites/persistence/basic/test_app.robot b/csit/suites/persistence/basic/test_app.robot index 464e48640e..dd81fa2187 100644 --- a/csit/suites/persistence/basic/test_app.robot +++ b/csit/suites/persistence/basic/test_app.robot @@ -120,12 +120,13 @@ Find Line ${output}= Issue Command On Karaf Console networkdevice:get-reachable ${output}= Split To Lines ${output} ${length}= Get Length ${output} - : FOR ${INDEX} IN RANGE 0 ${length} - \ ${line}= Get From List ${output} ${INDEX} - \ ${data}= Fetch From Right ${line} ipAddress=IpAddress{value= - \ ${data}= Split String ${data} }, - \ ${data}= Get From List ${data} 0 - \ Run Keyword If '${data}' == '${device_ip}' Exit For Loop + FOR ${INDEX} IN RANGE 0 ${length} + ${line}= Get From List ${output} ${INDEX} + ${data}= Fetch From Right ${line} ipAddress=IpAddress{value= + ${data}= Split String ${data} }, + ${data}= Get From List ${data} 0 + Run Keyword If '${data}' == '${device_ip}' Exit For Loop + END [Return] ${line} Find Device Id diff --git a/csit/suites/sfc/Full_Deploy/011__sfc_service_paths.robot b/csit/suites/sfc/Full_Deploy/011__sfc_service_paths.robot index f94612439f..b26f7b0f6b 100644 --- a/csit/suites/sfc/Full_Deploy/011__sfc_service_paths.robot +++ b/csit/suites/sfc/Full_Deploy/011__sfc_service_paths.robot @@ -82,7 +82,7 @@ Put one Service Function Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} Should Contain ${resp.content} SFC1-400 -*** keywords *** +*** Keywords *** Init Suite [Documentation] Initialize session and ODL version specific variables Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS} diff --git a/csit/suites/sfc/Full_Deploy/012__sfc_service_paths_validation.robot b/csit/suites/sfc/Full_Deploy/012__sfc_service_paths_validation.robot index e2486fc2a0..5fdc157b0d 100644 --- a/csit/suites/sfc/Full_Deploy/012__sfc_service_paths_validation.robot +++ b/csit/suites/sfc/Full_Deploy/012__sfc_service_paths_validation.robot @@ -79,7 +79,7 @@ Add Service Function Path where SFC types size and types for SFs in hops match ${path} Get From Dictionary ${result} service-function-paths Lists Should be Equal ${path} ${paths} -*** keywords *** +*** Keywords *** Init Suite [Documentation] Initialize session and ODL version specific variables Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS} diff --git a/csit/suites/sfc/Full_Deploy/014__sfc_service_forwarders_logical.robot b/csit/suites/sfc/Full_Deploy/014__sfc_service_forwarders_logical.robot index 9a37d92a1f..8ebbda7314 100644 --- a/csit/suites/sfc/Full_Deploy/014__sfc_service_forwarders_logical.robot +++ b/csit/suites/sfc/Full_Deploy/014__sfc_service_forwarders_logical.robot @@ -70,7 +70,7 @@ Put one Service Function Forwarder Check For Elements At URI ${SFF_SFFLOG_URI} ${elements} Check For Elements At URI ${SERVICE_FORWARDERS_URI} ${elements} -*** keywords *** +*** Keywords *** Init Suite [Documentation] Initialize session and ODL version specific variable. Logical SFFs Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS} diff --git a/csit/suites/sfc/SFC_Basic/020__sfc_service_forwarders.robot b/csit/suites/sfc/SFC_Basic/020__sfc_service_forwarders.robot index cad9f16032..745fa4f6c3 100644 --- a/csit/suites/sfc/SFC_Basic/020__sfc_service_forwarders.robot +++ b/csit/suites/sfc/SFC_Basic/020__sfc_service_forwarders.robot @@ -240,7 +240,7 @@ Put DPL of Connected SFF Dictionary to SFF Check For Elements At URI ${SFF_BOOTSTRAP_URI}/connected-sff-dictionary/br-int-ovs-2/sff-sff-data-plane-locator ${elements} Check For Elements At URI ${SFF_BOOTSTRAP_URI}/connected-sff-dictionary/br-int-ovs-2 ${elements} -*** keywords *** +*** Keywords *** Init Suite [Documentation] Initialize session and ODL version specific variables Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS} diff --git a/csit/suites/sfc/SFC_Basic/030__sfc_service_nodes.robot b/csit/suites/sfc/SFC_Basic/030__sfc_service_nodes.robot index 2b69878375..fa06ba19d6 100644 --- a/csit/suites/sfc/SFC_Basic/030__sfc_service_nodes.robot +++ b/csit/suites/sfc/SFC_Basic/030__sfc_service_nodes.robot @@ -74,7 +74,7 @@ Put one Service Node Check For Elements At URI ${SN_NODE100_URI} ${elements} Check For Elements At URI ${SERVICE_NODES_URI} ${elements} -*** keywords *** +*** Keywords *** Init Suite [Documentation] Initialize session and ODL version specific variables Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS} diff --git a/csit/suites/sfc/SFC_Basic/040__sfc_service_chains.robot b/csit/suites/sfc/SFC_Basic/040__sfc_service_chains.robot index c8003524b2..2e70f62626 100644 --- a/csit/suites/sfc/SFC_Basic/040__sfc_service_chains.robot +++ b/csit/suites/sfc/SFC_Basic/040__sfc_service_chains.robot @@ -115,7 +115,7 @@ Put one Service Function into Chain Check For Elements At URI ${SERVICE_CHAIN100_URI} ${elements} Check For Elements At URI ${SERVICE_CHAINS_URI} ${elements} -*** keywords *** +*** Keywords *** Init Suite [Documentation] Initialize session and ODL version specific variables Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS} diff --git a/csit/suites/sfc/SFC_Basic/050__sfc_service_schedule_types.robot b/csit/suites/sfc/SFC_Basic/050__sfc_service_schedule_types.robot index 2f76beaf9c..79036c8120 100644 --- a/csit/suites/sfc/SFC_Basic/050__sfc_service_schedule_types.robot +++ b/csit/suites/sfc/SFC_Basic/050__sfc_service_schedule_types.robot @@ -74,7 +74,7 @@ Put one Service Function Schedule Algorithm Type Check For Elements At URI ${SERVICE_WSP_SCHED_TYPE_URI} ${elements} Check For Elements At URI ${SERVICE_SCHED_TYPES_URI} ${elements} -*** keywords *** +*** Keywords *** Init Suite [Documentation] Initialize session and ODL version specific variables Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS} diff --git a/csit/suites/sfc/SFC_Basic/060__sfc_service_paths.robot b/csit/suites/sfc/SFC_Basic/060__sfc_service_paths.robot index 26e3750f0a..b24edc999e 100644 --- a/csit/suites/sfc/SFC_Basic/060__sfc_service_paths.robot +++ b/csit/suites/sfc/SFC_Basic/060__sfc_service_paths.robot @@ -81,7 +81,7 @@ Put One Service Function Path Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code} Should Contain ${resp.content} SFC1-400 -*** keywords *** +*** Keywords *** Init Suite [Documentation] Initialize session and ODL version specific variables Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS} diff --git a/csit/suites/sxp/basic/030_Connectivity.robot b/csit/suites/sxp/basic/030_Connectivity.robot index be4cd94bea..37302ab484 100644 --- a/csit/suites/sxp/basic/030_Connectivity.robot +++ b/csit/suites/sxp/basic/030_Connectivity.robot @@ -63,29 +63,30 @@ Mixed Versions Test Nodes [Arguments] ${version} ${PASSWORD} @{versions} [Documentation] Setup connection Speaker => Listener / Listener => Speaker / Both <=> Both for specific versions - : FOR ${r_version} IN @{versions} - \ ${cmp_version} Lower Version ${r_version} ${version} - \ BuiltIn.Log ${r_version} - \ SxpLib.Add Connection ${r_version} listener 127.0.0.2 64999 127.0.0.1 - \ ... ${PASSWORD} - \ SxpLib.Add Connection ${version} speaker 127.0.0.1 64999 127.0.0.2 - \ ... ${PASSWORD} - \ BuiltIn.Wait Until Keyword Succeeds 120x 1s SxpLib.Verify Connection ${cmp_version} listener - \ ... 127.0.0.2 64999 127.0.0.1 - \ BuiltIn.Wait Until Keyword Succeeds 120x 1s SxpLib.Verify Connection ${cmp_version} speaker - \ ... 127.0.0.1 64999 127.0.0.2 - \ BuiltIn.Log OK ${r_version}:listener ${version}:speaker - \ SxpLib.Add Connection ${version} listener 127.0.0.2 64999 127.0.0.3 - \ ... ${PASSWORD} - \ SxpLib.Add Connection ${r_version} speaker 127.0.0.3 64999 127.0.0.2 - \ ... ${PASSWORD} - \ BuiltIn.Wait Until Keyword Succeeds 120x 1s SxpLib.Verify Connection ${cmp_version} listener - \ ... 127.0.0.2 64999 127.0.0.3 - \ BuiltIn.Wait Until Keyword Succeeds 120x 1s SxpLib.Verify Connection ${cmp_version} speaker - \ ... 127.0.0.3 64999 127.0.0.2 - \ BuiltIn.Log OK ${version}:listener ${r_version}:speaker - \ BuiltIn.Run Keyword If '${version}' == 'version4' and '${r_version}' == 'version4' Test Both ${version} ${r_version} ${PASSWORD} - \ Clean Nodes + FOR ${r_version} IN @{versions} + ${cmp_version} Lower Version ${r_version} ${version} + BuiltIn.Log ${r_version} + SxpLib.Add Connection ${r_version} listener 127.0.0.2 64999 127.0.0.1 + ... ${PASSWORD} + SxpLib.Add Connection ${version} speaker 127.0.0.1 64999 127.0.0.2 + ... ${PASSWORD} + BuiltIn.Wait Until Keyword Succeeds 120x 1s SxpLib.Verify Connection ${cmp_version} listener + ... 127.0.0.2 64999 127.0.0.1 + BuiltIn.Wait Until Keyword Succeeds 120x 1s SxpLib.Verify Connection ${cmp_version} speaker + ... 127.0.0.1 64999 127.0.0.2 + BuiltIn.Log OK ${r_version}:listener ${version}:speaker + SxpLib.Add Connection ${version} listener 127.0.0.2 64999 127.0.0.3 + ... ${PASSWORD} + SxpLib.Add Connection ${r_version} speaker 127.0.0.3 64999 127.0.0.2 + ... ${PASSWORD} + BuiltIn.Wait Until Keyword Succeeds 120x 1s SxpLib.Verify Connection ${cmp_version} listener + ... 127.0.0.2 64999 127.0.0.3 + BuiltIn.Wait Until Keyword Succeeds 120x 1s SxpLib.Verify Connection ${cmp_version} speaker + ... 127.0.0.3 64999 127.0.0.2 + BuiltIn.Log OK ${version}:listener ${r_version}:speaker + BuiltIn.Run Keyword If '${version}' == 'version4' and '${r_version}' == 'version4' Test Both ${version} ${r_version} ${PASSWORD} + Clean Nodes + END Test Both [Arguments] ${version} ${r_version} ${PASSWORD} diff --git a/csit/suites/sxp/basic/040_SSL_Passwords.robot b/csit/suites/sxp/basic/040_SSL_Passwords.robot index 7566269067..567773f307 100644 --- a/csit/suites/sxp/basic/040_SSL_Passwords.robot +++ b/csit/suites/sxp/basic/040_SSL_Passwords.robot @@ -132,10 +132,11 @@ Setup SXP Environment Local RequestsLibrary.Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} timeout=${DEFAULT_TIMEOUT_HTTP} max_retries=0 SSHKeywords.Open_Connection_To_ODL_System ${ODL_SYSTEM_JAVA_HOME} SSHLibrary.Execute_Command java -XshowSettings:properties -version 2>&1 | grep java.home | sed 's/.*= //' - : FOR ${node} IN RANGE 1 ${node_range}+1 - \ SSHKeywords.Execute_Command_Should_Pass ${ODL_SYSTEM_JAVA_HOME}/bin/keytool -genkeypair -alias odl-sxp-${node} -keyalg RSA -storepass ${password} -keypass ${password} -dname "CN=www.opendaylight.org, OU=csit, O=ODL, L=N/A, S=N/A, C=N/A" -keystore csit-keystore-${node} - \ SSHKeywords.Execute_Command_Should_Pass ${ODL_SYSTEM_JAVA_HOME}/bin/keytool -exportcert -keystore csit-keystore-${node} -alias odl-sxp-${node} -storepass ${password} -file odl-sxp-${node}.cer - # Node-1 TRUSTS Node-2, Node-5 + FOR ${node} IN RANGE 1 ${node_range}+1 + SSHKeywords.Execute_Command_Should_Pass ${ODL_SYSTEM_JAVA_HOME}/bin/keytool -genkeypair -alias odl-sxp-${node} -keyalg RSA -storepass ${password} -keypass ${password} -dname "CN=www.opendaylight.org, OU=csit, O=ODL, L=N/A, S=N/A, C=N/A" -keystore csit-keystore-${node} + SSHKeywords.Execute_Command_Should_Pass ${ODL_SYSTEM_JAVA_HOME}/bin/keytool -exportcert -keystore csit-keystore-${node} -alias odl-sxp-${node} -storepass ${password} -file odl-sxp-${node}.cer + # Node-1 TRUSTS Node-2, Node-5 + END SSHKeywords.Execute_Command_Should_Pass ${ODL_SYSTEM_JAVA_HOME}/bin/keytool -importcert -keystore csit-truststore-1 -alias odl-sxp-2 -storepass ${password} -keypass ${password} -file odl-sxp-2.cer -noprompt SSHKeywords.Execute_Command_Should_Pass ${ODL_SYSTEM_JAVA_HOME}/bin/keytool -importcert -keystore csit-truststore-1 -alias odl-sxp-5 -storepass ${password} -keypass ${password} -file odl-sxp-5.cer -noprompt # Node-2 TRUSTS Node-1 @@ -149,21 +150,23 @@ Setup SXP Environment Local SSHKeywords.Execute_Command_Should_Pass mv ./csit-keystore-* ${ssl_stores} SSHKeywords.Execute_Command_Should_Pass mv ./csit-truststore-* ${ssl_stores} SSHLibrary.Close Connection - : FOR ${node} IN RANGE 1 ${node_range}+1 - \ ${SSL} BuiltIn.Create Dictionary truststore=${ssl_stores}/csit-truststore-${node} keystore=${ssl_stores}/csit-keystore-${node} password=${password} - \ ${rnd_retry_time} = BuiltIn.Evaluate random.randint(1, 5) modules=random - \ SxpLib.Add Node 127.0.0.${node} ${EMPTY} ssl_stores=${SSL} retry_open_timer=${rnd_retry_time} - \ BuiltIn.Wait Until Keyword Succeeds 20x 10s SxpLib.Check Node started 127.0.0.${node} system=${ODL_SYSTEM_IP} - \ SxpLib.Add Bindings ${node}00 1.1.1.${node}/32 127.0.0.${node} - \ SxpLib.Add Bindings ${node}00 2.2.2.${node}/32 127.0.0.${node} + FOR ${node} IN RANGE 1 ${node_range}+1 + ${SSL} BuiltIn.Create Dictionary truststore=${ssl_stores}/csit-truststore-${node} keystore=${ssl_stores}/csit-keystore-${node} password=${password} + ${rnd_retry_time} = BuiltIn.Evaluate random.randint(1, 5) modules=random + SxpLib.Add Node 127.0.0.${node} ${EMPTY} ssl_stores=${SSL} retry_open_timer=${rnd_retry_time} + BuiltIn.Wait Until Keyword Succeeds 20x 10s SxpLib.Check Node started 127.0.0.${node} system=${ODL_SYSTEM_IP} + SxpLib.Add Bindings ${node}00 1.1.1.${node}/32 127.0.0.${node} + SxpLib.Add Bindings ${node}00 2.2.2.${node}/32 127.0.0.${node} + END Verify Topology Bindings [Arguments] ${node_range} [Documentation] Create session to Controller ${resp} SxpLib.Get Bindings 127.0.0.5 - : FOR ${node} IN RANGE 1 ${node_range}+1 - \ SxpLib.Should Contain Binding ${resp} ${node}00 1.1.1.${node}/32 - \ SxpLib.Should Contain Binding ${resp} ${node}00 2.2.2.${node}/32 + FOR ${node} IN RANGE 1 ${node_range}+1 + SxpLib.Should Contain Binding ${resp} ${node}00 1.1.1.${node}/32 + SxpLib.Should Contain Binding ${resp} ${node}00 2.2.2.${node}/32 + END Clean Nodes [Documentation] Cleanup of resources alocated by test suite diff --git a/csit/suites/sxp/cluster-binding/010_Bindings_consistency.robot b/csit/suites/sxp/cluster-binding/010_Bindings_consistency.robot index d39534c5be..f565c7823f 100644 --- a/csit/suites/sxp/cluster-binding/010_Bindings_consistency.robot +++ b/csit/suites/sxp/cluster-binding/010_Bindings_consistency.robot @@ -61,8 +61,9 @@ Setup Custom SXP Cluster [Documentation] Setup custom SXP cluster topology with ${NUM_ODL_SYSTEM} nodes and one device SxpClusterLib.Check Shards Status SxpClusterLib.Setup SXP Cluster ${mode} - : FOR ${i} IN RANGE 1 25 - \ SxpLib.Add Bindings ${i}0 ${i}.${i}.${i}.${i}/32 node=${node} session=${session} + FOR ${i} IN RANGE 1 25 + SxpLib.Add Bindings ${i}0 ${i}.${i}.${i}.${i}/32 node=${node} session=${session} + END Isolate SXP Controller [Arguments] ${controller_index} ${node} ${session}=ClusterManagement__session_${controller_index} @@ -87,5 +88,6 @@ Check Bindings [Arguments] ${node} ${session} [Documentation] Checks that bindings were propagated to Peer ${resp} = SxpLib.Get Bindings node=${node} session=${session} - : FOR ${i} IN RANGE 1 25 - \ SxpLib.Should Contain Binding ${resp} ${i}0 ${i}.${i}.${i}.${i}/32 + FOR ${i} IN RANGE 1 25 + SxpLib.Should Contain Binding ${resp} ${i}0 ${i}.${i}.${i}.${i}/32 + END diff --git a/csit/suites/sxp/cluster-routing/020_Sxp_Node_Switching.robot b/csit/suites/sxp/cluster-routing/020_Sxp_Node_Switching.robot index 1ec947f55a..2fb0069909 100644 --- a/csit/suites/sxp/cluster-routing/020_Sxp_Node_Switching.robot +++ b/csit/suites/sxp/cluster-routing/020_Sxp_Node_Switching.robot @@ -113,8 +113,9 @@ Clean Custom SXP Cluster Add Bindings To Node [Arguments] ${node} ${session} [Documentation] Setup initial bindings to SXP device/controller ${node} with ${session} - : FOR ${i} IN RANGE 1 ${BINDINGS} - \ SxpLib.Add Bindings ${i}0 ${i}.${i}.${i}.${i}/32 node=${node} session=${session} + FOR ${i} IN RANGE 1 ${BINDINGS} + SxpLib.Add Bindings ${i}0 ${i}.${i}.${i}.${i}/32 node=${node} session=${session} + END Isolate SXP Controller [Arguments] ${controller_index} @@ -145,5 +146,6 @@ Check Bindings [Arguments] ${node} ${session} [Documentation] Check that bindings were propagated to the peer ${node} ${resp} = SxpLib.Get Bindings node=${node} session=${session} - : FOR ${i} IN RANGE 1 ${BINDINGS} - \ SxpLib.Should Contain Binding ${resp} ${i}0 ${i}.${i}.${i}.${i}/32 + FOR ${i} IN RANGE 1 ${BINDINGS} + SxpLib.Should Contain Binding ${resp} ${i}0 ${i}.${i}.${i}.${i}/32 + END diff --git a/csit/suites/sxp/clustering/020_RPC_Redirecting.robot b/csit/suites/sxp/clustering/020_RPC_Redirecting.robot index b6e84f8e43..8cd4be78bf 100644 --- a/csit/suites/sxp/clustering/020_RPC_Redirecting.robot +++ b/csit/suites/sxp/clustering/020_RPC_Redirecting.robot @@ -48,8 +48,9 @@ Test Add/Delete Peer Group SxpLib.Add PeerGroup GROUP peers=${EMPTY} node=${INADDR_ANY} session=ClusterManagement__session_1 ${resp} = SxpLib.Get Peer Groups ${INADDR_ANY} session=ClusterManagement__session_2 @{groups} = Sxp.Parse Peer Groups ${resp} - : FOR ${group} IN @{groups} - \ SxpLib.Delete Peer Group ${group['name']} node=${INADDR_ANY} session=ClusterManagement__session_3 + FOR ${group} IN @{groups} + SxpLib.Delete Peer Group ${group['name']} node=${INADDR_ANY} session=ClusterManagement__session_3 + END [Teardown] Delete Node And Check It Is Stopped Test Add/Delete Domain Filter diff --git a/csit/suites/sxp/clustering/030_RPC_functionality.robot b/csit/suites/sxp/clustering/030_RPC_functionality.robot index 817b64b40c..83719ffc6c 100644 --- a/csit/suites/sxp/clustering/030_RPC_functionality.robot +++ b/csit/suites/sxp/clustering/030_RPC_functionality.robot @@ -27,8 +27,9 @@ Isolate SXP Controller [Arguments] ${controller_index} [Documentation] Isolate one of cluster nodes and perform check that RPC changes were performed afterwards reverts isolation ${owner_controller} = SxpClusterLib.Get Owner Controller - : FOR ${i} IN RANGE ${NUM_ODL_SYSTEM} - \ SxpLib.Add Bindings ${i+1}0 ${i+1}0.${i+1}0.${i+1}0.${i+1}0/32 node=${INADDR_ANY} session=ClusterManagement__session_${owner_controller} + FOR ${i} IN RANGE ${NUM_ODL_SYSTEM} + SxpLib.Add Bindings ${i+1}0 ${i+1}0.${i+1}0.${i+1}0.${i+1}0/32 node=${INADDR_ANY} session=ClusterManagement__session_${owner_controller} + END @{running_members} = ClusterManagement.Isolate_Member_From_List_Or_All ${controller_index} BuiltIn.Wait Until Keyword Succeeds 120x 1s ClusterManagement.Verify_Members_Are_Ready member_index_list=${running_members} verify_cluster_sync=True verify_restconf=True ... verify_system_status=False service_list=${EMPTY_LIST} @@ -36,8 +37,9 @@ Isolate SXP Controller ${running_member} = Collections.Get From List ${running_members} 0 ${owner_controller} = SxpClusterLib.Get Owner Controller ${running_member} BuiltIn.Wait Until Keyword Succeeds 60x 1s Check Bindings Exist ${owner_controller} - : FOR ${i} IN RANGE ${NUM_ODL_SYSTEM} - \ SxpLib.Delete Bindings ${i+1}0 ${i+1}0.${i+1}0.${i+1}0.${i+1}0/32 node=${INADDR_ANY} session=ClusterManagement__session_${owner_controller} + FOR ${i} IN RANGE ${NUM_ODL_SYSTEM} + SxpLib.Delete Bindings ${i+1}0 ${i+1}0.${i+1}0.${i+1}0.${i+1}0/32 node=${INADDR_ANY} session=ClusterManagement__session_${owner_controller} + END ClusterManagement.Flush_Iptables_From_List_Or_All BuiltIn.Wait Until Keyword Succeeds 120x 1s ClusterManagement.Verify_Members_Are_Ready member_index_list=${EMPTY} verify_cluster_sync=True verify_restconf=True ... verify_system_status=False service_list=${EMPTY_LIST} @@ -47,12 +49,14 @@ Check Bindings Exist [Arguments] ${owner_controller} [Documentation] Check that bindings exists in Cluster datastore ${resp} = SxpLib.Get Bindings node=${INADDR_ANY} session=ClusterManagement__session_${owner_controller} - : FOR ${i} IN RANGE ${NUM_ODL_SYSTEM} - \ SxpLib.Should Contain Binding ${resp} ${i+1}0 ${i+1}0.${i+1}0.${i+1}0.${i+1}0/32 + FOR ${i} IN RANGE ${NUM_ODL_SYSTEM} + SxpLib.Should Contain Binding ${resp} ${i+1}0 ${i+1}0.${i+1}0.${i+1}0.${i+1}0/32 + END Check Bindings Does Not Exist [Arguments] ${owner_controller} [Documentation] Check that bindings does not exist in Cluster datastore ${resp} = SxpLib.Get Bindings node=${INADDR_ANY} session=ClusterManagement__session_${owner_controller} - : FOR ${i} IN RANGE ${NUM_ODL_SYSTEM} - \ SxpLib.Should Not Contain Binding ${resp} ${i+1}0 ${i+1}0.${i+1}0.${i+1}0.${i+1}0/32 + FOR ${i} IN RANGE ${NUM_ODL_SYSTEM} + SxpLib.Should Not Contain Binding ${resp} ${i+1}0 ${i+1}0.${i+1}0.${i+1}0.${i+1}0/32 + END diff --git a/csit/suites/sxp/filtering/030_Inbound_Filtering_Discarding.robot b/csit/suites/sxp/filtering/030_Inbound_Filtering_Discarding.robot index 42dee7365b..010b45892d 100644 --- a/csit/suites/sxp/filtering/030_Inbound_Filtering_Discarding.robot +++ b/csit/suites/sxp/filtering/030_Inbound_Filtering_Discarding.robot @@ -127,17 +127,18 @@ Prefix List Sgt Filtering Legacy *** Keywords *** Setup Nodes [Arguments] ${version}=version4 ${password}=none - : FOR ${node} IN RANGE 2 5 - \ SxpLib.Add Connection ${version} both 127.0.0.1 64999 127.0.0.${node} - \ ... ${password} - \ SxpLib.Add Connection ${version} both 127.0.0.${node} 64999 127.0.0.1 - \ ... ${password} - \ BuiltIn.Wait Until Keyword Succeeds 15 1 Verify Connection ${version} both - \ ... 127.0.0.${node} - \ SxpLib.Add Bindings ${node}0 10.10.10.${node}0/32 127.0.0.${node} - \ SxpLib.Add Bindings ${node}0 10.10.${node}0.0/24 127.0.0.${node} - \ SxpLib.Add Bindings ${node}0 10.${node}0.0.0/16 127.0.0.${node} - \ SxpLib.Add Bindings ${node}0 ${node}0.0.0.0/8 127.0.0.${node} + FOR ${node} IN RANGE 2 5 + SxpLib.Add Connection ${version} both 127.0.0.1 64999 127.0.0.${node} + ... ${password} + SxpLib.Add Connection ${version} both 127.0.0.${node} 64999 127.0.0.1 + ... ${password} + BuiltIn.Wait Until Keyword Succeeds 15 1 Verify Connection ${version} both + ... 127.0.0.${node} + SxpLib.Add Bindings ${node}0 10.10.10.${node}0/32 127.0.0.${node} + SxpLib.Add Bindings ${node}0 10.10.${node}0.0/24 127.0.0.${node} + SxpLib.Add Bindings ${node}0 10.${node}0.0.0/16 127.0.0.${node} + SxpLib.Add Bindings ${node}0 ${node}0.0.0.0/8 127.0.0.${node} + END SxpLib.Add Connection ${version} both 127.0.0.5 64999 127.0.0.3 ${password} SxpLib.Add Connection ${version} both 127.0.0.3 64999 127.0.0.5 ${password} BuiltIn.Wait Until Keyword Succeeds 15 1 Verify Connection ${version} both 127.0.0.5 @@ -153,11 +154,12 @@ Setup Nodes Setup Nodes Legacy Par One [Arguments] ${version}=version3 ${password}=none - : FOR ${node} IN RANGE 1 6 - \ SxpLib.Add Bindings ${node}0 10.10.10.${node}0/32 127.0.0.${node} - \ SxpLib.Add Bindings ${node}0 10.10.${node}0.0/24 127.0.0.${node} - \ SxpLib.Add Bindings ${node}0 10.${node}0.0.0/16 127.0.0.${node} - \ SxpLib.Add Bindings ${node}0 ${node}0.0.0.0/8 127.0.0.${node} + FOR ${node} IN RANGE 1 6 + SxpLib.Add Bindings ${node}0 10.10.10.${node}0/32 127.0.0.${node} + SxpLib.Add Bindings ${node}0 10.10.${node}0.0/24 127.0.0.${node} + SxpLib.Add Bindings ${node}0 10.${node}0.0.0/16 127.0.0.${node} + SxpLib.Add Bindings ${node}0 ${node}0.0.0.0/8 127.0.0.${node} + END SxpLib.Add Connection ${version} listener 127.0.0.1 64999 127.0.0.2 ${password} SxpLib.Add Connection ${version} speaker 127.0.0.2 64999 127.0.0.1 ${password} BuiltIn.Wait Until Keyword Succeeds 15 1 Verify Connection ${version} speaker 127.0.0.2 @@ -174,11 +176,12 @@ Setup Nodes Legacy Par One Setup Nodes Legacy Par Two [Arguments] ${version}=version3 ${password}=none - : FOR ${node} IN RANGE 1 6 - \ SxpLib.Add Bindings ${node}0 10.10.10.${node}0/32 127.0.0.${node} - \ SxpLib.Add Bindings ${node}0 10.10.${node}0.0/24 127.0.0.${node} - \ SxpLib.Add Bindings ${node}0 10.${node}0.0.0/16 127.0.0.${node} - \ SxpLib.Add Bindings ${node}0 ${node}0.0.0.0/8 127.0.0.${node} + FOR ${node} IN RANGE 1 6 + SxpLib.Add Bindings ${node}0 10.10.10.${node}0/32 127.0.0.${node} + SxpLib.Add Bindings ${node}0 10.10.${node}0.0/24 127.0.0.${node} + SxpLib.Add Bindings ${node}0 10.${node}0.0.0/16 127.0.0.${node} + SxpLib.Add Bindings ${node}0 ${node}0.0.0.0/8 127.0.0.${node} + END SxpLib.Add Connection ${version} speaker 127.0.0.1 64999 127.0.0.2 ${password} SxpLib.Add Connection ${version} listener 127.0.0.2 64999 127.0.0.1 ${password} BuiltIn.Wait Until Keyword Succeeds 15 1 Verify Connection ${version} listener 127.0.0.2 diff --git a/csit/suites/sxp/filtering/040_Peer_Sequence_filtering.robot b/csit/suites/sxp/filtering/040_Peer_Sequence_filtering.robot index 4be5f2c032..168c93c499 100644 --- a/csit/suites/sxp/filtering/040_Peer_Sequence_filtering.robot +++ b/csit/suites/sxp/filtering/040_Peer_Sequence_filtering.robot @@ -42,41 +42,43 @@ Inbound PL Combinations Filtering [Documentation] Test PeerSequence filter combined with PrefixList filter [Tags] SXP Filtering @{scopes} = BuiltIn.Create List inbound inbound-discarding - : FOR ${scope} IN @{scopes} - \ SxpLib.Add PeerGroup GROUP - \ ${entry1} = Sxp.Get Filter Entry 10 permit ps=le,1 - \ ${entries} = Common.Combine Strings ${entry1} - \ SxpLib.Add Filter GROUP ${scope} ${entries} - \ Setup Nodes Inbound Test - \ ${peers} = Sxp.Add Peers 127.0.0.2 - \ SxpLib.Add PeerGroup GROUP2 ${peers} - \ ${entry1} = Sxp.Get Filter Entry 10 permit pl=1.1.0.0/16 - \ ${entries} = Common.Combine Strings ${entry1} - \ SxpLib.Add Filter GROUP2 ${scope} ${entries} - \ BuiltIn.Wait Until Keyword Succeeds 4 2 Check Inbound PL Combinations Filtering - \ Clean Nodes + FOR ${scope} IN @{scopes} + SxpLib.Add PeerGroup GROUP + ${entry1} = Sxp.Get Filter Entry 10 permit ps=le,1 + ${entries} = Common.Combine Strings ${entry1} + SxpLib.Add Filter GROUP ${scope} ${entries} + Setup Nodes Inbound Test + ${peers} = Sxp.Add Peers 127.0.0.2 + SxpLib.Add PeerGroup GROUP2 ${peers} + ${entry1} = Sxp.Get Filter Entry 10 permit pl=1.1.0.0/16 + ${entries} = Common.Combine Strings ${entry1} + SxpLib.Add Filter GROUP2 ${scope} ${entries} + BuiltIn.Wait Until Keyword Succeeds 4 2 Check Inbound PL Combinations Filtering + Clean Nodes + END Inbound ACL Combinations Filtering [Documentation] Test PeerSequence filter combined with ACL filter [Tags] SXP Filtering @{scopes} = BuiltIn.Create List inbound inbound-discarding - : FOR ${scope} IN @{scopes} - \ ${peers} = Sxp.Add Peers 127.0.0.2 - \ SxpLib.Add PeerGroup GROUP2 ${peers} - \ ${entry1} = Sxp.Get Filter Entry 10 permit ps=le,2 - \ ${entries} Common.Combine Strings ${entry1} - \ SxpLib.Add Filter GROUP2 ${scope} ${entries} - \ Setup Nodes Inbound Test - \ ${entry1} = Sxp.Get Filter Entry 10 permit acl=1.1.1.0,0.0.0.255 - \ ${entries} = Common.Combine Strings ${entry1} - \ SxpLib.Add Filter GROUP2 ${scope} ${entries} - \ ${peers} = Sxp.Add Peers 127.0.0.5 - \ SxpLib.Add PeerGroup GROUP5 ${peers} - \ ${entry1} = Sxp.Get Filter Entry 10 permit sgt=40 - \ ${entries} = Common.Combine Strings ${entry1} - \ SxpLib.Add Filter GROUP5 ${scope} ${entries} - \ BuiltIn.Wait Until Keyword Succeeds 4 2 Check Inbound ACL Combinations Filtering - \ Clean Nodes + FOR ${scope} IN @{scopes} + ${peers} = Sxp.Add Peers 127.0.0.2 + SxpLib.Add PeerGroup GROUP2 ${peers} + ${entry1} = Sxp.Get Filter Entry 10 permit ps=le,2 + ${entries} Common.Combine Strings ${entry1} + SxpLib.Add Filter GROUP2 ${scope} ${entries} + Setup Nodes Inbound Test + ${entry1} = Sxp.Get Filter Entry 10 permit acl=1.1.1.0,0.0.0.255 + ${entries} = Common.Combine Strings ${entry1} + SxpLib.Add Filter GROUP2 ${scope} ${entries} + ${peers} = Sxp.Add Peers 127.0.0.5 + SxpLib.Add PeerGroup GROUP5 ${peers} + ${entry1} = Sxp.Get Filter Entry 10 permit sgt=40 + ${entries} = Common.Combine Strings ${entry1} + SxpLib.Add Filter GROUP5 ${scope} ${entries} + BuiltIn.Wait Until Keyword Succeeds 4 2 Check Inbound ACL Combinations Filtering + Clean Nodes + END Outbound PL Combinations Filtering [Documentation] Test PeerSequence filter combined with PrefixList filter @@ -117,11 +119,12 @@ Setup Nodes SxpLib.Add Bindings 10 10.10.10.0/24 127.0.0.1 SxpLib.Add Bindings 10 10.10.0.0/16 127.0.0.1 SxpLib.Add Bindings 10 10.0.0.0/8 127.0.0.1 - : FOR ${node} IN RANGE 2 6 - \ SxpLib.Add Bindings ${node}0 10.10.10.${node}0/32 127.0.0.${node} - \ SxpLib.Add Bindings ${node}0 10.10.${node}0.0/24 127.0.0.${node} - \ SxpLib.Add Bindings ${node}0 10.${node}0.0.0/16 127.0.0.${node} - \ SxpLib.Add Bindings ${node}0 ${node}0.0.0.0/8 127.0.0.${node} + FOR ${node} IN RANGE 2 6 + SxpLib.Add Bindings ${node}0 10.10.10.${node}0/32 127.0.0.${node} + SxpLib.Add Bindings ${node}0 10.10.${node}0.0/24 127.0.0.${node} + SxpLib.Add Bindings ${node}0 10.${node}0.0.0/16 127.0.0.${node} + SxpLib.Add Bindings ${node}0 ${node}0.0.0.0/8 127.0.0.${node} + END SxpLib.Add Connection ${version} listener 127.0.0.1 64999 127.0.0.2 ${password} SxpLib.Add Connection ${version} speaker 127.0.0.2 64999 127.0.0.1 ${password} BuiltIn.Wait Until Keyword Succeeds 15 1 SxpLib.Verify Connection ${version} speaker 127.0.0.2 @@ -140,11 +143,12 @@ Setup Nodes Setup Nodes Inbound Test [Arguments] ${version}=version4 ${password}=none [Documentation] Setup Topology for inbound PeerSequence and other filters tests - : FOR ${node} IN RANGE 2 6 - \ SxpLib.Add Bindings ${node}0 1.1.1.${node}/32 127.0.0.${node} - \ SxpLib.Add Bindings ${node}0 1.1.${node}.0/24 127.0.0.${node} - \ SxpLib.Add Bindings ${node}0 1.${node}.0.0/16 127.0.0.${node} - \ SxpLib.Add Bindings ${node}0 ${node}.0.0.0/8 127.0.0.${node} + FOR ${node} IN RANGE 2 6 + SxpLib.Add Bindings ${node}0 1.1.1.${node}/32 127.0.0.${node} + SxpLib.Add Bindings ${node}0 1.1.${node}.0/24 127.0.0.${node} + SxpLib.Add Bindings ${node}0 1.${node}.0.0/16 127.0.0.${node} + SxpLib.Add Bindings ${node}0 ${node}.0.0.0/8 127.0.0.${node} + END SxpLib.Add Connection ${version} speaker 127.0.0.1 64999 127.0.0.2 ${password} SxpLib.Add Connection ${version} listener 127.0.0.2 64999 127.0.0.1 ${password} BuiltIn.Wait Until Keyword Succeeds 15 1 SxpLib.Verify Connection ${version} listener 127.0.0.2 @@ -171,11 +175,12 @@ Setup Nodes Outbound Test SxpLib.Add Bindings 10 1.1.1.0/24 127.0.0.1 SxpLib.Add Bindings 10 1.1.0.0/16 127.0.0.1 SxpLib.Add Bindings 10 1.0.0.0/8 127.0.0.1 - : FOR ${node} IN RANGE 3 6 - \ SxpLib.Add Bindings ${node}0 1.1.1.${node}/32 127.0.0.${node} - \ SxpLib.Add Bindings ${node}0 1.1.${node}.0/24 127.0.0.${node} - \ SxpLib.Add Bindings ${node}0 1.${node}.0.0/16 127.0.0.${node} - \ SxpLib.Add Bindings ${node}0 ${node}.0.0.0/8 127.0.0.${node} + FOR ${node} IN RANGE 3 6 + SxpLib.Add Bindings ${node}0 1.1.1.${node}/32 127.0.0.${node} + SxpLib.Add Bindings ${node}0 1.1.${node}.0/24 127.0.0.${node} + SxpLib.Add Bindings ${node}0 1.${node}.0.0/16 127.0.0.${node} + SxpLib.Add Bindings ${node}0 ${node}.0.0.0/8 127.0.0.${node} + END SxpLib.Add Connection ${version} listener 127.0.0.1 64999 127.0.0.2 ${password} SxpLib.Add Connection ${version} speaker 127.0.0.2 64999 127.0.0.1 ${password} BuiltIn.Wait Until Keyword Succeeds 15 1 SxpLib.Verify Connection ${version} speaker 127.0.0.2 @@ -197,11 +202,12 @@ Check PeerSequence One SxpLib.Should Contain Binding ${resp} 10 10.10.10.0/24 SxpLib.Should Contain Binding ${resp} 10 10.10.0.0/16 SxpLib.Should Contain Binding ${resp} 10 10.0.0.0/8 - : FOR ${node} IN RANGE 3 6 - \ SxpLib.Should Not Contain Binding ${resp} ${node}0 10.10.10.${node}0/32 - \ SxpLib.Should Not Contain Binding ${resp} ${node}0 10.10.${node}0.0/24 - \ SxpLib.Should Not Contain Binding ${resp} ${node}0 10.${node}0.0.0/16 - \ SxpLib.Should Not Contain Binding ${resp} ${node}0 ${node}0.0.0.0/8 + FOR ${node} IN RANGE 3 6 + SxpLib.Should Not Contain Binding ${resp} ${node}0 10.10.10.${node}0/32 + SxpLib.Should Not Contain Binding ${resp} ${node}0 10.10.${node}0.0/24 + SxpLib.Should Not Contain Binding ${resp} ${node}0 10.${node}0.0.0/16 + SxpLib.Should Not Contain Binding ${resp} ${node}0 ${node}0.0.0.0/8 + END Check PeerSequence Two [Documentation] Node 127.0.0.2 should contain only bindings with peer sequence lower or equals 2 @@ -214,11 +220,12 @@ Check PeerSequence Two SxpLib.Should Contain Binding ${resp} 30 10.10.30.0/24 SxpLib.Should Contain Binding ${resp} 30 10.30.0.0/16 SxpLib.Should Contain Binding ${resp} 30 30.0.0.0/8 - : FOR ${node} IN RANGE 4 6 - \ SxpLib.Should Not Contain Binding ${resp} ${node}0 10.10.10.${node}0/32 - \ SxpLib.Should Not Contain Binding ${resp} ${node}0 10.10.${node}0.0/24 - \ SxpLib.Should Not Contain Binding ${resp} ${node}0 10.${node}0.0.0/16 - \ SxpLib.Should Not Contain Binding ${resp} ${node}0 ${node}0.0.0.0/8 + FOR ${node} IN RANGE 4 6 + SxpLib.Should Not Contain Binding ${resp} ${node}0 10.10.10.${node}0/32 + SxpLib.Should Not Contain Binding ${resp} ${node}0 10.10.${node}0.0/24 + SxpLib.Should Not Contain Binding ${resp} ${node}0 10.${node}0.0.0/16 + SxpLib.Should Not Contain Binding ${resp} ${node}0 ${node}0.0.0.0/8 + END Check PeerSequence Three [Documentation] Node 127.0.0.2 should contain only bindings with peer sequence lower or equals 3 diff --git a/csit/suites/sxp/filtering/050_Domain_filtering.robot b/csit/suites/sxp/filtering/050_Domain_filtering.robot index f74ac0a54e..f346677196 100644 --- a/csit/suites/sxp/filtering/050_Domain_filtering.robot +++ b/csit/suites/sxp/filtering/050_Domain_filtering.robot @@ -31,13 +31,15 @@ Update Messages Test Wait Until Keyword Succeeds 15 1 Check Initialized Add Filters Wait Until Keyword Succeeds 15 1 Check Domain Sharing - : FOR ${node} IN RANGE 2 5 - \ Delete Bindings ${node}0 ${node}0.${node}0.${node}0.0/24 127.0.0.${node} - \ Delete Bindings ${node}0 ${node}0.${node}0.0.0/16 127.0.0.${node} + FOR ${node} IN RANGE 2 5 + Delete Bindings ${node}0 ${node}0.${node}0.${node}0.0/24 127.0.0.${node} + Delete Bindings ${node}0 ${node}0.${node}0.0.0/16 127.0.0.${node} + END Wait Until Keyword Succeeds 15 1 Check Domain Sharing After Update - : FOR ${node} IN RANGE 2 5 - \ Add Bindings ${node}0 ${node}0.${node}0.${node}0.0/24 127.0.0.${node} - \ Add Bindings ${node}0 ${node}0.${node}0.0.0/16 127.0.0.${node} + FOR ${node} IN RANGE 2 5 + Add Bindings ${node}0 ${node}0.${node}0.${node}0.0/24 127.0.0.${node} + Add Bindings ${node}0 ${node}0.${node}0.0.0/16 127.0.0.${node} + END Wait Until Keyword Succeeds 15 1 Check Domain Sharing Local Binding Non Transitivity Test @@ -82,14 +84,16 @@ Binding Replacement Test Setup Nodes Local [Documentation] Setups Multi domain topology consisting of 3 specific domains and 1 default, data will be shared by filter. Setup SXP Environment 9 - : FOR ${node} IN RANGE 2 5 - \ Add Bindings ${node}0 ${node}0.${node}0.${node}0.${node}0/32 127.0.0.${node} - \ Add Bindings ${node}0 ${node}0.${node}0.${node}0.0/24 127.0.0.${node} - \ Add Bindings ${node}0 ${node}0.${node}0.0.0/16 127.0.0.${node} - \ Add Bindings ${node}0 ${node}0.0.0.0/8 127.0.0.${node} - \ Add Connection ${version} speaker 127.0.0.1 64999 127.0.0.${node} - : FOR ${node} IN RANGE 5 10 - \ Add Connection ${version} listener 127.0.0.1 64999 127.0.0.${node} + FOR ${node} IN RANGE 2 5 + Add Bindings ${node}0 ${node}0.${node}0.${node}0.${node}0/32 127.0.0.${node} + Add Bindings ${node}0 ${node}0.${node}0.${node}0.0/24 127.0.0.${node} + Add Bindings ${node}0 ${node}0.${node}0.0.0/16 127.0.0.${node} + Add Bindings ${node}0 ${node}0.0.0.0/8 127.0.0.${node} + Add Connection ${version} speaker 127.0.0.1 64999 127.0.0.${node} + END + FOR ${node} IN RANGE 5 10 + Add Connection ${version} listener 127.0.0.1 64999 127.0.0.${node} + END Add Domain ${DOMAIN_1} Add Domain ${DOMAIN_2} Add Domain ${DOMAIN_3} @@ -200,20 +204,21 @@ Check Initialized Should Contain Binding ${resp} 40 40.40.40.0/24 Should Contain Binding ${resp} 40 40.40.0.0/16 Should Contain Binding ${resp} 40 40.0.0.0/8 - : FOR ${node} IN RANGE 8 10 - \ ${resp} Get Bindings 127.0.0.${node} - \ Should Not Contain Binding ${resp} 20 20.20.20.20/32 - \ Should Not Contain Binding ${resp} 20 20.20.20.0/24 - \ Should Not Contain Binding ${resp} 20 20.20.0.0/16 - \ Should Not Contain Binding ${resp} 20 20.0.0.0/8 - \ Should Not Contain Binding ${resp} 30 30.30.30.30/32 - \ Should Not Contain Binding ${resp} 30 30.30.30.0/24 - \ Should Not Contain Binding ${resp} 30 30.30.0.0/16 - \ Should Not Contain Binding ${resp} 30 30.0.0.0/8 - \ Should Not Contain Binding ${resp} 40 40.40.40.40/32 - \ Should Not Contain Binding ${resp} 40 40.40.40.0/24 - \ Should Not Contain Binding ${resp} 40 40.40.0.0/16 - \ Should Not Contain Binding ${resp} 40 40.0.0.0/8 + FOR ${node} IN RANGE 8 10 + ${resp} Get Bindings 127.0.0.${node} + Should Not Contain Binding ${resp} 20 20.20.20.20/32 + Should Not Contain Binding ${resp} 20 20.20.20.0/24 + Should Not Contain Binding ${resp} 20 20.20.0.0/16 + Should Not Contain Binding ${resp} 20 20.0.0.0/8 + Should Not Contain Binding ${resp} 30 30.30.30.30/32 + Should Not Contain Binding ${resp} 30 30.30.30.0/24 + Should Not Contain Binding ${resp} 30 30.30.0.0/16 + Should Not Contain Binding ${resp} 30 30.0.0.0/8 + Should Not Contain Binding ${resp} 40 40.40.40.40/32 + Should Not Contain Binding ${resp} 40 40.40.40.0/24 + Should Not Contain Binding ${resp} 40 40.40.0.0/16 + Should Not Contain Binding ${resp} 40 40.0.0.0/8 + END Check Initialized Local [Documentation] Checks that Local Bindings are not shared between domains @@ -238,14 +243,15 @@ Check Initialized Local Should Not Contain Binding ${resp} 30 30.30.5.5/32 Should Contain Binding ${resp} 40 40.40.40.5/32 Should Contain Binding ${resp} 40 40.40.5.5/32 - : FOR ${node} IN RANGE 8 10 - \ ${resp} Get Bindings 127.0.0.${node} - \ Should Not Contain Binding ${resp} 20 20.20.20.5/32 - \ Should Not Contain Binding ${resp} 20 20.20.5.5/32 - \ Should Not Contain Binding ${resp} 30 30.30.30.5/32 - \ Should Not Contain Binding ${resp} 30 30.30.5.5/32 - \ Should Not Contain Binding ${resp} 40 40.40.40.5/32 - \ Should Not Contain Binding ${resp} 40 40.40.5.5/32 + FOR ${node} IN RANGE 8 10 + ${resp} Get Bindings 127.0.0.${node} + Should Not Contain Binding ${resp} 20 20.20.20.5/32 + Should Not Contain Binding ${resp} 20 20.20.5.5/32 + Should Not Contain Binding ${resp} 30 30.30.30.5/32 + Should Not Contain Binding ${resp} 30 30.30.5.5/32 + Should Not Contain Binding ${resp} 40 40.40.40.5/32 + Should Not Contain Binding ${resp} 40 40.40.5.5/32 + END Check Initialized After Update [Documentation] Checks that Local Bindings are not shared between domains diff --git a/csit/suites/sxp/filtering/100_Inbound_Filtering_Policy.robot b/csit/suites/sxp/filtering/100_Inbound_Filtering_Policy.robot index 75d9079bf7..4e4a7b3502 100644 --- a/csit/suites/sxp/filtering/100_Inbound_Filtering_Policy.robot +++ b/csit/suites/sxp/filtering/100_Inbound_Filtering_Policy.robot @@ -109,6 +109,7 @@ Reconnect Peers [Arguments] ${version}=version4 ${PASSWORD}=none [Documentation] Reconnect all peers connected to node containing filters Clean Connections 127.0.0.1 - : FOR ${node} IN RANGE 2 6 - \ Add Connection ${version} both 127.0.0.${node} 64999 127.0.0.1 - \ ... ${PASSWORD} + FOR ${node} IN RANGE 2 6 + Add Connection ${version} both 127.0.0.${node} 64999 127.0.0.1 + ... ${PASSWORD} + END diff --git a/csit/suites/sxp/performance/010_ConnectivityTests.robot b/csit/suites/sxp/performance/010_ConnectivityTests.robot index a6053f5279..ebee39b536 100644 --- a/csit/suites/sxp/performance/010_ConnectivityTests.robot +++ b/csit/suites/sxp/performance/010_ConnectivityTests.robot @@ -23,24 +23,26 @@ Connectivity TCP-MD5 Test Setup Topology [Arguments] ${connections} ${PASSWORD} ${version} [Documentation] Adds connections to local and remote nodes - : FOR ${num} IN RANGE 0 ${connections} - \ ${address} Get Ip From Number ${num} 2130771968 - \ Add Connection ${version} listener ${address} 64999 password=${PASSWORD} - \ ConnectionTestLibrary.Add Node ${address} ${version} 64999 ${PASSWORD} - \ ConnectionTestLibrary.Add Connection ${version} speaker 127.0.0.1 64999 ${PASSWORD} - \ ... ${address} + FOR ${num} IN RANGE 0 ${connections} + ${address} Get Ip From Number ${num} 2130771968 + Add Connection ${version} listener ${address} 64999 password=${PASSWORD} + ConnectionTestLibrary.Add Node ${address} ${version} 64999 ${PASSWORD} + ConnectionTestLibrary.Add Connection ${version} speaker 127.0.0.1 64999 ${PASSWORD} + ... ${address} + END Check Connectivity [Arguments] ${peers} ${min_peers} ${min_speed} ${PASSWORD}=${EMPTY} ${version}=version4 [Documentation] Starts SXP nodes and checks if peers are already connected, this is repeated N times @{ITEMS} Create List - : FOR ${num} IN RANGE 0 ${TEST_SAMPLES} - \ Setup Topology ${peers} ${PASSWORD} ${version} - \ ConnectionTestLibrary.Start Nodes - \ ConnectionTestLibrary.Initiate Connecting ${min_peers} - \ ${ELEMENT} Wait Until Keyword Succeeds 120 1 Check Connections Connected - \ Append To List ${ITEMS} ${ELEMENT} - \ Test Clean + FOR ${num} IN RANGE 0 ${TEST_SAMPLES} + Setup Topology ${peers} ${PASSWORD} ${version} + ConnectionTestLibrary.Start Nodes + ConnectionTestLibrary.Initiate Connecting ${min_peers} + ${ELEMENT} Wait Until Keyword Succeeds 120 1 Check Connections Connected + Append To List ${ITEMS} ${ELEMENT} + Test Clean + END ${connectivity_speed} Get Average Of Items ${ITEMS} Log Average connectivity speed ${connectivity_speed} connection/s. Should Be True ${connectivity_speed} > ${min_speed} diff --git a/csit/suites/sxp/performance/020_BindingExportTests.robot b/csit/suites/sxp/performance/020_BindingExportTests.robot index 2d35832e7e..d5cec0c57a 100644 --- a/csit/suites/sxp/performance/020_BindingExportTests.robot +++ b/csit/suites/sxp/performance/020_BindingExportTests.robot @@ -35,128 +35,140 @@ Binding Forwarding Export Test Binding Outbound Filter Export Test [Documentation] Test binding export speed with Outbound filter and multiple passrates. Add Bindings Range 112 84213760 ${EXPORT_AMOUNT} - : FOR ${num} IN RANGE 16 20 - \ ${passrate} Evaluate 100.0/(2**(${num} - 16)) - \ ${exported_bindings} Evaluate int(math.ceil( ${EXPORT_AMOUNT}*${passrate}/100 )) modules=math - \ ${exported_bindings} Convert To String ${exported_bindings} - \ Setup Filter ${num} outbound - \ ${export_speed} Simple Export ${exported_bindings} ${TEST_SAMPLES} - \ Log Outbound Export speed ${export_speed} with passrate ${passrate}%. - \ Should Be True ${export_speed} > ${MINIMAL_SPEED} + FOR ${num} IN RANGE 16 20 + ${passrate} Evaluate 100.0/(2**(${num} - 16)) + ${exported_bindings} Evaluate int(math.ceil( ${EXPORT_AMOUNT}*${passrate}/100 )) modules=math + ${exported_bindings} Convert To String ${exported_bindings} + Setup Filter ${num} outbound + ${export_speed} Simple Export ${exported_bindings} ${TEST_SAMPLES} + Log Outbound Export speed ${export_speed} with passrate ${passrate}%. + Should Be True ${export_speed} > ${MINIMAL_SPEED} + END Binding Inbound Filter Forwarding Export Test [Documentation] Test binding forwarding speed with Inbound filter and multiple passrates. - : FOR ${num} IN RANGE 16 20 - \ ${passrate} Evaluate 100.0/(2**(${num} - 16)) - \ ${exported_bindings} Evaluate math.ceil( ${EXPORT_AMOUNT}*${passrate}/100 ) modules=math - \ ${exported_bindings} Convert To String ${exported_bindings} - \ Setup Filter ${num} inbound-discarding - \ ${export_speed} Forwarding Export ${exported_bindings} ${TEST_SAMPLES} - \ Log Outbound Export speed ${export_speed} with passrate ${passrate}%. - \ Should Be True ${export_speed} > ${MINIMAL_SPEED} + FOR ${num} IN RANGE 16 20 + ${passrate} Evaluate 100.0/(2**(${num} - 16)) + ${exported_bindings} Evaluate math.ceil( ${EXPORT_AMOUNT}*${passrate}/100 ) modules=math + ${exported_bindings} Convert To String ${exported_bindings} + Setup Filter ${num} inbound-discarding + ${export_speed} Forwarding Export ${exported_bindings} ${TEST_SAMPLES} + Log Outbound Export speed ${export_speed} with passrate ${passrate}%. + Should Be True ${export_speed} > ${MINIMAL_SPEED} + END Binding Inbound-Discarding Filter Forwarding Export Test [Documentation] Test binding forwarding speed with Inbound-discarding filter and multiple passrates. - : FOR ${num} IN RANGE 16 20 - \ ${passrate} Evaluate 100.0/(2**(${num} - 16)) - \ ${exported_bindings} Evaluate math.ceil( ${EXPORT_AMOUNT}*${passrate}/100 ) modules=math - \ ${exported_bindings} Convert To String ${exported_bindings} - \ Setup Filter ${num} inbound-discarding - \ ${export_speed} Forwarding Export ${exported_bindings} ${TEST_SAMPLES} - \ Log Outbound Export speed ${export_speed} with passrate ${passrate}%. - \ Should Be True ${export_speed} > ${MINIMAL_SPEED} + FOR ${num} IN RANGE 16 20 + ${passrate} Evaluate 100.0/(2**(${num} - 16)) + ${exported_bindings} Evaluate math.ceil( ${EXPORT_AMOUNT}*${passrate}/100 ) modules=math + ${exported_bindings} Convert To String ${exported_bindings} + Setup Filter ${num} inbound-discarding + ${export_speed} Forwarding Export ${exported_bindings} ${TEST_SAMPLES} + Log Outbound Export speed ${export_speed} with passrate ${passrate}%. + Should Be True ${export_speed} > ${MINIMAL_SPEED} + END Binding Domain Filter Export Test [Documentation] Test binding export speed with domain filter and multiple passrates. Add Bindings Range 112 84213760 ${EXPORT_AMOUNT} - : FOR ${num} IN RANGE 16 20 - \ ${passrate} Evaluate 100.0/(2**(${num} - 16)) - \ ${exported_bindings} Evaluate math.ceil( ${EXPORT_AMOUNT}*${passrate}/100 ) modules=math - \ ${exported_bindings} Convert To String ${exported_bindings} - \ Run Keyword And Ignore Error Setup Domain Filter ${num} ${DOMAIN_1} - \ ${export_speed} Simple Export ${exported_bindings} ${TEST_SAMPLES} ${DOMAIN_1} - \ Log Outbound Export speed ${export_speed} with passrate ${passrate}%. - \ Should Be True ${export_speed} > ${MINIMAL_SPEED} + FOR ${num} IN RANGE 16 20 + ${passrate} Evaluate 100.0/(2**(${num} - 16)) + ${exported_bindings} Evaluate math.ceil( ${EXPORT_AMOUNT}*${passrate}/100 ) modules=math + ${exported_bindings} Convert To String ${exported_bindings} + Run Keyword And Ignore Error Setup Domain Filter ${num} ${DOMAIN_1} + ${export_speed} Simple Export ${exported_bindings} ${TEST_SAMPLES} ${DOMAIN_1} + Log Outbound Export speed ${export_speed} with passrate ${passrate}%. + Should Be True ${export_speed} > ${MINIMAL_SPEED} + END Binding Domain Filter Forwarding Export Test [Documentation] Test binding forward speed with domain filter and multiple passrates. - : FOR ${num} IN RANGE 16 20 - \ ${passrate} Evaluate 100.0/(2**(${num} - 16)) - \ ${exported_bindings} Evaluate math.ceil( ${EXPORT_AMOUNT}*${passrate}/100 ) modules=math - \ ${exported_bindings} Convert To String ${exported_bindings} - \ Run Keyword And Ignore Error Setup Domain Filter ${num} ${DOMAIN_1} - \ ${export_speed} Forwarding Export ${exported_bindings} ${TEST_SAMPLES} ${DOMAIN_1} - \ Log Outbound Export speed ${export_speed} with passrate ${passrate}%. - \ Should Be True ${export_speed} > ${MINIMAL_SPEED} + FOR ${num} IN RANGE 16 20 + ${passrate} Evaluate 100.0/(2**(${num} - 16)) + ${exported_bindings} Evaluate math.ceil( ${EXPORT_AMOUNT}*${passrate}/100 ) modules=math + ${exported_bindings} Convert To String ${exported_bindings} + Run Keyword And Ignore Error Setup Domain Filter ${num} ${DOMAIN_1} + ${export_speed} Forwarding Export ${exported_bindings} ${TEST_SAMPLES} ${DOMAIN_1} + Log Outbound Export speed ${export_speed} with passrate ${passrate}%. + Should Be True ${export_speed} > ${MINIMAL_SPEED} + END Binding Combined Filter Export Test [Documentation] Test binding export speed with domain filter, Outbound filter and multiple passrates. Add Bindings Range 112 84213760 ${EXPORT_AMOUNT} - : FOR ${num} IN RANGE 16 20 - \ ${passrate} Evaluate 100.0/(2**(${num} - 16)) - \ ${exported_bindings} Evaluate math.ceil( ${EXPORT_AMOUNT}*${passrate}/100 ) modules=math - \ ${exported_bindings} Convert To String ${exported_bindings} - \ Run Keyword And Ignore Error Setup Domain Filter ${num} ${DOMAIN_1} - \ Setup Filter ${num} outbound - \ ${export_speed} Simple Export ${exported_bindings} ${TEST_SAMPLES} ${DOMAIN_1} - \ Log Outbound Export speed ${export_speed} with passrate ${passrate}%. - \ Should Be True ${export_speed} > ${MINIMAL_SPEED} + FOR ${num} IN RANGE 16 20 + ${passrate} Evaluate 100.0/(2**(${num} - 16)) + ${exported_bindings} Evaluate math.ceil( ${EXPORT_AMOUNT}*${passrate}/100 ) modules=math + ${exported_bindings} Convert To String ${exported_bindings} + Run Keyword And Ignore Error Setup Domain Filter ${num} ${DOMAIN_1} + Setup Filter ${num} outbound + ${export_speed} Simple Export ${exported_bindings} ${TEST_SAMPLES} ${DOMAIN_1} + Log Outbound Export speed ${export_speed} with passrate ${passrate}%. + Should Be True ${export_speed} > ${MINIMAL_SPEED} + END Binding Combined Filter Forwarding Export Test [Documentation] Test binding forward speed with domain filter, Inbound-discarding filter and multiple passrates. - : FOR ${num} IN RANGE 16 20 - \ ${passrate} Evaluate 100.0/(2**(${num} - 16)) - \ ${exported_bindings} Evaluate math.ceil( ${EXPORT_AMOUNT}*${passrate}/100 ) modules=math - \ ${exported_bindings} Convert To String ${exported_bindings} - \ Run Keyword And Ignore Error Setup Domain Filter ${num} ${DOMAIN_1} - \ Setup Filter ${num} inbound-discarding - \ ${export_speed} Forwarding Export ${exported_bindings} ${TEST_SAMPLES} ${DOMAIN_1} - \ Log Outbound Export speed ${export_speed} with passrate ${passrate}%. - \ Should Be True ${export_speed} > ${MINIMAL_SPEED} + FOR ${num} IN RANGE 16 20 + ${passrate} Evaluate 100.0/(2**(${num} - 16)) + ${exported_bindings} Evaluate math.ceil( ${EXPORT_AMOUNT}*${passrate}/100 ) modules=math + ${exported_bindings} Convert To String ${exported_bindings} + Run Keyword And Ignore Error Setup Domain Filter ${num} ${DOMAIN_1} + Setup Filter ${num} inbound-discarding + ${export_speed} Forwarding Export ${exported_bindings} ${TEST_SAMPLES} ${DOMAIN_1} + Log Outbound Export speed ${export_speed} with passrate ${passrate}%. + Should Be True ${export_speed} > ${MINIMAL_SPEED} + END *** Keywords *** Setup Binding Export Topology [Arguments] ${version}=version4 ${PASSWORD}=${EMPTY} ${destination_nodes}=3 ${destination_domain}=global [Documentation] Adds connections to local and remote nodes and wait until they are connected Setup Simple Binding Export Topology ${version} ${PASSWORD} ${destination_nodes} 1 ${destination_domain} - : FOR ${num} IN RANGE 0 ${destination_nodes} - \ ${DESTINATION_NODE} Get Ip From Number And Ip ${num} ${DESTINATION_IP} - \ ExportLibrary.Add Connection ${version} listener 127.0.0.1 64999 ${PASSWORD} - \ ... ${DESTINATION_NODE} - \ Wait Until Keyword Succeeds 15 1 Verify Connection ${version} speaker - \ ... ${DESTINATION_NODE} 64999 domain=${destination_domain} + FOR ${num} IN RANGE 0 ${destination_nodes} + ${DESTINATION_NODE} Get Ip From Number And Ip ${num} ${DESTINATION_IP} + ExportLibrary.Add Connection ${version} listener 127.0.0.1 64999 ${PASSWORD} + ... ${DESTINATION_NODE} + Wait Until Keyword Succeeds 15 1 Verify Connection ${version} speaker + ... ${DESTINATION_NODE} 64999 domain=${destination_domain} + END Setup Simple Binding Export Topology [Arguments] ${version}=version4 ${PASSWORD}=${EMPTY} ${destination_nodes}=3 ${source_nodes}=1 ${destination_domain}=global [Documentation] Adds connections to local and remote nodes and wait until they are connected - : FOR ${num} IN RANGE 0 ${source_nodes} - \ ${SOURCE_NODE} Get Ip From Number And Ip ${num} ${SOURCE_IP} - \ ExportLibrary.Add Node ${SOURCE_NODE} ${version} 64999 ${PASSWORD} - \ ExportLibrary.Add Connection ${version} speaker 127.0.0.1 64999 ${PASSWORD} - \ ... ${SOURCE_NODE} - : FOR ${num} IN RANGE 0 ${destination_nodes} - \ ${DESTINATION_NODE} Get Ip From Number And Ip ${num} ${DESTINATION_IP} - \ ExportLibrary.Add Destination Node ${DESTINATION_NODE} ${version} 64999 ${PASSWORD} - \ Add Connection ${version} speaker ${DESTINATION_NODE} 64999 password=${PASSWORD} - \ ... domain=${destination_domain} + FOR ${num} IN RANGE 0 ${source_nodes} + ${SOURCE_NODE} Get Ip From Number And Ip ${num} ${SOURCE_IP} + ExportLibrary.Add Node ${SOURCE_NODE} ${version} 64999 ${PASSWORD} + ExportLibrary.Add Connection ${version} speaker 127.0.0.1 64999 ${PASSWORD} + ... ${SOURCE_NODE} + END + FOR ${num} IN RANGE 0 ${destination_nodes} + ${DESTINATION_NODE} Get Ip From Number And Ip ${num} ${DESTINATION_IP} + ExportLibrary.Add Destination Node ${DESTINATION_NODE} ${version} 64999 ${PASSWORD} + Add Connection ${version} speaker ${DESTINATION_NODE} 64999 password=${PASSWORD} + ... domain=${destination_domain} + END ExportLibrary.Start Nodes - : FOR ${num} IN RANGE 0 ${source_nodes} - \ ${SOURCE_NODE} Get Ip From Number And Ip ${num} ${SOURCE_IP} - \ Add Connection ${version} listener ${SOURCE_NODE} 64999 password=${PASSWORD} - \ Wait Until Keyword Succeeds 60 2 Verify Connection ${version} listener - \ ... ${SOURCE_NODE} 64999 + FOR ${num} IN RANGE 0 ${source_nodes} + ${SOURCE_NODE} Get Ip From Number And Ip ${num} ${SOURCE_IP} + Add Connection ${version} listener ${SOURCE_NODE} 64999 password=${PASSWORD} + Wait Until Keyword Succeeds 60 2 Verify Connection ${version} listener + ... ${SOURCE_NODE} 64999 + END Simple Export [Arguments] ${check_amount} ${samples}=10 ${destination_domain}=global [Documentation] Starts SXP nodes and checks if bindings are already exported, this is repeated N times @{ITEMS} Create List - : FOR ${num} IN RANGE 0 ${samples} - \ Setup Simple Binding Export Topology destination_domain=${destination_domain} - \ ExportLibrary.Set Export Amount ${check_amount} - \ ExportLibrary.Initiate Simple Export 127.0.0.1 - \ ${ELEMENT} Wait Until Keyword Succeeds 120 1 Check Bindings Exported - \ Append To List ${ITEMS} ${ELEMENT} - \ Test Clean + FOR ${num} IN RANGE 0 ${samples} + Setup Simple Binding Export Topology destination_domain=${destination_domain} + ExportLibrary.Set Export Amount ${check_amount} + ExportLibrary.Initiate Simple Export 127.0.0.1 + ${ELEMENT} Wait Until Keyword Succeeds 120 1 Check Bindings Exported + Append To List ${ITEMS} ${ELEMENT} + Test Clean + END Log ${ITEMS} ${export_speed} Get Average Of Items ${ITEMS} [Return] ${export_speed} @@ -165,13 +177,14 @@ Forwarding Export [Arguments] ${check_amount} ${samples}=10 ${destination_domain}=global [Documentation] Starts SXP nodes and checks if bindings are already forwarded, this is repeated N times @{ITEMS} Create List - : FOR ${num} IN RANGE 0 ${samples} - \ Setup Binding Export Topology destination_domain=${destination_domain} - \ ExportLibrary.Set Export Amount ${check_amount} - \ ExportLibrary.Initiate Export 132.5.0.0/16 112 - \ ${ELEMENT} Wait Until Keyword Succeeds 360 1 Check Bindings Exported - \ Append To List ${ITEMS} ${ELEMENT} - \ Test Clean + FOR ${num} IN RANGE 0 ${samples} + Setup Binding Export Topology destination_domain=${destination_domain} + ExportLibrary.Set Export Amount ${check_amount} + ExportLibrary.Initiate Export 132.5.0.0/16 112 + ${ELEMENT} Wait Until Keyword Succeeds 360 1 Check Bindings Exported + Append To List ${ITEMS} ${ELEMENT} + Test Clean + END Log ${ITEMS} ${export_speed} Get Average Of Items ${ITEMS} [Return] ${export_speed} diff --git a/csit/suites/sxp/topology/010_Topology_Features.robot b/csit/suites/sxp/topology/010_Topology_Features.robot index d57977556f..84a13dd2b0 100644 --- a/csit/suites/sxp/topology/010_Topology_Features.robot +++ b/csit/suites/sxp/topology/010_Topology_Features.robot @@ -27,16 +27,17 @@ Export Test Legacy [Documentation] Test behaviour after shutting down connections in Legacy versions [Tags] SXP TopoBuiltIn.Logy @{list} = Create List version1 - : FOR ${version} IN @{list} - \ Setup TopoBuiltIn.Logy Triangel ${version} - \ BuiltIn.Wait Until Keyword Succeeds 4 1 Check Export Part One - \ SxpLib.Delete Connections 127.0.0.1 64999 127.0.0.3 - \ SxpLib.Delete Connections 127.0.0.3 64999 127.0.0.1 - \ BuiltIn.Wait Until Keyword Succeeds 4 1 Check Export Part Two - \ SxpLib.Delete Connections 127.0.0.1 64999 127.0.0.2 - \ SxpLib.Delete Connections 127.0.0.2 64999 127.0.0.1 - \ BuiltIn.Wait Until Keyword Succeeds 4 1 Check Export Part Three - \ Clean Nodes + FOR ${version} IN @{list} + Setup TopoBuiltIn.Logy Triangel ${version} + BuiltIn.Wait Until Keyword Succeeds 4 1 Check Export Part One + SxpLib.Delete Connections 127.0.0.1 64999 127.0.0.3 + SxpLib.Delete Connections 127.0.0.3 64999 127.0.0.1 + BuiltIn.Wait Until Keyword Succeeds 4 1 Check Export Part Two + SxpLib.Delete Connections 127.0.0.1 64999 127.0.0.2 + SxpLib.Delete Connections 127.0.0.2 64999 127.0.0.1 + BuiltIn.Wait Until Keyword Succeeds 4 1 Check Export Part Three + Clean Nodes + END Forwarding Test V2=>V1 [Documentation] Version 2 => 1 functionality diff --git a/csit/suites/sxp/topology/020_Scalability.robot b/csit/suites/sxp/topology/020_Scalability.robot index 2df1a776c7..12635ae59b 100644 --- a/csit/suites/sxp/topology/020_Scalability.robot +++ b/csit/suites/sxp/topology/020_Scalability.robot @@ -26,9 +26,10 @@ Test Complex Mega Topology Text Bindings export [Documentation] Stress test that consist of exporting 500 Bindings under 5s [Tags] SXP Scalability - : FOR ${num} IN RANGE 2 502 - \ ${ip} = Sxp.Get Ip From Number ${num} - \ SxpLib.Add Bindings ${num} ${ip}/32 127.0.0.2 + FOR ${num} IN RANGE 2 502 + ${ip} = Sxp.Get Ip From Number ${num} + SxpLib.Add Bindings ${num} ${ip}/32 127.0.0.2 + END SxpLib.Add Connection version4 listener 127.0.0.2 64999 127.0.0.1 SxpLib.Add Connection version4 speaker 127.0.0.1 64999 127.0.0.2 BuiltIn.Wait Until Keyword Succeeds 15 1 Verify Connection version4 listener 127.0.0.2 @@ -37,43 +38,47 @@ Text Bindings export *** Keywords *** Setup Mega Topology [Arguments] ${version}=version4 - : FOR ${num} IN RANGE 2 22 - \ ${ip} = Sxp.Get Ip From Number ${num} - \ SxpLib.Add Bindings ${num} ${ip}/32 ${ip} - \ SxpLib.Add Connection ${version} listener ${ip} 64999 127.0.0.1 - \ SxpLib.Add Connection ${version} speaker 127.0.0.1 64999 ${ip} - \ BuiltIn.Wait Until Keyword Succeeds 15 1 Verify Connection ${version} listener - \ ... ${ip} + FOR ${num} IN RANGE 2 22 + ${ip} = Sxp.Get Ip From Number ${num} + SxpLib.Add Bindings ${num} ${ip}/32 ${ip} + SxpLib.Add Connection ${version} listener ${ip} 64999 127.0.0.1 + SxpLib.Add Connection ${version} speaker 127.0.0.1 64999 ${ip} + BuiltIn.Wait Until Keyword Succeeds 15 1 Verify Connection ${version} listener + ... ${ip} + END Setup Complex Mega Topology [Arguments] ${version}=version4 Setup Mega Topology ${version} ${second_num} Convert To Integer 2 - : FOR ${num} IN RANGE 22 32 - \ ${ip} = Sxp.Get Ip From Number ${num} - \ ${second_ip} = Sxp.Get Ip From Number ${second_num} - \ SxpLib.Add Bindings ${num} ${ip}/32 ${ip} - \ SxpLib.Add Connection ${version} listener ${ip} 64999 ${second_ip} - \ SxpLib.Add Connection ${version} speaker ${second_ip} 64999 ${ip} - \ BuiltIn.Wait Until Keyword Succeeds 15 1 Verify Connection ${version} listener - \ ... ${ip} 64999 ${second_ip} - \ ${second_num} = Set Variable ${second_num + 1} - \ ${second_ip} = Sxp.Get Ip From Number ${second_num} - \ SxpLib.Add Connection ${version} listener ${ip} 64999 ${second_ip} - \ SxpLib.Add Connection ${version} speaker ${second_ip} 64999 ${ip} - \ BuiltIn.Wait Until Keyword Succeeds 15 1 Verify Connection ${version} listener - \ ... ${ip} 64999 ${second_ip} + FOR ${num} IN RANGE 22 32 + ${ip} = Sxp.Get Ip From Number ${num} + ${second_ip} = Sxp.Get Ip From Number ${second_num} + SxpLib.Add Bindings ${num} ${ip}/32 ${ip} + SxpLib.Add Connection ${version} listener ${ip} 64999 ${second_ip} + SxpLib.Add Connection ${version} speaker ${second_ip} 64999 ${ip} + BuiltIn.Wait Until Keyword Succeeds 15 1 Verify Connection ${version} listener + ... ${ip} 64999 ${second_ip} + ${second_num} = Set Variable ${second_num + 1} + ${second_ip} = Sxp.Get Ip From Number ${second_num} + SxpLib.Add Connection ${version} listener ${ip} 64999 ${second_ip} + SxpLib.Add Connection ${version} speaker ${second_ip} 64999 ${ip} + BuiltIn.Wait Until Keyword Succeeds 15 1 Verify Connection ${version} listener + ... ${ip} 64999 ${second_ip} + END Check Binding Range [Arguments] ${start} ${end} ${node}=127.0.0.1 [Documentation] Check if binding range is contained by node ${resp} = SxpLib.Get Bindings ${node} - : FOR ${num} IN RANGE ${start} ${end} - \ ${ip} = Sxp.Get Ip From Number ${num} - \ Should Contain Binding ${resp} ${num} ${ip}/32 + FOR ${num} IN RANGE ${start} ${end} + ${ip} = Sxp.Get Ip From Number ${num} + Should Contain Binding ${resp} ${num} ${ip}/32 + END Clean Nodes - : FOR ${num} IN RANGE 1 32 - \ ${ip} = Sxp.Get Ip From Number ${num} - \ SxpLib.Clean Bindings ${ip} - \ SxpLib.Clean Connections ${ip} + FOR ${num} IN RANGE 1 32 + ${ip} = Sxp.Get Ip From Number ${num} + SxpLib.Clean Bindings ${ip} + SxpLib.Clean Connections ${ip} + END diff --git a/csit/suites/sxp/topology/030_Domains_Forwarding.robot b/csit/suites/sxp/topology/030_Domains_Forwarding.robot index 5422e9d16c..6079b76dfb 100644 --- a/csit/suites/sxp/topology/030_Domains_Forwarding.robot +++ b/csit/suites/sxp/topology/030_Domains_Forwarding.robot @@ -29,16 +29,17 @@ Export Separation Node 7 Test Export Separation Node 8-9 Test [Documentation] Test if Nodes 8,9 contains only bindings from guest domain [Tags] SXP Domains - : FOR ${node} IN RANGE 8 10 - \ Check Binding Range Negative 20 2000 2300 127.0.0.${node} - \ Check Binding Range 30 3000 3300 127.0.0.${node} - \ Check Binding Range 40 4000 3300 127.0.0.${node} - \ Check Binding Range Negative 50 5000 5300 127.0.0.${node} - \ Check Binding Range Negative 60 6000 6300 127.0.0.${node} - \ Check Binding Range Negative 110 11000 11300 127.0.0.${node} - \ Check Binding Range Negative 120 12000 12300 127.0.0.${node} - \ Check Binding Range Negative 130 13000 13300 127.0.0.${node} - \ Check Binding Range Negative 140 14000 14300 127.0.0.${node} + FOR ${node} IN RANGE 8 10 + Check Binding Range Negative 20 2000 2300 127.0.0.${node} + Check Binding Range 30 3000 3300 127.0.0.${node} + Check Binding Range 40 4000 3300 127.0.0.${node} + Check Binding Range Negative 50 5000 5300 127.0.0.${node} + Check Binding Range Negative 60 6000 6300 127.0.0.${node} + Check Binding Range Negative 110 11000 11300 127.0.0.${node} + Check Binding Range Negative 120 12000 12300 127.0.0.${node} + Check Binding Range Negative 130 13000 13300 127.0.0.${node} + Check Binding Range Negative 140 14000 14300 127.0.0.${node} + END Export Separation Node 10 Test [Documentation] Test if Node 10 contains only bindings from trusted domain @@ -56,30 +57,34 @@ Export Separation Node 10 Test Export Separation Node 11-14 Test [Documentation] Test if Nodes 11-14 contains only bindings from secure domain [Tags] SXP Domains - : FOR ${node} IN RANGE 11 15 - \ Check Binding Range Negative 20 2000 2300 127.0.0.${node} - \ Check Binding Range Negative 30 3000 3300 127.0.0.${node} - \ Check Binding Range Negative 40 4000 4300 127.0.0.${node} - \ Check Binding Range Negative 50 5000 5300 127.0.0.${node} - \ Check Binding Range Negative 60 6000 6300 127.0.0.${node} - \ Check Binding Range 110 11000 11300 127.0.0.${node} - \ Check Binding Range 120 12000 12300 127.0.0.${node} - \ Check Binding Range 130 13000 13300 127.0.0.${node} - \ Check Binding Range 140 14000 14300 127.0.0.${node} + FOR ${node} IN RANGE 11 15 + Check Binding Range Negative 20 2000 2300 127.0.0.${node} + Check Binding Range Negative 30 3000 3300 127.0.0.${node} + Check Binding Range Negative 40 4000 4300 127.0.0.${node} + Check Binding Range Negative 50 5000 5300 127.0.0.${node} + Check Binding Range Negative 60 6000 6300 127.0.0.${node} + Check Binding Range 110 11000 11300 127.0.0.${node} + Check Binding Range 120 12000 12300 127.0.0.${node} + Check Binding Range 130 13000 13300 127.0.0.${node} + Check Binding Range 140 14000 14300 127.0.0.${node} + END *** Keywords *** Setup Nodes Local [Arguments] ${version}=version4 [Documentation] Setups Multi domain topology consisting of 3 specific domains and 1 default, data between domains must remain separated. Setup SXP Environment 14 - : FOR ${node} IN RANGE 2 7 - \ Add Connection ${version} speaker 127.0.0.1 64999 127.0.0.${node} - \ Add Bindings Range ${node}0 ${node}000 300 127.0.0.${node} - : FOR ${node} IN RANGE 7 11 - \ Add Connection ${version} listener 127.0.0.1 64999 127.0.0.${node} - : FOR ${node} IN RANGE 11 15 - \ Add Connection ${version} both 127.0.0.1 64999 127.0.0.${node} - \ Add Bindings Range ${node}0 ${node}000 300 127.0.0.${node} + FOR ${node} IN RANGE 2 7 + Add Connection ${version} speaker 127.0.0.1 64999 127.0.0.${node} + Add Bindings Range ${node}0 ${node}000 300 127.0.0.${node} + END + FOR ${node} IN RANGE 7 11 + Add Connection ${version} listener 127.0.0.1 64999 127.0.0.${node} + END + FOR ${node} IN RANGE 11 15 + Add Connection ${version} both 127.0.0.1 64999 127.0.0.${node} + Add Bindings Range ${node}0 ${node}000 300 127.0.0.${node} + END Add Domain ${DOMAIN_1} Add Domain ${DOMAIN_2} Add Domain ${DOMAIN_3} @@ -112,7 +117,8 @@ Setup Nodes Local Wait Until Keyword Succeeds 15 1 Verify Connection ${version} speaker 127.0.0.10 ... domain=${DOMAIN_2} # DOMAIN 3 - : FOR ${node} IN RANGE 11 15 - \ Add Connection ${version} both 127.0.0.${node} 64999 domain=${DOMAIN_3} - \ Wait Until Keyword Succeeds 15 1 Verify Connection ${version} both - \ ... 127.0.0.${node} domain=${DOMAIN_3} + FOR ${node} IN RANGE 11 15 + Add Connection ${version} both 127.0.0.${node} 64999 domain=${DOMAIN_3} + Wait Until Keyword Succeeds 15 1 Verify Connection ${version} both + ... 127.0.0.${node} domain=${DOMAIN_3} + END diff --git a/csit/suites/sxp/topology/040_Domains_Substraction.robot b/csit/suites/sxp/topology/040_Domains_Substraction.robot index c3357bc56d..75dcfe9f6e 100644 --- a/csit/suites/sxp/topology/040_Domains_Substraction.robot +++ b/csit/suites/sxp/topology/040_Domains_Substraction.robot @@ -30,19 +30,22 @@ Export Separation Node 7 Test Export Separation Node 8-9 Test [Documentation] Test if Nodes 8,9 contains consistent data during its update [Tags] SXP Domains - : FOR ${node} IN RANGE 8 10 - \ Check Binding Range Negative 20 0 300 127.0.0.${node} - \ Check Binding Range 40 0 300 127.0.0.${node} - \ Check Binding Range Negative 60 0 300 127.0.0.${node} - \ Check Binding Range Negative 120 0 300 127.0.0.${node} + FOR ${node} IN RANGE 8 10 + Check Binding Range Negative 20 0 300 127.0.0.${node} + Check Binding Range 40 0 300 127.0.0.${node} + Check Binding Range Negative 60 0 300 127.0.0.${node} + Check Binding Range Negative 120 0 300 127.0.0.${node} + END Delete Bindings Range 60 0 300 127.0.0.6 - : FOR ${node} IN RANGE 8 10 - \ Wait Until Keyword Succeeds 15 1 Check Binding Range 40 0 - \ ... 300 127.0.0.${node} + FOR ${node} IN RANGE 8 10 + Wait Until Keyword Succeeds 15 1 Check Binding Range 40 0 + ... 300 127.0.0.${node} + END Delete Bindings Range 40 0 300 127.0.0.4 - : FOR ${node} IN RANGE 8 10 - \ Wait Until Keyword Succeeds 15 1 Check Binding Range Negative 40 0 - \ ... 300 127.0.0.${node} + FOR ${node} IN RANGE 8 10 + Wait Until Keyword Succeeds 15 1 Check Binding Range Negative 40 0 + ... 300 127.0.0.${node} + END Export Separation Node 10 Test [Documentation] Test if Node 10 contains consistent data during its update @@ -61,31 +64,37 @@ Export Separation Node 10 Test Export Separation Node 11-14 Test [Documentation] Test if Nodes 11-14 contains consistent data during its update [Tags] SXP Domains - : FOR ${node} IN RANGE 11 15 - \ Check Binding Range Negative 20 0 300 127.0.0.${node} - \ Check Binding Range Negative 40 0 300 127.0.0.${node} - \ Check Binding Range Negative 60 0 300 127.0.0.${node} - \ Check Binding Range 120 0 300 127.0.0.${node} + FOR ${node} IN RANGE 11 15 + Check Binding Range Negative 20 0 300 127.0.0.${node} + Check Binding Range Negative 40 0 300 127.0.0.${node} + Check Binding Range Negative 60 0 300 127.0.0.${node} + Check Binding Range 120 0 300 127.0.0.${node} + END Delete Bindings Range 60 0 300 127.0.0.6 - : FOR ${node} IN RANGE 11 15 - \ Wait Until Keyword Succeeds 15 1 Check Binding Range 120 0 - \ ... 300 127.0.0.${node} + FOR ${node} IN RANGE 11 15 + Wait Until Keyword Succeeds 15 1 Check Binding Range 120 0 + ... 300 127.0.0.${node} + END Delete Bindings Range 120 0 300 127.0.0.12 - : FOR ${node} IN RANGE 11 15 - \ Wait Until Keyword Succeeds 15 1 Check Binding Range Negative 120 0 - \ ... 300 127.0.0.${node} + FOR ${node} IN RANGE 11 15 + Wait Until Keyword Succeeds 15 1 Check Binding Range Negative 120 0 + ... 300 127.0.0.${node} + END *** Keywords *** Setup Nodes Local [Arguments] ${version}=version4 [Documentation] Setups Multi domain topology consisting of 3 specific domains and 1 default, data between domains must remain separated. Setup SXP Environment 14 - : FOR ${node} IN RANGE 2 7 - \ Add Connection ${version} speaker 127.0.0.1 64999 127.0.0.${node} - : FOR ${node} IN RANGE 7 11 - \ Add Connection ${version} listener 127.0.0.1 64999 127.0.0.${node} - : FOR ${node} IN RANGE 11 15 - \ Add Connection ${version} both 127.0.0.1 64999 127.0.0.${node} + FOR ${node} IN RANGE 2 7 + Add Connection ${version} speaker 127.0.0.1 64999 127.0.0.${node} + END + FOR ${node} IN RANGE 7 11 + Add Connection ${version} listener 127.0.0.1 64999 127.0.0.${node} + END + FOR ${node} IN RANGE 11 15 + Add Connection ${version} both 127.0.0.1 64999 127.0.0.${node} + END Add Domain ${DOMAIN_1} Add Domain ${DOMAIN_2} Add Domain ${DOMAIN_3} @@ -122,7 +131,8 @@ Setup Nodes Local Wait Until Keyword Succeeds 15 1 Verify Connection ${version} speaker 127.0.0.10 ... domain=${DOMAIN_2} # DOMAIN 3 - : FOR ${node} IN RANGE 11 15 - \ Add Connection ${version} both 127.0.0.${node} 64999 domain=${DOMAIN_3} - \ Wait Until Keyword Succeeds 15 1 Verify Connection ${version} both - \ ... 127.0.0.${node} domain=${DOMAIN_3} + FOR ${node} IN RANGE 11 15 + Add Connection ${version} both 127.0.0.${node} 64999 domain=${DOMAIN_3} + Wait Until Keyword Succeeds 15 1 Verify Connection ${version} both + ... 127.0.0.${node} domain=${DOMAIN_3} + END diff --git a/csit/suites/topoprocessing/basic-topology-operations/070_Underlay_update.robot b/csit/suites/topoprocessing/basic-topology-operations/070_Underlay_update.robot index cd041e046a..83b4633618 100644 --- a/csit/suites/topoprocessing/basic-topology-operations/070_Underlay_update.robot +++ b/csit/suites/topoprocessing/basic-topology-operations/070_Underlay_update.robot @@ -34,16 +34,18 @@ Unification Node Update Basic Request Put ${node} network-topology:network-topology/topology/network-topo:1/node/bgp:1 ${resp} Wait Until Keyword Succeeds 3x 1s Output Topo Should Be Complete node_count=7 supporting-node_count=10 ... tp_count=11 tp-ref_count=11 - : FOR ${index} IN RANGE 1 11 - \ Should Contain X Times ${resp.content} bgp:${index} 1 + FOR ${index} IN RANGE 1 11 + Should Contain X Times ${resp.content} bgp:${index} 1 + END Check Aggregated Node in Topology ${model} ${resp.content} 0 bgp:2 bgp:1 #Update a unified node, expecting creation of a new overlay node ${node} Create Isis Node bgp:3 router-id-ipv4=192.168.3.1 Basic Request Put ${node} network-topology:network-topology/topology/network-topo:1/node/bgp:3 ${resp} Wait Until Keyword Succeeds 3x 1s Output Topo Should Be Complete node_count=8 supporting-node_count=10 ... tp_count=9 tp-ref_count=9 - : FOR ${index} IN RANGE 1 11 - \ Should Contain X Times ${resp.content} bgp:${index} 1 + FOR ${index} IN RANGE 1 11 + Should Contain X Times ${resp.content} bgp:${index} 1 + END Unification Node Inventory [Documentation] Test processing of updates using unification operation on Inventory model @@ -59,16 +61,18 @@ Unification Node Inventory Basic Request Put ${node} opendaylight-inventory:nodes/node/openflow:2 ${resp} Wait Until Keyword Succeeds 3x 1s Output Topo Should Be Complete node_count=6 supporting-node_count=10 ... tp_count=12 tp-ref_count=12 - : FOR ${index} IN RANGE 1 11 - \ Should Contain X Times ${resp.content} of-node:${index} 1 + FOR ${index} IN RANGE 1 11 + Should Contain X Times ${resp.content} of-node:${index} 1 + END Check Aggregated Node in Topology ${model} ${resp.content} 5 of-node:2 of-node:6 of-node:1 #Update a unified node, expecting creation of a new overlay node ${node} Create Openflow Node openflow:4 192.168.3.1 Basic Request Put ${node} opendaylight-inventory:nodes/node/openflow:4 ${resp} Wait Until Keyword Succeeds 3x 1s Output Topo Should Be Complete node_count=7 supporting-node_count=10 ... tp_count=12 tp-ref_count=12 - : FOR ${index} IN RANGE 1 11 - \ Should Contain X Times ${resp.content} of-node:${index} 1 + FOR ${index} IN RANGE 1 11 + Should Contain X Times ${resp.content} of-node:${index} 1 + END Filtration Range Number Node Update Network Topology Model ${model} Set Variable network-topology-model @@ -82,8 +86,9 @@ Filtration Range Number Node Update Network Topology Model Basic Request Put ${request} network-topology:network-topology/topology/network-topo:2/node/bgp:7 ${resp} Wait Until Keyword Succeeds 3x 1s Output Topo Should Be Complete node_count=3 supporting-node_count=3 ... node-ref_count=3 tp_count=3 tp-ref_count=3 - : FOR ${index} IN RANGE 8 11 - \ Should Contain X Times ${resp.content} bgp:${index} 1 + FOR ${index} IN RANGE 8 11 + Should Contain X Times ${resp.content} bgp:${index} 1 + END Should Not Contain ${resp.content} bgp:7 ${topology_id} Set Variable network-topo:2 Check Aggregated Termination Point in Node ${model} ${resp.content} ${topology_id} bgp:8 tp:8:1 tp:8:1 @@ -97,8 +102,9 @@ Filtration Range Number Node Update Network Topology Model Basic Request Put ${request} network-topology:network-topology/topology/network-topo:2/node/bgp:7/termination-point/tp:7:1 ${resp} Wait Until Keyword Succeeds 3x 1s Output Topo Should Be Complete node_count=4 supporting-node_count=4 ... node-ref_count=4 tp_count=4 tp-ref_count=4 - : FOR ${index} IN RANGE 7 11 - \ Should Contain X Times ${resp.content} bgp:${index} 1 + FOR ${index} IN RANGE 7 11 + Should Contain X Times ${resp.content} bgp:${index} 1 + END Check Aggregated Termination Point in Node ${model} ${resp.content} ${topology_id} bgp:7 tp:7:1 tp:7:1 Check Aggregated Termination Point in Node ${model} ${resp.content} ${topology_id} bgp:8 tp:8:1 tp:8:1 Check Aggregated Termination Point in Node ${model} ${resp.content} ${topology_id} bgp:9 tp:9:1 tp:9:1 @@ -116,15 +122,17 @@ Filtration Range Number Node Update Inventory Model Basic Request Put ${request} opendaylight-inventory:nodes/node/openflow:7 ${resp} Wait Until Keyword Succeeds 3x 1s Output Topo Should Be Complete node_count=4 supporting-node_count=4 ... node-ref_count=4 tp_count=0 tp-ref_count=0 - : FOR ${index} IN RANGE 7 11 - \ Should Contain X Times ${resp.content} of-node:${index} 1 - #Update a Node so it is filtered out + FOR ${index} IN RANGE 7 11 + Should Contain X Times ${resp.content} of-node:${index} 1 + #Update a Node so it is filtered out + END ${request} Create Openflow Node openflow:7 192.168.2.3 17 Basic Request Put ${request} opendaylight-inventory:nodes/node/openflow:7 ${resp} Wait Until Keyword Succeeds 3x 1s Output Topo Should Be Complete node_count=3 supporting-node_count=3 ... node-ref_count=3 tp_count=0 tp-ref_count=0 - : FOR ${index} IN RANGE 8 11 - \ Should Contain X Times ${resp.content} of-node:${index} 1 + FOR ${index} IN RANGE 8 11 + Should Contain X Times ${resp.content} of-node:${index} 1 + END Should Not Contain ${resp.content} of-node:7 Filtration Range Number Termination Point Update NT @@ -227,15 +235,17 @@ Unification Filtration Node Update Inside Network Topology model Basic Request Put ${request} network-topology:network-topology/topology/network-topo:4/node/bgp:17 ${resp} Wait Until Keyword Succeeds 3x 1s Output Topo Should Be Complete node_count=2 supporting-node_count=4 ... node-ref_count=4 tp_count=0 tp-ref_count=0 - : FOR ${index} IN RANGE 17 21 - \ Should Contain X Times ${resp.content} bgp:${index} 1 + FOR ${index} IN RANGE 17 21 + Should Contain X Times ${resp.content} bgp:${index} 1 + END Check Aggregated Node in Topology ${model} ${resp.content} 0 bgp:18 bgp:17 bgp:20 ${request} Create Isis Node bgp:17 10 192.168.1.2 Basic Request Put ${request} network-topology:network-topology/topology/network-topo:4/node/bgp:17 ${resp} Wait Until Keyword Succeeds 3x 1s Output Topo Should Be Complete node_count=2 supporting-node_count=3 ... node-ref_count=3 tp_count=0 tp-ref_count=0 - : FOR ${index} IN RANGE 18 21 - \ Should Contain X Times ${resp.content} bgp:${index} 1 + FOR ${index} IN RANGE 18 21 + Should Contain X Times ${resp.content} bgp:${index} 1 + END Check Aggregated Node in Topology ${model} ${resp.content} 0 bgp:18 bgp:20 Unification Filtration Node Update Inside Inventory model @@ -251,8 +261,9 @@ Unification Filtration Node Update Inside Inventory model Basic Request Put ${request} opendaylight-inventory:nodes/node/openflow:17 ${resp} Wait Until Keyword Succeeds 3x 1s Output Topo Should Be Complete node_count=2 supporting-node_count=3 ... node-ref_count=3 tp_count=0 tp-ref_count=0 - : FOR ${index} IN RANGE 18 21 - \ Should Contain X Times ${resp.content} of-node:${index} 1 + FOR ${index} IN RANGE 18 21 + Should Contain X Times ${resp.content} of-node:${index} 1 + END ${node} Get Element ${resp.content} xpath=.//node/supporting-node[node-ref='of-node:19']/.. ${node} Element to String ${node} Should Contain X Times ${node} 2 @@ -263,8 +274,9 @@ Unification Filtration Node Update Inside Inventory model Basic Request Put ${request} opendaylight-inventory:nodes/node/openflow:17 ${resp} Wait Until Keyword Succeeds 3x 1s Output Topo Should Be Complete node_count=2 supporting-node_count=4 ... node-ref_count=4 tp_count=0 tp-ref_count=0 - : FOR ${index} IN RANGE 17 21 - \ Should Contain X Times ${resp.content} of-node:${index} 1 + FOR ${index} IN RANGE 17 21 + Should Contain X Times ${resp.content} of-node:${index} 1 + END Check Aggregated Node in Topology ${model} ${resp.content} 0 of-node:17 of-node:19 of-node:20 Link Computation Aggregation Inside Update NT diff --git a/csit/suites/tsdr/Cassandra/010_InterfaceMetrics.robot b/csit/suites/tsdr/Cassandra/010_InterfaceMetrics.robot index cd221cfcd4..3939c2e744 100644 --- a/csit/suites/tsdr/Cassandra/010_InterfaceMetrics.robot +++ b/csit/suites/tsdr/Cassandra/010_InterfaceMetrics.robot @@ -36,69 +36,72 @@ Verification of TSDR Cassandra Feature Installation Storing Statistics from Openflow REST [Documentation] Store openflow PortStats metrics using REST. - : FOR ${item} IN @{xpath} - \ ${ret_val}= Set Variable -1 - \ ${ret_val}= Get Stats XML ${OPERATIONAL_NODES_API}/node/openflow:1/node-connector/openflow:1:1 ${item} - \ Append To List ${xml_list} ${ret_val} - \ ${ret_val}= Set Variable -1 - \ ${ret_val}= Get Stats XML ${OPERATIONAL_NODES_API}/node/openflow:1/node-connector/openflow:1:2 ${item} - \ Append To List ${xml_list} ${ret_val} - \ ${ret_val}= Set Variable -1 - \ ${ret_val}= Get Stats XML ${OPERATIONAL_NODES_API}/node/openflow:1/node-connector/openflow:1:LOCAL ${item} - \ Append To List ${xml_list} ${ret_val} - \ ${ret_val}= Set Variable -1 - \ ${ret_val}= Get Stats XML ${OPERATIONAL_NODES_API}/node/openflow:2/node-connector/openflow:2:1 ${item} - \ Append To List ${xml_list} ${ret_val} - \ ${ret_val}= Set Variable -1 - \ ${ret_val}= Get Stats XML ${OPERATIONAL_NODES_API}/node/openflow:2/node-connector/openflow:2:2 ${item} - \ Append To List ${xml_list} ${ret_val} - \ ${ret_val}= Set Variable -1 - \ ${ret_val}= Get Stats XML ${OPERATIONAL_NODES_API}/node/openflow:2/node-connector/openflow:2:3 ${item} - \ Append To List ${xml_list} ${ret_val} - \ ${ret_val}= Set Variable -1 - \ ${ret_val}= Get Stats XML ${OPERATIONAL_NODES_API}/node/openflow:2/node-connector/openflow:2:LOCAL ${item} - \ Append To List ${xml_list} ${ret_val} - \ ${ret_val}= Set Variable -1 - \ ${ret_val}= Get Stats XML ${OPERATIONAL_NODES_API}/node/openflow:3/node-connector/openflow:3:1 ${item} - \ Append To List ${xml_list} ${ret_val} - \ ${ret_val}= Set Variable -1 - \ ${ret_val}= Get Stats XML ${OPERATIONAL_NODES_API}/node/openflow:3/node-connector/openflow:3:2 ${item} - \ Append To List ${xml_list} ${ret_val} - \ ${ret_val}= Set Variable -1 - \ ${ret_val}= Get Stats XML ${OPERATIONAL_NODES_API}/node/openflow:3/node-connector/openflow:3:LOCAL ${item} - \ Append To List ${xml_list} ${ret_val} - \ ${ret_val}= Set Variable -1 + FOR ${item} IN @{xpath} + ${ret_val}= Set Variable -1 + ${ret_val}= Get Stats XML ${OPERATIONAL_NODES_API}/node/openflow:1/node-connector/openflow:1:1 ${item} + Append To List ${xml_list} ${ret_val} + ${ret_val}= Set Variable -1 + ${ret_val}= Get Stats XML ${OPERATIONAL_NODES_API}/node/openflow:1/node-connector/openflow:1:2 ${item} + Append To List ${xml_list} ${ret_val} + ${ret_val}= Set Variable -1 + ${ret_val}= Get Stats XML ${OPERATIONAL_NODES_API}/node/openflow:1/node-connector/openflow:1:LOCAL ${item} + Append To List ${xml_list} ${ret_val} + ${ret_val}= Set Variable -1 + ${ret_val}= Get Stats XML ${OPERATIONAL_NODES_API}/node/openflow:2/node-connector/openflow:2:1 ${item} + Append To List ${xml_list} ${ret_val} + ${ret_val}= Set Variable -1 + ${ret_val}= Get Stats XML ${OPERATIONAL_NODES_API}/node/openflow:2/node-connector/openflow:2:2 ${item} + Append To List ${xml_list} ${ret_val} + ${ret_val}= Set Variable -1 + ${ret_val}= Get Stats XML ${OPERATIONAL_NODES_API}/node/openflow:2/node-connector/openflow:2:3 ${item} + Append To List ${xml_list} ${ret_val} + ${ret_val}= Set Variable -1 + ${ret_val}= Get Stats XML ${OPERATIONAL_NODES_API}/node/openflow:2/node-connector/openflow:2:LOCAL ${item} + Append To List ${xml_list} ${ret_val} + ${ret_val}= Set Variable -1 + ${ret_val}= Get Stats XML ${OPERATIONAL_NODES_API}/node/openflow:3/node-connector/openflow:3:1 ${item} + Append To List ${xml_list} ${ret_val} + ${ret_val}= Set Variable -1 + ${ret_val}= Get Stats XML ${OPERATIONAL_NODES_API}/node/openflow:3/node-connector/openflow:3:2 ${item} + Append To List ${xml_list} ${ret_val} + ${ret_val}= Set Variable -1 + ${ret_val}= Get Stats XML ${OPERATIONAL_NODES_API}/node/openflow:3/node-connector/openflow:3:LOCAL ${item} + Append To List ${xml_list} ${ret_val} + ${ret_val}= Set Variable -1 + END Log List ${xml_list} Verification of InterfaceMetrics-Attributes on Cassandra Client [Documentation] Verify the InterfaceMetrics has been updated on Cassandra Data Store Copy TSDR tables - : FOR ${list} IN @{INTERFACE_METRICS} - \ ${ret_val1}= Extract From DB Table grep NID=openflow:1 | grep DC=PORTSTATS | grep MN=${list} | grep RK=Node:openflow:1,NodeConnector:openflow:1:1 - \ Append To List ${tsdr_list} ${ret_val1} - \ ${ret_val1}= Extract From DB Table grep NID=openflow:1 | grep DC=PORTSTATS | grep MN=${list} | grep RK=Node:openflow:1,NodeConnector:openflow:1:2 - \ Append To List ${tsdr_list} ${ret_val1} - \ ${ret_val1}= Extract From DB Table grep NID=openflow:1 | grep DC=PORTSTATS | grep MN=${list} | grep RK=Node:openflow:1,NodeConnector:openflow:1:LOCAL - \ Append To List ${tsdr_list} ${ret_val1} - \ ${ret_val1}= Extract From DB Table grep NID=openflow:2 | grep DC=PORTSTATS | grep MN=${list} | grep RK=Node:openflow:2,NodeConnector:openflow:2:1 - \ Append To List ${tsdr_list} ${ret_val1} - \ ${ret_val1}= Extract From DB Table grep NID=openflow:2 | grep DC=PORTSTATS | grep MN=${list} | grep RK=Node:openflow:2,NodeConnector:openflow:2:2 - \ Append To List ${tsdr_list} ${ret_val1} - \ ${ret_val1}= Extract From DB Table grep NID=openflow:2 | grep DC=PORTSTATS | grep MN=${list} | grep RK=Node:openflow:2,NodeConnector:openflow:2:3 - \ Append To List ${tsdr_list} ${ret_val1} - \ ${ret_val1}= Extract From DB Table grep NID=openflow:2 | grep DC=PORTSTATS | grep MN=${list} | grep RK=Node:openflow:2,NodeConnector:openflow:2:LOCAL - \ Append To List ${tsdr_list} ${ret_val1} - \ ${ret_val1}= Extract From DB Table grep NID=openflow:3 | grep DC=PORTSTATS | grep MN=${list} | grep RK=Node:openflow:3,NodeConnector:openflow:3:1 - \ Append To List ${tsdr_list} ${ret_val1} - \ ${ret_val1}= Extract From DB Table grep NID=openflow:3 | grep DC=PORTSTATS | grep MN=${list} | grep RK=Node:openflow:3,NodeConnector:openflow:3:2 - \ Append To List ${tsdr_list} ${ret_val1} - \ ${ret_val1}= Extract From DB Table grep NID=openflow:3 | grep DC=PORTSTATS | grep MN=${list} | grep RK=Node:openflow:3,NodeConnector:openflow:3:LOCAL - \ Append To List ${tsdr_list} ${ret_val1} + FOR ${list} IN @{INTERFACE_METRICS} + ${ret_val1}= Extract From DB Table grep NID=openflow:1 | grep DC=PORTSTATS | grep MN=${list} | grep RK=Node:openflow:1,NodeConnector:openflow:1:1 + Append To List ${tsdr_list} ${ret_val1} + ${ret_val1}= Extract From DB Table grep NID=openflow:1 | grep DC=PORTSTATS | grep MN=${list} | grep RK=Node:openflow:1,NodeConnector:openflow:1:2 + Append To List ${tsdr_list} ${ret_val1} + ${ret_val1}= Extract From DB Table grep NID=openflow:1 | grep DC=PORTSTATS | grep MN=${list} | grep RK=Node:openflow:1,NodeConnector:openflow:1:LOCAL + Append To List ${tsdr_list} ${ret_val1} + ${ret_val1}= Extract From DB Table grep NID=openflow:2 | grep DC=PORTSTATS | grep MN=${list} | grep RK=Node:openflow:2,NodeConnector:openflow:2:1 + Append To List ${tsdr_list} ${ret_val1} + ${ret_val1}= Extract From DB Table grep NID=openflow:2 | grep DC=PORTSTATS | grep MN=${list} | grep RK=Node:openflow:2,NodeConnector:openflow:2:2 + Append To List ${tsdr_list} ${ret_val1} + ${ret_val1}= Extract From DB Table grep NID=openflow:2 | grep DC=PORTSTATS | grep MN=${list} | grep RK=Node:openflow:2,NodeConnector:openflow:2:3 + Append To List ${tsdr_list} ${ret_val1} + ${ret_val1}= Extract From DB Table grep NID=openflow:2 | grep DC=PORTSTATS | grep MN=${list} | grep RK=Node:openflow:2,NodeConnector:openflow:2:LOCAL + Append To List ${tsdr_list} ${ret_val1} + ${ret_val1}= Extract From DB Table grep NID=openflow:3 | grep DC=PORTSTATS | grep MN=${list} | grep RK=Node:openflow:3,NodeConnector:openflow:3:1 + Append To List ${tsdr_list} ${ret_val1} + ${ret_val1}= Extract From DB Table grep NID=openflow:3 | grep DC=PORTSTATS | grep MN=${list} | grep RK=Node:openflow:3,NodeConnector:openflow:3:2 + Append To List ${tsdr_list} ${ret_val1} + ${ret_val1}= Extract From DB Table grep NID=openflow:3 | grep DC=PORTSTATS | grep MN=${list} | grep RK=Node:openflow:3,NodeConnector:openflow:3:LOCAL + Append To List ${tsdr_list} ${ret_val1} + END Comparing Mertics [Documentation] Compare openflow Interface metrics between data collected from openflow Plugin and TSDR - : FOR ${xml_val} ${tsdr_val} IN ZIP ${xml_list} ${tsdr_list} - \ Compare Tsdr XML Metrics ${xml_val} ${tsdr_val} 20 + FOR ${xml_val} ${tsdr_val} IN ZIP ${xml_list} ${tsdr_list} + Compare Tsdr XML Metrics ${xml_val} ${tsdr_val} 20 + END *** Keywords *** Extract From DB Table diff --git a/csit/suites/tsdr/Cassandra/020_FlowMetrics.robot b/csit/suites/tsdr/Cassandra/020_FlowMetrics.robot index b4ce17f5ad..e21c44bb81 100644 --- a/csit/suites/tsdr/Cassandra/020_FlowMetrics.robot +++ b/csit/suites/tsdr/Cassandra/020_FlowMetrics.robot @@ -58,24 +58,30 @@ Getting all Tables from Openflow Plugin Verification of FlowStats-Attributes on Cassandra Data Store [Documentation] Verify the InterfaceMetrics has been updated on Cassandra Data Store Copy TSDR tables - : FOR ${flow} IN @{openflow_1} - \ ${ret_val1}= Verify the Metrics Attributes on Cassandra Client grep NID=openflow:1 | grep DC=FLOWSTATS | grep MN=PacketCount | grep -F 'RK=Node:openflow:1,Table:0,Flow:${flow}' - \ Append To List ${tsdr_op1_pc} ${ret_val1} - : FOR ${flow} IN @{openflow_2} - \ ${ret_val1}= Verify the Metrics Attributes on Cassandra Client grep NID=openflow:2 | grep DC=FLOWSTATS | grep MN=PacketCount | grep -F 'RK=Node:openflow:2,Table:0,Flow:${flow}' - \ Append To List ${tsdr_op2_pc} ${ret_val1} - : FOR ${flow} IN @{openflow_3} - \ ${ret_val1}= Verify the Metrics Attributes on Cassandra Client grep NID=openflow:3 | grep DC=FLOWSTATS | grep MN=PacketCount | grep -F 'RK=Node:openflow:3,Table:0,Flow:${flow}' - \ Append To List ${tsdr_op3_pc} ${ret_val1} - : FOR ${flow} IN @{openflow_1} - \ ${ret_val1}= Verify the Metrics Attributes on Cassandra Client grep NID=openflow:1 | grep DC=FLOWSTATS | grep MN=ByteCount | grep -F 'RK=Node:openflow:1,Table:0,Flow:${flow}' - \ Append To List ${tsdr_op1_bc} ${ret_val1} - : FOR ${flow} IN @{openflow_2} - \ ${ret_val1}= Verify the Metrics Attributes on Cassandra Client grep NID=openflow:2 | grep DC=FLOWSTATS | grep MN=ByteCount | grep -F 'RK=Node:openflow:2,Table:0,Flow:${flow}' - \ Append To List ${tsdr_op2_bc} ${ret_val1} - : FOR ${flow} IN @{openflow_3} - \ ${ret_val1}= Verify the Metrics Attributes on Cassandra Client grep NID=openflow:3 | grep DC=FLOWSTATS | grep MN=ByteCount | grep -F 'RK=Node:openflow:3,Table:0,Flow:${flow}' - \ Append To List ${tsdr_op3_bc} ${ret_val1} + FOR ${flow} IN @{openflow_1} + ${ret_val1}= Verify the Metrics Attributes on Cassandra Client grep NID=openflow:1 | grep DC=FLOWSTATS | grep MN=PacketCount | grep -F 'RK=Node:openflow:1,Table:0,Flow:${flow}' + Append To List ${tsdr_op1_pc} ${ret_val1} + END + FOR ${flow} IN @{openflow_2} + ${ret_val1}= Verify the Metrics Attributes on Cassandra Client grep NID=openflow:2 | grep DC=FLOWSTATS | grep MN=PacketCount | grep -F 'RK=Node:openflow:2,Table:0,Flow:${flow}' + Append To List ${tsdr_op2_pc} ${ret_val1} + END + FOR ${flow} IN @{openflow_3} + ${ret_val1}= Verify the Metrics Attributes on Cassandra Client grep NID=openflow:3 | grep DC=FLOWSTATS | grep MN=PacketCount | grep -F 'RK=Node:openflow:3,Table:0,Flow:${flow}' + Append To List ${tsdr_op3_pc} ${ret_val1} + END + FOR ${flow} IN @{openflow_1} + ${ret_val1}= Verify the Metrics Attributes on Cassandra Client grep NID=openflow:1 | grep DC=FLOWSTATS | grep MN=ByteCount | grep -F 'RK=Node:openflow:1,Table:0,Flow:${flow}' + Append To List ${tsdr_op1_bc} ${ret_val1} + END + FOR ${flow} IN @{openflow_2} + ${ret_val1}= Verify the Metrics Attributes on Cassandra Client grep NID=openflow:2 | grep DC=FLOWSTATS | grep MN=ByteCount | grep -F 'RK=Node:openflow:2,Table:0,Flow:${flow}' + Append To List ${tsdr_op2_bc} ${ret_val1} + END + FOR ${flow} IN @{openflow_3} + ${ret_val1}= Verify the Metrics Attributes on Cassandra Client grep NID=openflow:3 | grep DC=FLOWSTATS | grep MN=ByteCount | grep -F 'RK=Node:openflow:3,Table:0,Flow:${flow}' + Append To List ${tsdr_op3_bc} ${ret_val1} + END Set Suite Variable @{tsdr_op1_pc} Set Suite Variable @{tsdr_op2_pc} Set Suite Variable @{tsdr_op3_pc} @@ -85,21 +91,27 @@ Verification of FlowStats-Attributes on Cassandra Data Store Comparing Packet Count Metrics [Documentation] Comparing Packet count values between Cassandra and openflow plugin - : FOR ${xml_val} ${tsdr_val} IN ZIP ${openflow_1_packetcount} ${tsdr_op1_pc} - \ Compare Tsdr XML Metrics ${xml_val} ${tsdr_val} 20 - : FOR ${xml_val} ${tsdr_val} IN ZIP ${openflow_2_packetcount} ${tsdr_op2_pc} - \ Compare Tsdr XML Metrics ${xml_val} ${tsdr_val} 20 - : FOR ${xml_val} ${tsdr_val} IN ZIP ${openflow_3_packetcount} ${tsdr_op3_pc} - \ Compare Tsdr XML Metrics ${xml_val} ${tsdr_val} 20 + FOR ${xml_val} ${tsdr_val} IN ZIP ${openflow_1_packetcount} ${tsdr_op1_pc} + Compare Tsdr XML Metrics ${xml_val} ${tsdr_val} 20 + END + FOR ${xml_val} ${tsdr_val} IN ZIP ${openflow_2_packetcount} ${tsdr_op2_pc} + Compare Tsdr XML Metrics ${xml_val} ${tsdr_val} 20 + END + FOR ${xml_val} ${tsdr_val} IN ZIP ${openflow_3_packetcount} ${tsdr_op3_pc} + Compare Tsdr XML Metrics ${xml_val} ${tsdr_val} 20 + END Comparing Byte Count Metrics [Documentation] Comparing byte count values between Cassandra and openflow plugin - : FOR ${xml_val} ${tsdr_val} IN ZIP ${openflow_1_bytecount} ${tsdr_op1_bc} - \ Compare Tsdr XML Metrics ${xml_val} ${tsdr_val} 20 - : FOR ${xml_val} ${tsdr_val} IN ZIP ${openflow_2_bytecount} ${tsdr_op2_bc} - \ Compare Tsdr XML Metrics ${xml_val} ${tsdr_val} 20 - : FOR ${xml_val} ${tsdr_val} IN ZIP ${openflow_3_bytecount} ${tsdr_op3_bc} - \ Compare Tsdr XML Metrics ${xml_val} ${tsdr_val} 20 + FOR ${xml_val} ${tsdr_val} IN ZIP ${openflow_1_bytecount} ${tsdr_op1_bc} + Compare Tsdr XML Metrics ${xml_val} ${tsdr_val} 20 + END + FOR ${xml_val} ${tsdr_val} IN ZIP ${openflow_2_bytecount} ${tsdr_op2_bc} + Compare Tsdr XML Metrics ${xml_val} ${tsdr_val} 20 + END + FOR ${xml_val} ${tsdr_val} IN ZIP ${openflow_3_bytecount} ${tsdr_op3_bc} + Compare Tsdr XML Metrics ${xml_val} ${tsdr_val} 20 + END *** Keywords *** Initialize the Tsdr Suite diff --git a/csit/suites/tsdr/Cassandra/030_FlowTableMetrics.robot b/csit/suites/tsdr/Cassandra/030_FlowTableMetrics.robot index 539f9543d4..297a27b18f 100644 --- a/csit/suites/tsdr/Cassandra/030_FlowTableMetrics.robot +++ b/csit/suites/tsdr/Cassandra/030_FlowTableMetrics.robot @@ -81,12 +81,15 @@ Verification of FlowStats-Attributes on Cassandra Data Store Comparing Flow Table Metrics [Documentation] Comparing Flow table values between Cassandra and openflow plugin. - : FOR ${xml_val} ${tsdr_val} IN ZIP ${openflow_packetlookup} ${tsdr_pl} - \ Compare Tsdr XML Metrics ${xml_val} ${tsdr_val} 5 - : FOR ${xml_val} ${tsdr_val} IN ZIP ${openflow_activeflows} ${tsdr_af} - \ Compare Tsdr XML Metrics ${xml_val} ${tsdr_val} 5 - : FOR ${xml_val} ${tsdr_val} IN ZIP ${openflow_packetmatched} ${tsdr_pm} - \ Compare Tsdr XML Metrics ${xml_val} ${tsdr_val} 5 + FOR ${xml_val} ${tsdr_val} IN ZIP ${openflow_packetlookup} ${tsdr_pl} + Compare Tsdr XML Metrics ${xml_val} ${tsdr_val} 5 + END + FOR ${xml_val} ${tsdr_val} IN ZIP ${openflow_activeflows} ${tsdr_af} + Compare Tsdr XML Metrics ${xml_val} ${tsdr_val} 5 + END + FOR ${xml_val} ${tsdr_val} IN ZIP ${openflow_packetmatched} ${tsdr_pm} + Compare Tsdr XML Metrics ${xml_val} ${tsdr_val} 5 + END *** Keywords *** Initialize the Tsdr Suite diff --git a/csit/suites/tsdr/Cassandra/040_QueueMetrics.robot b/csit/suites/tsdr/Cassandra/040_QueueMetrics.robot index 5d4ff0afe3..4b9d2b9e64 100644 --- a/csit/suites/tsdr/Cassandra/040_QueueMetrics.robot +++ b/csit/suites/tsdr/Cassandra/040_QueueMetrics.robot @@ -84,12 +84,15 @@ Verification of FlowStats-Attributes on Cassandra Data Store Comparing Queue Metrics [Documentation] Comparing Queue metrics between Cassandra and OF plugin - : FOR ${xml_val} ${tsdr_val} IN ZIP ${openflow_q0} ${tsdr_q0} - \ Compare Tsdr XML Metrics ${xml_val} ${tsdr_val} 20 - : FOR ${xml_val} ${tsdr_val} IN ZIP ${openflow_q1} ${tsdr_q1} - \ Compare Tsdr XML Metrics ${xml_val} ${tsdr_val} 20 - : FOR ${xml_val} ${tsdr_val} IN ZIP ${openflow_q2} ${tsdr_q2} - \ Compare Tsdr XML Metrics ${xml_val} ${tsdr_val} 20 + FOR ${xml_val} ${tsdr_val} IN ZIP ${openflow_q0} ${tsdr_q0} + Compare Tsdr XML Metrics ${xml_val} ${tsdr_val} 20 + END + FOR ${xml_val} ${tsdr_val} IN ZIP ${openflow_q1} ${tsdr_q1} + Compare Tsdr XML Metrics ${xml_val} ${tsdr_val} 20 + END + FOR ${xml_val} ${tsdr_val} IN ZIP ${openflow_q2} ${tsdr_q2} + Compare Tsdr XML Metrics ${xml_val} ${tsdr_val} 20 + END *** Keyword *** Configuration of Queue on Switch diff --git a/csit/suites/tsdr/Cassandra/050_SyslogTable.robot b/csit/suites/tsdr/Cassandra/050_SyslogTable.robot index f9fa59d88e..4fcd17f8d6 100644 --- a/csit/suites/tsdr/Cassandra/050_SyslogTable.robot +++ b/csit/suites/tsdr/Cassandra/050_SyslogTable.robot @@ -18,10 +18,11 @@ Verification of TSDR Cassandra Feature Installation Sending syslog to ODL Syslog collector using Logger command [Documentation] Sending Syslogs to collector. - : FOR ${key} IN ZIP &{syslog_facility} - \ ${value}= Get From Dictionary ${syslog_facility} ${key} - \ ${f_value}= Evaluate ${value} * 8 - \ Generate Syslog ${f_value} + FOR ${key} IN ZIP &{syslog_facility} + ${value}= Get From Dictionary ${syslog_facility} ${key} + ${f_value}= Evaluate ${value} * 8 + Generate Syslog ${f_value} + END Verifying TSDR Data Store For Syslog Entries [Documentation] Verifying if syslogs is getting stored. @@ -29,9 +30,10 @@ Verifying TSDR Data Store For Syslog Entries ${metric_log}= Verify the Metrics Syslog on Cassandra Client grep DC=SYSLOG @{Syslogs}= Split to lines ${metric_log} ${iterator}= Set Variable 0 - : FOR ${key} IN ZIP &{syslog_facility} - \ ${value}= Get From Dictionary ${syslog_facility} ${key} - \ ${f_value}= Evaluate ${value} * 8 - \ Should Contain ${syslogs}[${iterator}] ${MESSAGE} - \ Should Contain ${syslogs}[${iterator}] <${f_value}> - \ ${iterator}= Evaluate ${iterator} + 1 + FOR ${key} IN ZIP &{syslog_facility} + ${value}= Get From Dictionary ${syslog_facility} ${key} + ${f_value}= Evaluate ${value} * 8 + Should Contain ${syslogs}[${iterator}] ${MESSAGE} + Should Contain ${syslogs}[${iterator}] <${f_value}> + ${iterator}= Evaluate ${iterator} + 1 + END diff --git a/csit/suites/tsdr/H2/010_InterfaceMetrics.robot b/csit/suites/tsdr/H2/010_InterfaceMetrics.robot index ed1c4a52d5..a81ca1d98e 100644 --- a/csit/suites/tsdr/H2/010_InterfaceMetrics.robot +++ b/csit/suites/tsdr/H2/010_InterfaceMetrics.robot @@ -33,19 +33,22 @@ Verification TSDR Command is exist in Help Should Contain ${output} tsdr:list Should Contain ${output} tsdr:purgeall ${output}= Issue Command On Karaf Console tsdr:list\t\t - : FOR ${list} IN @{CATEGORY} - \ Should Contain ${output} ${list} + FOR ${list} IN @{CATEGORY} + Should Contain ${output} ${list} + END Wait Until Keyword Succeeds 60s 1s Verify the Metric is Collected? ${TSDR_PORTSTATS} openflow Verify PortStats On Karaf console [Documentation] Verify the InterfaceMetrics(PortStats),attributes using ${TSDR_PORTSTATS} - : FOR ${list} IN @{INTERFACE_METRICS} - \ ${tsdr_cmd}= Concatenate the String ${TSDR_PORTSTATS} | grep ${list} | head - \ ${output}= Issue Command On Karaf Console ${tsdr_cmd} ${ODL_SYSTEM_IP} ${KARAF_SHELL_PORT} 30 - \ Should Contain ${output} ${list} + FOR ${list} IN @{INTERFACE_METRICS} + ${tsdr_cmd}= Concatenate the String ${TSDR_PORTSTATS} | grep ${list} | head + ${output}= Issue Command On Karaf Console ${tsdr_cmd} ${ODL_SYSTEM_IP} ${KARAF_SHELL_PORT} 30 + Should Contain ${output} ${list} + END Verify PortStats-Attributes on H2 Datastore using JDBC Client [Documentation] Verify the PortStats,attributes on H2 Datastore using JDBC Client - : FOR ${list} IN @{INTERFACE_METRICS} - \ ${output}= Query Metrics on H2 Datastore PORTSTATS ${list} - \ Should Contain ${output} ${list} + FOR ${list} IN @{INTERFACE_METRICS} + ${output}= Query Metrics on H2 Datastore PORTSTATS ${list} + Should Contain ${output} ${list} + END diff --git a/csit/suites/tsdr/H2/020_FlowMetrics.robot b/csit/suites/tsdr/H2/020_FlowMetrics.robot index 1dc5c17ab3..b55411a7da 100644 --- a/csit/suites/tsdr/H2/020_FlowMetrics.robot +++ b/csit/suites/tsdr/H2/020_FlowMetrics.robot @@ -19,11 +19,13 @@ Verification of TSDR FlowMetrics [Documentation] Verify the TSDR FlowStats Wait Until Keyword Succeeds 60s 1s Verify the Metric is Collected? ${TSDR_FLOWSTATS} PacketCount ${output}= Issue Command On Karaf Console ${TSDR_FLOWSTATS} ${ODL_SYSTEM_IP} ${KARAF_SHELL_PORT} 30 - : FOR ${list} IN @{FLOW_METRICS} - \ Should Contain ${output} ${list} + FOR ${list} IN @{FLOW_METRICS} + Should Contain ${output} ${list} + END Verify FlowStats-Attributes on H2 Datastore using JDBC Client [Documentation] Verify the PortStats,attributes on H2 Datastore using JDBC Client - : FOR ${list} IN @{FLOW_METRICS} - \ ${output}= Query Metrics on H2 Datastore FLOWSTATS ${list} - \ Should Contain ${output} ${list} + FOR ${list} IN @{FLOW_METRICS} + ${output}= Query Metrics on H2 Datastore FLOWSTATS ${list} + Should Contain ${output} ${list} + END diff --git a/csit/suites/tsdr/H2/030_FlowTableMetrics.robot b/csit/suites/tsdr/H2/030_FlowTableMetrics.robot index dec85bb649..505de3f11d 100644 --- a/csit/suites/tsdr/H2/030_FlowTableMetrics.robot +++ b/csit/suites/tsdr/H2/030_FlowTableMetrics.robot @@ -19,11 +19,13 @@ Verification of TSDR FlowTableStats [Documentation] Verify the TSDR FlowiTableStats Wait Until Keyword Succeeds 60s 1s Verify the Metric is Collected? ${TSDR_FLOWTABLE_STATS}| grep ActiveFlow FLOWTABLESTATS ${output}= Issue Command On Karaf Console ${TSDR_FLOWTABLE_STATS}| grep openflow:1 | head ${ODL_SYSTEM_IP} ${KARAF_SHELL_PORT} 180 - : FOR ${list} IN @{FLOWTABLE_METRICS} - \ Should Contain ${output} ${list} + FOR ${list} IN @{FLOWTABLE_METRICS} + Should Contain ${output} ${list} + END Verify FlowTableStats-Attributes on H2 Datastore using JDBC Client [Documentation] Verify the PortStats,attributes on H2 Datastore using JDBC Client - : FOR ${list} IN @{FLOWTABLE_METRICS} - \ ${output}= Query Metrics on H2 Datastore FLOWTABLESTATS ${list} - \ Should Contain ${output} ${list} + FOR ${list} IN @{FLOWTABLE_METRICS} + ${output}= Query Metrics on H2 Datastore FLOWTABLESTATS ${list} + Should Contain ${output} ${list} + END diff --git a/csit/suites/tsdr/H2/040_QueueMetrics.robot b/csit/suites/tsdr/H2/040_QueueMetrics.robot index f0e05837db..d33b259fc5 100644 --- a/csit/suites/tsdr/H2/040_QueueMetrics.robot +++ b/csit/suites/tsdr/H2/040_QueueMetrics.robot @@ -20,24 +20,28 @@ Verify the Queue Stats attributes exist thru Karaf console [Documentation] Verify the QueueMetrics attributes exist on Karaf Console Wait Until Keyword Succeeds 60s 1s Verify the Metric is Collected? ${TSDR_QUEUE_STATS} Transmitted ${output}= Issue Command On Karaf Console ${TSDR_QUEUE_STATS} ${ODL_SYSTEM_IP} ${KARAF_SHELL_PORT} 30 - : FOR ${list} IN @{QUEUE_METRICS} - \ Should Contain ${output} ${list} + FOR ${list} IN @{QUEUE_METRICS} + Should Contain ${output} ${list} + END Verify QueueStats-Attributes on H2 Datastore using JDBC Client [Documentation] Verify the QueueStats,attributes on H2 Datastore using JDBC Client - : FOR ${list} IN @{QUEUE_METRICS} - \ ${output}= Query Metrics on H2 Datastore QUEUESTATS ${list} - \ Should Contain ${output} ${list} + FOR ${list} IN @{QUEUE_METRICS} + ${output}= Query Metrics on H2 Datastore QUEUESTATS ${list} + Should Contain ${output} ${list} + END Verify tsdr:purgeall command [Documentation] Verify the tsdr:purgeall command Issue Command On Karaf Console tsdr:purgeall ${ODL_SYSTEM_IP} ${KARAF_SHELL_PORT} - : FOR ${list} IN @{CMD_LIST} - \ ${out}= Issue Command On Karaf Console tsdr:list ${list} ${ODL_SYSTEM_IP} ${KARAF_SHELL_PORT} - \ Should Contain ${out} no data of this category - : FOR ${list} IN @{QUEUE_METRICS} - \ ${out}= Query Metrics on H2 Datastore QUEUESTATS ${list} - \ Should not Contain ${out} ${list} + FOR ${list} IN @{CMD_LIST} + ${out}= Issue Command On Karaf Console tsdr:list ${list} ${ODL_SYSTEM_IP} ${KARAF_SHELL_PORT} + Should Contain ${out} no data of this category + END + FOR ${list} IN @{QUEUE_METRICS} + ${out}= Query Metrics on H2 Datastore QUEUESTATS ${list} + Should not Contain ${out} ${list} + END *** Keyword *** Configuration of Queue on Switch diff --git a/csit/suites/tsdr/H2/050_GroupMetrics.robot b/csit/suites/tsdr/H2/050_GroupMetrics.robot index a04322496e..eb3df2ac64 100644 --- a/csit/suites/tsdr/H2/050_GroupMetrics.robot +++ b/csit/suites/tsdr/H2/050_GroupMetrics.robot @@ -20,8 +20,9 @@ Verify the FlowGroup Stats attributes exist thru Karaf console [Documentation] Verify the FlowGroupStats attributes exist on Karaf Console Wait Until Keyword Succeeds 120s 1s Verify the Metric is Collected? ${TSDR_FLOWGROUPSTATS} ByteCount ${output}= Issue Command On Karaf Console ${TSDR_FLOWGROUPSTATS} ${ODL_SYSTEM_IP} ${KARAF_SHELL_PORT} 30 - : FOR ${list} IN @{FLOWGROUP_METRICS} - \ Should Contain ${output} ${list} + FOR ${list} IN @{FLOWGROUP_METRICS} + Should Contain ${output} ${list} + END Verification of FlowGroupStats-ByteCount on Karaf Console [Documentation] Verify the FlowGroupStats has been updated thru tsdr:list command on karaf console @@ -30,14 +31,16 @@ Verification of FlowGroupStats-ByteCount on Karaf Console Should Contain ${output} ByteCount Should Contain ${output} FLOWGROUPSTATS Should not Contain ${output} null - : FOR ${list} IN @{FLOWGROUP_HEADER} - \ Should Contain ${output} ${list} + FOR ${list} IN @{FLOWGROUP_HEADER} + Should Contain ${output} ${list} + END Verify FlowGroupStats-Attributes on H2 Datastore using JDBC Client [Documentation] Verify the GroupStats,attributes on H2 Datastore using JDBC Client - : FOR ${list} IN @{FLOWGROUP_METRICS} - \ ${output}= Query Metrics on H2 Datastore FLOWGROUPSTATS ${list} - \ Should Contain ${output} ${list} + FOR ${list} IN @{FLOWGROUP_METRICS} + ${output}= Query Metrics on H2 Datastore FLOWGROUPSTATS ${list} + Should Contain ${output} ${list} + END *** Keyword *** Start TSDR suite with CPqD Switch diff --git a/csit/suites/tsdr/H2/060_FlowMeterMetrics.robot b/csit/suites/tsdr/H2/060_FlowMeterMetrics.robot index c89afa391d..d38a0ec472 100644 --- a/csit/suites/tsdr/H2/060_FlowMeterMetrics.robot +++ b/csit/suites/tsdr/H2/060_FlowMeterMetrics.robot @@ -20,8 +20,9 @@ Verify the FlowMeter Stats attributes exist thru Karaf console [Documentation] Verify the FlowMeterStats attributes exist on Karaf Console Wait Until Keyword Succeeds 120s 1s Verify the Metric is Collected? ${TSDR_FLOWMETERSTATS} ByteInCount ${output}= Issue Command On Karaf Console ${TSDR_FLOWMETERSTATS} ${ODL_SYSTEM_IP} ${KARAF_SHELL_PORT} 30 - : FOR ${list} IN @{FLOWMETER_METRICS} - \ Should Contain ${output} ${list} + FOR ${list} IN @{FLOWMETER_METRICS} + Should Contain ${output} ${list} + END Verification of FlowMeterStats-ByteInCount on Karaf Console [Documentation] Verify the FlowMeterStats has been updated thru tsdr:list command on karaf console @@ -30,14 +31,16 @@ Verification of FlowMeterStats-ByteInCount on Karaf Console Should Contain ${output} ByteInCount Should Contain ${output} FLOWMETERSTATS Should not Contain ${output} null - : FOR ${list} IN @{FLOWMETER_HEADER} - \ Should Contain ${output} ${list} + FOR ${list} IN @{FLOWMETER_HEADER} + Should Contain ${output} ${list} + END Verify FlowMeterStats-Attributes on H2 Datastore using JDBC Client [Documentation] Verify the FlowMeterStats,attributes on H2 Datastore using JDBC Client - : FOR ${list} IN @{FLOWMETER_METRICS} - \ ${output}= Query Metrics on H2 Datastore FLOWMETERSTATS ${list} - \ Should Contain ${output} ${list} + FOR ${list} IN @{FLOWMETER_METRICS} + ${output}= Query Metrics on H2 Datastore FLOWMETERSTATS ${list} + Should Contain ${output} ${list} + END Uninstall all TSDR H2 Feature [Documentation] UnInstall all TSDR H2 Features diff --git a/csit/suites/tsdr/HBase/010_InterfaceMetrics.robot b/csit/suites/tsdr/HBase/010_InterfaceMetrics.robot index 87e7c1fc2b..acfbf45b81 100644 --- a/csit/suites/tsdr/HBase/010_InterfaceMetrics.robot +++ b/csit/suites/tsdr/HBase/010_InterfaceMetrics.robot @@ -34,21 +34,24 @@ Verification TSDR Command is exist in Help ${output}= Issue Command On Karaf Console tsdr\t Should Contain ${output} tsdr:list ${output}= Issue Command On Karaf Console tsdr:list\t\t - : FOR ${list} IN @{CATEGORY} - \ Should Contain ${output} ${list} + FOR ${list} IN @{CATEGORY} + Should Contain ${output} ${list} + END Wait Until Keyword Succeeds 620s 1s Verify the Metric is Collected? ${TSDR_PORTSTATS} openflow Verification of TSDR PortStats [Documentation] Verify the TSDR InterfaceMetrics - : FOR ${list} IN @{INTERFACE_METRICS} - \ ${tsdr_cmd}= Concatenate the String ${TSDR_PORTSTATS} | grep ${list} | head - \ ${output}= Issue Command On Karaf Console ${tsdr_cmd} ${ODL_SYSTEM_IP} ${KARAF_SHELL_PORT} 30 - \ Should Contain ${output} ${list} + FOR ${list} IN @{INTERFACE_METRICS} + ${tsdr_cmd}= Concatenate the String ${TSDR_PORTSTATS} | grep ${list} | head + ${output}= Issue Command On Karaf Console ${tsdr_cmd} ${ODL_SYSTEM_IP} ${KARAF_SHELL_PORT} 30 + Should Contain ${output} ${list} + END Verification of InterfaceMetrics-Attributes on HBase Client [Documentation] Verify the InterfaceMetrics has been updated on HBase Datastore - : FOR ${list} IN @{INTERFACE_METRICS} - \ Verify the Metrics Attributes on Hbase Client ${list} ${node_connector} ${portstats} + FOR ${list} IN @{INTERFACE_METRICS} + Verify the Metrics Attributes on Hbase Client ${list} ${node_connector} ${portstats} + END Verify Configuration Interval-change [Documentation] Verify the TSDR Collection configuration changes diff --git a/csit/suites/tsdr/HBase/020_FlowMetrics.robot b/csit/suites/tsdr/HBase/020_FlowMetrics.robot index 710f8cd859..1ab9f624b0 100644 --- a/csit/suites/tsdr/HBase/020_FlowMetrics.robot +++ b/csit/suites/tsdr/HBase/020_FlowMetrics.robot @@ -23,8 +23,9 @@ Verification of TSDR FlowMetrics [Documentation] Verify the TSDR FlowStats Wait Until Keyword Succeeds 120s 1s Verify the Metric is Collected? ${TSDR_FLOWSTATS} PacketCount ${output}= Issue Command On Karaf Console ${TSDR_FLOWSTATS} ${ODL_SYSTEM_IP} ${KARAF_SHELL_PORT} 30 - : FOR ${list} IN @{FLOW_METRICS} - \ Should Contain ${output} ${list} + FOR ${list} IN @{FLOW_METRICS} + Should Contain ${output} ${list} + END Verification of FlowMetrics-PacketCount on HBase Client [Documentation] Verify the FlowStats-Packetcount on both Karaf console and Hbase client diff --git a/csit/suites/tsdr/HBase/040_QueueMetrics.robot b/csit/suites/tsdr/HBase/040_QueueMetrics.robot index ece16b45ea..d95f09f62e 100644 --- a/csit/suites/tsdr/HBase/040_QueueMetrics.robot +++ b/csit/suites/tsdr/HBase/040_QueueMetrics.robot @@ -23,8 +23,9 @@ Verify the Queue Metrics attributes exist thru Karaf console [Documentation] Verify the QueueMetrics attributes exist on Karaf Console Wait Until Keyword Succeeds 180s 1s Verify the Metric is Collected? ${TSDR_QUEUESTATS} Transmitted ${output}= Issue Command On Karaf Console ${TSDR_QUEUESTATS} ${ODL_SYSTEM_IP} ${KARAF_SHELL_PORT} 90 - : FOR ${list} IN @{QUEUE_METRICS} - \ Should Contain ${output} ${list} + FOR ${list} IN @{QUEUE_METRICS} + Should Contain ${output} ${list} + END Verification of QueueMetrics-TransmittedPackets on Karaf Console [Documentation] Verify the QueueMetrics has been updated thru tsdr:list command on karaf console diff --git a/csit/suites/tsdr/HBase/050_SyslogTable.robot b/csit/suites/tsdr/HBase/050_SyslogTable.robot index 8ad0f10e9b..0fb69ceca5 100644 --- a/csit/suites/tsdr/HBase/050_SyslogTable.robot +++ b/csit/suites/tsdr/HBase/050_SyslogTable.robot @@ -18,13 +18,15 @@ Verification of TSDR HBase Feature Installation Sending syslog to ODL Syslog collector using Logger command [Documentation] Verifying if syslogs is collected and getting stored. Query the Data from HBaseClient truncate 'SYSLOG' - : FOR ${key} IN ZIP &{syslog_facility} - \ ${value}= Get From Dictionary ${syslog_facility} ${key} - \ ${f_value}= Evaluate ${value} * 8 - \ Generate Syslog ${f_value} + FOR ${key} IN ZIP &{syslog_facility} + ${value}= Get From Dictionary ${syslog_facility} ${key} + ${f_value}= Evaluate ${value} * 8 + Generate Syslog ${f_value} + END ${output}= Query the Data from HBaseClient scan 'SYSLOG' Should Contain X Times ${output} ${MESSAGE_PATTERN} 1 - : FOR ${key} IN ZIP &{syslog_facility} - \ ${value}= Get From Dictionary ${syslog_facility} ${key} - \ ${f_value}= Evaluate ${value} * 8 - \ Should Match ${output} *${f_value}>* + FOR ${key} IN ZIP &{syslog_facility} + ${value}= Get From Dictionary ${syslog_facility} ${key} + ${f_value}= Evaluate ${value} * 8 + Should Match ${output} *${f_value}>* + END diff --git a/csit/suites/tsdr/HSQLDB/010_InterfaceMetrics.robot b/csit/suites/tsdr/HSQLDB/010_InterfaceMetrics.robot index db052e5f2f..a53a4d1dc9 100644 --- a/csit/suites/tsdr/HSQLDB/010_InterfaceMetrics.robot +++ b/csit/suites/tsdr/HSQLDB/010_InterfaceMetrics.robot @@ -32,16 +32,18 @@ Verification TSDR Command exists in Help ${output}= Issue Command On Karaf Console tsdr\t Should Contain ${output} tsdr:list ${output}= Issue Command On Karaf Console tsdr:list\t\t - : FOR ${list} IN @{CATEGORY} - \ Should Contain ${output} ${list} + FOR ${list} IN @{CATEGORY} + Should Contain ${output} ${list} + END Wait Until Keyword Succeeds 60s 1s Verify the Metric is Collected? ${TSDR_PORTSTATS} openflow Verify PortStats On Karaf console [Documentation] Verify the InterfaceMetrics(PortStats),attributes using ${TSDR_PORTSTATS} - : FOR ${list} IN @{INTERFACE_METRICS} - \ ${tsdr_cmd}= Concatenate the String ${TSDR_PORTSTATS} | grep ${list} | head - \ ${output}= Issue Command On Karaf Console ${tsdr_cmd} ${ODL_SYSTEM_IP} ${KARAF_SHELL_PORT} 30 - \ Should Contain ${output} ${list} + FOR ${list} IN @{INTERFACE_METRICS} + ${tsdr_cmd}= Concatenate the String ${TSDR_PORTSTATS} | grep ${list} | head + ${output}= Issue Command On Karaf Console ${tsdr_cmd} ${ODL_SYSTEM_IP} ${KARAF_SHELL_PORT} 30 + Should Contain ${output} ${list} + END *** Keywords *** Init Variables Master diff --git a/csit/suites/tsdr/HSQLDB/020_FlowMetrics.robot b/csit/suites/tsdr/HSQLDB/020_FlowMetrics.robot index 0a5753ef3d..5713e4c84d 100644 --- a/csit/suites/tsdr/HSQLDB/020_FlowMetrics.robot +++ b/csit/suites/tsdr/HSQLDB/020_FlowMetrics.robot @@ -23,8 +23,9 @@ Verification of TSDR FlowMetrics [Documentation] Verify the TSDR FLOWSTATS Wait Until Keyword Succeeds 60s 1s Verify the Metric is Collected? ${TSDR_FLOWSTATS} PacketCount ${output}= Issue Command On Karaf Console ${TSDR_FLOWSTATS} ${ODL_SYSTEM_IP} ${KARAF_SHELL_PORT} 30 - : FOR ${list} IN @{FLOW_METRICS} - \ Should Contain ${output} ${list} + FOR ${list} IN @{FLOW_METRICS} + Should Contain ${output} ${list} + END *** Keywords *** Init Variables Master diff --git a/csit/suites/tsdr/HSQLDB/030_FlowTableMetrics.robot b/csit/suites/tsdr/HSQLDB/030_FlowTableMetrics.robot index dd558e30b4..f78bdcbbea 100644 --- a/csit/suites/tsdr/HSQLDB/030_FlowTableMetrics.robot +++ b/csit/suites/tsdr/HSQLDB/030_FlowTableMetrics.robot @@ -23,8 +23,9 @@ Verification of TSDR FLOWTABLESTATS [Documentation] Verify the TSDR FlowiTableStats Wait Until Keyword Succeeds 60s 1s Verify the Metric is Collected? ${TSDR_FLOWTABLE_STATS}| grep ActiveFlow | grep openflow:1 FLOWTABLESTATS ${output}= Issue Command On Karaf Console ${TSDR_FLOWTABLE_STATS}| grep openflow:1 | head ${ODL_SYSTEM_IP} ${KARAF_SHELL_PORT} 180 - : FOR ${list} IN @{FLOWTABLE_METRICS} - \ Should Contain ${output} ${list} + FOR ${list} IN @{FLOWTABLE_METRICS} + Should Contain ${output} ${list} + END *** Keywords *** Init Variables Master diff --git a/csit/suites/tsdr/HSQLDB/040_QueueMetrics.robot b/csit/suites/tsdr/HSQLDB/040_QueueMetrics.robot index 953d376240..69e0de9f41 100644 --- a/csit/suites/tsdr/HSQLDB/040_QueueMetrics.robot +++ b/csit/suites/tsdr/HSQLDB/040_QueueMetrics.robot @@ -23,8 +23,9 @@ Verify the QueueStats attributes exist thru Karaf console [Documentation] Verify the QueueMetrics attributes exist on Karaf Console Wait Until Keyword Succeeds 60s 1s Verify the Metric is Collected? ${TSDR_QUEUE_STATS} Transmitted ${output}= Issue Command On Karaf Console ${TSDR_QUEUE_STATS} ${ODL_SYSTEM_IP} ${KARAF_SHELL_PORT} 30 - : FOR ${list} IN @{QUEUE_METRICS} - \ Should Contain ${output} ${list} + FOR ${list} IN @{QUEUE_METRICS} + Should Contain ${output} ${list} + END *** Keyword *** Configuration of Queue on Switch diff --git a/csit/suites/tsdr/HSQLDB/060_syslog_Collector.robot b/csit/suites/tsdr/HSQLDB/060_syslog_Collector.robot index 67a6b8edb5..d06003e9aa 100644 --- a/csit/suites/tsdr/HSQLDB/060_syslog_Collector.robot +++ b/csit/suites/tsdr/HSQLDB/060_syslog_Collector.robot @@ -19,10 +19,11 @@ Verification of TSDR HSQLDB Feature Installation Sending syslog to ODL Syslog collector using Logger command [Documentation] Verifying if syslogs is getting generated. - : FOR ${key} IN ZIP &{syslog_facility} - \ ${value}= Get From Dictionary ${syslog_facility} ${key} - \ ${f_value}= Evaluate ${value} * 8 - \ Generate Syslog ${f_value} + FOR ${key} IN ZIP &{syslog_facility} + ${value}= Get From Dictionary ${syslog_facility} ${key} + ${f_value}= Evaluate ${value} * 8 + Generate Syslog ${f_value} + END Wait Until Keyword Succeeds 24x 10 sec Check HSQLDB 1 SYSLOG | grep SYSLOG | wc -l Verifying TSDR Data Store For Syslog Entries diff --git a/csit/suites/usc/tcp/110_TCP/Test.robot b/csit/suites/usc/tcp/110_TCP/Test.robot index d830e6ba05..de06ef1856 100644 --- a/csit/suites/usc/tcp/110_TCP/Test.robot +++ b/csit/suites/usc/tcp/110_TCP/Test.robot @@ -40,11 +40,12 @@ Send Messages ${content} Create Dictionary hostname=${TOOLS_SYSTEM_IP} port=${ECHO_SERVER_PORT} tcp=true content=${TEST_MESSAGE} ${channel} Create Dictionary channel=${content} ${input} Create Dictionary input=${channel} - : FOR ${index} IN RANGE 0 ${NUM_OF_MESSAGES} - \ ${data} json.dumps ${input} - \ ${resp} Post Request session ${REST_SEND_MESSAGE} data=${data} - \ Should Be Equal As Strings ${resp.status_code} 200 - \ Should Contain ${resp.content} Succeed to send request + FOR ${index} IN RANGE 0 ${NUM_OF_MESSAGES} + ${data} json.dumps ${input} + ${resp} Post Request session ${REST_SEND_MESSAGE} data=${data} + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain ${resp.content} Succeed to send request + END View Bytes In and Bytes Out [Documentation] Check if the number of Bytes In and Bytes Out are correct diff --git a/csit/suites/usc/tcp/200_Multiple_Sessions_TCP/Test.robot b/csit/suites/usc/tcp/200_Multiple_Sessions_TCP/Test.robot index ecb12cbe07..baa824cd0a 100644 --- a/csit/suites/usc/tcp/200_Multiple_Sessions_TCP/Test.robot +++ b/csit/suites/usc/tcp/200_Multiple_Sessions_TCP/Test.robot @@ -16,15 +16,16 @@ Resource ../../../../libraries/UscUtils.robot *** Test Cases *** Add Channel [Documentation] Add multiple USC TLS channels - : FOR ${port_index} IN @{LIST_ECHO_SERVER_PORT} - \ ${content} Create Dictionary hostname=${TOOLS_SYSTEM_IP} port=${port_index} tcp=true remote=false - \ ${channel} Create Dictionary channel=${content} - \ ${input} Create Dictionary input=${channel} - \ ${data} json.dumps ${input} - \ ${resp} Post Request session ${REST_ADD_CHANNEL} data=${data} - \ Log ${resp.content} - \ Should Be Equal As Strings ${resp.status_code} 200 - \ Should Contain ${resp.content} Succeed to connect + FOR ${port_index} IN @{LIST_ECHO_SERVER_PORT} + ${content} Create Dictionary hostname=${TOOLS_SYSTEM_IP} port=${port_index} tcp=true remote=false + ${channel} Create Dictionary channel=${content} + ${input} Create Dictionary input=${channel} + ${data} json.dumps ${input} + ${resp} Post Request session ${REST_ADD_CHANNEL} data=${data} + Log ${resp.content} + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain ${resp.content} Succeed to connect + END Check added Channel [Documentation] Check if the channels are correct @@ -41,11 +42,12 @@ Check added Channel Send Messages [Documentation] Send test messages multiple times - : FOR ${port_index} IN @{LIST_ECHO_SERVER_PORT} - \ ${content} Create Dictionary hostname=${TOOLS_SYSTEM_IP} port=${port_index} tcp=true content=${TEST_MESSAGE} - \ ${channel} Create Dictionary channel=${content} - \ ${input} Create Dictionary input=${channel} - \ Send Now ${input} + FOR ${port_index} IN @{LIST_ECHO_SERVER_PORT} + ${content} Create Dictionary hostname=${TOOLS_SYSTEM_IP} port=${port_index} tcp=true content=${TEST_MESSAGE} + ${channel} Create Dictionary channel=${content} + ${input} Create Dictionary input=${channel} + Send Now ${input} + END View Bytes In and Bytes Out [Documentation] Check if the number of Bytes In and Bytes Out are correct @@ -64,15 +66,16 @@ View Bytes In and Bytes Out Remove Sessions [Documentation] Remove the channels - : FOR ${port_index} IN @{LIST_ECHO_SERVER_PORT} - \ ${content} Create Dictionary hostname=${TOOLS_SYSTEM_IP} port=${port_index} tcp=true - \ ${channel} Create Dictionary channel=${content} - \ ${input} Create Dictionary input=${channel} - \ ${data} json.dumps ${input} - \ ${resp} Post Request session ${REST_REMOVE_SESSION} data=${data} - \ Log ${resp.content} - \ Should Be Equal As Strings ${resp.status_code} 200 - \ Should Contain ${resp.content} Succeed to remove + FOR ${port_index} IN @{LIST_ECHO_SERVER_PORT} + ${content} Create Dictionary hostname=${TOOLS_SYSTEM_IP} port=${port_index} tcp=true + ${channel} Create Dictionary channel=${content} + ${input} Create Dictionary input=${channel} + ${data} json.dumps ${input} + ${resp} Post Request session ${REST_REMOVE_SESSION} data=${data} + Log ${resp.content} + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain ${resp.content} Succeed to remove + END Remove Channel [Documentation] Remove the channels @@ -98,8 +101,9 @@ Check Channel *** Keywords *** Send Now [Arguments] ${body} - : FOR ${index} IN RANGE 0 ${NUM_OF_MESSAGES} - \ ${data} json.dumps ${body} - \ ${resp} Post Request session ${REST_SEND_MESSAGE} data=${data} - \ Should Be Equal As Strings ${resp.status_code} 200 - \ Should Contain ${resp.content} Succeed to send request + FOR ${index} IN RANGE 0 ${NUM_OF_MESSAGES} + ${data} json.dumps ${body} + ${resp} Post Request session ${REST_SEND_MESSAGE} data=${data} + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain ${resp.content} Succeed to send request + END diff --git a/csit/suites/usc/tcp/300_Callhome_TCP/test.robot b/csit/suites/usc/tcp/300_Callhome_TCP/test.robot index a61b0a2b48..80fd13fb80 100644 --- a/csit/suites/usc/tcp/300_Callhome_TCP/test.robot +++ b/csit/suites/usc/tcp/300_Callhome_TCP/test.robot @@ -41,11 +41,12 @@ Send Messages ${content} Create Dictionary hostname=${TOOLS_SYSTEM_IP} port=${ECHO_SERVER_PORT} tcp=true content=${TEST_MESSAGE} ${channel} Create Dictionary channel=${content} ${input} Create Dictionary input=${channel} - : FOR ${index} IN RANGE 0 ${NUM_OF_MESSAGES} - \ ${data} json.dumps ${input} - \ ${resp} Post Request session ${REST_SEND_MESSAGE} data=${data} - \ Should Be Equal As Strings ${resp.status_code} 200 - \ Should Contain ${resp.content} Succeed to send request + FOR ${index} IN RANGE 0 ${NUM_OF_MESSAGES} + ${data} json.dumps ${input} + ${resp} Post Request session ${REST_SEND_MESSAGE} data=${data} + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain ${resp.content} Succeed to send request + END View Bytes In and Bytes Out [Documentation] Check if the number of Bytes In and Bytes Out are correct diff --git a/csit/suites/usc/udp/110_UDP/Test.robot b/csit/suites/usc/udp/110_UDP/Test.robot index f15a07a13a..412aa7906d 100644 --- a/csit/suites/usc/udp/110_UDP/Test.robot +++ b/csit/suites/usc/udp/110_UDP/Test.robot @@ -40,11 +40,12 @@ Send Messages ${content} Create Dictionary hostname=${TOOLS_SYSTEM_IP} port=${ECHO_SERVER_PORT} tcp=false content=${TEST_MESSAGE} ${channel} Create Dictionary channel=${content} ${input} Create Dictionary input=${channel} - : FOR ${index} IN RANGE 0 ${NUM_OF_MESSAGES} - \ ${data} json.dumps ${input} - \ ${resp} Post Request session ${REST_SEND_MESSAGE} data=${data} - \ Should Be Equal As Strings ${resp.status_code} 200 - \ Should Contain ${resp.content} Succeed to send request + FOR ${index} IN RANGE 0 ${NUM_OF_MESSAGES} + ${data} json.dumps ${input} + ${resp} Post Request session ${REST_SEND_MESSAGE} data=${data} + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain ${resp.content} Succeed to send request + END View Bytes In and Bytes Out [Documentation] Check if the number of Bytes In and Bytes Out are correct diff --git a/csit/suites/usc/udp/200_Multiple_Sessions_UDP/Test.robot b/csit/suites/usc/udp/200_Multiple_Sessions_UDP/Test.robot index 47fe293d25..533389fbf5 100644 --- a/csit/suites/usc/udp/200_Multiple_Sessions_UDP/Test.robot +++ b/csit/suites/usc/udp/200_Multiple_Sessions_UDP/Test.robot @@ -17,15 +17,16 @@ Resource ../../../../libraries/UscUtils.robot *** Test Cases *** Add Channel [Documentation] Add multiple USC DTLS channels - : FOR ${port_index} IN @{LIST_ECHO_SERVER_PORT} - \ ${content} Create Dictionary hostname=${TOOLS_SYSTEM_IP} port=${port_index} tcp=false remote=false - \ ${channel} Create Dictionary channel=${content} - \ ${input} Create Dictionary input=${channel} - \ ${data} json.dumps ${input} - \ ${resp} Post Request session ${REST_ADD_CHANNEL} data=${data} - \ Log ${resp.content} - \ Should Be Equal As Strings ${resp.status_code} 200 - \ Should Contain ${resp.content} Succeed to connect + FOR ${port_index} IN @{LIST_ECHO_SERVER_PORT} + ${content} Create Dictionary hostname=${TOOLS_SYSTEM_IP} port=${port_index} tcp=false remote=false + ${channel} Create Dictionary channel=${content} + ${input} Create Dictionary input=${channel} + ${data} json.dumps ${input} + ${resp} Post Request session ${REST_ADD_CHANNEL} data=${data} + Log ${resp.content} + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain ${resp.content} Succeed to connect + END Check added Channel [Documentation] Check if the channels are correct @@ -42,11 +43,12 @@ Check added Channel Send Messages [Documentation] Send test messages multiple times - : FOR ${port_index} IN @{LIST_ECHO_SERVER_PORT} - \ ${content} Create Dictionary hostname=${TOOLS_SYSTEM_IP} port=${port_index} tcp=false content=${TEST_MESSAGE} - \ ${channel} Create Dictionary channel=${content} - \ ${input} Create Dictionary input=${channel} - \ Send Now ${input} + FOR ${port_index} IN @{LIST_ECHO_SERVER_PORT} + ${content} Create Dictionary hostname=${TOOLS_SYSTEM_IP} port=${port_index} tcp=false content=${TEST_MESSAGE} + ${channel} Create Dictionary channel=${content} + ${input} Create Dictionary input=${channel} + Send Now ${input} + END View Bytes In and Bytes Out [Documentation] Check if the number of Bytes In and Bytes Out are correct @@ -66,15 +68,16 @@ View Bytes In and Bytes Out Remove Sessions [Documentation] Remove the channels - : FOR ${port_index} IN @{LIST_ECHO_SERVER_PORT} - \ ${content} Create Dictionary hostname=${TOOLS_SYSTEM_IP} port=${port_index} tcp=false - \ ${channel} Create Dictionary channel=${content} - \ ${input} Create Dictionary input=${channel} - \ ${data} json.dumps ${input} - \ ${resp} Post Request session ${REST_REMOVE_SESSION} data=${data} - \ Log ${resp.content} - \ Should Be Equal As Strings ${resp.status_code} 200 - \ Should Contain ${resp.content} Succeed to remove + FOR ${port_index} IN @{LIST_ECHO_SERVER_PORT} + ${content} Create Dictionary hostname=${TOOLS_SYSTEM_IP} port=${port_index} tcp=false + ${channel} Create Dictionary channel=${content} + ${input} Create Dictionary input=${channel} + ${data} json.dumps ${input} + ${resp} Post Request session ${REST_REMOVE_SESSION} data=${data} + Log ${resp.content} + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain ${resp.content} Succeed to remove + END Remove Channel [Documentation] Remove the channels @@ -100,8 +103,9 @@ Check Channel *** Keywords *** Send Now [Arguments] ${body} - : FOR ${index} IN RANGE 0 ${NUM_OF_MESSAGES} - \ ${data} json.dumps ${body} - \ ${resp} Post Request session ${REST_SEND_MESSAGE} data=${data} - \ Should Be Equal As Strings ${resp.status_code} 200 - \ Should Contain ${resp.content} Succeed to send request + FOR ${index} IN RANGE 0 ${NUM_OF_MESSAGES} + ${data} json.dumps ${body} + ${resp} Post Request session ${REST_SEND_MESSAGE} data=${data} + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain ${resp.content} Succeed to send request + END diff --git a/csit/suites/usc/udp/300_Callhome_UDP/Test.robot b/csit/suites/usc/udp/300_Callhome_UDP/Test.robot index 18731418b2..40869064ff 100644 --- a/csit/suites/usc/udp/300_Callhome_UDP/Test.robot +++ b/csit/suites/usc/udp/300_Callhome_UDP/Test.robot @@ -42,11 +42,12 @@ Send Messages ${content} Create Dictionary hostname=${TOOLS_SYSTEM_IP} port=${ECHO_SERVER_PORT} tcp=false content=${TEST_MESSAGE} ${channel} Create Dictionary channel=${content} ${input} Create Dictionary input=${channel} - : FOR ${index} IN RANGE 0 ${NUM_OF_MESSAGES} - \ ${data} json.dumps ${input} - \ ${resp} Post Request session ${REST_SEND_MESSAGE} data=${data} - \ Should Be Equal As Strings ${resp.status_code} 200 - \ Should Contain ${resp.content} Succeed to send request + FOR ${index} IN RANGE 0 ${NUM_OF_MESSAGES} + ${data} json.dumps ${input} + ${resp} Post Request session ${REST_SEND_MESSAGE} data=${data} + Should Be Equal As Strings ${resp.status_code} 200 + Should Contain ${resp.content} Succeed to send request + END View Bytes In and Bytes Out [Documentation] Check if the number of Bytes In and Bytes Out are correct diff --git a/csit/suites/vpnservice/010__verify_feature.robot b/csit/suites/vpnservice/010__verify_feature.robot index 8eb9863a77..f91d0df288 100644 --- a/csit/suites/vpnservice/010__verify_feature.robot +++ b/csit/suites/vpnservice/010__verify_feature.robot @@ -11,14 +11,16 @@ Resource ../../libraries/KarafKeywords.robot Verify if the VPN Service features are installed for vpnservice [Documentation] Executes command "feature list -i | grep " in karaf console and checks if output \ contain \ the specific features. [Tags] Verify Feature - : FOR ${feature} IN @{FEATURE_LIST} - \ Verify Feature Is Installed ${feature} + FOR ${feature} IN @{FEATURE_LIST} + Verify Feature Is Installed ${feature} + END Verify if the VPN Service bundles are loaded [Documentation] Executes command "bundle:list -s | grep " and checks in the output for the specific bundles [Tags] Verify VPN bundles - : FOR ${bundle} IN @{BUNDLE_LIST} - \ Verify Bundle Is Installed ${bundle} + FOR ${bundle} IN @{BUNDLE_LIST} + Verify Bundle Is Installed ${bundle} + END Verify if the sessions for bundles got initiated [Documentation] Executes"log:display | grep vpnservice" command in karaf console and verifies the logs for session initiation diff --git a/csit/suites/vpnservice/020__configure_vpn.robot b/csit/suites/vpnservice/020__configure_vpn.robot index 2c3fb43e65..b41793caa4 100644 --- a/csit/suites/vpnservice/020__configure_vpn.robot +++ b/csit/suites/vpnservice/020__configure_vpn.robot @@ -30,8 +30,9 @@ Verify VPN instance ${resp} RequestsLibrary.Get Request session ${REST_CON}l3vpn:vpn-instances/vpn-instance/${vpn_inst_values[0]}/ headers=${ACCEPT_XML} Should Be Equal As Strings ${resp.status_code} 200 Log ${resp.content} - : FOR ${value} IN @{vpn_inst_values} - \ Should Contain ${resp.content} ${value} + FOR ${value} IN @{vpn_inst_values} + Should Contain ${resp.content} ${value} + END Create ietf vm interface [Documentation] Creates ietf interface through the restconf @@ -46,8 +47,9 @@ Verify ietf vm interface ${resp} RequestsLibrary.Get Request session ${REST_CON}ietf-interfaces:interfaces/interface/${vm_int_values[0]}/ headers=${ACCEPT_XML} Should Be Equal As Strings ${resp.status_code} 200 Log ${resp.content} - : FOR ${value} IN @{vm_int_values} - \ Should Contain ${resp.content} ${value} + FOR ${value} IN @{vm_int_values} + Should Contain ${resp.content} ${value} + END Create VPN interface [Documentation] Creates vpn interface for the corresponding ietf interface @@ -62,8 +64,9 @@ Verify VPN interface ${resp} RequestsLibrary.Get Request session ${REST_CON}l3vpn:vpn-interfaces/ headers=${ACCEPT_XML} Should Be Equal As Strings ${resp.status_code} 200 Log ${resp.content} - : FOR ${value} IN @{vm_vpnint_values} - \ Should Contain ${resp.content} ${value} + FOR ${value} IN @{vm_vpnint_values} + Should Contain ${resp.content} ${value} + END Verify FIB entry after create [Documentation] Verifies the fib entry for the corresponding vpn interface diff --git a/csit/suites/vpnservice/030__configure_2_switches.robot b/csit/suites/vpnservice/030__configure_2_switches.robot index c166e9a070..756cffb0f9 100644 --- a/csit/suites/vpnservice/030__configure_2_switches.robot +++ b/csit/suites/vpnservice/030__configure_2_switches.robot @@ -140,7 +140,6 @@ Verify FIB entries after delete Verify flows after delete [Documentation] Verify if the flows are deleted from the switch [Tags] verify in switch - [Template] Wait Until Keyword Succeeds 12s 2s Ensure Flows Are Removed ${mininet1_conn_id_1} Wait Until Keyword Succeeds 12s 2s Ensure Flows Are Removed ${mininet2_conn_id_1} @@ -156,8 +155,9 @@ Ensure Flows Are Present Should Contain X Times ${output} goto_table:21 2 Should Contain X Times ${output} table=20 2 Should Contain X Times ${output} table=21 4 - : FOR ${i} IN @{flow_elements} - \ Should Contain ${output} ${i} + FOR ${i} IN @{flow_elements} + Should Contain ${output} ${i} + END Ensure Groups Are Present [Arguments] ${conn_id} ${group_elements} ${gre_port_id} @@ -167,8 +167,9 @@ Ensure Groups Are Present ${output}= Read Until mininet> Log ${output} Should Contain X Times ${output} actions=output:${gre_port_id} 1 - : FOR ${i} IN @{group_elements} - \ Should Contain ${output} actions=pop_mpls:0x0800,set_field:${i} + FOR ${i} IN @{group_elements} + Should Contain ${output} actions=pop_mpls:0x0800,set_field:${i} + END Ensure Flows Are Removed [Arguments] ${conn_id} diff --git a/csit/suites/yangtools/yang-model-validator/yang-model-validator.robot b/csit/suites/yangtools/yang-model-validator/yang-model-validator.robot index 822db20f3e..4fcb54e0b7 100644 --- a/csit/suites/yangtools/yang-model-validator/yang-model-validator.robot +++ b/csit/suites/yangtools/yang-model-validator/yang-model-validator.robot @@ -53,12 +53,13 @@ Deploy_And_Start_Odl_Yang_Validator_Utility ... and run it for each single yang file in the prepared set. ... The version is either given by ${EXPLICIT_YANG_SYSTEM_TEST_URL}, ... or constructed from Jenkins-shaped ${BUNDLE_URL}, or downloaded from Nexus based on ODL version. - : FOR ${yang_file} IN @{yang_files_to_validate} - \ ${logfile} = NexusKeywords.Install_And_Start_Java_Artifact component=yangtools artifact=${TEST_TOOL_NAME} suffix=jar-with-dependencies tool_options=-p ${p_option_value} ${yang_file} - \ ... explicit_url=${EXPLICIT_YANG_SYSTEM_TEST_URL} - \ BuiltIn.Set_Suite_Variable \${logfile} - \ Wait_Until_Utility_Finishes - \ Check_Return_Code + FOR ${yang_file} IN @{yang_files_to_validate} + ${logfile} = NexusKeywords.Install_And_Start_Java_Artifact component=yangtools artifact=${TEST_TOOL_NAME} suffix=jar-with-dependencies tool_options=-p ${p_option_value} ${yang_file} + ... explicit_url=${EXPLICIT_YANG_SYSTEM_TEST_URL} + BuiltIn.Set_Suite_Variable \${logfile} + Wait_Until_Utility_Finishes + Check_Return_Code + END Collect_Files_To_Archive [Documentation] Download created files so Releng scripts would archive it. @@ -89,10 +90,11 @@ Get_Recursive_Dirs ... This implementation returns absolute paths as that is easier. ${depth_1} = SSHLibrary.List_Directories_In_Directory path=${root} absolute=True ${subtrees} = BuiltIn.Create_List - : FOR ${subdir} IN @{depth_1} - \ ${tree} = Get_Recursive_Dirs root=${subdir} - \ # Relative paths would require prepending ${subdir}${/} to each @{tree} element. - \ Collections.Append_To_List ${subtrees} ${tree} + FOR ${subdir} IN @{depth_1} + ${tree} = Get_Recursive_Dirs root=${subdir} + # Relative paths would require prepending ${subdir}${/} to each @{tree} element. + Collections.Append_To_List ${subtrees} ${tree} + END ${flat_list} = Collections.Combine_Lists ${depth_1} @{subtrees} [Return] ${flat_list} @@ -100,9 +102,10 @@ Get_Yang_Files_From_Dirs [Arguments] ${dirs_to_process} [Documentation] Return list of yang files from provided directories ${collected_yang_files} = BuiltIn.Create_List - : FOR ${dir} IN @{dirs_to_process} - \ ${yang_files_in_dir} = SSHLibrary.List_Files_In_Directory path=${dir} pattern=*.yang absolute=True - \ ${collected_yang_files} = Collections.Combine_Lists ${collected_yang_files} ${yang_files_in_dir} + FOR ${dir} IN @{dirs_to_process} + ${yang_files_in_dir} = SSHLibrary.List_Files_In_Directory path=${dir} pattern=*.yang absolute=True + ${collected_yang_files} = Collections.Combine_Lists ${collected_yang_files} ${yang_files_in_dir} + END [Return] ${collected_yang_files} Wait_Until_Utility_Finishes diff --git a/tools/deployment/openstack_ha/deploy/01_mysql_setup.robot b/tools/deployment/openstack_ha/deploy/01_mysql_setup.robot index 5ca20b9b07..30b7cf338d 100644 --- a/tools/deployment/openstack_ha/deploy/01_mysql_setup.robot +++ b/tools/deployment/openstack_ha/deploy/01_mysql_setup.robot @@ -82,7 +82,7 @@ Configure Cluster Root Node ... mysql Grant Privileges To Mysql Database ${os_node_cxn} root mysql *.* ${hostuser} ${HAPROXY_HOSTNAME} ... mysql #Grant Process To Mysql Database ${os_node_cxn} root mysql *.* - ... # clustercheck_user localhost # my_clustercheck_password + ... # clustercheck_user localhost # my_clustercheck_password Execute MySQL STATUS Query ${os_node_cxn} root mysql wsrep_cluster_size Enable MySQL non-root nodes @@ -95,7 +95,7 @@ Enable MySQL non-root nodes ... mysql Grant Privileges To Mysql Database ${os_node_cxn} root mysql *.* ${hostuser} ${HAPROXY_HOSTNAME} ... mysql #Grant Process To Mysql Database ${os_node_cxn} root mysql *.* - ... # clustercheck_user localhost # my_clustercheck_password + ... # clustercheck_user localhost # my_clustercheck_password Execute MySQL STATUS Query ${os_node_cxn} root mysql wsrep_cluster_size Add HAPROXY Entry for DB diff --git a/tools/deployment/openstack_ha/libraries/OpenStackOperations.robot b/tools/deployment/openstack_ha/libraries/OpenStackOperations.robot index 4f329aa4b4..7935c9bb2a 100644 --- a/tools/deployment/openstack_ha/libraries/OpenStackOperations.robot +++ b/tools/deployment/openstack_ha/libraries/OpenStackOperations.robot @@ -154,13 +154,14 @@ Create And Associate Floating IPs [Arguments] ${external_net} @{vm_list} [Documentation] Create and associate floating IPs to VMs with nova request ${ip_list} = BuiltIn.Create List @{EMPTY} - : FOR ${vm} IN @{vm_list} - \ ${output} = OpenStack CLI openstack floating ip create ${external_net} - \ @{ip} = String.Get Regexp Matches ${output} [0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3} - \ ${ip_length} = BuiltIn.Get Length ${ip} - \ BuiltIn.Run Keyword If ${ip_length}>0 Collections.Append To List ${ip_list} @{ip}[0] - \ ... ELSE Collections.Append To List ${ip_list} None - \ ${output} = OpenStack CLI openstack server add floating ip ${vm} @{ip}[0] + FOR ${vm} IN @{vm_list} + ${output} = OpenStack CLI openstack floating ip create ${external_net} + @{ip} = String.Get Regexp Matches ${output} [0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3} + ${ip_length} = BuiltIn.Get Length ${ip} + BuiltIn.Run Keyword If ${ip_length}>0 Collections.Append To List ${ip_list} @{ip}[0] + ... ELSE Collections.Append To List ${ip_list} None + ${output} = OpenStack CLI openstack server add floating ip ${vm} @{ip}[0] + END [Return] ${ip_list} Delete Floating IP @@ -216,8 +217,9 @@ Create Vm Instances [Documentation] Create X Vm Instance with the net id of the Netowrk. ${image} BuiltIn.Set Variable If "${image}"=="${EMPTY}" ${CIRROS_${OPENSTACK_BRANCH}} ${image} ${net_id} = OpenStackOperations.Get Net Id ${net_name} - : FOR ${vm} IN @{vm_instance_names} - \ ${output} = OpenStack CLI openstack server create --image ${image} --flavor ${flavor} --nic net-id=${net_id} ${vm} --security-group ${sg} --min ${min} --max ${max} + FOR ${vm} IN @{vm_instance_names} + ${output} = OpenStack CLI openstack server create --image ${image} --flavor ${flavor} --nic net-id=${net_id} ${vm} --security-group ${sg} --min ${min} --max ${max} + END Create Vm Instance On Compute Node [Arguments] ${net_name} ${vm_name} ${node_hostname} ${image}=${EMPTY} ${flavor}=m1.nano ${sg}=default @@ -278,18 +280,19 @@ Collect VM IP Addresses ... if available in the console-log output. The keyword will also return a list of the learned ips as it ... finds them in the console log output, and will have "None" for Vms that no ip was found. ${ip_list} Create List @{EMPTY} - : FOR ${vm} IN @{vm_list} - \ ${rc} ${vm_ip_line}= Run And Return Rc And Output openstack console log show ${vm} | grep -i "obtained" - \ @{vm_ip} Get Regexp Matches ${vm_ip_line} [0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3} - \ ${vm_ip_length} Get Length ${vm_ip} - \ Run Keyword If ${vm_ip_length}>0 Append To List ${ip_list} @{vm_ip}[0] - \ ... ELSE Append To List ${ip_list} None - \ ${rc} ${dhcp_ip_line}= Run And Return Rc And Output openstack console log show ${vm} | grep "^nameserver" - \ ${dhcp_ip} Get Regexp Matches ${dhcp_ip_line} [0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3} - \ ${dhcp_ip_length} Get Length ${dhcp_ip} - \ Run Keyword If ${dhcp_ip_length}<=0 Append To List ${dhcp_ip} None - \ ${vm_console_output}= Run openstack console log show ${vm} - \ Log ${vm_console_output} + FOR ${vm} IN @{vm_list} + ${rc} ${vm_ip_line}= Run And Return Rc And Output openstack console log show ${vm} | grep -i "obtained" + @{vm_ip} Get Regexp Matches ${vm_ip_line} [0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3} + ${vm_ip_length} Get Length ${vm_ip} + Run Keyword If ${vm_ip_length}>0 Append To List ${ip_list} @{vm_ip}[0] + ... ELSE Append To List ${ip_list} None + ${rc} ${dhcp_ip_line}= Run And Return Rc And Output openstack console log show ${vm} | grep "^nameserver" + ${dhcp_ip} Get Regexp Matches ${dhcp_ip_line} [0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3} + ${dhcp_ip_length} Get Length ${dhcp_ip} + Run Keyword If ${dhcp_ip_length}<=0 Append To List ${dhcp_ip} None + ${vm_console_output}= Run openstack console log show ${vm} + Log ${vm_console_output} + END ${dhcp_length} Get Length ${dhcp_ip} Run Keyword If '${fail_on_none}' == 'true' Should Not Contain ${ip_list} None Run Keyword If '${fail_on_none}' == 'true' Should Not Contain ${dhcp_ip} None @@ -330,19 +333,20 @@ Get VM IPs ... TODO: there is a potential issue for a caller that passes in VMs belonging to different networks that ... may have different dhcp server addresses. Not sure what TODO about that, but noting it here for reference. @{vm_ips} BuiltIn.Create List @{EMPTY} - : FOR ${vm} IN @{vms} - \ OpenStackOperations.Poll VM Is ACTIVE ${vm} - \ ${status} ${ips_and_console_log} BuiltIn.Run Keyword And Ignore Error BuiltIn.Wait Until Keyword Succeeds 180s 15s - \ ... OpenStackOperations.Get VM IP true ${vm} - \ # If there is trouble with Get VM IP, the status will be FAIL and the return value will be a string of what went - \ # wrong. We need to handle both the PASS and FAIL cases. In the FAIL case we know we wont have access to the - \ # console log, as it would not be returned; so we need to grab it again to log it. We also can append 'None' to - \ # the vm ip list if status is FAIL. - \ BuiltIn.Run Keyword If "${status}" == "PASS" BuiltIn.Log ${ips_and_console_log[2]} - \ BuiltIn.Run Keyword If "${status}" == "PASS" Collections.Append To List ${vm_ips} ${ips_and_console_log[0]} - \ BuiltIn.Run Keyword If "${status}" == "FAIL" Collections.Append To List ${vm_ips} None - \ ${vm_console_output} = BuiltIn.Run Keyword If "${status}" == "FAIL" OpenStack CLI openstack console log show ${vm} - \ BuiltIn.Run Keyword If "${status}" == "FAIL" BuiltIn.Log ${vm_console_output} + FOR ${vm} IN @{vms} + OpenStackOperations.Poll VM Is ACTIVE ${vm} + ${status} ${ips_and_console_log} BuiltIn.Run Keyword And Ignore Error BuiltIn.Wait Until Keyword Succeeds 180s 15s + ... OpenStackOperations.Get VM IP true ${vm} + # If there is trouble with Get VM IP, the status will be FAIL and the return value will be a string of what went + # wrong. We need to handle both the PASS and FAIL cases. In the FAIL case we know we wont have access to the + # console log, as it would not be returned; so we need to grab it again to log it. We also can append 'None' to + # the vm ip list if status is FAIL. + BuiltIn.Run Keyword If "${status}" == "PASS" BuiltIn.Log ${ips_and_console_log[2]} + BuiltIn.Run Keyword If "${status}" == "PASS" Collections.Append To List ${vm_ips} ${ips_and_console_log[0]} + BuiltIn.Run Keyword If "${status}" == "FAIL" Collections.Append To List ${vm_ips} None + ${vm_console_output} = BuiltIn.Run Keyword If "${status}" == "FAIL" OpenStack CLI openstack console log show ${vm} + BuiltIn.Run Keyword If "${status}" == "FAIL" BuiltIn.Log ${vm_console_output} + END OpenStackOperations.Copy DHCP Files From Control Node [Return] @{vm_ips} ${ips_and_console_log[1]} @@ -354,25 +358,27 @@ Collect VM IPv6 SLAAC Addresses ... Returns an empty list if no IPv6 addresses found or if SSH connection fails. ... Otherwise, returns a list of IPv6 addresses. ${ipv6_list} = BuiltIn.Create List @{EMPTY} - : FOR ${vm} IN @{vm_list} - \ ${output} = OpenStack CLI openstack server show ${vm} -f shell - \ ${pattern} = String.Replace String ${subnet} ::/64 (:[a-f0-9]{,4}){,4} - \ @{vm_ipv6} = String.Get Regexp Matches ${output} ${pattern} - \ ${vm_ip_length} = BuiltIn.Get Length ${vm_ipv6}[0] - \ ${ipv6_data_from_vm} = BuiltIn.Run Keyword If ${vm_ip_length}>0 OpenStackOperations.Execute Command on VM Instance ${network} ${vm_ipv6[0]} - \ ... ip -6 a - \ @{ipv6} = String.Get Regexp Matches ${ipv6_data_from_vm} ${pattern} - \ ${ipv6_addr_list_length} BuiltIn.Get Length @{ipv6} - \ BuiltIn.Run Keyword If ${ipv6_addr_list_length}>0 Collections.Append To List ${ipv6_list} ${ipv6[0]} - \ ... ELSE Collections.Append To List ${ipv6_list} None + FOR ${vm} IN @{vm_list} + ${output} = OpenStack CLI openstack server show ${vm} -f shell + ${pattern} = String.Replace String ${subnet} ::/64 (:[a-f0-9]{,4}){,4} + @{vm_ipv6} = String.Get Regexp Matches ${output} ${pattern} + ${vm_ip_length} = BuiltIn.Get Length ${vm_ipv6}[0] + ${ipv6_data_from_vm} = BuiltIn.Run Keyword If ${vm_ip_length}>0 OpenStackOperations.Execute Command on VM Instance ${network} ${vm_ipv6[0]} + ... ip -6 a + @{ipv6} = String.Get Regexp Matches ${ipv6_data_from_vm} ${pattern} + ${ipv6_addr_list_length} BuiltIn.Get Length @{ipv6} + BuiltIn.Run Keyword If ${ipv6_addr_list_length}>0 Collections.Append To List ${ipv6_list} ${ipv6[0]} + ... ELSE Collections.Append To List ${ipv6_list} None + END [Return] ${ipv6_list} View Vm Console [Arguments] ${vm_instance_names} [Documentation] View Console log of the created vm instances using nova show. - : FOR ${vm} IN @{vm_instance_names} - \ ${output} = OpenStack CLI openstack server show ${vm} - \ ${output} = OpenStack CLI openstack console log show ${vm} + FOR ${vm} IN @{vm_instance_names} + ${output} = OpenStack CLI openstack server show ${vm} + ${output} = OpenStack CLI openstack console log show ${vm} + END Ping Vm From DHCP Namespace [Arguments] ${net_name} ${vm_ip} @@ -464,11 +470,12 @@ Test Operations From Vm Instance BuiltIn.Run Keyword If ${rcode} Utils.Write Commands Until Expected Prompt route -A inet6 ${OS_SYSTEM_PROMPT} BuiltIn.Run Keyword If ${rcode} Utils.Write Commands Until Expected Prompt arp -an ${OS_SYSTEM_PROMPT} BuiltIn.Run Keyword If ${rcode} Utils.Write Commands Until Expected Prompt ip -f inet6 neigh show ${OS_SYSTEM_PROMPT} - : FOR ${dest_ip} IN @{dest_ips} - \ ${string_empty} = BuiltIn.Run Keyword And Return Status Should Be Empty ${dest_ip} - \ BuiltIn.Run Keyword If ${string_empty} Continue For Loop - \ BuiltIn.Run Keyword If ${rcode} and "${ping_should_succeed}" == "True" OpenStackOperations.Check Ping ${dest_ip} ttl=${ttl} - \ ... ELSE OpenStackOperations.Check No Ping ${dest_ip} ttl=${ttl} + FOR ${dest_ip} IN @{dest_ips} + ${string_empty} = BuiltIn.Run Keyword And Return Status Should Be Empty ${dest_ip} + BuiltIn.Run Keyword If ${string_empty} Continue For Loop + BuiltIn.Run Keyword If ${rcode} and "${ping_should_succeed}" == "True" OpenStackOperations.Check Ping ${dest_ip} ttl=${ttl} + ... ELSE OpenStackOperations.Check No Ping ${dest_ip} ttl=${ttl} + END ${ethertype} = String.Get Regexp Matches ${src_ip} ${IP_REGEX} BuiltIn.Run Keyword If ${rcode} and "${check_metadata}" and ${ethertype} == "True" OpenStackOperations.Check Metadata Access [Teardown] Exit From Vm Console @@ -494,8 +501,9 @@ Ping Other Instances [Arguments] ${list_of_external_dst_ips} [Documentation] Check reachability with other network's instances. ${rcode} = BuiltIn.Run Keyword And Return Status OpenStackOperations.Check If Console Is VmInstance - : FOR ${dest_ip} IN @{list_of_external_dst_ips} - \ OpenStackOperations.Check Ping ${dest_ip} + FOR ${dest_ip} IN @{list_of_external_dst_ips} + OpenStackOperations.Check Ping ${dest_ip} + END Create Router [Arguments] ${router_name} @@ -558,10 +566,11 @@ Get DumpFlows And Ovsconfig Utils.Write Commands Until Expected Prompt arp -an ${DEFAULT_LINUX_PROMPT_STRICT} ${nslist} = Utils.Write Commands Until Expected Prompt ip netns list | awk '{print $1}' ${DEFAULT_LINUX_PROMPT_STRICT} @{lines} Split To Lines ${nslist} end=-1 - : FOR ${line} IN @{lines} - \ Utils.Write Commands Until Expected Prompt sudo ip netns exec ${line} ip -o link ${DEFAULT_LINUX_PROMPT_STRICT} - \ Utils.Write Commands Until Expected Prompt sudo ip netns exec ${line} ip -o addr ${DEFAULT_LINUX_PROMPT_STRICT} - \ Utils.Write Commands Until Expected Prompt sudo ip netns exec ${line} ip route ${DEFAULT_LINUX_PROMPT_STRICT} + FOR ${line} IN @{lines} + Utils.Write Commands Until Expected Prompt sudo ip netns exec ${line} ip -o link ${DEFAULT_LINUX_PROMPT_STRICT} + Utils.Write Commands Until Expected Prompt sudo ip netns exec ${line} ip -o addr ${DEFAULT_LINUX_PROMPT_STRICT} + Utils.Write Commands Until Expected Prompt sudo ip netns exec ${line} ip route ${DEFAULT_LINUX_PROMPT_STRICT} + END Utils.Write Commands Until Expected Prompt sudo ovs-vsctl show ${DEFAULT_LINUX_PROMPT_STRICT} Utils.Write Commands Until Expected Prompt sudo ovs-vsctl list Open_vSwitch ${DEFAULT_LINUX_PROMPT_STRICT} Utils.Write Commands Until Expected Prompt sudo ovs-ofctl show br-int -OOpenFlow13 ${DEFAULT_LINUX_PROMPT_STRICT} @@ -579,9 +588,10 @@ Get Karaf Log Type From Test Start Get Karaf Log Types From Test Start [Arguments] ${ip} ${test_name} ${types} ${user}=${ODL_SYSTEM_USER} ${password}=${ODL_SYSTEM_PASSWORD} ${prompt}=${ODL_SYSTEM_PROMPT} ... ${log_file}=${WORKSPACE}/${BUNDLEFOLDER}/data/log/karaf.log - : FOR ${type} IN @{types} - \ OpenStackOperations.Get Karaf Log Type From Test Start ${ip} ${test_name} ${type} ${user} ${password} - \ ... ${prompt} ${log_file} + FOR ${type} IN @{types} + OpenStackOperations.Get Karaf Log Type From Test Start ${ip} ${test_name} ${type} ${user} ${password} + ... ${prompt} ${log_file} + END Get Karaf Log Events From Test Start [Arguments] ${test_name} ${user}=${ODL_SYSTEM_USER} ${password}=${ODL_SYSTEM_PASSWORD} ${prompt}=${ODL_SYSTEM_PROMPT} @@ -615,9 +625,10 @@ Show Debugs [Documentation] Run these commands for debugging, it can list state of VM instances and ip information in control node OpenStackOperations.Get ControlNode Connection ${output} = DevstackUtils.Write Commands Until Prompt And Log sudo ip netns list - : FOR ${index} IN @{vm_indices} - \ ${rc} ${output} = OperatingSystem.Run And Return Rc And Output nova show ${index} - \ BuiltIn.Log ${output} + FOR ${index} IN @{vm_indices} + ${rc} ${output} = OperatingSystem.Run And Return Rc And Output nova show ${index} + BuiltIn.Log ${output} + END OpenStackOperations.List Nova VMs OpenStackOperations.List Routers OpenStackOperations.List Networks @@ -708,8 +719,9 @@ Delete All Security Group Rules [Documentation] Delete all security rules from a specified security group ${sg_rules_output} = OpenStack CLI openstack security group rule list ${sg_name} -cID -fvalue @{sg_rules} = String.Split String ${sg_rules_output} \n - : FOR ${rule} IN @{sg_rules} - \ ${output} = OpenStack CLI openstack security group rule delete ${rule} + FOR ${rule} IN @{sg_rules} + ${output} = OpenStack CLI openstack security group rule delete ${rule} + END Create Allow All SecurityGroup [Arguments] ${sg_name} ${ether_type}=IPv4 @@ -735,9 +747,10 @@ Get Ports MacAddr [Arguments] ${ports} [Documentation] Retrieve the port MacAddr for the given list of port name and return the MAC address list. ${macs} BuiltIn.Create List - : FOR ${port} IN @{ports} - \ ${mac} = OpenStackOperations.Get Port Mac ${port} - \ Collections.Append To List ${macs} ${mac} + FOR ${port} IN @{ports} + ${mac} = OpenStackOperations.Get Port Mac ${port} + Collections.Append To List ${macs} ${mac} + END [Return] ${macs} Get Port Ip @@ -945,33 +958,40 @@ Wait For Routes To Propogate [Arguments] ${networks} ${subnets} [Documentation] Check propagated routes OpenStackOperations.Get ControlNode Connection - : FOR ${INDEX} IN RANGE 0 1 - \ ${net_id} = OpenStackOperations.Get Net Id @{networks}[${INDEX}] - \ ${is_ipv6} = String.Get Regexp Matches @{subnets}[${INDEX}] ${IP6_REGEX} - \ ${length} = BuiltIn.Get Length ${is_ipv6} - \ ${cmd} = BuiltIn.Set Variable If ${length} == 0 ip route ip -6 route - \ ${output} = Utils.Write Commands Until Expected Prompt sudo ip netns exec qdhcp-${net_id} ${cmd} ]> - \ BuiltIn.Should Contain ${output} @{subnets}[${INDEX}] + FOR ${INDEX} IN RANGE 0 1 + ${net_id} = OpenStackOperations.Get Net Id @{networks}[${INDEX}] + ${is_ipv6} = String.Get Regexp Matches @{subnets}[${INDEX}] ${IP6_REGEX} + ${length} = BuiltIn.Get Length ${is_ipv6} + ${cmd} = BuiltIn.Set Variable If ${length} == 0 ip route ip -6 route + ${output} = Utils.Write Commands Until Expected Prompt sudo ip netns exec qdhcp-${net_id} ${cmd} ]> + BuiltIn.Should Contain ${output} @{subnets}[${INDEX}] + END Neutron Cleanup [Arguments] ${vms}=@{EMPTY} ${networks}=@{EMPTY} ${subnets}=@{EMPTY} ${ports}=@{EMPTY} ${sgs}=@{EMPTY} - : FOR ${vm} IN @{vms} - \ BuiltIn.Run Keyword And Ignore Error Delete Vm Instance ${vm} - : FOR ${port} IN @{ports} - \ BuiltIn.Run Keyword And Ignore Error Delete Port ${port} - : FOR ${subnet} IN @{subnets} - \ BuiltIn.Run Keyword And Ignore Error Delete SubNet ${subnet} - : FOR ${network} IN @{networks} - \ BuiltIn.Run Keyword And Ignore Error Delete Network ${network} - : FOR ${sg} IN @{sgs} - \ BuiltIn.Run Keyword And Ignore Error Delete SecurityGroup ${sg} + FOR ${vm} IN @{vms} + BuiltIn.Run Keyword And Ignore Error Delete Vm Instance ${vm} + END + FOR ${port} IN @{ports} + BuiltIn.Run Keyword And Ignore Error Delete Port ${port} + END + FOR ${subnet} IN @{subnets} + BuiltIn.Run Keyword And Ignore Error Delete SubNet ${subnet} + END + FOR ${network} IN @{networks} + BuiltIn.Run Keyword And Ignore Error Delete Network ${network} + END + FOR ${sg} IN @{sgs} + BuiltIn.Run Keyword And Ignore Error Delete SecurityGroup ${sg} + END OpenStack List All [Documentation] Get a list of different OpenStack resources that might be in use. @{modules} = BuiltIn.Create List server port network subnet security group ... security group rule floating ip router - : FOR ${module} IN @{modules} - \ ${output} = OpenStack CLI openstack ${module} list + FOR ${module} IN @{modules} + ${output} = OpenStack CLI openstack ${module} list + END OpenStack CLI Get List [Arguments] ${cmd} @@ -1001,34 +1021,41 @@ OpenStack Cleanup All [Documentation] Cleanup all Openstack resources with best effort. The keyword will query for all resources ... in use and then attempt to delete them. Errors are ignored to allow the cleanup to continue. @{fips} = OpenStack CLI Get List openstack floating ip list -f json - : FOR ${fip} IN @{fips} - \ BuiltIn.Run Keyword And Ignore Error Delete Floating IP ${fip['ID']} + FOR ${fip} IN @{fips} + BuiltIn.Run Keyword And Ignore Error Delete Floating IP ${fip['ID']} + END @{vms} = OpenStack CLI Get List openstack server list -f json - : FOR ${vm} IN @{vms} - \ BuiltIn.Run Keyword And Ignore Error Delete Vm Instance ${vm['ID']} + FOR ${vm} IN @{vms} + BuiltIn.Run Keyword And Ignore Error Delete Vm Instance ${vm['ID']} + END @{routers} = OpenStack CLI Get List openstack router list -f json - : FOR ${router} IN @{routers} - \ BuiltIn.Run Keyword And Ignore Error Cleanup Router ${router['ID']} + FOR ${router} IN @{routers} + BuiltIn.Run Keyword And Ignore Error Cleanup Router ${router['ID']} + END @{ports} = OpenStack CLI Get List openstack port list -f json - : FOR ${port} IN @{ports} - \ BuiltIn.Run Keyword And Ignore Error Delete Port ${port['ID']} + FOR ${port} IN @{ports} + BuiltIn.Run Keyword And Ignore Error Delete Port ${port['ID']} + END @{networks} = OpenStack CLI Get List openstack network list -f json - : FOR ${network} IN @{networks} - \ BuiltIn.Run Keyword And Ignore Error Delete Subnet ${network['Subnets']} - \ BuiltIn.Run Keyword And Ignore Error Delete Network ${network['ID']} + FOR ${network} IN @{networks} + BuiltIn.Run Keyword And Ignore Error Delete Subnet ${network['Subnets']} + BuiltIn.Run Keyword And Ignore Error Delete Network ${network['ID']} + END @{security_groups} = OpenStack CLI Get List openstack security group list -f json - : FOR ${security_group} IN @{security_groups} - \ BuiltIn.Run Keyword If "${security_group['Name']}" != "default" BuiltIn.Run Keyword And Ignore Error Delete SecurityGroup ${security_group['ID']} + FOR ${security_group} IN @{security_groups} + BuiltIn.Run Keyword If "${security_group['Name']}" != "default" BuiltIn.Run Keyword And Ignore Error Delete SecurityGroup ${security_group['ID']} + END OpenStack List All Cleanup Router [Arguments] ${id} [Documentation] Delete a router, but first remove any interfaces or gateways so that the delete will be successful. @{ports} = OpenStack CLI Get List openstack port list --router ${id} -f json --long - : FOR ${port} IN @{ports} - \ ${subnet_id} = OpenStackOperations.Get Match ${port['Fixed IP Addresses']} ${REGEX_UUID} 0 - \ BuiltIn.Run Keyword If "${port['Device Owner']}" == "network:router_gateway" BuiltIn.Run Keyword And Ignore Error Remove Gateway ${id} - \ BuiltIn.Run Keyword If "${port['Device Owner']}" == "network:router_interface" BuiltIn.Run Keyword And Ignore Error Remove Interface ${id} ${subnet_id} + FOR ${port} IN @{ports} + ${subnet_id} = OpenStackOperations.Get Match ${port['Fixed IP Addresses']} ${REGEX_UUID} 0 + BuiltIn.Run Keyword If "${port['Device Owner']}" == "network:router_gateway" BuiltIn.Run Keyword And Ignore Error Remove Gateway ${id} + BuiltIn.Run Keyword If "${port['Device Owner']}" == "network:router_interface" BuiltIn.Run Keyword And Ignore Error Remove Interface ${id} ${subnet_id} + END BuiltIn.Run Keyword And Ignore Error Delete Router ${id} OpenStack Suite Setup @@ -1060,9 +1087,10 @@ Copy DHCP Files From Control Node Is Feature Installed [Arguments] ${features}=none - : FOR ${feature} IN @{features} - \ ${status} ${output} BuiltIn.Run Keyword And Ignore Error BuiltIn.Should Contain ${CONTROLLERFEATURES} ${feature} - \ Return From Keyword If "${status}" == "PASS" True + FOR ${feature} IN @{features} + ${status} ${output} BuiltIn.Run Keyword And Ignore Error BuiltIn.Should Contain ${CONTROLLERFEATURES} ${feature} + Return From Keyword If "${status}" == "PASS" True + END [Return] False Add OVS Logging On All OpenStack Nodes -- 2.36.6