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

CERTZ2.1 server_certificates #3313

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open

Conversation

priyacj
Copy link

@priyacj priyacj commented Jul 19, 2024

CERTZ2.1 server_certificates testcase
CERTZ2.2 server_certificates testcase

@priyacj priyacj requested review from a team as code owners July 19, 2024 19:23
@OpenConfigBot
Copy link

OpenConfigBot commented Jul 19, 2024

Pull Request Functional Test Report for #3313 / d4c3a84

Virtual Devices

Device Test Test Documentation Job Raw Log
Arista cEOS status
CERTZ-2: Server Certificate
Cisco 8000E status
CERTZ-2: Server Certificate
Cisco XRd status
CERTZ-2: Server Certificate
Juniper ncPTX status
CERTZ-2: Server Certificate
Nokia SR Linux status
CERTZ-2: Server Certificate
Openconfig Lemming status
CERTZ-2: Server Certificate

Hardware Devices

Device Test Test Documentation Raw Log
Arista 7808 status
CERTZ-2: Server Certificate
Cisco 8808 status
CERTZ-2: Server Certificate
Juniper PTX10008 status
CERTZ-2: Server Certificate
Nokia 7250 IXR-10e status
CERTZ-2: Server Certificate

Help

@coveralls
Copy link

coveralls commented Jul 19, 2024

Pull Request Test Coverage Report for Build 11444866423

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 55.268%

Totals Coverage Status
Change from base Build 11410654670: 0.0%
Covered Lines: 1983
Relevant Lines: 3588

💛 - Coveralls

}
rotateResponse := &certzpb.RotateCertificateResponse{}
for i := 0; i < 20; i++ {
rotateResponse, err = rotateRequestClient.Recv()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recv here is blocking -- so you don't need to do this. If you're wanting something like a maximum wait time here you need to do something like having a goroutine that sits calling Recv, and one that subsequently cancels it after a timeout. An example is shown below.

https://go.dev/play/p/eFM5QqcM6Jd

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did this comment make sense, please let me know if you'd like to discuss it further.

@robshakir
Copy link
Contributor

Thanks for this test case -- it looks to cover the Certz tests explained. I have a few questions and Go implementation comments.

@robshakir
Copy link
Contributor

/gcbrun

"encoding/pem"
"fmt"

//"io"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove stale unused import?

*creds.UserPass
}

func (r *rpcCredentials) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
func (r *rpcCredentials) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) {
func (r *rpcCredentials) GetRequestMetadata(_ context.Context, _ ...string) (map[string]string, error) {

//a valid check for trust not empty
if len(trust) == 0 {
return &certzpb.CertificateChain{}
} else {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per the static check, you can just change this to:

if len(trust) == 0 {
  return &certzpb.CertificateChain{}
}

<rest of code>

since the else is not adding any new condition.

}

// CertzRotate function to request the client certificate rotation and returns true on successful rotation.
func CertzRotate(t *testing.T, caCert *x509.CertPool, certzClient certzpb.CertzClient, cert tls.Certificate, san, serverAddr, profileID string, entities ...*certzpb.Entity) bool {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are unused arguments for this function -- since this isn't meeting a signature defined elsewhere, please remove the arguments.

}
rotateResponse := &certzpb.RotateCertificateResponse{}
for i := 0; i < 20; i++ {
rotateResponse, err = rotateRequestClient.Recv()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did this comment make sense, please let me know if you'd like to discuss it further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants