Skip to content

Commit

Permalink
Merge branch 'main' into TUN13
Browse files Browse the repository at this point in the history
  • Loading branch information
charantejag504 authored Apr 29, 2024
2 parents 90940fc + 87f3397 commit 2cd3861
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func configureImportExportAcceptAllBGPPolicy(t *testing.T, dut *ondatra.DUTDevic
func configureImportExportMultifacetMatchActionsBGPPolicy(t *testing.T, dut *ondatra.DUTDevice, ipv4 string, ipv6 string) {
rejectCommunities := []string{"10:1"}
acceptCommunities := []string{"20:1"}
regexCommunities := []string{"^30:.*$"}
regexCommunities := []string{"(^|\\s)30:[0-9]+($|\\s)"}
addCommunitiesRefs := []string{"40:1", "40:2"}
addCommunitiesSetRefsAction := []string{"add-communities"}
setCommunitySetRefs := []string{"add_comm_60", "add_comm_70"}
Expand All @@ -156,7 +156,7 @@ func configureImportExportMultifacetMatchActionsBGPPolicy(t *testing.T, dut *ond
t.Fatalf("AppendNewStatement(%s) failed: %v", callPolicyStatement, err)
}

// Configure regex_community:["^30:.*$"] to match_community_regex statement
// Configure regex_community:["(^|\\s)30:[0-9]+($|\\s)"] to match_community_regex statement
communitySetRegex := rp.GetOrCreateDefinedSets().GetOrCreateBgpDefinedSets().GetOrCreateCommunitySet(regexCommunitySet)

pd2cs1 := []oc.RoutingPolicy_DefinedSets_BgpDefinedSets_CommunitySet_CommunityMember_Union{}
Expand Down
15 changes: 12 additions & 3 deletions feature/system/tests/system_base_test/g_protocol_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import (
"github.com/openconfig/ondatra"
"github.com/openconfig/ondatra/binding/introspect"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

gpb "github.com/openconfig/gnmi/proto/gnmi"
spb "github.com/openconfig/gnoi/system"
Expand Down Expand Up @@ -56,7 +58,7 @@ func TestGNMIClient(t *testing.T) {
dut := ondatra.DUT(t, "dut")
conn := dialConn(t, dut, introspect.GNMI, 9339)
c := gpb.NewGNMIClient(conn)
if _, err := c.Get(context.Background(), &gpb.GetRequest{}); err != nil {
if _, err := c.Get(context.Background(), &gpb.GetRequest{Encoding: gpb.Encoding_JSON_IETF, Path: []*gpb.Path{{Elem: []*gpb.PathElem{}}}}); err != nil {
t.Fatalf("gnmi.Get failed: %v", err)
}
}
Expand All @@ -76,9 +78,16 @@ func TestGNSIClient(t *testing.T) {
dut := ondatra.DUT(t, "dut")
conn := dialConn(t, dut, introspect.GNSI, 9339)
c := authzpb.NewAuthzClient(conn)
if _, err := c.Get(context.Background(), &authzpb.GetRequest{}); err != nil {
t.Fatalf("gnsi.authz.Get failed: %v", err)
rsp, err := c.Get(context.Background(), &authzpb.GetRequest{})
if err != nil {
statusError, _ := status.FromError(err)
if statusError.Code() == codes.FailedPrecondition {
t.Logf("Expected error FAILED_PRECONDITION seen for authz Get Request.")
} else {
t.Errorf("Unexpected error during authz Get Request.")
}
}
t.Logf("gNSI authz get response is %s", rsp)
}

// TestGRIBIClient validates that the DUT listens on standard gRIBI Port.
Expand Down

0 comments on commit 2cd3861

Please sign in to comment.