Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions feature/gnoi/os/tests/osinstall/metadata.textproto
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,7 @@ platform_exceptions: {
deviations: {
default_network_instance: "default"
interface_enabled: true
missing_value_for_defaults: true
bgp_default_vrf_ipv4_unicast_afi_safi_enabled_leaf_missing: "true"
}
}
88 changes: 71 additions & 17 deletions feature/gnoi/os/tests/osinstall/osinstall_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"fmt"
"io"
"os"
"reflect"
"strings"
"testing"
"time"
Expand Down Expand Up @@ -449,15 +448,34 @@ func TestPushAndVerifyInterfaceConfig(t *testing.T) {
}

t.Logf("Fetch interface config from the DUT using Get RPC and verify it matches with the config that was pushed earlier")
if val, present := gnmi.LookupConfig(t, dut, dc).Val(); present {
if reflect.DeepEqual(val, in) {
t.Logf("Interface config Want and Got matched")
fptest.LogQuery(t, fmt.Sprintf("%s from Get", dutPort), dc, val)
} else {
t.Errorf("Config %v Get() value not matching with what was Set()", dc)
intfPath := gnmi.OC().Interface(dutPortName)
if got := gnmi.Get(t, dut, intfPath.Description().Config()); got != dutAttrs.Desc {
t.Errorf("Interface %v description: got %v, want %v", dutPortName, got, dutAttrs.Desc)
}
if got := gnmi.Get(t, dut, intfPath.Type().Config()); got != oc.IETFInterfaces_InterfaceType_ethernetCsmacd {
t.Errorf("Interface %v type: got %v, want ethernetCsmacd", dutPortName, got)
}
if deviations.InterfaceEnabled(dut) {
if got, present := gnmi.LookupConfig(t, dut, intfPath.Enabled().Config()).Val(); !present {
if !deviations.MissingValueForDefaults(dut) {
t.Errorf("Interface %v enabled: leaf absent, want true", dutPortName)
}
} else if !got {
t.Errorf("Interface %v enabled: got false, want true", dutPortName)
}
}
Comment thread
sriram-arista marked this conversation as resolved.
subPath := intfPath.Subinterface(0).Ipv4()
if got := gnmi.Get(t, dut, subPath.Address(dutAttrs.IPv4).PrefixLength().Config()); got != dutAttrs.IPv4Len {
t.Errorf("Interface %v subinterface 0 IPv4 prefix-length: got %v, want %v", dutPortName, got, dutAttrs.IPv4Len)
}
if deviations.InterfaceEnabled(dut) && !deviations.IPv4MissingEnabled(dut) {
if got, present := gnmi.LookupConfig(t, dut, subPath.Enabled().Config()).Val(); !present {
if !deviations.MissingValueForDefaults(dut) {
t.Errorf("Interface %v subinterface 0 IPv4 enabled: leaf absent, want true", dutPortName)
}
} else if !got {
t.Errorf("Interface %v subinterface 0 IPv4 enabled: got false, want true", dutPortName)
}
} else {
t.Errorf("Config %v Get() failed", dc)
}
Comment thread
sriram-arista marked this conversation as resolved.
}

Expand Down Expand Up @@ -495,15 +513,51 @@ func TestPushAndVerifyBGPConfig(t *testing.T) {
gnmi.Replace(t, dut, dutConfPath.Config(), dutConf)

t.Logf("Fetch BGP config from the DUT using Get RPC and verify it matches with the config that was pushed earlier")
if val, present := gnmi.LookupConfig(t, dut, dutConfPath.Config()).Val(); present {
if reflect.DeepEqual(val, dutConf) {
t.Logf("BGP config Want and Got matched")
fptest.LogQuery(t, "BGP fetched from DUT using Get()", dutConfPath.Config(), val)
} else {
t.Errorf("Config %v Get() value not matching with what was Set()", dutConfPath.Config())
bgpPath := dutConfPath.Bgp()
nbr := bgpNbr1

// Global
if got := gnmi.Get(t, dut, bgpPath.Global().As().Config()); got != uint32(bgpGlobalAttrs.dutAS) {
t.Errorf("BGP global AS: got %v, want %v", got, bgpGlobalAttrs.dutAS)
}
if got := gnmi.Get(t, dut, bgpPath.Global().RouterId().Config()); got != dutSrc.IPv4 {
t.Errorf("BGP global router-id: got %v, want %v", got, dutSrc.IPv4)
}
afiSafiPath := bgpPath.Global().AfiSafi(oc.BgpTypes_AFI_SAFI_TYPE_IPV4_UNICAST)
implicitValue := deviations.BgpDefaultVrfIPv4UnicastAfiSafiEnabledLeafMissing(dut)
if got, present := gnmi.LookupConfig(t, dut, afiSafiPath.Enabled().Config()).Val(); !present {
if implicitValue == "" {
t.Errorf("BGP global afi-safi IPV4_UNICAST enabled: leaf absent, want true")
} else if implicitValue != "true" {
t.Errorf("BGP global afi-safi IPV4_UNICAST enabled: leaf absent, implicit value is false, want true")
}
} else {
t.Errorf("Config %v Get() failed", dutConfPath.Config())
} else if !got {
t.Errorf("BGP global afi-safi IPV4_UNICAST enabled: got false, want true")
}
Comment thread
sriram-arista marked this conversation as resolved.

// PeerGroup
pgPath := bgpPath.PeerGroup(bgpGlobalAttrs.peerGrpNamev4)
if got := gnmi.Get(t, dut, pgPath.PeerAs().Config()); got != uint32(bgpGlobalAttrs.ateAS) {
t.Errorf("BGP peer-group %v peer-as: got %v, want %v", bgpGlobalAttrs.peerGrpNamev4, got, bgpGlobalAttrs.ateAS)
}
if got := gnmi.Get(t, dut, pgPath.PeerGroupName().Config()); got != bgpGlobalAttrs.peerGrpNamev4 {
t.Errorf("BGP peer-group name: got %v, want %v", got, bgpGlobalAttrs.peerGrpNamev4)
}

// Neighbor
nbrPath := bgpPath.Neighbor(nbr.neighborip)
if got := gnmi.Get(t, dut, nbrPath.PeerAs().Config()); got != uint32(nbr.peerAs) {
t.Errorf("BGP neighbor %v peer-as: got %v, want %v", nbr.neighborip, got, nbr.peerAs)
}
if got := gnmi.Get(t, dut, nbrPath.PeerGroup().Config()); got != bgpGlobalAttrs.peerGrpNamev4 {
t.Errorf("BGP neighbor %v peer-group: got %v, want %v", nbr.neighborip, got, bgpGlobalAttrs.peerGrpNamev4)
}
if got, present := gnmi.LookupConfig(t, dut, nbrPath.Enabled().Config()).Val(); !present {
if !deviations.MissingValueForDefaults(dut) {
t.Errorf("BGP neighbor %v enabled: leaf absent, want true", nbr.neighborip)
}
} else if !got {
t.Errorf("BGP neighbor %v enabled: got false, want true", nbr.neighborip)
}
}

Expand Down
8 changes: 8 additions & 0 deletions internal/deviations/deviations.go
Original file line number Diff line number Diff line change
Expand Up @@ -1693,6 +1693,14 @@ func MatchAsPathSetUnsupported(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetMatchAsPathSetUnsupported()
}

// BgpDefaultVrfIPv4UnicastAfiSafiEnabledLeafMissing returns the implicit value to assume for the
// enabled leaf under bgp/global/afi-safis/afi-safi[IPV4_UNICAST] config in the default VRF when
// it is absent from the device response. An empty string means the deviation is not set.
// Arista: https://issuetracker.google.com/493611623
func BgpDefaultVrfIPv4UnicastAfiSafiEnabledLeafMissing(dut *ondatra.DUTDevice) string {
return lookupDUTDeviations(dut).GetBgpDefaultVrfIpv4UnicastAfiSafiEnabledLeafMissing()
}
Comment thread
sriram-arista marked this conversation as resolved.

// SameAfiSafiAndPeergroupPoliciesUnsupported returns true if configuring same apply-policy under peer-group and peer-group/afi-safi is unsupported
func SameAfiSafiAndPeergroupPoliciesUnsupported(dut *ondatra.DUTDevice) bool {
return lookupDUTDeviations(dut).GetSameAfiSafiAndPeergroupPoliciesUnsupported()
Expand Down
5 changes: 5 additions & 0 deletions proto/metadata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1289,6 +1289,11 @@ message Metadata {
// Cisco: https://partnerissuetracker.corp.google.com/issues/429166378
string fabric_ft = 412;

// Device does not return the enabled leaf under bgp/global/afi-safis/afi-safi[IPV4_UNICAST]
// config in the default VRF; the leaf is implicitly true when absent.
// Arista: https://issuetracker.google.com/493611623
string bgp_default_vrf_ipv4_unicast_afi_safi_enabled_leaf_missing = 413;

// Reserved field numbers and identifiers.
reserved 84, 9, 28, 20, 38, 43, 90, 97, 55, 89, 19, 36, 35, 40, 113, 131, 141, 173, 234, 254, 231, 300, 241, 49;
}
Expand Down
26 changes: 19 additions & 7 deletions proto/metadata_go_proto/metadata.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading