-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RT-1.28: Fixed script with added deviations (#3567)
* RT-1.28: Fixed script with additional deviations - Added new deviation EnableTableConnections & other required deviation. - Used `bgp_community_member_is_a_string: true` with ref to https://partnerissuetracker.corp.google.com/issues/376799780#comment2 - Match-Community-Set under bgp-conditions configuration moved under policy-defitions as its configuration is deprecated under bgp-defined-sets. - Under nonMatchingCommunityRoutePolicy(both v4 & v6) changed gnmi.Replace to gnmi.Update to avoid precondition error of failing to delete AllowAll route-policy. "This code is a Contribution to the OpenConfig Feature Profiles project ("Work") made under the Google Software Grant and Corporate Contributor License Agreement ("CLA") and governed by the Apache License 2.0. No other rights or licenses in or to any of Nokia's intellectual property are granted for any other purpose. This code is provided on an "as is" basis without any warranties of any kind." * -Removed comment "This code is a Contribution to the OpenConfig Feature Profiles project ("Work") made under the Google Software Grant and Corporate Contributor License Agreement ("CLA") and governed by the Apache License 2.0. No other rights or licenses in or to any of Nokia's intellectual property are granted for any other purpose. This code is provided on an "as is" basis without any warranties of any kind." * -Adding changes to deviations.go, metadata.proto & metadata.pb.go for EnableTableConnections. "This code is a Contribution to the OpenConfig Feature Profiles project ("Work") made under the Google Software Grant and Corporate Contributor License Agreement ("CLA") and governed by the Apache License 2.0. No other rights or licenses in or to any of Nokia's intellectual property are granted for any other purpose. This code is provided on an "as is" basis without any warranties of any kind." * -Resolving conflicts "This code is a Contribution to the OpenConfig Feature Profiles project ("Work") made under the Google Software Grant and Corporate Contributor License Agreement ("CLA") and governed by the Apache License 2.0. No other rights or licenses in or to any of Nokia's intellectual property are granted for any other purpose. This code is provided on an "as is" basis without any warranties of any kind." * Revert "-Resolving conflicts" This reverts commit f41b14a. * -Defined & calling `ConfigEnableTbNative` function from fptest. "This code is a Contribution to the OpenConfig Feature Profiles project ("Work") made under the Google Software Grant and Corporate Contributor License Agreement ("CLA") and governed by the Apache License 2.0. No other rights or licenses in or to any of Nokia's intellectual property are granted for any other purpose. This code is provided on an "as is" basis without any warranties of any kind." * -updated deviation comment "This code is a Contribution to the OpenConfig Feature Profiles project ("Work") made under the Google Software Grant and Corporate Contributor License Agreement ("CLA") and governed by the Apache License 2.0. No other rights or licenses in or to any of Nokia's intellectual property are granted for any other purpose. This code is provided on an "as is" basis without any warranties of any kind." * Fixed tableconnection with comment * -Removing extra space in deviations.go "This code is a Contribution to the OpenConfig Feature Profiles project ("Work") made under the Google Software Grant and Corporate Contributor License Agreement ("CLA") and governed by the Apache License 2.0. No other rights or licenses in or to any of Nokia's intellectual property are granted for any other purpose. This code is provided on an "as is" basis without any warranties of any kind." --------- Co-authored-by: trathod <[email protected]> Co-authored-by: Tushar Rathod <[email protected]>
- Loading branch information
1 parent
d63d627
commit 3a3d098
Showing
5 changed files
with
115 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// Copyright 2022 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package fptest | ||
|
||
import ( | ||
"context" | ||
"encoding/json" | ||
"testing" | ||
|
||
gpb "github.com/openconfig/gnmi/proto/gnmi" | ||
"github.com/openconfig/ondatra" | ||
) | ||
|
||
// ConfigEnableTbNative enables admin-state of table-connections in native mode. | ||
func ConfigEnableTbNative(t testing.TB, d *ondatra.DUTDevice) { | ||
t.Helper() | ||
state := "enable" | ||
switch d.Vendor() { | ||
case ondatra.NOKIA: | ||
adminEnable, err := json.Marshal(state) | ||
if err != nil { | ||
t.Fatalf("Error with json Marshal: %v", err) | ||
} | ||
|
||
gpbSetRequest := &gpb.SetRequest{ | ||
Prefix: &gpb.Path{ | ||
Origin: "native", | ||
}, | ||
Update: []*gpb.Update{ | ||
{ | ||
Path: &gpb.Path{ | ||
Elem: []*gpb.PathElem{ | ||
{Name: "network-instance", Key: map[string]string{"name": "DEFAULT"}}, | ||
{Name: "table-connections"}, | ||
{Name: "admin-state"}, | ||
}, | ||
}, | ||
Val: &gpb.TypedValue{ | ||
Value: &gpb.TypedValue_JsonIetfVal{ | ||
JsonIetfVal: adminEnable, | ||
}, | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
gnmiClient := d.RawAPIs().GNMI(t) | ||
if _, err := gnmiClient.Set(context.Background(), gpbSetRequest); err != nil { | ||
t.Fatalf("Unexpected error updating SRL static-route tag-set: %v", err) | ||
} | ||
default: | ||
t.Fatalf("Unsupported vendor %s for deviation 'EnableTableConnections'", d.Vendor()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters