Skip to content

Commit 5fbacb6

Browse files
committed
invoking mk_cas.sh passing DIRS string from command-line argument certs_list
1 parent 9c13a78 commit 5fbacb6

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

feature/gnsi/certz/tests/trust_bundle/trustbundle_test.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ import (
1818
"context"
1919
"crypto/tls"
2020
"crypto/x509"
21+
"flag"
22+
"fmt"
2123
"slices"
2224
"testing"
2325
"time"
@@ -49,9 +51,14 @@ var (
4951
prevClientKeyFile string = ""
5052
prevTrustBundleFile string = ""
5153
expectedResult bool = true
54+
certs_list = flag.String("certs_list", "01,02,10,1000,20000", "Number of Certificate Sets to generate for this test. Comma separated string")
55+
certs_string = func(t *testing.T) string {
56+
return *certs_list
57+
}
5258
)
5359

5460
func TestMain(m *testing.M) {
61+
flag.Parse()
5562
fptest.RunTests(m)
5663
}
5764

@@ -70,7 +77,8 @@ func TestTrustBundleCert(t *testing.T) {
7077
gnmiClient, gnsiC := setup_service.PreInitCheck(context.Background(), t, dut)
7178
//Generate testdata certificates.
7279
t.Logf("%s:Creation of test data.", time.Now().String())
73-
if err := setup_service.TestdataMakeCleanup(t, dirPath, timeOutVar, "./mk_cas.sh"); err != nil {
80+
command := fmt.Sprintf("./mk_cas.sh %v", certs_string(t))
81+
if err := setup_service.TestdataMakeCleanup(t, dirPath, timeOutVar, command); err != nil {
7482
t.Logf("%s:STATUS:Generation of testdata certificates failed!: %v", time.Now().String(), err)
7583
}
7684
//Create a certz client.

0 commit comments

Comments
 (0)