Skip to content

Commit 6ef6608

Browse files
Merge branch 'main' into rishabh/mount-point-readme-implementation
2 parents 781e95c + 844b599 commit 6ef6608

File tree

4 files changed

+64
-79
lines changed

4 files changed

+64
-79
lines changed

feature/acl/otg_tests/acl_large_scale/acl_large_scale_test.go

Lines changed: 48 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ var (
116116
IPv6: "2001:db8::1",
117117
IPv4Len: 30,
118118
IPv6Len: 126,
119-
MAC: "02:01:00:00:00:01",
120119
}
121120

122121
atePort1 = &attrs.Attributes{
@@ -131,7 +130,6 @@ var (
131130

132131
dutPort2 = &attrs.Attributes{
133132
Desc: "DUT to ATE Port2",
134-
MAC: "02:02:00:00:00:01",
135133
IPv4: "192.168.1.5",
136134
IPv6: "2001:db8::5",
137135
IPv4Len: 30,
@@ -150,7 +148,6 @@ var (
150148

151149
dutPort3 = &attrs.Attributes{
152150
Desc: "DUT to ATE Port3",
153-
MAC: "02:03:00:00:00:01",
154151
IPv4: "192.168.1.9",
155152
IPv6: "2001:db8::9",
156153
IPv4Len: 30,
@@ -169,7 +166,6 @@ var (
169166

170167
dutPort4 = &attrs.Attributes{
171168
Desc: "DUT to ATE Port4",
172-
MAC: "02:04:00:00:00:01",
173169
IPv4: "192.168.1.13",
174170
IPv6: "2001:db8::c",
175171
IPv4Len: 30,
@@ -206,6 +202,7 @@ type bgpNeighbor struct {
206202
neighborip string
207203
isV4 bool
208204
name string
205+
device gosnappi.Device
209206
}
210207

211208
type aclConfig struct {
@@ -613,7 +610,6 @@ func createBGPNeighbor(localAs uint32, bgpNbrs []*bgpNeighbor, dut *ondatra.DUTD
613610
}
614611

615612
func configureOTG(t *testing.T, otg *ondatra.ATEDevice, prefixConfig bool) gosnappi.Config {
616-
617613
otgConfig := gosnappi.NewConfig()
618614

619615
for portName, portAttrs := range otgPorts {
@@ -622,18 +618,24 @@ func configureOTG(t *testing.T, otg *ondatra.ATEDevice, prefixConfig bool) gosna
622618
portAttrs.AddToOTG(otgConfig, port, dutPort)
623619
}
624620

621+
devices := otgConfig.Devices().Items()
622+
devMap := make(map[string]gosnappi.Device)
623+
for _, dev := range devices {
624+
devMap[dev.Name()] = dev
625+
}
626+
625627
bgpv4Devices := []*bgpNeighbor{
626-
{neighborip: atePort1.IPv4, as: atePort1AS, name: atePort1.Name, isV4: true},
627-
{neighborip: atePort2.IPv4, as: atePort2AS, name: atePort2.Name, isV4: true},
628-
{neighborip: atePort3.IPv4, as: atePort3AS, name: atePort3.Name, isV4: true},
629-
{neighborip: atePort4.IPv4, as: atePort4AS, name: atePort4.Name, isV4: true},
628+
{neighborip: atePort1.IPv4, as: atePort1AS, name: atePort1.Name, isV4: true, device: devMap[atePort1.Name]},
629+
{neighborip: atePort2.IPv4, as: atePort2AS, name: atePort2.Name, isV4: true, device: devMap[atePort2.Name]},
630+
{neighborip: atePort3.IPv4, as: atePort3AS, name: atePort3.Name, isV4: true, device: devMap[atePort3.Name]},
631+
{neighborip: atePort4.IPv4, as: atePort4AS, name: atePort4.Name, isV4: true, device: devMap[atePort4.Name]},
630632
}
631633

632634
bgpv6Devices := []*bgpNeighbor{
633-
{neighborip: atePort1.IPv6, as: atePort1AS, name: atePort1.Name, isV4: false},
634-
{neighborip: atePort2.IPv6, as: atePort2AS, name: atePort2.Name, isV4: false},
635-
{neighborip: atePort3.IPv6, as: atePort3AS, name: atePort3.Name, isV4: false},
636-
{neighborip: atePort4.IPv6, as: atePort4AS, name: atePort4.Name, isV4: false},
635+
{neighborip: atePort1.IPv6, as: atePort1AS, name: atePort1.Name, isV4: false, device: devMap[atePort1.Name]},
636+
{neighborip: atePort2.IPv6, as: atePort2AS, name: atePort2.Name, isV4: false, device: devMap[atePort2.Name]},
637+
{neighborip: atePort3.IPv6, as: atePort3AS, name: atePort3.Name, isV4: false, device: devMap[atePort3.Name]},
638+
{neighborip: atePort4.IPv6, as: atePort4AS, name: atePort4.Name, isV4: false, device: devMap[atePort4.Name]},
637639
}
638640

639641
multiplePrefixV4IPs := []struct {
@@ -660,91 +662,62 @@ func configureOTG(t *testing.T, otg *ondatra.ATEDevice, prefixConfig bool) gosna
660662
{prefixV6Address4, prefixV6_4, true, pfxvLen128},
661663
}
662664

663-
devices := otgConfig.Devices().Items()
664-
665-
// PrefixConfig flag is set to test the testcases using prefix-list, it will create routes used for prefix-list
666-
if prefixConfig {
667-
for i, peer := range bgpv4Devices {
668-
bgp := devices[i].Bgp().SetRouterId(peer.neighborip)
669-
iDut1Ipv4 := devices[i].Ethernets().Items()[0].Ipv4Addresses().Items()[0]
670-
iDut1Bgp := bgp.SetRouterId(iDut1Ipv4.Address())
665+
for i, peer := range bgpv4Devices {
666+
bgp := peer.device.Bgp().SetRouterId(peer.neighborip)
667+
iDut1Ipv4 := peer.device.Ethernets().Items()[0].Ipv4Addresses().Items()[0]
668+
iDut1Bgp := bgp.SetRouterId(iDut1Ipv4.Address())
671669

672-
iDut1Bgp4Peer := iDut1Bgp.Ipv4Interfaces().Add().SetIpv4Name(iDut1Ipv4.Name()).Peers().Add().SetName(peer.name + ".BGP4.peer")
673-
iDut1Bgp4Peer.SetPeerAddress(iDut1Ipv4.Gateway()).SetAsNumber(peer.as).SetAsType(gosnappi.BgpV4PeerAsType.EBGP)
674-
// configure Ipv4 Network Group
675-
bgp4Peer := devices[i].Bgp().Ipv4Interfaces().Items()[0].Peers().Items()[0]
670+
iDut1Bgp4Peer := iDut1Bgp.Ipv4Interfaces().Add().SetIpv4Name(iDut1Ipv4.Name()).Peers().Add().SetName(peer.name + ".BGP4.peer")
671+
iDut1Bgp4Peer.SetPeerAddress(iDut1Ipv4.Gateway()).SetAsNumber(peer.as).SetAsType(gosnappi.BgpV4PeerAsType.EBGP)
672+
// configure Ipv4 Network Group
673+
bgp4Peer := peer.device.Bgp().Ipv4Interfaces().Items()[0].Peers().Items()[0]
676674

675+
// PrefixConfig flag is set to test the testcases using prefix-list, it will create routes used for prefix-list
676+
if prefixConfig {
677677
// Configure IPv4 Network group with Source Prefix List
678678
netV4_2 := bgp4Peer.V4Routes().Add().SetName(fmt.Sprintf("v4-bgpNetSrc-devSrc%d-2", i+1))
679679
netV4_2.Addresses().Add().SetAddress(prfxListSrcIpv4List[i]).SetPrefix(uint32(prfxListSrcSubnetList[i])).SetCount(peerCountSrcPrefix)
680680

681681
// Configure IPv4 Network group with Destination Prefix List
682682
netV4_3 := bgp4Peer.V4Routes().Add().SetName(fmt.Sprintf("v4-bgpNetDst-devDst%d-3", i+1))
683683
netV4_3.Addresses().Add().SetAddress(prfxListDstIpv4List[i]).SetPrefix(uint32(prfxListDstSubnet)).SetCount(peerCountDstPrefix)
684+
} else {
685+
for index, prefixIPs := range multiplePrefixV4IPs {
686+
// Configure IPv4 Network group with multiple prefixes
687+
netV4_1 := bgp4Peer.V4Routes().Add().SetName(fmt.Sprintf("v4-bgpNet-dev%d-1-prfx%d", i+1, index+1))
688+
netV4_1.Addresses().Add().SetAddress(prefixIPs.startIP).SetPrefix(prefixIPs.subnet).SetCount(uint32(prefixIPs.count))
689+
}
684690
}
691+
}
685692

686-
for i, peer := range bgpv6Devices {
687-
bgp := devices[i].Bgp().SetRouterId(peer.neighborip)
688-
iDut1Ipv4 := devices[i].Ethernets().Items()[0].Ipv4Addresses().Items()[0]
689-
iDut1Bgp := bgp.SetRouterId(iDut1Ipv4.Address())
690-
691-
// eBGP v6 session on OTG Port.
692-
iDut1Ipv6 := devices[i].Ethernets().Items()[0].Ipv6Addresses().Items()[0]
693-
iDut1Bgp6Peer := iDut1Bgp.Ipv6Interfaces().Add().SetIpv6Name(iDut1Ipv6.Name()).Peers().Add().SetName(peer.name + ".BGP6.peer")
694-
iDut1Bgp6Peer.SetPeerAddress(iDut1Ipv6.Gateway()).SetAsNumber(peer.as).SetAsType(gosnappi.BgpV6PeerAsType.EBGP)
695-
iDut1Bgp6Peer.LearnedInformationFilter().SetUnicastIpv6Prefix(true)
693+
for i, peer := range bgpv6Devices {
694+
bgp := peer.device.Bgp().SetRouterId(peer.neighborip)
695+
iDut1Ipv4 := peer.device.Ethernets().Items()[0].Ipv4Addresses().Items()[0]
696+
iDut1Bgp := bgp.SetRouterId(iDut1Ipv4.Address())
696697

697-
// configure Ipv6 Network Group
698-
bgp6Peer := devices[i].Bgp().Ipv6Interfaces().Items()[0].Peers().Items()[0]
698+
// eBGP v6 session on OTG Port.
699+
iDut1Ipv6 := peer.device.Ethernets().Items()[0].Ipv6Addresses().Items()[0]
700+
iDut1Bgp6Peer := iDut1Bgp.Ipv6Interfaces().Add().SetIpv6Name(iDut1Ipv6.Name()).Peers().Add().SetName(peer.name + ".BGP6.peer")
701+
iDut1Bgp6Peer.SetPeerAddress(iDut1Ipv6.Gateway()).SetAsNumber(peer.as).SetAsType(gosnappi.BgpV6PeerAsType.EBGP)
702+
iDut1Bgp6Peer.LearnedInformationFilter().SetUnicastIpv6Prefix(true)
699703

704+
// configure Ipv6 Network Group
705+
bgp6Peer := peer.device.Bgp().Ipv6Interfaces().Items()[0].Peers().Items()[0]
706+
if prefixConfig {
700707
// Configure IPv6 Network group with Source Prefix List
701708
netV6_2 := bgp6Peer.V6Routes().Add().SetName(fmt.Sprintf("v6-bgpNetSrc-devSrc%d-2", i+1))
702709
netV6_2.Addresses().Add().SetAddress(prfxListSrcIpv6List[i]).SetPrefix(prfxListSrcV6SubnetList[i]).SetCount(peerCountSrcPrefix)
703710

704711
// Configure IPv6 Network group with Destination Prefix List
705712
netV6_3 := bgp6Peer.V6Routes().Add().SetName(fmt.Sprintf("v6-bgpNetDst-devDst%d-3", i+1))
706713
netV6_3.Addresses().Add().SetAddress(prfxListDstIpv6List[i]).SetPrefix(uint32(prfxListDstV6Subnet)).SetCount(peerCountDstPrefix)
707-
}
708-
} else {
709-
for i, peer := range bgpv4Devices {
710-
bgp := devices[i].Bgp().SetRouterId(peer.neighborip)
711-
iDut1Ipv4 := devices[i].Ethernets().Items()[0].Ipv4Addresses().Items()[0]
712-
iDut1Bgp := bgp.SetRouterId(iDut1Ipv4.Address())
713-
714-
iDut1Bgp4Peer := iDut1Bgp.Ipv4Interfaces().Add().SetIpv4Name(iDut1Ipv4.Name()).Peers().Add().SetName(peer.name + ".BGP4.peer")
715-
iDut1Bgp4Peer.SetPeerAddress(iDut1Ipv4.Gateway()).SetAsNumber(peer.as).SetAsType(gosnappi.BgpV4PeerAsType.EBGP)
716-
// configure Ipv4 Network Group
717-
bgp4Peer := devices[i].Bgp().Ipv4Interfaces().Items()[0].Peers().Items()[0]
718-
719-
for index, prefixIPs := range multiplePrefixV4IPs {
720-
// Configure IPv4 Network group with multiple prefixes
721-
netV4_1 := bgp4Peer.V4Routes().Add().SetName(fmt.Sprintf("v4-bgpNet-dev%d-1-prfx%d", i+1, index+1))
722-
netV4_1.Addresses().Add().SetAddress(prefixIPs.startIP).SetPrefix(prefixIPs.subnet).SetCount(uint32(prefixIPs.count))
723-
}
724-
725-
}
726-
727-
for i, peer := range bgpv6Devices {
728-
bgp := devices[i].Bgp().SetRouterId(peer.neighborip)
729-
iDut1Ipv4 := devices[i].Ethernets().Items()[0].Ipv4Addresses().Items()[0]
730-
iDut1Bgp := bgp.SetRouterId(iDut1Ipv4.Address())
731-
732-
// eBGP v6 session on OTG Port.
733-
iDut1Ipv6 := devices[i].Ethernets().Items()[0].Ipv6Addresses().Items()[0]
734-
iDut1Bgp6Peer := iDut1Bgp.Ipv6Interfaces().Add().SetIpv6Name(iDut1Ipv6.Name()).Peers().Add().SetName(peer.name + ".BGP6.peer")
735-
iDut1Bgp6Peer.SetPeerAddress(iDut1Ipv6.Gateway()).SetAsNumber(peer.as).SetAsType(gosnappi.BgpV6PeerAsType.EBGP)
736-
iDut1Bgp6Peer.LearnedInformationFilter().SetUnicastIpv6Prefix(true)
737-
738-
// configure Ipv6 Network Group
739-
bgp6Peer := devices[i].Bgp().Ipv6Interfaces().Items()[0].Peers().Items()[0]
740-
714+
} else {
741715
for index, prefixIPs := range multiplePrefixV6IPs {
742716
// Configure IPv6 Network group with multiple prefixes
743717
netV6 := bgp6Peer.V6Routes().Add().SetName(fmt.Sprintf("v6-bgpNet-dev%d-1-prfx%d", i+1, index+1))
744718
netV6.Addresses().Add().SetAddress(prefixIPs.startIP).SetPrefix(prefixIPs.subnet).SetCount(uint32(prefixIPs.count))
745719
}
746720
}
747-
748721
}
749722

750723
return otgConfig
@@ -1086,7 +1059,7 @@ func testv4AddressScale(t *testing.T, dut *ondatra.DUTDevice, ate *ondatra.ATEDe
10861059

10871060
otgConfig.PushConfig(t, config)
10881061
otgConfig.StartProtocols(t)
1089-
time.Sleep(time.Second * 300)
1062+
time.Sleep(time.Second * 30)
10901063

10911064
t.Logf("Verify OTG BGP sessions up")
10921065
cfgplugins.VerifyOTGBGPEstablished(t, ate, 6*time.Minute)
@@ -1318,7 +1291,7 @@ func testv6AddressScale(t *testing.T, dut *ondatra.DUTDevice, ate *ondatra.ATEDe
13181291

13191292
otgConfig.PushConfig(t, config)
13201293
otgConfig.StartProtocols(t)
1321-
time.Sleep(time.Second * 120)
1294+
time.Sleep(time.Second * 30)
13221295

13231296
t.Logf("Verify OTG BGP sessions up")
13241297
cfgplugins.VerifyOTGBGPEstablished(t, ate, 6*time.Minute)
@@ -1626,7 +1599,7 @@ func testv6PrefixList(t *testing.T, dut *ondatra.DUTDevice, ate *ondatra.ATEDevi
16261599
otgConfig.PushConfig(t, configV6)
16271600

16281601
otgConfig.StartProtocols(t)
1629-
time.Sleep(time.Second * 120)
1602+
time.Sleep(time.Second * 30)
16301603

16311604
t.Logf("Verify OTG BGP sessions up")
16321605
cfgplugins.VerifyOTGBGPEstablished(t, ate, 6*time.Minute)

feature/interface/otg_tests/telemetry_interface_carrier_transitions_test/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# FNT: Carrier Transitions Test
1+
# gNMI-1.26: Carrier Transitions Test
22

33
## Summary
44

@@ -52,7 +52,7 @@ port roles:
5252
* Verify that the counter values do not increase by more than 100 between samples.
5353
* Verify that the final value is greater than the initial value.
5454

55-
#### [TODO: b/391432919] FNT-1 - Admin Flap Test
55+
#### [TODO: b/391432919] gNMI-1.26.1 - Admin Flap Test
5656
1. Get Initial Counters: Read the values of:
5757
* `/interfaces/interface[name=dutPort1]/state/counters/interface-transitions`
5858
* `/interfaces/interface[name=dutPort1]/state/counters/link-transitions`
@@ -76,7 +76,7 @@ port roles:
7676
* `interface_transitions_final` must be equal to `interface_transitions_initial + 2`.
7777
* `link_transitions_final` must not change from `link_transitions_initial`.
7878

79-
#### [TODO: b/391432919] FNT-2 - ATE Port Flap Test
79+
#### [TODO: b/391432919] gNMI-1.26.2 - ATE Port Flap Test
8080
1. Setup: Ensure the interface is configured as per the basic setup and is
8181
operationally UP.
8282
2. Get Initial Counters: Read the values of:

feature/interface/otg_tests/telemetry_interface_carrier_transitions_test/metadata.textproto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
# proto-message: Metadata
33

44
uuid: "f43d95b6-438c-4128-801e-043e426b55cd"
5-
plan_id: "FNT"
5+
plan_id: "gNMI-1.26"
66
description: "Carrier Transitions Test"
77
testbed: TESTBED_DUT_ATE_2LINKS

testregistry.textproto

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2228,3 +2228,15 @@ test: {
22282228
readme: "https://github.com/openconfig/featureprofiles/blob/main/feature/ha_groups/tests/telemetry_high_availability_test/README.md"
22292229
exec: ""
22302230
}
2231+
test: {
2232+
id: "TE-1.2"
2233+
description: "My Station MAC"
2234+
readme: "https://github.com/openconfig/featureprofiles/blob/main/feature/interface/my_station_mac/otg_tests/my_station_mac_test/README.md"
2235+
exec: "https://github.com/openconfig/featureprofiles/blob/main/feature/interface/my_station_mac/otg_tests/my_station_mac_test/my_station_mac_test.go"
2236+
}
2237+
test: {
2238+
id: "gNMI-1.26"
2239+
description: "Carrier Transitions Test"
2240+
readme: "https://github.com/openconfig/featureprofiles/blob/main/feature/interface/otg_tests/telemetry_interface_carrier_transitions_test/README.md"
2241+
exec: "https://github.com/openconfig/featureprofiles/blob/main/feature/interface/otg_tests/telemetry_interface_carrier_transitions_test/carrier_transitions_test.go"
2242+
}

0 commit comments

Comments
 (0)