Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
162 commits
Select commit Hold shift + click to select a range
07ac30d
added certz4.1
priyacj Aug 2, 2024
bc42b9b
fixed the readme under tests
priyacj Aug 2, 2024
aba3b0a
Merge branch 'main' into certz4
priyacj Aug 2, 2024
c300c3f
fixed the metadata.textproto file
priyacj Aug 2, 2024
7d6c344
Merge branch 'openconfig:main' into certz4
priyacj Aug 3, 2024
b7dfda7
Merge branch 'openconfig:main' into certz4
priyacj Aug 14, 2024
8a8ad0e
Merge branch 'openconfig:main' into certz4
priyacj Aug 19, 2024
6a29dfb
Merge branch 'openconfig:main' into certz4
priyacj Aug 20, 2024
2e42b13
Merge branch 'openconfig:main' into certz4
priyacj Aug 23, 2024
53191df
Merge branch 'openconfig:main' into certz4
priyacj Aug 28, 2024
da23136
Merge branch 'openconfig:main' into certz4
priyacj Aug 28, 2024
af659cc
Merge branch 'openconfig:main' into certz4
priyacj Sep 10, 2024
261161a
Merge branch 'openconfig:main' into certz4
priyacj Sep 18, 2024
b8fd96d
Merge branch 'openconfig:main' into certz4
priyacj Sep 21, 2024
73911ba
Merge branch 'openconfig:main' into certz4
priyacj Oct 21, 2024
2a2a1ec
Merge branch 'main' into certz4
priyacj Nov 7, 2024
08ff7e9
Merge branch 'openconfig:main' into certz4
priyacj Nov 14, 2024
ec5b53b
Merge branch 'openconfig:main' into certz4
priyacj Nov 18, 2024
38ddffa
Merge branch 'main' into certz4
priyacj Nov 20, 2024
3297006
fixed the deprecated functions of DialOption
priyacj Nov 20, 2024
d50ba6f
Merge branch 'openconfig:main' into certz4
priyacj Nov 21, 2024
bd4d696
modified trustbundle_test
priyacj Nov 21, 2024
df1a5c1
Merge branch 'openconfig:main' into certz4
priyacj Nov 25, 2024
878802e
fixed the static error
priyacj Nov 25, 2024
0bc32cf
Merge branch 'openconfig:main' into certz4
priyacj Nov 26, 2024
4d2b110
Merge branch 'openconfig:main' into certz4
priyacj Dec 4, 2024
f12dac8
Merge branch 'openconfig:main' into certz4
priyacj Dec 5, 2024
e3100b2
Merge branch 'openconfig:main' into certz4
priyacj Dec 5, 2024
274d5a1
Merge branch 'openconfig:main' into certz4
priyacj Dec 5, 2024
85564f9
Merge branch 'openconfig:main' into certz4
priyacj Dec 12, 2024
cdade39
Merge branch 'openconfig:main' into certz4
priyacj Dec 16, 2024
702811f
Merge branch 'openconfig:main' into certz4
priyacj Dec 19, 2024
abb6b7b
Merge branch 'openconfig:main' into certz4
priyacj Jan 2, 2025
82c56df
Merge branch 'openconfig:main' into certz4
priyacj Jan 3, 2025
14c997e
Merge branch 'openconfig:main' into certz4
priyacj Jan 6, 2025
10cc144
Merge branch 'openconfig:main' into certz4
priyacj Jan 7, 2025
a4b277a
Merge branch 'openconfig:main' into certz4
priyacj Jan 7, 2025
a59aae8
certz4 f:ten care of the feedback comments
priyacj Jan 7, 2025
abf9325
Merge branch 'openconfig:main' into certz4
priyacj Jan 9, 2025
827a639
Merge branch 'openconfig:main' into certz4
priyacj Jan 10, 2025
0001e58
Merge branch 'openconfig:main' into certz4
priyacj Jan 13, 2025
5fd4997
Merge branch 'openconfig:main' into certz4
priyacj Jan 16, 2025
5868780
Merge branch 'openconfig:main' into certz4
priyacj Jan 17, 2025
1f28b2d
Merge branch 'openconfig:main' into certz4
priyacj Jan 23, 2025
760f41f
Merge branch 'openconfig:main' into certz4
priyacj Jan 27, 2025
f526ddf
Merge branch 'main' into certz4
lvaish05 Jan 29, 2025
11cb32a
Merge branch 'openconfig:main' into certz4
priyacj Jan 30, 2025
beffe47
Merge branch 'main' into certz4
lvaish05 Feb 1, 2025
c7e29de
Merge branch 'openconfig:main' into certz4
priyacj Feb 3, 2025
ae649fd
Merge branch 'openconfig:main' into certz4
priyacj Feb 7, 2025
6a6a9da
Merge branch 'openconfig:main' into certz4
priyacj Feb 10, 2025
133beac
Merge branch 'main' into certz4
lvaish05 Feb 11, 2025
b758f08
Merge branch 'openconfig:main' into certz4
priyacj Feb 14, 2025
5c34135
Merge branch 'openconfig:main' into certz4
priyacj Feb 16, 2025
06d6d9a
Merge branch 'main' into certz4
lvaish05 Feb 18, 2025
8a7c48c
Merge branch 'openconfig:main' into certz4
priyacj Feb 20, 2025
465efd8
Merge branch 'main' into certz4
lvaish05 Feb 26, 2025
f49c69d
Merge branch 'openconfig:main' into certz4
priyacj Mar 10, 2025
089dea4
Merge branch 'main' into certz4
lvaish05 Mar 12, 2025
1579892
Merge branch 'openconfig:main' into certz4
priyacj Mar 13, 2025
2928bcf
Merge branch 'main' into certz4
lvaish05 Mar 19, 2025
1f11db1
Merge branch 'openconfig:main' into certz4
priyacj Mar 27, 2025
1be59d1
Merge branch 'main' into certz4
lvaish05 Apr 2, 2025
cee59fd
Merge branch 'openconfig:main' into certz4
priyacj Apr 14, 2025
46dc697
Merge branch 'main' into certz4
lvaish05 Apr 23, 2025
ad78def
Merge branch 'openconfig:main' into certz4
priyacj Apr 29, 2025
1705959
Merge branch 'main' into certz4
lvaish05 Apr 30, 2025
9e4db92
Merge branch 'main' into certz4
lvaish05 May 12, 2025
4379d57
Merge branch 'openconfig:main' into certz4
priyacj May 13, 2025
616ad24
Merge branch 'main' into certz4
lvaish05 Jun 10, 2025
d594a6e
Merge branch 'openconfig:main' into certz4
priyacj Sep 15, 2025
2c59615
Merge branch 'openconfig:main' into certz4
priyacj Sep 21, 2025
c6fbc77
Merge branch 'openconfig:main' into certz4
priyacj Sep 23, 2025
0d80790
Merge branch 'openconfig:main' into certz4
priyacj Sep 26, 2025
9720a5b
Merge branch 'openconfig:main' into certz4
priyacj Sep 29, 2025
d533439
Merge branch 'openconfig:main' into certz4
priyacj Oct 1, 2025
f5d58d2
Merge branch 'openconfig:main' into certz4
priyacj Oct 2, 2025
21c255f
Merge branch 'openconfig:main' into certz4
priyacj Oct 7, 2025
497cc47
Merge branch 'openconfig:main' into certz4
priyacj Oct 7, 2025
55ce46d
Merge branch 'openconfig:main' into certz4
priyacj Oct 8, 2025
2259c95
Merge branch 'openconfig:main' into certz4
priyacj Oct 9, 2025
ca1db6f
Merge branch 'openconfig:main' into certz4
priyacj Oct 10, 2025
9fd9322
Merge branch 'openconfig:main' into certz4
priyacj Oct 10, 2025
7d2e162
Merge branch 'openconfig:main' into certz4
priyacj Oct 13, 2025
3ccf327
Merge branch 'openconfig:main' into certz4
priyacj Oct 13, 2025
e2ee04f
fixed the path of files
priyacj Oct 14, 2025
a6a8bff
Merge branch 'openconfig:main' into certz4
priyacj Oct 14, 2025
c30d329
Merge branch 'openconfig:main' into certz4
priyacj Oct 16, 2025
29974cc
Merge branch 'openconfig:main' into certz4
priyacj Oct 17, 2025
f008a46
Merge branch 'openconfig:main' into certz4
priyacj Oct 21, 2025
09d865b
Merge branch 'openconfig:main' into certz4
priyacj Oct 22, 2025
75616d0
Merge branch 'openconfig:main' into certz4
priyacj Oct 28, 2025
1b6d393
Merge branch 'openconfig:main' into certz4
priyacj Oct 29, 2025
9a655f3
Merge branch 'openconfig:main' into certz4
priyacj Oct 31, 2025
02a7e3a
fixed with the latest feedback comments
priyacj Oct 31, 2025
7cc12b7
Merge branch 'openconfig:main' into certz4
priyacj Oct 31, 2025
2966920
Merge branch 'openconfig:main' into certz4
priyacj Oct 31, 2025
7afe91a
Update README.md
priyacj Oct 31, 2025
644093e
fixed the README path
priyacj Oct 31, 2025
1ac5397
fixed the fmt error
priyacj Oct 31, 2025
6ef9a9c
fixed metadata file
priyacj Oct 31, 2025
19d63ae
Merge branch 'openconfig:main' into certz4
priyacj Nov 3, 2025
c6bf410
Merge branch 'openconfig:main' into certz4
priyacj Nov 4, 2025
193a532
Merge branch 'openconfig:main' into certz4
priyacj Nov 5, 2025
daf44b4
Merge branch 'openconfig:main' into certz4
priyacj Nov 5, 2025
bc07422
Merge branch 'main' into certz4
lvaish05 Nov 6, 2025
c3112bb
Merge branch 'openconfig:main' into certz4
priyacj Nov 7, 2025
e6f0627
Merge branch 'openconfig:main' into certz4
priyacj Nov 10, 2025
b537f78
Merge branch 'openconfig:main' into certz4
priyacj Nov 13, 2025
7e0b49f
Merge branch 'openconfig:main' into certz4
priyacj Nov 19, 2025
4a89776
Merge branch 'openconfig:main' into certz4
priyacj Nov 20, 2025
7aa830a
Merge branch 'openconfig:main' into certz4
priyacj Nov 21, 2025
56af4b1
Merge branch 'openconfig:main' into certz4
priyacj Dec 1, 2025
c333769
Merge branch 'openconfig:main' into certz4
priyacj Dec 8, 2025
93bf990
fixed the go.mod file
priyacj Jan 8, 2026
a1c56b3
Merge branch 'openconfig:main' into certz4
priyacj Jan 13, 2026
a757041
Merge branch 'openconfig:main' into certz4
priyacj Jan 14, 2026
1d2dfb0
Merge branch 'openconfig:main' into certz4
priyacj Jan 16, 2026
6d85f30
Merge branch 'openconfig:main' into certz4
priyacj Jan 20, 2026
25c7a3e
Merge branch 'openconfig:main' into certz4
priyacj Jan 22, 2026
900ea09
Merge branch 'openconfig:main' into certz4
priyacj Jan 23, 2026
afd08b3
Merge branch 'openconfig:main' into certz4
priyacj Jan 26, 2026
6a24e94
Merge branch 'openconfig:main' into certz4
priyacj Jan 31, 2026
5a3f23d
Merge branch 'openconfig:main' into certz4
priyacj Feb 3, 2026
25c3c80
Merge branch 'openconfig:main' into certz4
priyacj Feb 4, 2026
2049593
Merge branch 'openconfig:main' into certz4
priyacj Feb 6, 2026
0deac10
Merge branch 'openconfig:main' into certz4
priyacj Feb 9, 2026
f4aeae2
Merge branch 'openconfig:main' into certz4
priyacj Feb 10, 2026
a5a2413
Merge branch 'openconfig:main' into certz4
priyacj Feb 12, 2026
695f05f
Merge branch 'main' into certz4
priyacj Mar 1, 2026
b7d22f1
Merge branch 'openconfig:main' into certz4
priyacj Mar 2, 2026
a02575f
modified cleanup
priyacj Mar 2, 2026
b2cfa79
added go mod files
priyacj Mar 2, 2026
43c4d86
modified as per certz4.1 given feedback
priyacj Mar 2, 2026
7a8d15c
fixed end of line error in the static check
priyacj Mar 2, 2026
6e66ad4
Merge branch 'main' into certz4
lvaish05 Mar 3, 2026
0dae9fc
Merge branch 'openconfig:main' into certz4
priyacj Mar 9, 2026
9c88828
Merge branch 'main' into certz4
morrowc Mar 11, 2026
f8be609
Merge branch 'openconfig:main' into certz4
priyacj Mar 12, 2026
fff7363
Merge branch 'openconfig:main' into certz4
priyacj Mar 18, 2026
320d8a7
Merge branch 'openconfig:main' into certz4
priyacj Mar 18, 2026
15a4618
Merge branch 'main' into certz4
lvaish05 Mar 23, 2026
58ad7d5
Merge branch 'openconfig:main' into certz4
priyacj Mar 24, 2026
bbb1aeb
Merge branch 'openconfig:main' into certz4
priyacj Mar 30, 2026
a532d06
Merge branch 'openconfig:main' into certz4
priyacj Mar 31, 2026
691e371
Merge branch 'openconfig:main' into certz4
priyacj Apr 13, 2026
eff732b
Merge branch 'openconfig:main' into certz4
priyacj Apr 22, 2026
c249f0f
Merge branch 'openconfig:main' into certz4
priyacj Apr 24, 2026
42752a6
Merge branch 'openconfig:main' into certz4
priyacj Apr 29, 2026
6b70f81
Merge branch 'openconfig:main' into certz4
priyacj May 5, 2026
4fa220d
increased timeout value
priyacj May 5, 2026
1ebe3cb
Uncomment logTime variable in trustbundle_test.go
priyacj May 5, 2026
52917d1
Merge branch 'openconfig:main' into certz4
priyacj May 11, 2026
48b69f4
added delay
priyacj May 13, 2026
35e5bdf
Merge branch 'openconfig:main' into certz4
priyacj May 13, 2026
4c71918
Fix comment typo in setup_service.go
priyacj May 13, 2026
fe4368f
fixed fmterror
priyacj May 13, 2026
d224b5e
Merge branch 'openconfig:main' into certz4
priyacj May 13, 2026
cb2c963
gofmt error fixed
priyacj May 13, 2026
d37b71f
removed logTime
priyacj May 13, 2026
84f7f10
Update feature/gnsi/certz/tests/trust_bundle/trustbundle_test.go
sudhirakondi May 14, 2026
d561294
Merge branch 'main' into certz4
priyacj May 14, 2026
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
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,11 @@ func CertzRotate(ctx context.Context, t *testing.T, newcaCert *x509.CertPool, ce
t.Logf("gNMI config is replaced with new ssl profile %s successfully.", profileID)
time.Sleep(30 * time.Second) //waiting 30s for gnmi config propagation//
}
if scale {
// waiting 180s for large scale certs to propagate after rotate response
t.Logf("STATUS:%s waiting 180s for large-scale 1000certs to propagate", time.Now())
time.Sleep(180 * time.Second)
}
//Verify gNSI service with new TLS credentials in loop with retries before finalize.
if success = VerifyGnsi(t, newcaCert, san, serverAddr, username, password, newclientCert, mismatch); !success {
t.Fatalf("gNSI service RPC did not succeed after rotate. Certz/Rotate failed. FinalizeRequest will not be sent")
Expand Down
53 changes: 26 additions & 27 deletions feature/gnsi/certz/tests/trust_bundle/trustbundle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (

const (
dirPath = "../../test_data/"
timeOutVar time.Duration = 2 * time.Minute
timeOutVar time.Duration = 180 * time.Minute
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The timeout timeOutVar is set to 180 minutes (3 hours). This is extremely long for a script that generates certificates (mk_cas.sh). Given that the corresponding sleep in setup_service.go is 180 seconds, it is highly likely that 180 seconds (or a few minutes) was intended here. A 3-hour timeout can cause CI jobs to hang for a very long time if the script fails or deadlocks.

Suggested change
timeOutVar time.Duration = 180 * time.Minute
timeOutVar time.Duration = 180 * time.Second

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The value is intentional because the script invokes mk_cas.sh to create 20k certs. This generation of certs takes significant amount of time, close to 3 hours.

)

// DUTCredentialer is an interface for getting credentials from a DUT binding.
Expand All @@ -48,7 +48,6 @@ var (
prevClientCertFile string = ""
prevClientKeyFile string = ""
prevTrustBundleFile string = ""
logTime string = time.Now().String() //Timestamp
expectedResult bool = true
)

Expand All @@ -63,37 +62,37 @@ func TestTrustBundleCert(t *testing.T) {
dut := ondatra.DUT(t, "dut")
serverAddr = dut.Name() //returns the device name.
if err := binding.DUTAs(dut.RawAPIs().BindingDUT(), &creds); err != nil {
t.Fatalf("%s:STATUS:Failed to get DUT credentials using binding.DUTAs: %v. The binding for %s must implement the DUTCredentialer interface.", logTime, err, dut.Name())
t.Fatalf("STATUS:Failed to get DUT credentials using binding.DUTAs: %v. The binding for %s must implement the DUTCredentialer interface.", err, dut.Name())
}
username := creds.RPCUsername()
password := creds.RPCPassword()
t.Logf("%s:STATUS:Validation of all services that are using gRPC before certz rotation.", logTime)
t.Logf("%s:STATUS:Validation of all services that are using gRPC before certz rotation.", time.Now().String())
gnmiClient, gnsiC := setup_service.PreInitCheck(context.Background(), t, dut)
//Generate testdata certificates.
t.Logf("%s:Creation of test data.", logTime)
t.Logf("%s:Creation of test data.", time.Now().String())
if err := setup_service.TestdataMakeCleanup(t, dirPath, timeOutVar, "./mk_cas.sh"); err != nil {
t.Logf("%s:STATUS:Generation of testdata certificates failed!: %v", logTime, err)
t.Logf("%s:STATUS:Generation of testdata certificates failed!: %v", time.Now().String(), err)
}
//Create a certz client.
ctx := context.Background()
certzClient := gnsiC.Certz()
t.Logf("%s:STATUS:Precheck:checking baseline sslprofile list.", logTime)
t.Logf("%s:STATUS:Precheck:checking baseline sslprofile list.", time.Now().String())
//Get sslprofile list.
if getResp := setup_service.GetSslProfilelist(ctx, t, certzClient, &certzpb.GetProfileListRequest{}); slices.Contains(getResp.SslProfileIds, testProfile) {
t.Fatalf("%s:STATUS:profileID %s already exists.", logTime, testProfile)
t.Fatalf("%s:STATUS:profileID %s already exists.", time.Now().String(), testProfile)
}
//Add new sslprofileID.
t.Logf("%s:Adding new empty sslprofile ID %s.", logTime, testProfile)
t.Logf("%s:Adding new empty sslprofile ID %s.", time.Now().String(), testProfile)
if addProfileResponse, err := certzClient.AddProfile(ctx, &certzpb.AddProfileRequest{SslProfileId: testProfile}); err != nil {
t.Fatalf("%s:STATUS:Add profile request failed with %v! ", logTime, err)
t.Fatalf("%s:STATUS:Add profile request failed with %v! ", time.Now().String(), err)
} else {
t.Logf("%s:STATUS:Received the AddProfileResponse %v.", logTime, addProfileResponse)
t.Logf("%s:STATUS:Received the AddProfileResponse %v.", time.Now().String(), addProfileResponse)
}
//Get sslprofile list after new sslprofile addition.
if getResp := setup_service.GetSslProfilelist(ctx, t, certzClient, &certzpb.GetProfileListRequest{}); !slices.Contains(getResp.SslProfileIds, testProfile) {
t.Fatalf("%s:STATUS:newly added profileID is not seen.", logTime)
t.Fatalf("%s:STATUS:newly added profileID is not seen.", time.Now().String())
} else {
t.Logf("%s:STATUS:new profileID %s is seen in sslprofile list", logTime, testProfile)
t.Logf("%s:STATUS:new profileID %s is seen in sslprofile list", time.Now().String(), testProfile)
}
cases := []struct {
desc string
Expand Down Expand Up @@ -200,7 +199,7 @@ func TestTrustBundleCert(t *testing.T) {
}
for _, tc := range cases {
t.Run(tc.desc, func(t *testing.T) {
t.Logf("%s:STATUS:Starting test case: %s", logTime, tc.desc)
t.Logf("%s:STATUS:Starting test case: %s", time.Now().String(), tc.desc)
//Read the serverSAN (Subject Alternative Name) from the certificate used for TLS verification.
serverSAN := setup_service.ReadDecodeServerCertificate(t, tc.serverCertFile)
//Build serverCertEntity for the server certificate rotation.
Expand All @@ -212,7 +211,7 @@ func TestTrustBundleCert(t *testing.T) {
//Create a new Cert Pool and add the certs from the trust bundle.
pkcs7certs, pkcs7data, err := setup_service.Loadpkcs7TrustBundle(tc.trustBundleFile)
if err != nil {
t.Fatalf("%s:STATUS:failed to load trust bundle: %v", logTime, err)
t.Fatalf("%s:STATUS:failed to load trust bundle: %v", time.Now().String(), err)
}
newCaCert := x509.NewCertPool()
for _, c := range pkcs7certs {
Expand All @@ -223,18 +222,18 @@ func TestTrustBundleCert(t *testing.T) {
//Load Client certificate.
newClientCert, err := tls.LoadX509KeyPair(tc.clientCertFile, tc.clientKeyFile)
if err != nil {
t.Fatalf("%s:STATUS:Failed to load client cert:%v", logTime, err)
t.Fatalf("%s:STATUS:Failed to load client cert:%v", time.Now().String(), err)
}
if tc.newTLScreds {
t.Logf("%s:STATUS:%s:Creating new TLS credentials for client connection.", logTime, tc.desc)
t.Logf("%s:STATUS:%s:Creating new TLS credentials for client connection.", time.Now().String(), tc.desc)
//Load the prior client keypair for new client TLS credentials.
prevClientCert, err := tls.LoadX509KeyPair(prevClientCertFile, prevClientKeyFile)
if err != nil {
t.Fatalf("%s:STATUS:%s:Failed to load previous client cert: %v", logTime, tc.desc, err)
t.Fatalf("%s:STATUS:%s:Failed to load previous client cert: %v", time.Now().String(), tc.desc, err)
}
oldPkcs7certs, oldPkcs7data, err := setup_service.Loadpkcs7TrustBundle(prevTrustBundleFile)
if err != nil {
t.Fatalf("%s:STATUS:%sFailed to load previous trust bundle,data %v with %v", logTime, tc.desc, oldPkcs7data, err)
t.Fatalf("%s:STATUS:%sFailed to load previous trust bundle,data %v with %v", time.Now().String(), tc.desc, oldPkcs7data, err)
}
//Create a old set of Cert Pool and append the certs from previous trust bundle.
prevCaCert := x509.NewCertPool()
Expand All @@ -243,39 +242,39 @@ func TestTrustBundleCert(t *testing.T) {
}
//Before rotation,validation of all services with existing certificates.
if result := setup_service.ServicesValidationCheck(t, prevCaCert, expectedResult, serverSAN, serverAddr, username, password, prevClientCert, tc.mismatch); !result {
t.Fatalf("%s:STATUS:%s:service validation failed before rotate- got %v, want %v.", logTime, tc.desc, result, expectedResult)
t.Fatalf("%s:STATUS:%s:service validation failed before rotate- got %v, want %v.", time.Now().String(), tc.desc, result, expectedResult)
}
//Retrieve the connection with previous TLS credentials for certz rotation.
conn := setup_service.CreateNewDialOption(t, prevClientCert, prevCaCert, serverSAN, username, password, serverAddr)
defer conn.Close()
certzClient = certzpb.NewCertzClient(conn)
gnmiClient = gnmi.NewGNMIClient(conn)
} else {
t.Logf("%s:STATUS:%s:Using existing TLS credentials for client connection in first iteration.", logTime, tc.desc)
t.Logf("%s:STATUS:%s:Using existing TLS credentials for client connection in first iteration.", time.Now().String(), tc.desc)
}
//Initiate trustbundle rotation.
t.Logf("STATUS:%s Initiating Certz rotation with server cert: %s and trust bundle: %s.", tc.desc, tc.serverCertFile, tc.trustBundleFile)
if success := setup_service.CertzRotate(ctx, t, newCaCert, certzClient, gnmiClient, newClientCert, dut, username, password, serverSAN, serverAddr, testProfile, tc.newTLScreds, tc.mismatch, tc.scale, &serverCertEntity, &trustBundleEntity); !success {
t.Fatalf("%s:STATUS: %s:CertzRotation failed.", logTime, tc.desc)
t.Fatalf("%s:STATUS: %s:CertzRotation failed.", time.Now().String(), tc.desc)
}
t.Logf("%s:STATUS:%s: TrustBundle rotation completed!", logTime, tc.desc)
t.Logf("%s:STATUS:%s: TrustBundle rotation completed!", time.Now().String(), tc.desc)
//Post rotate validation of all services.
t.Run("Verification of new connection after successful trustBundle rotation", func(t *testing.T) {
if result := setup_service.ServicesValidationCheck(t, newCaCert, expectedResult, serverSAN, serverAddr, username, password, newClientCert, tc.mismatch); !result {
t.Fatalf("STATUS:%s:service validation failed after rotate- got %v, want %v.", tc.desc, result, expectedResult)
}
t.Logf("%s:STATUS:%s:service validation done!", logTime, tc.desc)
t.Logf("%s:STATUS:%s:service validation done!", time.Now().String(), tc.desc)
})
//Archiving previous client cert/key and trustbundle.
prevClientCertFile = tc.clientCertFile
prevClientKeyFile = tc.clientKeyFile
prevTrustBundleFile = tc.trustBundleFile
})
}
t.Logf("%s:STATUS:Cleanup of test data.", logTime)
t.Logf("%s:STATUS:Cleanup of test data.", time.Now().String())
//Cleanup of test data.
if err := setup_service.TestdataMakeCleanup(t, dirPath, timeOutVar, "./cleanup.sh"); err != nil {
t.Logf("%s:STATUS:Cleanup of testdata certificates failed!: %v", logTime, err)
t.Logf("%s:STATUS:Cleanup of testdata certificates failed!: %v", time.Now().String(), err)
}
t.Logf("%s:STATUS:Test completed!", logTime)
t.Logf("%s:STATUS:Test completed!", time.Now().String())
}
Loading