From a4e0264d1c10958d5dbd595d01ba6c8e60e5f4de Mon Sep 17 00:00:00 2001 From: Greg Dennis <5436032+greg-dennis@users.noreply.github.com> Date: Wed, 17 Jan 2024 14:44:04 -0500 Subject: [PATCH] Remove unnecessary SetChoice calls (#2555) * Remove unnecessary SetChoice calls * remove inadvertent quotes around Set --- .../route_summary_counters_test.go | 2 +- .../route_propagation_test.go | 2 +- .../bgp_multipath_ecmp_test.go | 1 - .../bgp_default_policies_test.go | 4 ++-- .../route_installation_test.go | 8 +++---- .../bgp_prefix_limit_test.go | 4 ++-- ...palive_and_holdtimer_configuration_test.go | 4 ++-- .../tests/topology_test/topology_test.go | 2 +- .../bgp_afi_safi_defaults_test.go | 4 ++-- .../bgp_always_compare_med_test.go | 10 ++++----- .../bgp_remove_private_as_test.go | 4 ++-- .../bgp_tcp_mss_path_mtu_test.go | 4 ++-- .../fib_failed_due_to_hw_res_exhaust_test.go | 8 +++---- .../route_addition_during_failover_test.go | 4 ++-- .../route_removal_during_failover_test.go | 4 ++-- .../interface_loopback_aggregate_test.go | 2 +- .../my_station_mac_test.go | 2 +- .../isis_change_lsp_lifetime_test.go | 4 ++-- .../isis_drain_test/isis_drain_test.go | 12 +++++------ ...sis_interface_hello_padding_enable_test.go | 4 ++-- .../isis_interface_level_passive_test.go | 4 ++-- .../isis_metric_style_wide_enabled_test.go | 4 ++-- ...isis_metric_style_wide_not_enabled_test.go | 4 ++-- .../base_vrf_selection_test.go | 10 ++++----- ...tocol_dscp_rules_for_vrf_selection_test.go | 10 ++++----- .../tun_acl_dscp_test.go | 6 +++--- ...rface_based_ipv6_gre_encapsulation_test.go | 6 +++--- .../telemetry_basic_check_test.go | 4 ++-- ...elemetry_interface_packet_counters_test.go | 4 ++-- feature/gribi/mplsutil/mplsutil.go | 21 +++++++++---------- .../route_ack_test.go | 10 ++++----- .../backup_nhg_multiple_nh_test.go | 2 +- ...se_hierarchical_route_installation_test.go | 2 +- .../base_leader_election_test.go | 8 +++---- .../otg_tests/get_rpc_test/get_rpc_test.go | 4 ++-- .../gribi_scaling/gribi_scaling_test.go | 2 +- .../ipv4_entry_with_aggregate_ports_test.go | 6 +++--- .../ordering_ack_test/ordering_ack_test.go | 8 +++---- .../persistence_mode_test.go | 8 +++---- .../route_removal_via_flush_test.go | 2 +- .../weighted_balancing_test/setup_test.go | 10 ++++----- .../aggregate_forwarding_viable_test.go | 3 +-- .../aggregate_test/aggregate_test.go | 7 +++---- .../balancing_test/balancing_test.go | 4 ++-- .../singleton_test/singleton_test.go | 4 ++-- .../static_arp_test/static_arp_test.go | 1 - .../core_lldp_tlv_population_test.go | 2 +- .../large_ip_packet_transmission_test.go | 2 +- .../utilization_test/utilization_test.go | 4 ++-- .../bursty_traffic_test.go | 1 - .../qos_output_queue_counters_test.go | 4 ++-- internal/attrs/attrs.go | 2 +- 52 files changed, 126 insertions(+), 132 deletions(-) diff --git a/feature/aft/aft_summary/otg_tests/route_summary_counters_test/route_summary_counters_test.go b/feature/aft/aft_summary/otg_tests/route_summary_counters_test/route_summary_counters_test.go index 55f9b825b4e..ee6193d047e 100644 --- a/feature/aft/aft_summary/otg_tests/route_summary_counters_test/route_summary_counters_test.go +++ b/feature/aft/aft_summary/otg_tests/route_summary_counters_test/route_summary_counters_test.go @@ -261,7 +261,7 @@ func (ad *ateData) ConfigureOTG(t *testing.T, otg *otg.OTG, ateList []string) go dev := config.Devices().Add().SetName(devName) eth := dev.Ethernets().Add().SetName(devName + ".Eth").SetMac(v.iface.MAC) - eth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(port.Name()) + eth.Connection().SetPortName(port.Name()) bgp := dev.Bgp().SetRouterId(v.iface.IPv4) if v.ip.v4 != "" { address := strings.Split(v.ip.v4, "/")[0] diff --git a/feature/bgp/addpath/otg_tests/route_propagation_test/route_propagation_test.go b/feature/bgp/addpath/otg_tests/route_propagation_test/route_propagation_test.go index 6d85dad51f2..29ce31ff7da 100644 --- a/feature/bgp/addpath/otg_tests/route_propagation_test/route_propagation_test.go +++ b/feature/bgp/addpath/otg_tests/route_propagation_test/route_propagation_test.go @@ -122,7 +122,7 @@ func (ad *ateData) ConfigureOTG(t *testing.T, otg *otg.OTG, ateList []string) go ateIndex++ eth := dev.Ethernets().Add().SetName(devName + ".Eth").SetMac(v.iface.mac) - eth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(port.Name()) + eth.Connection().SetPortName(port.Name()) bgp := dev.Bgp().SetRouterId(v.iface.routerId) if v.ip.v4 != "" { address := strings.Split(v.ip.v4, "/")[0] diff --git a/feature/bgp/multipath/otg_tests/bgp_multipath_ecmp_test/bgp_multipath_ecmp_test.go b/feature/bgp/multipath/otg_tests/bgp_multipath_ecmp_test/bgp_multipath_ecmp_test.go index cada4eee4ed..95c38d00260 100644 --- a/feature/bgp/multipath/otg_tests/bgp_multipath_ecmp_test/bgp_multipath_ecmp_test.go +++ b/feature/bgp/multipath/otg_tests/bgp_multipath_ecmp_test/bgp_multipath_ecmp_test.go @@ -84,7 +84,6 @@ func configureFlow(bs *cfgplugins.BGPSession) { flow.TxRx().Device(). SetTxNames([]string{bs.ATEPorts[0].Name + ".IPv4"}). SetRxNames(rxNames) - flow.Duration().SetChoice(gosnappi.FlowDurationChoice.FIXED_PACKETS) flow.Duration().FixedPackets().SetPackets(totalPackets) flow.Size().SetFixed(1500) flow.Rate().SetPps(trafficPps) diff --git a/feature/bgp/policybase/otg_tests/default_policies_test/bgp_default_policies_test.go b/feature/bgp/policybase/otg_tests/default_policies_test/bgp_default_policies_test.go index b08a80eeb4f..f654c3f7d2c 100644 --- a/feature/bgp/policybase/otg_tests/default_policies_test/bgp_default_policies_test.go +++ b/feature/bgp/policybase/otg_tests/default_policies_test/bgp_default_policies_test.go @@ -287,7 +287,7 @@ func configureOTG(t *testing.T, otg *otg.OTG) { // Port1 Configuration. iDut1Dev := config.Devices().Add().SetName(atePort1.Name) iDut1Eth := iDut1Dev.Ethernets().Add().SetName(atePort1.Name + ".Eth").SetMac(atePort1.MAC) - iDut1Eth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(port1.Name()) + iDut1Eth.Connection().SetPortName(port1.Name()) iDut1Ipv4 := iDut1Eth.Ipv4Addresses().Add().SetName(atePort1.Name + ".IPv4") iDut1Ipv4.SetAddress(atePort1.IPv4).SetGateway(dutPort1.IPv4).SetPrefix(uint32(atePort1.IPv4Len)) iDut1Ipv6 := iDut1Eth.Ipv6Addresses().Add().SetName(atePort1.Name + ".IPv6") @@ -296,7 +296,7 @@ func configureOTG(t *testing.T, otg *otg.OTG) { // Port2 Configuration. iDut2Dev := config.Devices().Add().SetName(atePort2.Name) iDut2Eth := iDut2Dev.Ethernets().Add().SetName(atePort2.Name + ".Eth").SetMac(atePort2.MAC) - iDut2Eth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(port2.Name()) + iDut2Eth.Connection().SetPortName(port2.Name()) iDut2Ipv4 := iDut2Eth.Ipv4Addresses().Add().SetName(atePort2.Name + ".IPv4") iDut2Ipv4.SetAddress(atePort2.IPv4).SetGateway(dutPort2.IPv4).SetPrefix(uint32(atePort2.IPv4Len)) iDut2Ipv6 := iDut2Eth.Ipv6Addresses().Add().SetName(atePort2.Name + ".IPv6") diff --git a/feature/bgp/policybase/otg_tests/route_installation_test/route_installation_test.go b/feature/bgp/policybase/otg_tests/route_installation_test/route_installation_test.go index 948670a9662..c4a588e2625 100644 --- a/feature/bgp/policybase/otg_tests/route_installation_test/route_installation_test.go +++ b/feature/bgp/policybase/otg_tests/route_installation_test/route_installation_test.go @@ -426,7 +426,7 @@ func configureATE(t *testing.T, otg *otg.OTG) gosnappi.Config { srcDev := config.Devices().Add().SetName(ateSrc.Name) srcEth := srcDev.Ethernets().Add().SetName(ateSrc.Name + ".Eth").SetMac(ateSrc.MAC) - srcEth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(srcPort.Name()) + srcEth.Connection().SetPortName(srcPort.Name()) srcIpv4 := srcEth.Ipv4Addresses().Add().SetName(ateSrc.Name + ".IPv4") srcIpv4.SetAddress(ateSrc.IPv4).SetGateway(dutSrc.IPv4).SetPrefix(uint32(ateSrc.IPv4Len)) srcIpv6 := srcEth.Ipv6Addresses().Add().SetName(ateSrc.Name + ".IPv6") @@ -434,7 +434,7 @@ func configureATE(t *testing.T, otg *otg.OTG) gosnappi.Config { dstDev := config.Devices().Add().SetName(ateDst.Name) dstEth := dstDev.Ethernets().Add().SetName(ateDst.Name + ".Eth").SetMac(ateDst.MAC) - dstEth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(dstPort.Name()) + dstEth.Connection().SetPortName(dstPort.Name()) dstIpv4 := dstEth.Ipv4Addresses().Add().SetName(ateDst.Name + ".IPv4") dstIpv4.SetAddress(ateDst.IPv4).SetGateway(dutDst.IPv4).SetPrefix(uint32(ateDst.IPv4Len)) dstIpv6 := dstEth.Ipv6Addresses().Add().SetName(ateDst.Name + ".IPv6") @@ -477,7 +477,7 @@ func configureATE(t *testing.T, otg *otg.OTG) gosnappi.Config { SetTxNames([]string{srcIpv4.Name()}). SetRxNames([]string{dstBgp4PeerRoutes.Name()}) flowipv4.Size().SetFixed(512) - flowipv4.Duration().SetChoice("continuous") + flowipv4.Duration().Continuous() e1 := flowipv4.Packet().Add().Ethernet() e1.Src().SetValue(srcEth.Mac()) v4 := flowipv4.Packet().Add().Ipv4() @@ -490,7 +490,7 @@ func configureATE(t *testing.T, otg *otg.OTG) gosnappi.Config { SetTxNames([]string{srcIpv6.Name()}). SetRxNames([]string{dstBgp6PeerRoutes.Name()}) flowipv6.Size().SetFixed(512) - flowipv6.Duration().SetChoice("continuous") + flowipv6.Duration().Continuous() e2 := flowipv6.Packet().Add().Ethernet() e2.Src().SetValue(srcEth.Mac()) v6 := flowipv6.Packet().Add().Ipv6() diff --git a/feature/bgp/prefixlimit/otg_tests/bgp_prefix_limit_test/bgp_prefix_limit_test.go b/feature/bgp/prefixlimit/otg_tests/bgp_prefix_limit_test/bgp_prefix_limit_test.go index 3062d717367..520e868b7b1 100644 --- a/feature/bgp/prefixlimit/otg_tests/bgp_prefix_limit_test/bgp_prefix_limit_test.go +++ b/feature/bgp/prefixlimit/otg_tests/bgp_prefix_limit_test/bgp_prefix_limit_test.go @@ -159,7 +159,7 @@ func configureATE(t *testing.T, ate *ondatra.ATEDevice) gosnappi.Config { srcPort := topo.Ports().Add().SetName("port1") srcDev := topo.Devices().Add().SetName(ateSrc.Name) srcEth := srcDev.Ethernets().Add().SetName(ateSrc.Name + ".Eth").SetMac(ateSrc.MAC) - srcEth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(srcPort.Name()) + srcEth.Connection().SetPortName(srcPort.Name()) srcIpv4 := srcEth.Ipv4Addresses().Add().SetName(ateSrc.Name + ".IPv4") srcIpv4.SetAddress(ateSrc.IPv4).SetGateway(dutSrc.IPv4).SetPrefix(uint32(ateSrc.IPv4Len)) srcIpv6 := srcEth.Ipv6Addresses().Add().SetName(ateSrc.Name + ".IPv6") @@ -168,7 +168,7 @@ func configureATE(t *testing.T, ate *ondatra.ATEDevice) gosnappi.Config { dstPort := topo.Ports().Add().SetName("port2") dstDev := topo.Devices().Add().SetName(ateDst.Name) dstEth := dstDev.Ethernets().Add().SetName(ateDst.Name + ".Eth").SetMac(ateDst.MAC) - dstEth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(dstPort.Name()) + dstEth.Connection().SetPortName(dstPort.Name()) dstIpv4 := dstEth.Ipv4Addresses().Add().SetName(ateDst.Name + ".IPv4") dstIpv4.SetAddress(ateDst.IPv4).SetGateway(dutDst.IPv4).SetPrefix(uint32(ateDst.IPv4Len)) dstIpv6 := dstEth.Ipv6Addresses().Add().SetName(ateDst.Name + ".IPv6") diff --git a/feature/bgp/timers/otg_tests/bgp_keepalive_and_holdtimer_configuration_test/bgp_keepalive_and_holdtimer_configuration_test.go b/feature/bgp/timers/otg_tests/bgp_keepalive_and_holdtimer_configuration_test/bgp_keepalive_and_holdtimer_configuration_test.go index a2a29135bb7..043531d4b08 100644 --- a/feature/bgp/timers/otg_tests/bgp_keepalive_and_holdtimer_configuration_test/bgp_keepalive_and_holdtimer_configuration_test.go +++ b/feature/bgp/timers/otg_tests/bgp_keepalive_and_holdtimer_configuration_test/bgp_keepalive_and_holdtimer_configuration_test.go @@ -208,7 +208,7 @@ func ateFlowConfig(t *testing.T, topo gosnappi.Config, srcEth gosnappi.DeviceEth SetTxNames([]string{srcIpv4.Name()}). SetRxNames([]string{dstBgp4PeerRoutes.Name()}) flowipv4.Size().SetFixed(512) - flowipv4.Duration().SetChoice("continuous") + flowipv4.Duration().Continuous() e1 := flowipv4.Packet().Add().Ethernet() e1.Src().SetValue(srcEth.Mac()) v4 := flowipv4.Packet().Add().Ipv4() @@ -221,7 +221,7 @@ func ateFlowConfig(t *testing.T, topo gosnappi.Config, srcEth gosnappi.DeviceEth SetTxNames([]string{srcIpv6.Name()}). SetRxNames([]string{dstBgp6PeerRoutes.Name()}) flowipv6.Size().SetFixed(512) - flowipv6.Duration().SetChoice("continuous") + flowipv6.Duration().Continuous() e2 := flowipv6.Packet().Add().Ethernet() e2.Src().SetValue(srcEth.Mac()) v6 := flowipv6.Packet().Add().Ipv6() diff --git a/feature/example/tests/topology_test/topology_test.go b/feature/example/tests/topology_test/topology_test.go index 7f635620201..2e688c08809 100644 --- a/feature/example/tests/topology_test/topology_test.go +++ b/feature/example/tests/topology_test/topology_test.go @@ -145,7 +145,7 @@ func configureATE(t *testing.T, ate *ondatra.ATEDevice) gosnappi.Config { in := top.Ports().Add().SetName(ap.ID()) dev := top.Devices().Add().SetName(ap.Name() + ".dev") eth := dev.Ethernets().Add().SetName(ap.Name() + ".eth").SetMac(atePortMac(i)) - eth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(in.Name()) + eth.Connection().SetPortName(in.Name()) ipv4Addr := strings.Split(atePortCIDR(i), "/")[0] eth.Ipv4Addresses().Add().SetName(dev.Name() + ".ipv4"). SetAddress(ipv4Addr).SetGateway(dutPortIP(i)). diff --git a/feature/experimental/bgp/otg_tests/bgp_afi_safi_defaults/bgp_afi_safi_defaults_test.go b/feature/experimental/bgp/otg_tests/bgp_afi_safi_defaults/bgp_afi_safi_defaults_test.go index 59efcf30977..d5405862c93 100644 --- a/feature/experimental/bgp/otg_tests/bgp_afi_safi_defaults/bgp_afi_safi_defaults_test.go +++ b/feature/experimental/bgp/otg_tests/bgp_afi_safi_defaults/bgp_afi_safi_defaults_test.go @@ -258,7 +258,7 @@ func configureOTG(t *testing.T, otg *otg.OTG, otgPeerList []string) gosnappi.Con iDut1Dev := config.Devices().Add().SetName(atePort1.Name) iDut1Eth := iDut1Dev.Ethernets().Add().SetName(atePort1.Name + ".Eth").SetMac(atePort1.MAC) - iDut1Eth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(port1.Name()) + iDut1Eth.Connection().SetPortName(port1.Name()) iDut1Ipv4 := iDut1Eth.Ipv4Addresses().Add().SetName(atePort1.Name + ".IPv4") iDut1Ipv4.SetAddress(atePort1.IPv4).SetGateway(dutPort1.IPv4).SetPrefix(uint32(atePort1.IPv4Len)) iDut1Ipv6 := iDut1Eth.Ipv6Addresses().Add().SetName(atePort1.Name + ".IPv6") @@ -266,7 +266,7 @@ func configureOTG(t *testing.T, otg *otg.OTG, otgPeerList []string) gosnappi.Con iDut2Dev := config.Devices().Add().SetName(atePort2.Name) iDut2Eth := iDut2Dev.Ethernets().Add().SetName(atePort2.Name + ".Eth").SetMac(atePort2.MAC) - iDut2Eth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(port2.Name()) + iDut2Eth.Connection().SetPortName(port2.Name()) iDut2Ipv4 := iDut2Eth.Ipv4Addresses().Add().SetName(atePort2.Name + ".IPv4") iDut2Ipv4.SetAddress(atePort2.IPv4).SetGateway(dutPort2.IPv4).SetPrefix(uint32(atePort2.IPv4Len)) iDut2Ipv6 := iDut2Eth.Ipv6Addresses().Add().SetName(atePort2.Name + ".IPv6") diff --git a/feature/experimental/bgp/otg_tests/bgp_always_compare_med/bgp_always_compare_med_test.go b/feature/experimental/bgp/otg_tests/bgp_always_compare_med/bgp_always_compare_med_test.go index da00ed71614..a7ced348df7 100644 --- a/feature/experimental/bgp/otg_tests/bgp_always_compare_med/bgp_always_compare_med_test.go +++ b/feature/experimental/bgp/otg_tests/bgp_always_compare_med/bgp_always_compare_med_test.go @@ -288,19 +288,19 @@ func configureOTG(t *testing.T, otg *otg.OTG) gosnappi.Config { iDut1Dev := config.Devices().Add().SetName(ateSrc.Name) iDut1Eth := iDut1Dev.Ethernets().Add().SetName(ateSrc.Name + ".Eth").SetMac(ateSrc.MAC) - iDut1Eth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(port1.Name()) + iDut1Eth.Connection().SetPortName(port1.Name()) iDut1Ipv4 := iDut1Eth.Ipv4Addresses().Add().SetName(ateSrc.Name + ".IPv4") iDut1Ipv4.SetAddress(ateSrc.IPv4).SetGateway(dutSrc.IPv4).SetPrefix(uint32(ateSrc.IPv4Len)) iDut2Dev := config.Devices().Add().SetName(ateDst1.Name) iDut2Eth := iDut2Dev.Ethernets().Add().SetName(ateDst1.Name + ".Eth").SetMac(ateDst1.MAC) - iDut2Eth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(port2.Name()) + iDut2Eth.Connection().SetPortName(port2.Name()) iDut2Ipv4 := iDut2Eth.Ipv4Addresses().Add().SetName(ateDst1.Name + ".IPv4") iDut2Ipv4.SetAddress(ateDst1.IPv4).SetGateway(dutDst1.IPv4).SetPrefix(uint32(ateDst1.IPv4Len)) iDut3Dev := config.Devices().Add().SetName(ateDst2.Name) iDut3Eth := iDut3Dev.Ethernets().Add().SetName(ateDst2.Name + ".Eth").SetMac(ateDst2.MAC) - iDut3Eth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(port3.Name()) + iDut3Eth.Connection().SetPortName(port3.Name()) iDut3Ipv4 := iDut3Eth.Ipv4Addresses().Add().SetName(ateDst2.Name + ".IPv4") iDut3Ipv4.SetAddress(ateDst2.IPv4).SetGateway(dutDst2.IPv4).SetPrefix(uint32(ateDst2.IPv4Len)) @@ -345,7 +345,7 @@ func configureOTG(t *testing.T, otg *otg.OTG) gosnappi.Config { SetRxNames([]string{bgpNeti1Bgp4PeerRoutes.Name()}) flow1ipv4.Size().SetFixed(512) flow1ipv4.Rate().SetPps(100) - flow1ipv4.Duration().SetChoice("continuous") + flow1ipv4.Duration().Continuous() e1 := flow1ipv4.Packet().Add().Ethernet() e1.Src().SetValue(iDut1Eth.Mac()) v4 := flow1ipv4.Packet().Add().Ipv4() @@ -360,7 +360,7 @@ func configureOTG(t *testing.T, otg *otg.OTG) gosnappi.Config { SetRxNames([]string{bgpNeti2Bgp4PeerRoutes.Name()}) flow2ipv4.Size().SetFixed(512) flow2ipv4.Rate().SetPps(100) - flow2ipv4.Duration().SetChoice("continuous") + flow2ipv4.Duration().Continuous() e2 := flow2ipv4.Packet().Add().Ethernet() e2.Src().SetValue(iDut1Eth.Mac()) v4Flow2 := flow2ipv4.Packet().Add().Ipv4() diff --git a/feature/experimental/bgp/otg_tests/bgp_remove_private_as/bgp_remove_private_as_test.go b/feature/experimental/bgp/otg_tests/bgp_remove_private_as/bgp_remove_private_as_test.go index ba297277319..3b865545acd 100644 --- a/feature/experimental/bgp/otg_tests/bgp_remove_private_as/bgp_remove_private_as_test.go +++ b/feature/experimental/bgp/otg_tests/bgp_remove_private_as/bgp_remove_private_as_test.go @@ -244,7 +244,7 @@ func configureOTG(t *testing.T, otg *otg.OTG, asSeg []uint32, asSEQMode bool) go iDut1Dev := config.Devices().Add().SetName(ateSrc.Name) iDut1Eth := iDut1Dev.Ethernets().Add().SetName(ateSrc.Name + ".Eth").SetMac(ateSrc.MAC) - iDut1Eth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(port1.Name()) + iDut1Eth.Connection().SetPortName(port1.Name()) iDut1Ipv4 := iDut1Eth.Ipv4Addresses().Add().SetName(ateSrc.Name + ".IPv4") iDut1Ipv4.SetAddress(ateSrc.IPv4).SetGateway(dutSrc.IPv4).SetPrefix(uint32(ateSrc.IPv4Len)) iDut1Ipv6 := iDut1Eth.Ipv6Addresses().Add().SetName(ateSrc.Name + ".IPv6") @@ -252,7 +252,7 @@ func configureOTG(t *testing.T, otg *otg.OTG, asSeg []uint32, asSEQMode bool) go iDut2Dev := config.Devices().Add().SetName(ateDst.Name) iDut2Eth := iDut2Dev.Ethernets().Add().SetName(ateDst.Name + ".Eth").SetMac(ateDst.MAC) - iDut2Eth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(port2.Name()) + iDut2Eth.Connection().SetPortName(port2.Name()) iDut2Ipv4 := iDut2Eth.Ipv4Addresses().Add().SetName(ateDst.Name + ".IPv4") iDut2Ipv4.SetAddress(ateDst.IPv4).SetGateway(dutDst.IPv4).SetPrefix(uint32(ateDst.IPv4Len)) iDut2Ipv6 := iDut2Eth.Ipv6Addresses().Add().SetName(ateDst.Name + ".IPv6") diff --git a/feature/experimental/bgp/otg_tests/bgp_tcp_mss_path_mtu/bgp_tcp_mss_path_mtu_test.go b/feature/experimental/bgp/otg_tests/bgp_tcp_mss_path_mtu/bgp_tcp_mss_path_mtu_test.go index 6953d93da2d..468f7480fdb 100644 --- a/feature/experimental/bgp/otg_tests/bgp_tcp_mss_path_mtu/bgp_tcp_mss_path_mtu_test.go +++ b/feature/experimental/bgp/otg_tests/bgp_tcp_mss_path_mtu/bgp_tcp_mss_path_mtu_test.go @@ -213,7 +213,7 @@ func configureOTG(t *testing.T, otg *otg.OTG) gosnappi.Config { iDut1Dev := config.Devices().Add().SetName(atePort1.Name) iDut1Eth := iDut1Dev.Ethernets().Add().SetName(atePort1.Name + ".Eth").SetMac(atePort1.MAC) - iDut1Eth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(port1.Name()) + iDut1Eth.Connection().SetPortName(port1.Name()) iDut1Ipv4 := iDut1Eth.Ipv4Addresses().Add().SetName(atePort1.Name + ".IPv4") iDut1Ipv4.SetAddress(atePort1.IPv4).SetGateway(dut1Port1.IPv4).SetPrefix(uint32(atePort1.IPv4Len)) iDut1Ipv6 := iDut1Eth.Ipv6Addresses().Add().SetName(atePort1.Name + ".IPv6") @@ -247,7 +247,7 @@ func configOTG(t *testing.T, otg *otg.OTG) gosnappi.Config { iDut1Dev := config.Devices().Add().SetName(atePort1.Name) iDut1Eth := iDut1Dev.Ethernets().Add().SetName(atePort1.Name + ".Eth").SetMac(atePort1.MAC).SetMtu(uint32(mtu5040B)) - iDut1Eth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(port1.Name()) + iDut1Eth.Connection().SetPortName(port1.Name()) iDut1Ipv4 := iDut1Eth.Ipv4Addresses().Add().SetName(atePort1.Name + ".IPv4") iDut1Ipv4.SetAddress(atePort1.IPv4).SetGateway(dut1Port1.IPv4).SetPrefix(uint32(atePort1.IPv4Len)) iDut1Ipv6 := iDut1Eth.Ipv6Addresses().Add().SetName(atePort1.Name + ".IPv6") diff --git a/feature/experimental/gribi/otg_tests/fib_failed_due_to_hw_res_exhaust_test/fib_failed_due_to_hw_res_exhaust_test.go b/feature/experimental/gribi/otg_tests/fib_failed_due_to_hw_res_exhaust_test/fib_failed_due_to_hw_res_exhaust_test.go index 1ae960476af..1919def9c00 100644 --- a/feature/experimental/gribi/otg_tests/fib_failed_due_to_hw_res_exhaust_test/fib_failed_due_to_hw_res_exhaust_test.go +++ b/feature/experimental/gribi/otg_tests/fib_failed_due_to_hw_res_exhaust_test/fib_failed_due_to_hw_res_exhaust_test.go @@ -150,7 +150,7 @@ func configureOTG(t *testing.T, otg *otg.OTG) (gosnappi.BgpV6Peer, gosnappi.Devi iDut1Dev := config.Devices().Add().SetName(atePort1.Name) iDut1Eth := iDut1Dev.Ethernets().Add().SetName(atePort1.Name + ".Eth").SetMac(atePort1.MAC) - iDut1Eth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(port1.Name()) + iDut1Eth.Connection().SetPortName(port1.Name()) iDut1Ipv4 := iDut1Eth.Ipv4Addresses().Add().SetName(atePort1.Name + ".IPv4") iDut1Ipv4.SetAddress(atePort1.IPv4).SetGateway(dutPort1.IPv4).SetPrefix(uint32(atePort1.IPv4Len)) iDut1Ipv6 := iDut1Eth.Ipv6Addresses().Add().SetName(atePort1.Name + ".IPv6") @@ -158,7 +158,7 @@ func configureOTG(t *testing.T, otg *otg.OTG) (gosnappi.BgpV6Peer, gosnappi.Devi iDut2Dev := config.Devices().Add().SetName(atePort2.Name) iDut2Eth := iDut2Dev.Ethernets().Add().SetName(atePort2.Name + ".Eth").SetMac(atePort2.MAC) - iDut2Eth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(port2.Name()) + iDut2Eth.Connection().SetPortName(port2.Name()) iDut2Ipv4 := iDut2Eth.Ipv4Addresses().Add().SetName(atePort2.Name + ".IPv4") iDut2Ipv4.SetAddress(atePort2.IPv4).SetGateway(dutPort2.IPv4).SetPrefix(uint32(atePort2.IPv4Len)) @@ -304,7 +304,7 @@ func sendTraffic(t *testing.T, args *testArgs) { SetRxNames([]string{atePort2.Name + ".IPv4"}) flow1ipv4.Size().SetFixed(512) flow1ipv4.Rate().SetPps(100) - flow1ipv4.Duration().SetChoice("continuous") + flow1ipv4.Duration().Continuous() e1 := flow1ipv4.Packet().Add().Ethernet() e1.Src().SetValue(atePort1.MAC) v4 := flow1ipv4.Packet().Add().Ipv4() @@ -318,7 +318,7 @@ func sendTraffic(t *testing.T, args *testArgs) { SetRxNames([]string{atePort2.Name + ".IPv4"}) flow2ipv4.Size().SetFixed(512) flow2ipv4.Rate().SetPps(100) - flow2ipv4.Duration().SetChoice("continuous") + flow2ipv4.Duration().Continuous() e2 := flow2ipv4.Packet().Add().Ethernet() e2.Src().SetValue(atePort1.MAC) v4Flow2 := flow2ipv4.Packet().Add().Ipv4() diff --git a/feature/experimental/gribi/otg_tests/route_addition_during_failover_test/route_addition_during_failover_test.go b/feature/experimental/gribi/otg_tests/route_addition_during_failover_test/route_addition_during_failover_test.go index 8f4fe0a0aff..8cd803f96a7 100644 --- a/feature/experimental/gribi/otg_tests/route_addition_during_failover_test/route_addition_during_failover_test.go +++ b/feature/experimental/gribi/otg_tests/route_addition_during_failover_test/route_addition_during_failover_test.go @@ -349,7 +349,7 @@ func configureSubinterfaceDUT(t *testing.T, d *oc.Root, dutPort *ondatra.Port, i func configureATE(t *testing.T, top gosnappi.Config, atePort *ondatra.Port, vlanID uint16, Name, MAC, dutIPv4, ateIPv4 string) { dev := top.Devices().Add().SetName(Name + ".Dev") eth := dev.Ethernets().Add().SetName(Name + ".Eth").SetMac(MAC) - eth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(atePort.ID()) + eth.Connection().SetPortName(atePort.ID()) if vlanID != 0 { eth.Vlans().Add().SetName(Name).SetId(uint32(vlanID)) } @@ -386,7 +386,7 @@ func createTrafficFlow(t *testing.T, ate *ondatra.ATEDevice, top gosnappi.Config flow.TxRx().Port().SetTxName("port1").SetRxName("port2") e1 := flow.Packet().Add().Ethernet() e1.Src().SetValue(atePort1.MAC) - e1.Dst().SetChoice("value").SetValue(dstMac) + e1.Dst().SetValue(dstMac) v4 := flow.Packet().Add().Ipv4() v4.Src().SetValue(atePort1.IPv4) v4.Dst().Increment().SetStart(flowArgs.flowStartAddress).SetCount(flowArgs.flowCount) diff --git a/feature/experimental/gribi/otg_tests/route_removal_during_failover_test/route_removal_during_failover_test.go b/feature/experimental/gribi/otg_tests/route_removal_during_failover_test/route_removal_during_failover_test.go index ee9874f4844..62933c1c4fd 100644 --- a/feature/experimental/gribi/otg_tests/route_removal_during_failover_test/route_removal_during_failover_test.go +++ b/feature/experimental/gribi/otg_tests/route_removal_during_failover_test/route_removal_during_failover_test.go @@ -298,7 +298,7 @@ func configureSubinterfaceDUT(d *oc.Root, dutPort *ondatra.Port, index uint32, v func configureATE(top gosnappi.Config, atePort *ondatra.Port, Name string, vlanID uint16, dutIPv4, ateIPv4, ateMAC string) { dev := top.Devices().Add().SetName(Name + ".Dev") eth := dev.Ethernets().Add().SetName(Name + ".Eth").SetMac(ateMAC) - eth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(atePort.ID()) + eth.Connection().SetPortName(atePort.ID()) if vlanID != 0 { eth.Vlans().Add().SetName(Name).SetId(uint32(vlanID)) } @@ -333,7 +333,7 @@ func createTrafficFlow(t *testing.T, ate *ondatra.ATEDevice, top gosnappi.Config flow.TxRx().Port().SetTxName("port1").SetRxName("port2") e1 := flow.Packet().Add().Ethernet() e1.Src().SetValue(atePort1.MAC) - e1.Dst().SetChoice("value").SetValue(dstMac) + e1.Dst().SetValue(dstMac) v4 := flow.Packet().Add().Ipv4() v4.Src().SetValue(atePort1.IPv4) v4.Dst().Increment().SetStart("198.18.196.1").SetCount(1020) diff --git a/feature/experimental/interface/interface_loopback_aggregate/otg_tests/interface_loopback_aggregate/interface_loopback_aggregate_test.go b/feature/experimental/interface/interface_loopback_aggregate/otg_tests/interface_loopback_aggregate/interface_loopback_aggregate_test.go index 313b9790fec..7b5eb91c7ea 100644 --- a/feature/experimental/interface/interface_loopback_aggregate/otg_tests/interface_loopback_aggregate/interface_loopback_aggregate_test.go +++ b/feature/experimental/interface/interface_loopback_aggregate/otg_tests/interface_loopback_aggregate/interface_loopback_aggregate_test.go @@ -119,7 +119,7 @@ func configureOTG(t *testing.T, otg *otg.OTG) { port1 := config.Ports().Add().SetName("port1") iDut1Dev := config.Devices().Add().SetName(atePort1Attr.Name) iDut1Eth := iDut1Dev.Ethernets().Add().SetName(atePort1Attr.Name + ".Eth").SetMac(atePort1Attr.MAC) - iDut1Eth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(port1.Name()) + iDut1Eth.Connection().SetPortName(port1.Name()) t.Logf("Pushing config to ATE and starting protocols...") otg.PushConfig(t, config) otg.StartProtocols(t) diff --git a/feature/experimental/interface/my_station_mac/otg_tests/my_station_mac_test/my_station_mac_test.go b/feature/experimental/interface/my_station_mac/otg_tests/my_station_mac_test/my_station_mac_test.go index 095fde831ae..a03ac6965a3 100644 --- a/feature/experimental/interface/my_station_mac/otg_tests/my_station_mac_test/my_station_mac_test.go +++ b/feature/experimental/interface/my_station_mac/otg_tests/my_station_mac_test/my_station_mac_test.go @@ -159,7 +159,7 @@ func testTraffic( flow.Metrics().SetEnable(true) eth := flow.Packet().Add().Ethernet() eth.Src().SetValue(ateSrc.MAC) - eth.Dst().SetChoice("value").SetValue(myStationMAC) + eth.Dst().SetValue(myStationMAC) if ipType == "IPv4" { v4 := flow.Packet().Add().Ipv4() v4.Src().SetValue(ateSrc.IPv4) diff --git a/feature/experimental/isis/otg_tests/isis_change_lsp_lifetime_test/isis_change_lsp_lifetime_test.go b/feature/experimental/isis/otg_tests/isis_change_lsp_lifetime_test/isis_change_lsp_lifetime_test.go index f271078b5d9..c9da9ae8a7a 100644 --- a/feature/experimental/isis/otg_tests/isis_change_lsp_lifetime_test/isis_change_lsp_lifetime_test.go +++ b/feature/experimental/isis/otg_tests/isis_change_lsp_lifetime_test/isis_change_lsp_lifetime_test.go @@ -98,7 +98,7 @@ func configureOTG(t *testing.T, ts *isissession.TestSession) { SetRxNames([]string{v4NetName}) v4Flow.Size().SetFixed(512) v4Flow.Rate().SetPps(100) - v4Flow.Duration().SetChoice("continuous") + v4Flow.Duration().Continuous() e1 := v4Flow.Packet().Add().Ethernet() e1.Src().SetValue(isissession.ATEISISAttrs.MAC) v4 := v4Flow.Packet().Add().Ipv4() @@ -114,7 +114,7 @@ func configureOTG(t *testing.T, ts *isissession.TestSession) { SetRxNames([]string{v6NetName}) v6Flow.Size().SetFixed(512) v6Flow.Rate().SetPps(100) - v6Flow.Duration().SetChoice("continuous") + v6Flow.Duration().Continuous() e2 := v6Flow.Packet().Add().Ethernet() e2.Src().SetValue(isissession.ATEISISAttrs.MAC) v6 := v6Flow.Packet().Add().Ipv6() diff --git a/feature/experimental/isis/otg_tests/isis_drain_test/isis_drain_test.go b/feature/experimental/isis/otg_tests/isis_drain_test/isis_drain_test.go index ff3ff63f3dd..62e5004aae9 100644 --- a/feature/experimental/isis/otg_tests/isis_drain_test/isis_drain_test.go +++ b/feature/experimental/isis/otg_tests/isis_drain_test/isis_drain_test.go @@ -294,7 +294,7 @@ func configureATE(t *testing.T, ate *otg.OTG) gosnappi.Config { // configure port 1 - src i1 := cfg.Devices().Add().SetName(atePort1.Name) i1Eth := i1.Ethernets().Add().SetName(atePort1.Name + ".Eth").SetMac(atePort1.MAC) - i1Eth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(p1.Name()) + i1Eth.Connection().SetPortName(p1.Name()) i1IPv4 := i1Eth.Ipv4Addresses().Add().SetName(atePort1.Name + ".IPv4") i1IPv4.SetAddress(atePort1.IPv4).SetGateway(dutPort1.IPv4).SetPrefix(plen4) i1IPv6 := i1Eth.Ipv6Addresses().Add().SetName(atePort1.Name + ".IPv6") @@ -302,12 +302,12 @@ func configureATE(t *testing.T, ate *otg.OTG) gosnappi.Config { // configure lag2 - dst lag2 := cfg.Lags().Add().SetName("lag2") - lag2.Protocol().SetChoice("static").Static().SetLagId(2) + lag2.Protocol().Static().SetLagId(2) lag2.Ports().Add().SetPortName(p2.Name()).Ethernet().SetMac(lag2MAC).SetName("LAGRx-2") lag2Dev := cfg.Devices().Add().SetName(lag2.Name() + ".Dev") lag2Eth := lag2Dev.Ethernets().Add().SetName(atePort2.Name + ".Eth").SetMac(atePort2.MAC) - lag2Eth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetLagName(lag2.Name()) + lag2Eth.Connection().SetLagName(lag2.Name()) lag2IPv4 := lag2Eth.Ipv4Addresses().Add().SetName(atePort2.Name + ".IPv4") lag2IPv4.SetAddress(atePort2.IPv4).SetGateway(dutPort2.IPv4).SetPrefix(plen4) lag2IPv6 := lag2Eth.Ipv6Addresses().Add().SetName(atePort2.Name + ".IPv6") @@ -315,12 +315,12 @@ func configureATE(t *testing.T, ate *otg.OTG) gosnappi.Config { // configure lag3 - dst lag3 := cfg.Lags().Add().SetName("lag3") - lag3.Protocol().SetChoice("static").Static().SetLagId(3) + lag3.Protocol().Static().SetLagId(3) lag3.Ports().Add().SetPortName(p3.Name()).Ethernet().SetMac(lag3MAC).SetName("LAGRx-3") lag3Dev := cfg.Devices().Add().SetName(lag3.Name() + ".Dev") lag3Eth := lag3Dev.Ethernets().Add().SetName(atePort3.Name + ".Eth").SetMac(atePort3.MAC) - lag3Eth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetLagName(lag3.Name()) + lag3Eth.Connection().SetLagName(lag3.Name()) lag3IPv4 := lag3Eth.Ipv4Addresses().Add().SetName(atePort3.Name + ".IPv4") lag3IPv4.SetAddress(atePort3.IPv4).SetGateway(dutPort3.IPv4).SetPrefix(plen4) lag3IPv6 := lag3Eth.Ipv6Addresses().Add().SetName(atePort3.Name + ".IPv6") @@ -397,7 +397,7 @@ func createFlow(t *testing.T, ateTopo gosnappi.Config, name string, dstPorts ... ip.Dst().Increment().SetStart(v4IP).SetCount(50) tcp := flow.Packet().Add().Tcp() - tcp.DstPort().SetChoice("increment").Increment().SetStart(12345).SetCount(200) + tcp.DstPort().Increment().SetStart(12345).SetCount(200) return flow } diff --git a/feature/experimental/isis/otg_tests/isis_interface_hello_padding_enable_test/isis_interface_hello_padding_enable_test.go b/feature/experimental/isis/otg_tests/isis_interface_hello_padding_enable_test/isis_interface_hello_padding_enable_test.go index 23da6edf27a..3e5ed1a4a69 100644 --- a/feature/experimental/isis/otg_tests/isis_interface_hello_padding_enable_test/isis_interface_hello_padding_enable_test.go +++ b/feature/experimental/isis/otg_tests/isis_interface_hello_padding_enable_test/isis_interface_hello_padding_enable_test.go @@ -146,7 +146,7 @@ func configureOTG(t *testing.T, ts *isissession.TestSession) { SetRxNames([]string{v4NetName}) v4Flow.Size().SetFixed(512) v4Flow.Rate().SetPps(100) - v4Flow.Duration().SetChoice("continuous") + v4Flow.Duration().Continuous() e1 := v4Flow.Packet().Add().Ethernet() e1.Src().SetValue(isissession.ATEISISAttrs.MAC) v4 := v4Flow.Packet().Add().Ipv4() @@ -162,7 +162,7 @@ func configureOTG(t *testing.T, ts *isissession.TestSession) { SetRxNames([]string{v6NetName}) v6Flow.Size().SetFixed(512) v6Flow.Rate().SetPps(100) - v6Flow.Duration().SetChoice("continuous") + v6Flow.Duration().Continuous() e2 := v6Flow.Packet().Add().Ethernet() e2.Src().SetValue(isissession.ATEISISAttrs.MAC) v6 := v6Flow.Packet().Add().Ipv6() diff --git a/feature/experimental/isis/otg_tests/isis_interface_level_passive_test/isis_interface_level_passive_test.go b/feature/experimental/isis/otg_tests/isis_interface_level_passive_test/isis_interface_level_passive_test.go index 2a0d6549032..86a695e5ab7 100644 --- a/feature/experimental/isis/otg_tests/isis_interface_level_passive_test/isis_interface_level_passive_test.go +++ b/feature/experimental/isis/otg_tests/isis_interface_level_passive_test/isis_interface_level_passive_test.go @@ -142,7 +142,7 @@ func configureOTG(t *testing.T, ts *isissession.TestSession) { SetRxNames([]string{v4NetName}) v4Flow.Size().SetFixed(512) v4Flow.Rate().SetPps(100) - v4Flow.Duration().SetChoice("continuous") + v4Flow.Duration().Continuous() e1 := v4Flow.Packet().Add().Ethernet() e1.Src().SetValue(isissession.ATEISISAttrs.MAC) v4 := v4Flow.Packet().Add().Ipv4() @@ -158,7 +158,7 @@ func configureOTG(t *testing.T, ts *isissession.TestSession) { SetRxNames([]string{v6NetName}) v6Flow.Size().SetFixed(512) v6Flow.Rate().SetPps(100) - v6Flow.Duration().SetChoice("continuous") + v6Flow.Duration().Continuous() e2 := v6Flow.Packet().Add().Ethernet() e2.Src().SetValue(isissession.ATEISISAttrs.MAC) v6 := v6Flow.Packet().Add().Ipv6() diff --git a/feature/experimental/isis/otg_tests/isis_metric_style_wide_enabled_test/isis_metric_style_wide_enabled_test.go b/feature/experimental/isis/otg_tests/isis_metric_style_wide_enabled_test/isis_metric_style_wide_enabled_test.go index c8b05bac6ec..637993169b5 100644 --- a/feature/experimental/isis/otg_tests/isis_metric_style_wide_enabled_test/isis_metric_style_wide_enabled_test.go +++ b/feature/experimental/isis/otg_tests/isis_metric_style_wide_enabled_test/isis_metric_style_wide_enabled_test.go @@ -153,7 +153,7 @@ func configureOTG(t *testing.T, ts *isissession.TestSession) { SetRxNames([]string{v4NetName}) v4Flow.Size().SetFixed(512) v4Flow.Rate().SetPps(100) - v4Flow.Duration().SetChoice("continuous") + v4Flow.Duration().Continuous() e1 := v4Flow.Packet().Add().Ethernet() e1.Src().SetValue(isissession.ATEISISAttrs.MAC) v4 := v4Flow.Packet().Add().Ipv4() @@ -169,7 +169,7 @@ func configureOTG(t *testing.T, ts *isissession.TestSession) { SetRxNames([]string{v6NetName}) v6Flow.Size().SetFixed(512) v6Flow.Rate().SetPps(100) - v6Flow.Duration().SetChoice("continuous") + v6Flow.Duration().Continuous() e2 := v6Flow.Packet().Add().Ethernet() e2.Src().SetValue(isissession.ATEISISAttrs.MAC) v6 := v6Flow.Packet().Add().Ipv6() diff --git a/feature/experimental/isis/otg_tests/isis_metric_style_wide_not_enabled_test/isis_metric_style_wide_not_enabled_test.go b/feature/experimental/isis/otg_tests/isis_metric_style_wide_not_enabled_test/isis_metric_style_wide_not_enabled_test.go index 1603c51652a..b2c1abf2fb9 100644 --- a/feature/experimental/isis/otg_tests/isis_metric_style_wide_not_enabled_test/isis_metric_style_wide_not_enabled_test.go +++ b/feature/experimental/isis/otg_tests/isis_metric_style_wide_not_enabled_test/isis_metric_style_wide_not_enabled_test.go @@ -148,7 +148,7 @@ func configureOTG(t *testing.T, ts *isissession.TestSession) { SetRxNames([]string{v4NetName}) v4Flow.Size().SetFixed(512) v4Flow.Rate().SetPps(100) - v4Flow.Duration().SetChoice("continuous") + v4Flow.Duration().Continuous() e1 := v4Flow.Packet().Add().Ethernet() e1.Src().SetValue(isissession.ATEISISAttrs.MAC) v4 := v4Flow.Packet().Add().Ipv4() @@ -164,7 +164,7 @@ func configureOTG(t *testing.T, ts *isissession.TestSession) { SetRxNames([]string{v6NetName}) v6Flow.Size().SetFixed(512) v6Flow.Rate().SetPps(100) - v6Flow.Duration().SetChoice("continuous") + v6Flow.Duration().Continuous() e2 := v6Flow.Packet().Add().Ethernet() e2.Src().SetValue(isissession.ATEISISAttrs.MAC) v6 := v6Flow.Packet().Add().Ipv6() diff --git a/feature/experimental/policy/policy_vrf_selection/otg_tests/base_vrf_selection/base_vrf_selection_test.go b/feature/experimental/policy/policy_vrf_selection/otg_tests/base_vrf_selection/base_vrf_selection_test.go index 48431a522e5..960c8934087 100644 --- a/feature/experimental/policy/policy_vrf_selection/otg_tests/base_vrf_selection/base_vrf_selection_test.go +++ b/feature/experimental/policy/policy_vrf_selection/otg_tests/base_vrf_selection/base_vrf_selection_test.go @@ -306,7 +306,7 @@ func configureATE(t *testing.T, ate *ondatra.ATEDevice) *trafficFlows { topo.Ports().Add().SetName(p1.ID()) srcDev := topo.Devices().Add().SetName(ateSrc.Name) ethSrc := srcDev.Ethernets().Add().SetName(ateSrc.Name + ".Eth") - ethSrc.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(p1.ID()) + ethSrc.Connection().SetPortName(p1.ID()) ethSrc.SetMac(ateSrc.MAC) ethSrc.Ipv4Addresses().Add().SetName(srcDev.Name() + ".IPv4").SetAddress(ateSrc.IPv4).SetGateway(dutSrc.IPv4).SetPrefix(uint32(ateSrc.IPv4Len)) ethSrc.Ipv6Addresses().Add().SetName(srcDev.Name() + ".IPv6").SetAddress(ateSrc.IPv6).SetGateway(dutSrc.IPv6).SetPrefix(uint32(ateSrc.IPv6Len)) @@ -315,7 +315,7 @@ func configureATE(t *testing.T, ate *ondatra.ATEDevice) *trafficFlows { dstDev := topo.Devices().Add().SetName(ateDst.Name) ethDst := dstDev.Ethernets().Add().SetName(ateDst.Name + ".Eth") - ethDst.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(p2.ID()) + ethDst.Connection().SetPortName(p2.ID()) ethDst.SetMac(ateDst.MAC) ethDst.Vlans().Add().SetName(dstDev.Name() + "-VLAN").SetId(uint32(vlan10)) ethDst.Ipv4Addresses().Add().SetName(dstDev.Name() + ".IPv4").SetAddress(ateDst.IPv4).SetGateway(dutDst.IPv4).SetPrefix(uint32(ateDst.IPv4Len)) @@ -324,7 +324,7 @@ func configureATE(t *testing.T, ate *ondatra.ATEDevice) *trafficFlows { dstDev2 := topo.Devices().Add().SetName(ateDst2.Name) ethDst2 := dstDev2.Ethernets().Add().SetName(ateDst2.Name + ".Eth") - ethDst2.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(p2.ID()) + ethDst2.Connection().SetPortName(p2.ID()) ethDst2.SetMac(ateDst2.MAC) ethDst2.Vlans().Add().SetName(dstDev2.Name() + "-VLAN").SetId(uint32(vlan20)) ethDst2.Ipv4Addresses().Add().SetName(dstDev2.Name() + ".IPv4").SetAddress(ateDst2.IPv4).SetGateway(dutDst2.IPv4).SetPrefix(uint32(ateDst2.IPv4Len)) @@ -350,7 +350,7 @@ func configureATE(t *testing.T, ate *ondatra.ATEDevice) *trafficFlows { v6.Src().SetValue(ateSrc.IPv6) v6.Dst().SetValue("2001:DB8:2::") nativeIPv6.Size().SetFixed(512) - nativeIPv6.Rate().SetChoice("percentage").SetPercentage(5) + nativeIPv6.Rate().SetPercentage(5) t.Logf("Pushing config to ATE and starting protocols...") ate.OTG().PushConfig(t, topo) @@ -376,7 +376,7 @@ func createIPv4Flow(name string, top gosnappi.Config, dst attrs.Attributes, srcI flow.Packet().Add().Ipv6() } flow.Size().SetFixed(512) - flow.Rate().SetChoice("percentage").SetPercentage(5) + flow.Rate().SetPercentage(5) return flow } diff --git a/feature/experimental/policy/policy_vrf_selection/otg_tests/protocol_dscp_rules_for_vrf_selection_test/protocol_dscp_rules_for_vrf_selection_test.go b/feature/experimental/policy/policy_vrf_selection/otg_tests/protocol_dscp_rules_for_vrf_selection_test/protocol_dscp_rules_for_vrf_selection_test.go index c58e635be57..02a6a4980ce 100644 --- a/feature/experimental/policy/policy_vrf_selection/otg_tests/protocol_dscp_rules_for_vrf_selection_test/protocol_dscp_rules_for_vrf_selection_test.go +++ b/feature/experimental/policy/policy_vrf_selection/otg_tests/protocol_dscp_rules_for_vrf_selection_test/protocol_dscp_rules_for_vrf_selection_test.go @@ -153,7 +153,7 @@ func configureATE(t *testing.T, ate *ondatra.ATEDevice, dut *ondatra.DUTDevice) top.Ports().Add().SetName(p1.ID()) srcDev := top.Devices().Add().SetName(atePort1.Name) ethSrc := srcDev.Ethernets().Add().SetName(atePort1.Name + ".eth").SetMac(atePort1.MAC) - ethSrc.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(p1.ID()) + ethSrc.Connection().SetPortName(p1.ID()) ethSrc.Ipv4Addresses().Add().SetName(srcDev.Name() + ".ipv4").SetAddress(atePort1.IPv4).SetGateway(dutPort1.IPv4).SetPrefix(uint32(atePort1.IPv4Len)) ethSrc.Ipv6Addresses().Add().SetName(srcDev.Name() + ".ipv6").SetAddress(atePort1.IPv6).SetGateway(dutPort1.IPv6).SetPrefix(uint32(atePort1.IPv6Len)) @@ -164,28 +164,28 @@ func configureATE(t *testing.T, ate *ondatra.ATEDevice, dut *ondatra.DUTDevice) if deviations.NoMixOfTaggedAndUntaggedSubinterfaces(dut) { ethDst.Vlans().Add().SetName(atePort2.Name + "vlan").SetId(1) } - ethDst.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(p2.ID()) + ethDst.Connection().SetPortName(p2.ID()) ethDst.Ipv4Addresses().Add().SetName(dstDev.Name() + ".ipv4").SetAddress(atePort2.IPv4).SetGateway(dutPort2.IPv4).SetPrefix(uint32(atePort2.IPv4Len)) ethDst.Ipv6Addresses().Add().SetName(dstDev.Name() + ".ipv6").SetAddress(atePort2.IPv6).SetGateway(dutPort2.IPv6).SetPrefix(uint32(atePort2.IPv6Len)) // configure vlans on ATE port2 dstDevVlan10 := top.Devices().Add().SetName(atePort2Vlan10.Name) ethDstVlan10 := dstDevVlan10.Ethernets().Add().SetName(atePort2Vlan10.Name + ".eth").SetMac(atePort2Vlan10.MAC) - ethDstVlan10.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(p2.ID()) + ethDstVlan10.Connection().SetPortName(p2.ID()) ethDstVlan10.Vlans().Add().SetName(atePort2Vlan10.Name + "vlan").SetId(10) ethDstVlan10.Ipv4Addresses().Add().SetName(atePort2Vlan10.Name + ".ipv4").SetAddress(atePort2Vlan10.IPv4).SetGateway(dutPort2Vlan10.IPv4).SetPrefix(uint32(atePort2Vlan10.IPv4Len)) ethDstVlan10.Ipv6Addresses().Add().SetName(atePort2Vlan10.Name + ".ipv6").SetAddress(atePort2Vlan10.IPv6).SetGateway(dutPort2Vlan10.IPv6).SetPrefix(uint32(atePort2Vlan10.IPv6Len)) dstDevVlan20 := top.Devices().Add().SetName(atePort2Vlan20.Name) ethDstVlan20 := dstDevVlan20.Ethernets().Add().SetName(atePort2Vlan20.Name + ".eth").SetMac(atePort2Vlan20.MAC) - ethDstVlan20.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(p2.ID()) + ethDstVlan20.Connection().SetPortName(p2.ID()) ethDstVlan20.Vlans().Add().SetName(atePort2Vlan20.Name + "vlan").SetId(20) ethDstVlan20.Ipv4Addresses().Add().SetName(atePort2Vlan20.Name + ".ipv4").SetAddress(atePort2Vlan20.IPv4).SetGateway(dutPort2Vlan20.IPv4).SetPrefix(uint32(atePort2Vlan20.IPv4Len)) ethDstVlan20.Ipv6Addresses().Add().SetName(atePort2Vlan20.Name + ".ipv6").SetAddress(atePort2Vlan20.IPv6).SetGateway(dutPort2Vlan20.IPv6).SetPrefix(uint32(atePort2Vlan20.IPv6Len)) dstDevVlan30 := top.Devices().Add().SetName(atePort2Vlan30.Name) ethDstVlan30 := dstDevVlan30.Ethernets().Add().SetName(atePort2Vlan30.Name + ".eth").SetMac(atePort2Vlan30.MAC) - ethDstVlan30.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(p2.ID()) + ethDstVlan30.Connection().SetPortName(p2.ID()) ethDstVlan30.Vlans().Add().SetName(atePort2Vlan30.Name + "vlan").SetId(30) ethDstVlan30.Ipv4Addresses().Add().SetName(atePort2Vlan30.Name + ".ipv4").SetAddress(atePort2Vlan30.IPv4).SetGateway(dutPort2Vlan30.IPv4).SetPrefix(uint32(atePort2Vlan30.IPv4Len)) ethDstVlan30.Ipv6Addresses().Add().SetName(atePort2Vlan30.Name + ".ipv6").SetAddress(atePort2Vlan30.IPv6).SetGateway(dutPort2Vlan30.IPv6).SetPrefix(uint32(atePort2Vlan30.IPv6Len)) diff --git a/feature/experimental/tunnel/otg_tests/tunnel_acl_based_test/tun_acl_dscp_test.go b/feature/experimental/tunnel/otg_tests/tunnel_acl_based_test/tun_acl_dscp_test.go index 2085ca9edda..ad68a25b62a 100644 --- a/feature/experimental/tunnel/otg_tests/tunnel_acl_based_test/tun_acl_dscp_test.go +++ b/feature/experimental/tunnel/otg_tests/tunnel_acl_based_test/tun_acl_dscp_test.go @@ -200,14 +200,14 @@ func configureOTG(t *testing.T, ate *ondatra.ATEDevice) gosnappi.Config { srcPort := topo.Ports().Add().SetName("port1") srcDev := topo.Devices().Add().SetName(ateSrc.Name) srcEth := srcDev.Ethernets().Add().SetName(ateSrc.Name + ".Eth").SetMac(ateSrc.MAC) - srcEth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(srcPort.Name()) + srcEth.Connection().SetPortName(srcPort.Name()) srcIpv4 := srcEth.Ipv4Addresses().Add().SetName(ateSrc.Name + ".IPv4") srcIpv4.SetAddress(ateSrc.IPv4).SetGateway(dutSrc.IPv4).SetPrefix(uint32(ateSrc.IPv4Len)) t.Logf("Configuring OTG port2") dstPort := topo.Ports().Add().SetName("port2") dstDev := topo.Devices().Add().SetName(ateDst.Name) dstEth := dstDev.Ethernets().Add().SetName(ateDst.Name + ".Eth").SetMac(ateDst.MAC) - dstEth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(dstPort.Name()) + dstEth.Connection().SetPortName(dstPort.Name()) dstIpv4 := dstEth.Ipv4Addresses().Add().SetName(ateDst.Name + ".IPv4") dstIpv4.SetAddress(ateDst.IPv4).SetGateway(dutDst.IPv4).SetPrefix(uint32(ateDst.IPv4Len)) topo.Captures().Add().SetName("grecapture").SetPortNames([]string{dstPort.Name()}).SetFormat(gosnappi.CaptureFormat.PCAP) @@ -219,7 +219,7 @@ func configureOTG(t *testing.T, ate *ondatra.ATEDevice) gosnappi.Config { SetRxNames([]string{dstIpv4.Name()}) flowipv4.Size().SetFixed(FrameSize) flowipv4.Rate().SetPps(pps) - flowipv4.Duration().SetChoice("continuous") + flowipv4.Duration().Continuous() e1 := flowipv4.Packet().Add().Ethernet() e1.Src().SetValue(srcEth.Mac()) v4 := flowipv4.Packet().Add().Ipv4() diff --git a/feature/experimental/tunnel/otg_tests/tunnel_interface_based_ipv6_gre_encapsulation_test/tunnel_interface_based_ipv6_gre_encapsulation_test.go b/feature/experimental/tunnel/otg_tests/tunnel_interface_based_ipv6_gre_encapsulation_test/tunnel_interface_based_ipv6_gre_encapsulation_test.go index 0647e95cfb2..c6121bb458d 100644 --- a/feature/experimental/tunnel/otg_tests/tunnel_interface_based_ipv6_gre_encapsulation_test/tunnel_interface_based_ipv6_gre_encapsulation_test.go +++ b/feature/experimental/tunnel/otg_tests/tunnel_interface_based_ipv6_gre_encapsulation_test/tunnel_interface_based_ipv6_gre_encapsulation_test.go @@ -258,7 +258,7 @@ func configureOtgPorts(top gosnappi.Config, port *ondatra.Port, name string, mac //port1 iDutDev := top.Devices().Add().SetName(name) iDutEth := iDutDev.Ethernets().Add().SetName(name + ".Eth").SetMac(mac) - iDutEth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(port.ID()) + iDutEth.Connection().SetPortName(port.ID()) iDutIpv6 := iDutEth.Ipv6Addresses().Add().SetName(name + ".IPv6") iDutIpv6.SetAddress(ipv6Address).SetGateway(ipv6Gateway).SetPrefix(uint32(ipv6Mask)) } @@ -273,7 +273,7 @@ func configureTrafficFlowsToEncasulation(t *testing.T, top gosnappi.Config, port // Flow settings. flow1ipv6.Size().SetFixed(512) flow1ipv6.Rate().SetPps(trafficRatePps) - flow1ipv6.Duration().SetChoice("continuous") + flow1ipv6.Duration().Continuous() // Ethernet header f1e2 := flow1ipv6.Packet().Add().Ethernet() f1e2.Src().SetValue(peer.MAC) @@ -281,7 +281,7 @@ func configureTrafficFlowsToEncasulation(t *testing.T, top gosnappi.Config, port // IPv6 header f1v6 := flow1ipv6.Packet().Add().Ipv6() // V6 NextHeader - f1v6.NextHeader().SetChoice("value").SetValue(6) + f1v6.NextHeader().SetValue(6) // V6 source f1v6.Src().Increment().SetStart(peer.IPv6).SetCount(200) // V6 destination diff --git a/feature/gnmi/otg_tests/telemetry_basic_check_test/telemetry_basic_check_test.go b/feature/gnmi/otg_tests/telemetry_basic_check_test/telemetry_basic_check_test.go index fb94d33e287..a8da72bb3eb 100644 --- a/feature/gnmi/otg_tests/telemetry_basic_check_test/telemetry_basic_check_test.go +++ b/feature/gnmi/otg_tests/telemetry_basic_check_test/telemetry_basic_check_test.go @@ -793,14 +793,14 @@ func TestIntfCounterUpdate(t *testing.T) { config.Ports().Add().SetName(ap1.ID()) intf1 := config.Devices().Add().SetName(ap1.Name()) eth1 := intf1.Ethernets().Add().SetName(ap1.Name() + ".Eth").SetMac("02:00:01:01:01:01") - eth1.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(ap1.ID()) + eth1.Connection().SetPortName(ap1.ID()) ip4_1 := eth1.Ipv4Addresses().Add().SetName(intf1.Name() + ".IPv4"). SetAddress("198.51.100.1").SetGateway("198.51.100.0"). SetPrefix(31) config.Ports().Add().SetName(ap2.ID()) intf2 := config.Devices().Add().SetName(ap2.Name()) eth2 := intf2.Ethernets().Add().SetName(ap2.Name() + ".Eth").SetMac("02:00:01:02:01:01") - eth2.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(ap2.ID()) + eth2.Connection().SetPortName(ap2.ID()) ip4_2 := eth2.Ipv4Addresses().Add().SetName(intf2.Name() + ".IPv4"). SetAddress("198.51.100.3").SetGateway("198.51.100.2"). SetPrefix(31) diff --git a/feature/gnmi/otg_tests/telemetry_interface_packet_counters_test/telemetry_interface_packet_counters_test.go b/feature/gnmi/otg_tests/telemetry_interface_packet_counters_test/telemetry_interface_packet_counters_test.go index b3bb95b68c2..cf9310999ee 100644 --- a/feature/gnmi/otg_tests/telemetry_interface_packet_counters_test/telemetry_interface_packet_counters_test.go +++ b/feature/gnmi/otg_tests/telemetry_interface_packet_counters_test/telemetry_interface_packet_counters_test.go @@ -262,7 +262,7 @@ func TestIntfCounterUpdate(t *testing.T) { config.Ports().Add().SetName(ap1.ID()) intf1 := config.Devices().Add().SetName(ap1.Name()) eth1 := intf1.Ethernets().Add().SetName(ap1.Name() + ".Eth").SetMac("02:00:01:01:01:01") - eth1.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(ap1.ID()) + eth1.Connection().SetPortName(ap1.ID()) ip4_1 := eth1.Ipv4Addresses().Add().SetName(intf1.Name() + ".IPv4"). SetAddress("198.51.100.1").SetGateway("198.51.100.0"). SetPrefix(31) @@ -272,7 +272,7 @@ func TestIntfCounterUpdate(t *testing.T) { config.Ports().Add().SetName(ap2.ID()) intf2 := config.Devices().Add().SetName(ap2.Name()) eth2 := intf2.Ethernets().Add().SetName(ap2.Name() + ".Eth").SetMac("02:00:01:02:01:01") - eth2.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(ap2.ID()) + eth2.Connection().SetPortName(ap2.ID()) ip4_2 := eth2.Ipv4Addresses().Add().SetName(intf2.Name() + ".IPv4"). SetAddress("198.51.100.3").SetGateway("198.51.100.2"). SetPrefix(31) diff --git a/feature/gribi/mplsutil/mplsutil.go b/feature/gribi/mplsutil/mplsutil.go index 02c0b58c0f9..8b385560b87 100644 --- a/feature/gribi/mplsutil/mplsutil.go +++ b/feature/gribi/mplsutil/mplsutil.go @@ -391,27 +391,26 @@ func (g *GRIBIMPLSTest) ConfigureFlows(t *testing.T, ate *ondatra.ATEDevice) { mplsFlow := g.otgConfig.Flows().Add().SetName(flowName) mplsFlow.Metrics().SetEnable(true) mplsFlow.TxRx().Port().SetTxName(ATESrc.Name).SetRxName(ATEDst.Name) - - mplsFlow.Rate().SetChoice("pps").SetPps(1) + mplsFlow.Rate().SetPps(1) // Set up ethernet layer. eth := mplsFlow.Packet().Add().Ethernet() - eth.Src().SetChoice("value").SetValue(ATESrc.MAC) - eth.Dst().SetChoice("value").SetValue(dstMAC) + eth.Src().SetValue(ATESrc.MAC) + eth.Dst().SetValue(dstMAC) // Set up MPLS layer with destination label 100. mpls := mplsFlow.Packet().Add().Mpls() - mpls.Label().SetChoice("value").SetValue(staticMPLSToATE) - mpls.BottomOfStack().SetChoice("value").SetValue(0) + mpls.Label().SetValue(staticMPLSToATE) + mpls.BottomOfStack().SetValue(0) mplsInner := mplsFlow.Packet().Add().Mpls() - mplsInner.Label().SetChoice("value").SetValue(innerLabel) - mplsInner.BottomOfStack().SetChoice("value").SetValue(1) + mplsInner.Label().SetValue(innerLabel) + mplsInner.BottomOfStack().SetValue(1) ip4 := mplsFlow.Packet().Add().Ipv4() - ip4.Src().SetChoice("value").SetValue("198.18.1.1") - ip4.Dst().SetChoice("value").SetValue("198.18.2.1") - ip4.Version().SetChoice("value").SetValue(4) + ip4.Src().SetValue("198.18.1.1") + ip4.Dst().SetValue("198.18.2.1") + ip4.Version().SetValue(4) ate.OTG().PushConfig(t, g.otgConfig) default: diff --git a/feature/gribi/otg_tests/ack_in_presence_other_routes/route_ack_test.go b/feature/gribi/otg_tests/ack_in_presence_other_routes/route_ack_test.go index efe4f1fda4b..e244944b193 100644 --- a/feature/gribi/otg_tests/ack_in_presence_other_routes/route_ack_test.go +++ b/feature/gribi/otg_tests/ack_in_presence_other_routes/route_ack_test.go @@ -163,19 +163,19 @@ func configureATE(t *testing.T, ate *ondatra.ATEDevice) gosnappi.Config { top.Ports().Add().SetName(atePort1.Name) i1 := top.Devices().Add().SetName(atePort1.Name) eth1 := i1.Ethernets().Add().SetName(atePort1.Name + ".Eth").SetMac(atePort1.MAC) - eth1.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(i1.Name()) + eth1.Connection().SetPortName(i1.Name()) eth1.Ipv4Addresses().Add().SetName(i1.Name() + ".IPv4").SetAddress(atePort1.IPv4).SetGateway(dutPort1.IPv4).SetPrefix(uint32(atePort1.IPv4Len)) top.Ports().Add().SetName(atePort2.Name) i2 := top.Devices().Add().SetName(atePort2.Name) eth2 := i2.Ethernets().Add().SetName(atePort2.Name + ".Eth").SetMac(atePort2.MAC) - eth2.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(i2.Name()) + eth2.Connection().SetPortName(i2.Name()) eth2.Ipv4Addresses().Add().SetName(i2.Name() + ".IPv4").SetAddress(atePort2.IPv4).SetGateway(dutPort2.IPv4).SetPrefix(uint32(atePort2.IPv4Len)) top.Ports().Add().SetName(atePort3.Name) i3 := top.Devices().Add().SetName(atePort3.Name) eth3 := i3.Ethernets().Add().SetName(atePort3.Name + ".Eth").SetMac(atePort3.MAC) - eth3.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(i3.Name()) + eth3.Connection().SetPortName(i3.Name()) eth3.Ipv4Addresses().Add().SetName(i3.Name() + ".IPv4").SetAddress(atePort3.IPv4).SetGateway(dutPort3.IPv4).SetPrefix(uint32(atePort3.IPv4Len)) return top } @@ -194,10 +194,10 @@ func testTraffic(t *testing.T, ate *ondatra.ATEDevice, top gosnappi.Config, srcE flowipv4.TxRx().Port(). SetTxName(srcEndPoint.Name). SetRxName(dstEndPoint.Name) - flowipv4.Duration().SetChoice("continuous") + flowipv4.Duration().Continuous() e1 := flowipv4.Packet().Add().Ethernet() e1.Src().SetValue(srcEndPoint.MAC) - e1.Dst().SetChoice("value").SetValue(dstMac) + e1.Dst().SetValue(dstMac) v4 := flowipv4.Packet().Add().Ipv4() srcIpv4 := srcEndPoint.IPv4 v4.Src().SetValue(srcIpv4) diff --git a/feature/gribi/otg_tests/backup_nhg_multiple_nh_test/backup_nhg_multiple_nh_test.go b/feature/gribi/otg_tests/backup_nhg_multiple_nh_test/backup_nhg_multiple_nh_test.go index 9c70313b01f..1a07fa7dbeb 100644 --- a/feature/gribi/otg_tests/backup_nhg_multiple_nh_test/backup_nhg_multiple_nh_test.go +++ b/feature/gribi/otg_tests/backup_nhg_multiple_nh_test/backup_nhg_multiple_nh_test.go @@ -392,7 +392,7 @@ func (a *testArgs) createFlow(t *testing.T, name, dstMac string) string { e1.Src().SetValue(atePort1.MAC) flow.TxRx().Port().SetTxName("port1").SetRxNames([]string{"port2", "port3", "port4"}) flow.Rate().SetPps(fps) - e1.Dst().SetChoice("value").SetValue(dstMac) + e1.Dst().SetValue(dstMac) v4 := flow.Packet().Add().Ipv4() v4.Src().Increment().SetStart(dutPort1.IPv4) v4.Dst().Increment().SetStart(dstPfxMin).SetCount(routeCount) diff --git a/feature/gribi/otg_tests/base_hierarchical_route_installation_test/base_hierarchical_route_installation_test.go b/feature/gribi/otg_tests/base_hierarchical_route_installation_test/base_hierarchical_route_installation_test.go index 8aafa24a7ac..a2988705056 100644 --- a/feature/gribi/otg_tests/base_hierarchical_route_installation_test/base_hierarchical_route_installation_test.go +++ b/feature/gribi/otg_tests/base_hierarchical_route_installation_test/base_hierarchical_route_installation_test.go @@ -217,7 +217,7 @@ func configureATE(t *testing.T, ate *ondatra.ATEDevice) gosnappi.Config { top.Ports().Add().SetName(ap.Name) i1 := top.Devices().Add().SetName(ap.Name) eth1 := i1.Ethernets().Add().SetName(ap.Name + ".Eth").SetMac(ap.MAC) - eth1.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(i1.Name()) + eth1.Connection().SetPortName(i1.Name()) eth1.Ipv4Addresses().Add().SetName(i1.Name() + ".IPv4"). SetAddress(ap.IPv4).SetGateway(dp.IPv4). SetPrefix(uint32(ap.IPv4Len)) diff --git a/feature/gribi/otg_tests/base_leader_election_test/base_leader_election_test.go b/feature/gribi/otg_tests/base_leader_election_test/base_leader_election_test.go index 2ed34099f14..adfe393f5cc 100644 --- a/feature/gribi/otg_tests/base_leader_election_test/base_leader_election_test.go +++ b/feature/gribi/otg_tests/base_leader_election_test/base_leader_election_test.go @@ -162,21 +162,21 @@ func configureATE(t *testing.T, ate *ondatra.ATEDevice) gosnappi.Config { top.Ports().Add().SetName(atePort1.Name) dev := top.Devices().Add().SetName(atePort1.Name) eth := dev.Ethernets().Add().SetName(atePort1.Name + ".Eth").SetMac(atePort1.MAC) - eth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(dev.Name()) + eth.Connection().SetPortName(dev.Name()) ip := eth.Ipv4Addresses().Add().SetName(dev.Name() + ".IPv4") ip.SetAddress(atePort1.IPv4).SetGateway(dutPort1.IPv4).SetPrefix(uint32(atePort1.IPv4Len)) top.Ports().Add().SetName(atePort2.Name) dev = top.Devices().Add().SetName(atePort2.Name) eth = dev.Ethernets().Add().SetName(atePort2.Name + ".Eth").SetMac(atePort2.MAC) - eth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(dev.Name()) + eth.Connection().SetPortName(dev.Name()) ip = eth.Ipv4Addresses().Add().SetName(dev.Name() + ".IPv4") ip.SetAddress(atePort2.IPv4).SetGateway(dutPort2.IPv4).SetPrefix(uint32(atePort2.IPv4Len)) top.Ports().Add().SetName(atePort3.Name) dev = top.Devices().Add().SetName(atePort3.Name) eth = dev.Ethernets().Add().SetName(atePort3.Name + ".Eth").SetMac(atePort3.MAC) - eth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(dev.Name()) + eth.Connection().SetPortName(dev.Name()) ip = eth.Ipv4Addresses().Add().SetName(dev.Name() + ".IPv4") ip.SetAddress(atePort3.IPv4).SetGateway(dutPort3.IPv4).SetPrefix(uint32(atePort3.IPv4Len)) @@ -202,7 +202,7 @@ func testTraffic(t *testing.T, ate *ondatra.ATEDevice, config gosnappi.Config, s flowipv4.TxRx().Port().SetTxName(srcEndPoint.Name).SetRxName(dstEndPoint.Name) e1 := flowipv4.Packet().Add().Ethernet() e1.Src().SetValue(srcEndPoint.MAC) - e1.Dst().SetChoice("value").SetValue(dstMac) + e1.Dst().SetValue(dstMac) v4 := flowipv4.Packet().Add().Ipv4() v4.Src().SetValue(srcEndPoint.IPv4) v4.Dst().Increment().SetStart(ateDstNetStart).SetCount(250) diff --git a/feature/gribi/otg_tests/get_rpc_test/get_rpc_test.go b/feature/gribi/otg_tests/get_rpc_test/get_rpc_test.go index 5b2a5b8ff16..874d27aaf6b 100644 --- a/feature/gribi/otg_tests/get_rpc_test/get_rpc_test.go +++ b/feature/gribi/otg_tests/get_rpc_test/get_rpc_test.go @@ -144,7 +144,7 @@ func configureATE(t *testing.T, ate *ondatra.ATEDevice) gosnappi.Config { top.Ports().Add().SetName(ate.Port(t, "port1").ID()) i1 := top.Devices().Add().SetName(ate.Port(t, "port1").ID()) eth1 := i1.Ethernets().Add().SetName(atePort1.Name + ".Eth").SetMac(atePort1.MAC) - eth1.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(i1.Name()) + eth1.Connection().SetPortName(i1.Name()) eth1.Ipv4Addresses().Add().SetName(atePort1.Name + ".IPv4"). SetAddress(atePort1.IPv4).SetGateway(dutPort1.IPv4). SetPrefix(uint32(atePort1.IPv4Len)) @@ -152,7 +152,7 @@ func configureATE(t *testing.T, ate *ondatra.ATEDevice) gosnappi.Config { top.Ports().Add().SetName(ate.Port(t, "port2").ID()) i2 := top.Devices().Add().SetName(ate.Port(t, "port2").ID()) eth2 := i2.Ethernets().Add().SetName(atePort2.Name + ".Eth").SetMac(atePort2.MAC) - eth2.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(i2.Name()) + eth2.Connection().SetPortName(i2.Name()) eth2.Ipv4Addresses().Add().SetName(atePort2.Name + ".IPv4"). SetAddress(atePort2.IPv4).SetGateway(dutPort2.IPv4). SetPrefix(uint32(atePort2.IPv4Len)) diff --git a/feature/gribi/otg_tests/gribi_scaling/gribi_scaling_test.go b/feature/gribi/otg_tests/gribi_scaling/gribi_scaling_test.go index f0a90d3639c..c8ed4bf9571 100644 --- a/feature/gribi/otg_tests/gribi_scaling/gribi_scaling_test.go +++ b/feature/gribi/otg_tests/gribi_scaling/gribi_scaling_test.go @@ -446,7 +446,7 @@ func configureATE(t *testing.T, top gosnappi.Config, atePort *ondatra.Port, vlan dev := top.Devices().Add().SetName(Name + ".Dev") eth := dev.Ethernets().Add().SetName(Name + ".Eth").SetMac(MAC) - eth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(atePort.ID()) + eth.Connection().SetPortName(atePort.ID()) if vlanID != 0 { eth.Vlans().Add().SetName(Name).SetId(uint32(vlanID)) } diff --git a/feature/gribi/otg_tests/ipv4_entry_with_aggregate_ports_test/ipv4_entry_with_aggregate_ports_test.go b/feature/gribi/otg_tests/ipv4_entry_with_aggregate_ports_test/ipv4_entry_with_aggregate_ports_test.go index 38c601e938a..47f5f56309c 100644 --- a/feature/gribi/otg_tests/ipv4_entry_with_aggregate_ports_test/ipv4_entry_with_aggregate_ports_test.go +++ b/feature/gribi/otg_tests/ipv4_entry_with_aggregate_ports_test/ipv4_entry_with_aggregate_ports_test.go @@ -317,7 +317,7 @@ func configureATE(t *testing.T, ate *ondatra.ATEDevice, top gosnappi.Config, agg top.Ports().Add().SetName(p1.ID()) srcDev := top.Devices().Add().SetName(atePort1.Name) srcEth := srcDev.Ethernets().Add().SetName(atePort1.Name + ".Eth").SetMac(atePort1.MAC) - srcEth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(p1.ID()) + srcEth.Connection().SetPortName(p1.ID()) srcEth.Ipv4Addresses().Add().SetName(atePort1.Name + ".IPv4").SetAddress(atePort1.IPv4).SetGateway(dutPort1.IPv4).SetPrefix(uint32(atePort1.IPv4Len)) ateAggPorts := []*ondatra.Port{ @@ -334,7 +334,7 @@ func configureATEBundle(t *testing.T, ate *ondatra.ATEDevice, top gosnappi.Confi t.Helper() agg := top.Lags().Add().SetName(lagName) lagID, _ := strconv.Atoi(aggID) - agg.Protocol().SetChoice("static").Static().SetLagId(uint32(lagID)) + agg.Protocol().Static().SetLagId(uint32(lagID)) for i, p := range aggPorts { port := top.Ports().Add().SetName(p.ID()) newMac, err := incrementMAC(ateDst.MAC, i+1) @@ -346,7 +346,7 @@ func configureATEBundle(t *testing.T, ate *ondatra.ATEDevice, top gosnappi.Confi dstDev := top.Devices().Add().SetName(agg.Name() + ".dev") dstEth := dstDev.Ethernets().Add().SetName(lagName + ".Eth").SetMac(ateDst.MAC) - dstEth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.LAG_NAME).SetLagName(agg.Name()) + dstEth.Connection().SetLagName(agg.Name()) dstEth.Ipv4Addresses().Add().SetName(lagName + ".IPv4").SetAddress(ateDst.IPv4).SetGateway(dutDst.IPv4).SetPrefix(uint32(ateDst.IPv4Len)) } diff --git a/feature/gribi/otg_tests/ordering_ack_test/ordering_ack_test.go b/feature/gribi/otg_tests/ordering_ack_test/ordering_ack_test.go index 3ba8832bb08..accd99b5ef9 100644 --- a/feature/gribi/otg_tests/ordering_ack_test/ordering_ack_test.go +++ b/feature/gribi/otg_tests/ordering_ack_test/ordering_ack_test.go @@ -150,7 +150,7 @@ func configureATE(t *testing.T, ate *ondatra.ATEDevice) gosnappi.Config { top.Ports().Add().SetName(ate.Port(t, "port1").ID()) i1 := top.Devices().Add().SetName(ate.Port(t, "port1").ID()) eth1 := i1.Ethernets().Add().SetName(ateSrc.Name + ".Eth").SetMac(ateSrc.MAC) - eth1.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(i1.Name()) + eth1.Connection().SetPortName(i1.Name()) eth1.Ipv4Addresses().Add().SetName(ateSrc.Name + ".IPv4"). SetAddress(ateSrc.IPv4).SetGateway(dutSrc.IPv4). SetPrefix(uint32(ateSrc.IPv4Len)) @@ -158,7 +158,7 @@ func configureATE(t *testing.T, ate *ondatra.ATEDevice) gosnappi.Config { top.Ports().Add().SetName(ate.Port(t, "port2").ID()) i2 := top.Devices().Add().SetName(ate.Port(t, "port2").ID()) eth2 := i2.Ethernets().Add().SetName(ateDst.Name + ".Eth").SetMac(ateDst.MAC) - eth2.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(i2.Name()) + eth2.Connection().SetPortName(i2.Name()) eth2.Ipv4Addresses().Add().SetName(ateDst.Name + ".IPv4"). SetAddress(ateDst.IPv4).SetGateway(dutDst.IPv4). SetPrefix(uint32(ateDst.IPv4Len)) @@ -185,10 +185,10 @@ func testTraffic( flowipv4.TxRx().Port(). SetTxName(ate.Port(t, "port1").ID()). SetRxName(ate.Port(t, "port2").ID()) - flowipv4.Duration().SetChoice("continuous") + flowipv4.Duration().Continuous() e1 := flowipv4.Packet().Add().Ethernet() e1.Src().SetValue(ateSrc.MAC) - e1.Dst().SetChoice("value").SetValue(dstMac) + e1.Dst().SetValue(dstMac) v4 := flowipv4.Packet().Add().Ipv4() v4.Src().SetValue(ateSrc.IPv4) v4.Dst().Increment().SetStart(ateDstNetStartIp).SetCount(ateDstNetAddressCount) diff --git a/feature/gribi/otg_tests/persistence_mode_test/persistence_mode_test.go b/feature/gribi/otg_tests/persistence_mode_test/persistence_mode_test.go index d6bccfdb944..fa33c4bc91c 100644 --- a/feature/gribi/otg_tests/persistence_mode_test/persistence_mode_test.go +++ b/feature/gribi/otg_tests/persistence_mode_test/persistence_mode_test.go @@ -132,7 +132,7 @@ func configureATE(t *testing.T, ate *ondatra.ATEDevice) gosnappi.Config { top.Ports().Add().SetName(ate.Port(t, "port1").ID()) i1 := top.Devices().Add().SetName(ate.Port(t, "port1").ID()) eth1 := i1.Ethernets().Add().SetName(atePort1.Name + ".Eth").SetMac(atePort1.MAC) - eth1.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(i1.Name()) + eth1.Connection().SetPortName(i1.Name()) eth1.Ipv4Addresses().Add().SetName(atePort1.Name + ".IPv4"). SetAddress(atePort1.IPv4).SetGateway(dutPort1.IPv4). SetPrefix(uint32(atePort1.IPv4Len)) @@ -140,7 +140,7 @@ func configureATE(t *testing.T, ate *ondatra.ATEDevice) gosnappi.Config { top.Ports().Add().SetName(ate.Port(t, "port2").ID()) i2 := top.Devices().Add().SetName(ate.Port(t, "port2").ID()) eth2 := i2.Ethernets().Add().SetName(atePort2.Name + ".Eth").SetMac(atePort2.MAC) - eth2.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(i2.Name()) + eth2.Connection().SetPortName(i2.Name()) eth2.Ipv4Addresses().Add().SetName(atePort2.Name + ".IPv4"). SetAddress(atePort2.IPv4).SetGateway(dutPort2.IPv4). SetPrefix(uint32(atePort2.IPv4Len)) @@ -164,10 +164,10 @@ func testTraffic(t *testing.T, ate *ondatra.ATEDevice, top gosnappi.Config, srcE flowipv4.TxRx().Port(). SetTxName(ate.Port(t, "port1").ID()). SetRxName(ate.Port(t, "port2").ID()) - flowipv4.Duration().SetChoice("continuous") + flowipv4.Duration().Continuous() e1 := flowipv4.Packet().Add().Ethernet() e1.Src().SetValue(atePort1.MAC) - e1.Dst().SetChoice("value").SetValue(dstMac) + e1.Dst().SetValue(dstMac) v4 := flowipv4.Packet().Add().Ipv4() v4.Src().SetValue(atePort1.IPv4) v4.Dst().Increment().SetStart("203.0.113.1").SetCount(250) diff --git a/feature/gribi/otg_tests/route_removal_via_flush_test/route_removal_via_flush_test.go b/feature/gribi/otg_tests/route_removal_via_flush_test/route_removal_via_flush_test.go index c354054d75f..5c3c5050763 100644 --- a/feature/gribi/otg_tests/route_removal_via_flush_test/route_removal_via_flush_test.go +++ b/feature/gribi/otg_tests/route_removal_via_flush_test/route_removal_via_flush_test.go @@ -315,7 +315,7 @@ func testTraffic(t *testing.T, ate *ondatra.ATEDevice, top gosnappi.Config) floa SetTxNames([]string{atePort1.Name + ".IPv4"}). SetRxNames([]string{atePort2.Name + ".IPv4"}) - flowipv4.Duration().SetChoice("continuous") + flowipv4.Duration().Continuous() e1 := flowipv4.Packet().Add().Ethernet() e1.Src().SetValue(atePort1.MAC) v4 := flowipv4.Packet().Add().Ipv4() diff --git a/feature/gribi/otg_tests/weighted_balancing_test/setup_test.go b/feature/gribi/otg_tests/weighted_balancing_test/setup_test.go index d86de00be8f..bd228ed02ce 100644 --- a/feature/gribi/otg_tests/weighted_balancing_test/setup_test.go +++ b/feature/gribi/otg_tests/weighted_balancing_test/setup_test.go @@ -217,7 +217,7 @@ func configureATE(t testing.TB, ate *ondatra.ATEDevice) gosnappi.Config { dev := config.Devices().Add().SetName(ateid) macAddress, _ := incrementMAC(ateSrcPortMac, i) eth := dev.Ethernets().Add().SetName(ateid + ".Eth").SetMac(macAddress) - eth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(ap.ID()) + eth.Connection().SetPortName(ap.ID()) eth.Ipv4Addresses().Add().SetName(dev.Name() + ".IPv4"). SetAddress(portsIPv4[ateid]).SetGateway(portsIPv4[dutid]). SetPrefix(plen) @@ -312,23 +312,23 @@ func generateTraffic(t *testing.T, ate *ondatra.ATEDevice, config gosnappi.Confi if *randomSrcIP { ipv4.Src().SetValues(generateRandomIPList(t, ateSrcNetFirstIP+"/32", ateSrcNetCount)) } else { - ipv4.Src().SetChoice("increment").Increment().SetStart(ateSrcNetFirstIP).SetCount(uint32(ateSrcNetCount)) + ipv4.Src().Increment().SetStart(ateSrcNetFirstIP).SetCount(uint32(ateSrcNetCount)) } if *randomDstIP { ipv4.Dst().SetValues(generateRandomIPList(t, ateDstNetFirstIP+"/32", ateDstNetCount)) } else { - ipv4.Dst().SetChoice("increment").Increment().SetStart(ateDstNetFirstIP).SetCount(uint32(ateDstNetCount)) + ipv4.Dst().Increment().SetStart(ateDstNetFirstIP).SetCount(uint32(ateDstNetCount)) } tcp := flow.Packet().Add().Tcp() if *randomSrcPort { tcp.SrcPort().SetValues((generateRandomPortList(65534))) } else { - tcp.SrcPort().SetChoice("increment").Increment().SetStart(1).SetCount(65534) + tcp.SrcPort().Increment().SetStart(1).SetCount(65534) } if *randomDstPort { tcp.DstPort().SetValues(generateRandomPortList(65534)) } else { - tcp.DstPort().SetChoice("increment").Increment().SetStart(1).SetCount(65534) + tcp.DstPort().Increment().SetStart(1).SetCount(65534) } flow.Size().SetFixed(200) diff --git a/feature/interface/aggregate/otg_tests/aggregate_forwarding_viable_test/aggregate_forwarding_viable_test.go b/feature/interface/aggregate/otg_tests/aggregate_forwarding_viable_test/aggregate_forwarding_viable_test.go index 9d6e1802c2d..be892937519 100644 --- a/feature/interface/aggregate/otg_tests/aggregate_forwarding_viable_test/aggregate_forwarding_viable_test.go +++ b/feature/interface/aggregate/otg_tests/aggregate_forwarding_viable_test/aggregate_forwarding_viable_test.go @@ -343,7 +343,7 @@ func (tc *testArgs) configureATE(t *testing.T) { agg := tc.top.Lags().Add().SetName(ateDst.Name) if tc.lagType == lagTypeSTATIC { lagId, _ := strconv.Atoi(tc.aggID) - agg.Protocol().SetChoice("static").Static().SetLagId(uint32(lagId)) + agg.Protocol().Static().SetLagId(uint32(lagId)) for i, p := range tc.atePorts[1:] { port := tc.top.Ports().Add().SetName(p.ID()) newMac, err := incrementMAC(ateDst.MAC, i+1) @@ -353,7 +353,6 @@ func (tc *testArgs) configureATE(t *testing.T) { agg.Ports().Add().SetPortName(port.Name()).Ethernet().SetMac(newMac).SetName("LAGRx-" + strconv.Itoa(i)) } } else { - agg.Protocol().SetChoice("lacp") agg.Protocol().Lacp().SetActorKey(1).SetActorSystemPriority(1).SetActorSystemId(ateDst.MAC) for i, p := range tc.atePorts[1:] { port := tc.top.Ports().Add().SetName(p.ID()) diff --git a/feature/interface/aggregate/otg_tests/aggregate_test/aggregate_test.go b/feature/interface/aggregate/otg_tests/aggregate_test/aggregate_test.go index b222d8e0bbf..16016e67890 100644 --- a/feature/interface/aggregate/otg_tests/aggregate_test/aggregate_test.go +++ b/feature/interface/aggregate/otg_tests/aggregate_test/aggregate_test.go @@ -270,7 +270,7 @@ func (tc *testCase) configureATE(t *testing.T) { tc.top.Ports().Add().SetName(p0.ID()) srcDev := tc.top.Devices().Add().SetName(ateSrc.Name) srcEth := srcDev.Ethernets().Add().SetName(ateSrc.Name + ".Eth").SetMac(ateSrc.MAC) - srcEth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(p0.ID()) + srcEth.Connection().SetPortName(p0.ID()) srcEth.Ipv4Addresses().Add().SetName(ateSrc.Name + ".IPv4").SetAddress(ateSrc.IPv4).SetGateway(dutSrc.IPv4).SetPrefix(uint32(ateSrc.IPv4Len)) srcEth.Ipv6Addresses().Add().SetName(ateSrc.Name + ".IPv6").SetAddress(ateSrc.IPv6).SetGateway(dutSrc.IPv6).SetPrefix(uint32(ateSrc.IPv6Len)) @@ -278,7 +278,7 @@ func (tc *testCase) configureATE(t *testing.T) { agg := tc.top.Lags().Add().SetName(ateDst.Name) if tc.lagType == lagTypeSTATIC { lagId, _ := strconv.Atoi(tc.aggID) - agg.Protocol().SetChoice("static").Static().SetLagId(uint32(lagId)) + agg.Protocol().Static().SetLagId(uint32(lagId)) for i, p := range tc.atePorts[1:] { port := tc.top.Ports().Add().SetName(p.ID()) newMac, err := incrementMAC(ateDst.MAC, i+1) @@ -288,7 +288,6 @@ func (tc *testCase) configureATE(t *testing.T) { agg.Ports().Add().SetPortName(port.Name()).Ethernet().SetMac(newMac).SetName("LAGRx-" + strconv.Itoa(i)) } } else { - agg.Protocol().SetChoice("lacp") agg.Protocol().Lacp().SetActorKey(1).SetActorSystemPriority(1).SetActorSystemId(ateDst.MAC) for i, p := range tc.atePorts[1:] { port := tc.top.Ports().Add().SetName(p.ID()) @@ -319,7 +318,7 @@ func (tc *testCase) configureATE(t *testing.T) { dstDev := tc.top.Devices().Add().SetName(agg.Name() + ".dev") dstEth := dstDev.Ethernets().Add().SetName(ateDst.Name + ".Eth").SetMac(ateDst.MAC) - dstEth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.LAG_NAME).SetLagName(agg.Name()) + dstEth.Connection().SetLagName(agg.Name()) dstEth.Ipv4Addresses().Add().SetName(ateDst.Name + ".IPv4").SetAddress(ateDst.IPv4).SetGateway(dutDst.IPv4).SetPrefix(uint32(ateDst.IPv4Len)) dstEth.Ipv6Addresses().Add().SetName(ateDst.Name + ".IPv6").SetAddress(ateDst.IPv6).SetGateway(dutDst.IPv6).SetPrefix(uint32(ateDst.IPv6Len)) diff --git a/feature/interface/aggregate/otg_tests/balancing_test/balancing_test.go b/feature/interface/aggregate/otg_tests/balancing_test/balancing_test.go index 435f53f07f6..9937fabf31d 100644 --- a/feature/interface/aggregate/otg_tests/balancing_test/balancing_test.go +++ b/feature/interface/aggregate/otg_tests/balancing_test/balancing_test.go @@ -381,7 +381,7 @@ func (tc *testCase) configureATE(t *testing.T) { tc.top.Ports().Add().SetName(p0.ID()) d0 := tc.top.Devices().Add().SetName(ateSrc.Name) srcEth := d0.Ethernets().Add().SetName(ateSrc.Name + ".Eth").SetMac(ateSrc.MAC) - srcEth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(p0.ID()) + srcEth.Connection().SetPortName(p0.ID()) srcEth.Ipv4Addresses().Add().SetName(ateSrc.Name + ".IPv4").SetAddress(ateSrc.IPv4).SetGateway(dutSrc.IPv4).SetPrefix(uint32(ateSrc.IPv4Len)) srcEth.Ipv6Addresses().Add().SetName(ateSrc.Name + ".IPv6").SetAddress(ateSrc.IPv6).SetGateway(dutSrc.IPv6).SetPrefix(uint32(ateSrc.IPv6Len)) @@ -417,7 +417,7 @@ func (tc *testCase) configureATE(t *testing.T) { dstDev := tc.top.Devices().Add().SetName(agg.Name() + ".dev") dstEth := dstDev.Ethernets().Add().SetName(ateDst.Name + ".Eth").SetMac(ateDst.MAC) - dstEth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.LAG_NAME).SetLagName(agg.Name()) + dstEth.Connection().SetLagName(agg.Name()) dstEth.Ipv4Addresses().Add().SetName(ateDst.Name + ".IPv4").SetAddress(ateDst.IPv4).SetGateway(dutDst.IPv4).SetPrefix(uint32(ateDst.IPv4Len)) dstEth.Ipv6Addresses().Add().SetName(ateDst.Name + ".IPv6").SetAddress(ateDst.IPv6).SetGateway(dutDst.IPv6).SetPrefix(uint32(ateDst.IPv6Len)) diff --git a/feature/interface/singleton/otg_tests/singleton_test/singleton_test.go b/feature/interface/singleton/otg_tests/singleton_test/singleton_test.go index 4d6b7e10534..999a36ac48f 100644 --- a/feature/interface/singleton/otg_tests/singleton_test/singleton_test.go +++ b/feature/interface/singleton/otg_tests/singleton_test/singleton_test.go @@ -192,7 +192,7 @@ func (tc *testCase) configureATE(t *testing.T) { i1 := tc.top.Devices().Add().SetName(ap1.ID()) eth1 := i1.Ethernets().Add().SetName(ateSrc.Name + ".Eth"). SetMac(ateSrc.MAC).SetMtu(uint32(ateMTU)) - eth1.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(i1.Name()) + eth1.Connection().SetPortName(i1.Name()) if ateSrc.IPv4 != "" { eth1.Ipv4Addresses().Add().SetName(ateSrc.Name + ".IPv4"). SetAddress(ateSrc.IPv4).SetGateway(dutSrc.IPv4). @@ -207,7 +207,7 @@ func (tc *testCase) configureATE(t *testing.T) { i2 := tc.top.Devices().Add().SetName(ap2.ID()) eth2 := i2.Ethernets().Add().SetName(ateDst.Name + ".Eth"). SetMac(ateDst.MAC).SetMtu(uint32(ateMTU)) - eth2.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(i2.Name()) + eth2.Connection().SetPortName(i2.Name()) if ateDst.IPv4 != "" { eth2.Ipv4Addresses().Add().SetName(ateDst.Name + ".IPv4"). SetAddress(ateDst.IPv4).SetGateway(dutDst.IPv4). diff --git a/feature/interface/staticarp/otg_tests/static_arp_test/static_arp_test.go b/feature/interface/staticarp/otg_tests/static_arp_test/static_arp_test.go index a2cc54786e6..a03fb89b463 100644 --- a/feature/interface/staticarp/otg_tests/static_arp_test/static_arp_test.go +++ b/feature/interface/staticarp/otg_tests/static_arp_test/static_arp_test.go @@ -243,7 +243,6 @@ func testFlow( v6.Src().SetValue(ateSrc.IPv6) v6.Dst().SetValue(ateDst.IPv6) } - flow.Duration().SetChoice("fixed_packets") flow.Duration().FixedPackets().SetPackets(1000) flow.Size().SetFixed(100) eth := flow.EgressPacket().Add().Ethernet() diff --git a/feature/lldp/otg_tests/core_lldp_tlv_population_test/core_lldp_tlv_population_test.go b/feature/lldp/otg_tests/core_lldp_tlv_population_test/core_lldp_tlv_population_test.go index 3eb1dce5f70..532595c9e28 100644 --- a/feature/lldp/otg_tests/core_lldp_tlv_population_test/core_lldp_tlv_population_test.go +++ b/feature/lldp/otg_tests/core_lldp_tlv_population_test/core_lldp_tlv_population_test.go @@ -159,7 +159,7 @@ func configureATE(t *testing.T, otg *otg.OTG) gosnappi.Config { srcPort := config.Ports().Add().SetName(portName) srcDev := config.Devices().Add().SetName(ateSrc.Name) srcEth := srcDev.Ethernets().Add().SetName(ateSrc.Name + ".Eth").SetMac(ateSrc.MAC) - srcEth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(srcPort.Name()) + srcEth.Connection().SetPortName(srcPort.Name()) // LLDP configuration. lldp := config.Lldp().Add() diff --git a/feature/mtu/largeippacket/otg_tests/large_ip_packet_transmission/large_ip_packet_transmission_test.go b/feature/mtu/largeippacket/otg_tests/large_ip_packet_transmission/large_ip_packet_transmission_test.go index a79f8ecb0a9..0f7304d92d5 100644 --- a/feature/mtu/largeippacket/otg_tests/large_ip_packet_transmission/large_ip_packet_transmission_test.go +++ b/feature/mtu/largeippacket/otg_tests/large_ip_packet_transmission/large_ip_packet_transmission_test.go @@ -538,7 +538,7 @@ func configureATEBundle( SetName(fmt.Sprintf("%s.Eth", ateLag.Name)). SetMac(ateLag.MAC). SetMtu(mtu) - aggEth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.LAG_NAME).SetLagName(agg.Name()) + aggEth.Connection().SetLagName(agg.Name()) aggEth.Ipv4Addresses().Add().SetName(fmt.Sprintf("%s.IPv4", ateLag.Name)). SetAddress(ateLag.IPv4). diff --git a/feature/platform/integrated_circuit/otg_tests/utilization_test/utilization_test.go b/feature/platform/integrated_circuit/otg_tests/utilization_test/utilization_test.go index a6836706857..792ba60587c 100644 --- a/feature/platform/integrated_circuit/otg_tests/utilization_test/utilization_test.go +++ b/feature/platform/integrated_circuit/otg_tests/utilization_test/utilization_test.go @@ -292,7 +292,7 @@ func configureOTG(t *testing.T, otg *otg.OTG) (gosnappi.BgpV6Peer, gosnappi.Devi iDut1Dev := config.Devices().Add().SetName(atePort1.Name) iDut1Eth := iDut1Dev.Ethernets().Add().SetName(atePort1.Name + ".Eth").SetMac(atePort1.MAC) - iDut1Eth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(port1.Name()) + iDut1Eth.Connection().SetPortName(port1.Name()) iDut1Ipv4 := iDut1Eth.Ipv4Addresses().Add().SetName(atePort1.Name + ".IPv4") iDut1Ipv4.SetAddress(atePort1.IPv4).SetGateway(dutPort1.IPv4).SetPrefix(uint32(atePort1.IPv4Len)) iDut1Ipv6 := iDut1Eth.Ipv6Addresses().Add().SetName(atePort1.Name + ".IPv6") @@ -300,7 +300,7 @@ func configureOTG(t *testing.T, otg *otg.OTG) (gosnappi.BgpV6Peer, gosnappi.Devi iDut2Dev := config.Devices().Add().SetName(atePort2.Name) iDut2Eth := iDut2Dev.Ethernets().Add().SetName(atePort2.Name + ".Eth").SetMac(atePort2.MAC) - iDut2Eth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(port2.Name()) + iDut2Eth.Connection().SetPortName(port2.Name()) iDut2Ipv4 := iDut2Eth.Ipv4Addresses().Add().SetName(atePort2.Name + ".IPv4") iDut2Ipv4.SetAddress(atePort2.IPv4).SetGateway(dutPort2.IPv4).SetPrefix(uint32(atePort2.IPv4Len)) diff --git a/feature/qos/otg_tests/bursty_traffic_test/bursty_traffic_test.go b/feature/qos/otg_tests/bursty_traffic_test/bursty_traffic_test.go index 35c0e943897..ba98e083401 100644 --- a/feature/qos/otg_tests/bursty_traffic_test/bursty_traffic_test.go +++ b/feature/qos/otg_tests/bursty_traffic_test/bursty_traffic_test.go @@ -361,7 +361,6 @@ func TestBurstyTraffic(t *testing.T) { flow.Size().SetFixed(uint32(data.frameSize)) flow.Rate().SetPercentage(float32(data.trafficRate)) - flow.Duration().SetChoice("burst") flow.Duration().Burst().SetPackets(uint32(data.burstPackets)).SetGap(uint32(data.burstMinGap)) flow.Duration().Burst().InterBurstGap().SetBytes(float64(data.burstGap)) diff --git a/feature/qos/otg_tests/qos_output_queue_counters_test/qos_output_queue_counters_test.go b/feature/qos/otg_tests/qos_output_queue_counters_test/qos_output_queue_counters_test.go index 98e78968967..3ba558b3091 100644 --- a/feature/qos/otg_tests/qos_output_queue_counters_test/qos_output_queue_counters_test.go +++ b/feature/qos/otg_tests/qos_output_queue_counters_test/qos_output_queue_counters_test.go @@ -101,12 +101,12 @@ func TestQoSCounters(t *testing.T) { dev1 := top.Devices().Add().SetName(ateSrcName) eth1 := dev1.Ethernets().Add().SetName(dev1.Name() + ".eth").SetMac(ateSrcMac) - eth1.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(ap1.ID()) + eth1.Connection().SetPortName(ap1.ID()) eth1.Ipv4Addresses().Add().SetName(dev1.Name() + ".ipv4").SetAddress(ateSrcIp).SetGateway(ateSrcGateway).SetPrefix(uint32(prefixLen)) dev2 := top.Devices().Add().SetName(ateDstName) eth2 := dev2.Ethernets().Add().SetName(dev2.Name() + ".eth").SetMac(ateDstMac) - eth2.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(ap2.ID()) + eth2.Connection().SetPortName(ap2.ID()) eth2.Ipv4Addresses().Add().SetName(dev2.Name() + ".ipv4").SetAddress(ateDstIp).SetGateway(ateDstGateway).SetPrefix(uint32(prefixLen)) queues := netutil.CommonTrafficQueues(t, dut) diff --git a/internal/attrs/attrs.go b/internal/attrs/attrs.go index 9a07c9e071d..a502e35c4ab 100644 --- a/internal/attrs/attrs.go +++ b/internal/attrs/attrs.go @@ -134,7 +134,7 @@ func (a *Attributes) AddToOTG(top gosnappi.Config, ap *ondatra.Port, peer *Attri top.Ports().Add().SetName(ap.ID()) dev := top.Devices().Add().SetName(a.Name) eth := dev.Ethernets().Add().SetName(a.Name + ".Eth").SetMac(a.MAC) - eth.Connection().SetChoice(gosnappi.EthernetConnectionChoice.PORT_NAME).SetPortName(ap.ID()) + eth.Connection().SetPortName(ap.ID()) if a.MTU > 0 { eth.SetMtu(uint32(a.MTU))