Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

certz1.1/1.2 #3684

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fixed the TODOs ,notations and comments
priyacj committed Jan 16, 2025
commit dedd6859e36f6fd235a2804c4098b20f78c53dc0
2 changes: 2 additions & 0 deletions feature/security/gnsi/certz/test_data/README.md
Original file line number Diff line number Diff line change
@@ -14,6 +14,8 @@ Creation of test data for use in TLS tests.
* server_cert.cnf/server_cert_ext.cnf - server openssl profile configuration
* client_cert.cnf/client_cert_ext.cnf - client openssl profile configuration

## TODO:Perform this for the permutations of 20000 CA trust_bundle configurations

Each CA set includes, for both RSA and ECDSA signature types:
* CA key
* CA public certificate
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@ identification information. The client certificate should have a
SPIFFE Idenitifier embedded in it to be used as the identifier of
the client to the server.


## Baseline Setup

### Input Args
@@ -42,8 +43,11 @@ gRPC service.

Perform this for both RSA and ECDSA signed CA bundles and
certificates.
Perform this for the permutations of 1, 2, 10, 1000, 20000 CA
trust_bundle configurations: (## indicates the 1, 2, 10, 1000, 20000 CA testdata)

## TODO:Perform this for the permutations of 20000 CA
## TODO:trust_bundle configurations: ( 20000 CA testdata)
Perform this for the permutations of 1, 2, 10, 1000 CA
trust_bundle configurations: (## indicates the 1, 2, 10, 1000 CA testdata)

1) Load the correct key-type trust bundle onto the device and client system:
ca-##/trust_bundle_##_rsa.pem
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
package client_certificates_test

import (
context "context"
"context"
"crypto/tls"
"crypto/x509"
"os"
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@
package setupservice

import (
context "context"
"context"
"crypto/tls"
"crypto/x509"
"encoding/pem"
@@ -147,16 +147,20 @@ func CreateCertzChain(t *testing.T, certData CertificateChainRequest) certzpb.Ce
t.Fatalf("Error reading Server Key file at: %v with error: %v", certData.ServerKeyFile, err)
}
return certzpb.CertificateChain{Certificate: &certzpb.Certificate{
Type: certzpb.CertificateType_CERTIFICATE_TYPE_X509,
Encoding: certzpb.CertificateEncoding_CERTIFICATE_ENCODING_PEM,
Certificate: serverCertContent,
PrivateKey: serverKeyContent}, Parent: nil}
Type: certzpb.CertificateType_CERTIFICATE_TYPE_X509,
Encoding: certzpb.CertificateEncoding_CERTIFICATE_ENCODING_PEM,
Certificate: serverCertContent,
PrivateKey: serverKeyContent,
PrivateKeyType: &certzpb.Certificate_RawPrivateKey{RawPrivateKey: serverKeyContent},
CertificateType: &certzpb.Certificate_RawCertificate{RawCertificate: serverCertContent}}, Parent: nil}
}
return certzpb.CertificateChain{Certificate: &certzpb.Certificate{
Type: certzpb.CertificateType_CERTIFICATE_TYPE_X509,
Encoding: certzpb.CertificateEncoding_CERTIFICATE_ENCODING_PEM,
Certificate: serverCertContent,
PrivateKey: nil}, Parent: nil}
Type: certzpb.CertificateType_CERTIFICATE_TYPE_X509,
Encoding: certzpb.CertificateEncoding_CERTIFICATE_ENCODING_PEM,
Certificate: serverCertContent,
PrivateKey: nil,
PrivateKeyType: nil,
CertificateType: &certzpb.Certificate_RawCertificate{RawCertificate: serverCertContent}}, Parent: nil}

case EntityTypeTrustBundle:
if len(certData.TrustBundleFile) == 0 {

Unchanged files with check annotations Beta

}
// ConfigureOtgInterface configures the Ethernet for the LAG or subinterface.
func ConfigureOtgInterface(t *testing.T, top gosnappi.Config, intf *InterfaceProperties, a *Port) {

Check failure on line 96 in internal/otg_helpers/otg_config_helpers/otgconfighelpers.go

GitHub Actions / Static Analysis

parameter 't' seems to be unused, consider removing or renaming it as _
dev := top.Devices().Add().SetName(intf.Name + ".Dev")
eth := dev.Ethernets().Add().SetName(intf.Name + ".Eth").SetMac(intf.Mac)
if a.Islag {
"github.com/openconfig/ondatra"
)
// DeviationCiscoRoutingPolicyBGPActionSetCommunity is used as an alternative to

Check failure on line 25 in internal/cfgplugins/bgp_policy.go

GitHub Actions / Static Analysis

comment on exported function DeviationCiscoRoutingPolicyBGPActionSetMed should be of the form "DeviationCiscoRoutingPolicyBGPActionSetMed ..."
// /routing-policy/policy-definitions/policy-definition/statements/statement/actions/bgp-actions/config/set-med.
// This deviation implements CLI to perform the equivalent function.
func DeviationCiscoRoutingPolicyBGPActionSetMed(t *testing.T, dut *ondatra.DUTDevice, policyName string, statement string, prefixSetName string, setMed int, origin string) {
t.Fatalf("Cannot copy baseConfig: %v", err)
}
copy := o.(*oc.Root)

Check failure on line 175 in internal/fptest/config.go

GitHub Actions / Static Analysis

redefinition of the built-in function copy
if *setEthernetFromState {
setEthernetFromBase(t, config, copy)