google / testrun

A tool to automate verification of network-based device behavior
Apache License 2.0
23 stars 9 forks source link

Fix GAR bug with cert upload #590

Closed jboddey closed 1 month ago

jboddey commented 2 months ago

When the user uploads a cert and an error occurs, the user is informed that a cert with the same name already exists. However, this is not the case, and instead the cert was not the correct format - raising an exception. The logic behind determining the error message for the user was incorrect. This PR aims to fix that by correcting error logic.

New output:

image

jhughesbiot commented 2 months ago

What were the steps to reproduce before this correction? Removing the specific method to raise the Value error from the session introducess a bug to detect duplicate certificates as it now reports the wrong error:

image

Adding ValueError back in corrects this error: image

Are we sure the reported issue was using a bad certificate format and not a duplicate?

jboddey commented 2 months ago

The issue was that duplicate value errors were being thrown so the session was catching it's own error. I've updated the logic and tested the 3 scenarios: filename duplicate, common name duplicate and invalid certificate.