@@ -90,7 +90,7 @@ func GetVersionsFromEnv(t *testing.T) (string, string) {
90
90
91
91
func UpgradeTest (details VersionDetails , opts TestOptions ) func (t * testing.T ) {
92
92
return func (t * testing.T ) {
93
- daprPath := getDaprPath ()
93
+ daprPath := GetDaprPath ()
94
94
args := []string {
95
95
"upgrade" , "-k" ,
96
96
"--runtime-version" , details .RuntimeVersion ,
@@ -117,7 +117,7 @@ func UpgradeTest(details VersionDetails, opts TestOptions) func(t *testing.T) {
117
117
}
118
118
119
119
func EnsureUninstall (all bool ) (string , error ) {
120
- daprPath := getDaprPath ()
120
+ daprPath := GetDaprPath ()
121
121
122
122
var _command [10 ]string
123
123
command := append (_command [0 :], "uninstall" , "-k" )
@@ -187,7 +187,7 @@ func GetTestsPostCertificateRenewal(details VersionDetails, opts TestOptions) []
187
187
188
188
func MTLSTestOnInstallUpgrade (opts TestOptions ) func (t * testing.T ) {
189
189
return func (t * testing.T ) {
190
- daprPath := getDaprPath ()
190
+ daprPath := GetDaprPath ()
191
191
output , err := spawn .Command (daprPath , "mtls" , "-k" )
192
192
require .NoError (t , err , "expected no error on querying for mtls" )
193
193
if ! opts .MTLSEnabled {
@@ -233,7 +233,7 @@ func MTLSTestOnInstallUpgrade(opts TestOptions) func(t *testing.T) {
233
233
234
234
func ComponentsTestOnInstallUpgrade (opts TestOptions ) func (t * testing.T ) {
235
235
return func (t * testing.T ) {
236
- daprPath := getDaprPath ()
236
+ daprPath := GetDaprPath ()
237
237
// if dapr is installed.
238
238
if opts .ApplyComponentChanges {
239
239
// apply any changes to the component.
@@ -256,7 +256,7 @@ func ComponentsTestOnInstallUpgrade(opts TestOptions) func(t *testing.T) {
256
256
257
257
func StatusTestOnInstallUpgrade (details VersionDetails , opts TestOptions ) func (t * testing.T ) {
258
258
return func (t * testing.T ) {
259
- daprPath := getDaprPath ()
259
+ daprPath := GetDaprPath ()
260
260
output , err := spawn .Command (daprPath , "status" , "-k" )
261
261
require .NoError (t , err , "status check failed" )
262
262
var notFound map [string ][]string
@@ -419,7 +419,7 @@ func CRDTest(details VersionDetails, opts TestOptions) func(t *testing.T) {
419
419
420
420
func GenerateNewCertAndRenew (details VersionDetails , opts TestOptions ) func (t * testing.T ) {
421
421
return func (t * testing.T ) {
422
- daprPath := getDaprPath ()
422
+ daprPath := GetDaprPath ()
423
423
err := exportCurrentCertificate (daprPath )
424
424
require .NoError (t , err , "expected no error on certificate exporting" )
425
425
@@ -445,7 +445,7 @@ func GenerateNewCertAndRenew(details VersionDetails, opts TestOptions) func(t *t
445
445
446
446
func UseProvidedPrivateKeyAndRenewCerts (details VersionDetails , opts TestOptions ) func (t * testing.T ) {
447
447
return func (t * testing.T ) {
448
- daprPath := getDaprPath ()
448
+ daprPath := GetDaprPath ()
449
449
args := []string {
450
450
"mtls" , "renew-certificate" , "-k" ,
451
451
"--private-key" , "../testdata/example-root.key" ,
@@ -473,7 +473,7 @@ func UseProvidedPrivateKeyAndRenewCerts(details VersionDetails, opts TestOptions
473
473
474
474
func UseProvidedNewCertAndRenew (details VersionDetails , opts TestOptions ) func (t * testing.T ) {
475
475
return func (t * testing.T ) {
476
- daprPath := getDaprPath ()
476
+ daprPath := GetDaprPath ()
477
477
args := []string {
478
478
"mtls" , "renew-certificate" , "-k" ,
479
479
"--ca-root-certificate" , "./certs/ca.crt" ,
@@ -507,7 +507,7 @@ func UseProvidedNewCertAndRenew(details VersionDetails, opts TestOptions) func(t
507
507
508
508
func NegativeScenarioForCertRenew () func (t * testing.T ) {
509
509
return func (t * testing.T ) {
510
- daprPath := getDaprPath ()
510
+ daprPath := GetDaprPath ()
511
511
args := []string {
512
512
"mtls" , "renew-certificate" , "-k" ,
513
513
"--ca-root-certificate" , "invalid_cert_file.pem" ,
@@ -551,7 +551,7 @@ func NegativeScenarioForCertRenew() func(t *testing.T) {
551
551
552
552
func CheckMTLSStatus (details VersionDetails , opts TestOptions , shouldWarningExist bool ) func (t * testing.T ) {
553
553
return func (t * testing.T ) {
554
- daprPath := getDaprPath ()
554
+ daprPath := GetDaprPath ()
555
555
output , err := spawn .Command (daprPath , "mtls" , "-k" )
556
556
require .NoError (t , err , "expected no error on querying for mtls" )
557
557
if ! opts .MTLSEnabled {
@@ -595,7 +595,7 @@ func (v VersionDetails) constructFoundMap(res Resource) map[string]bool {
595
595
return foundMap
596
596
}
597
597
598
- func getDaprPath () string {
598
+ func GetDaprPath () string {
599
599
distDir := fmt .Sprintf ("%s_%s" , runtime .GOOS , runtime .GOARCH )
600
600
601
601
return filepath .Join (".." , ".." , ".." , "dist" , distDir , "release" , "dapr" )
@@ -642,7 +642,7 @@ func getClient() (*k8s.Clientset, error) {
642
642
643
643
func installTest (details VersionDetails , opts TestOptions ) func (t * testing.T ) {
644
644
return func (t * testing.T ) {
645
- daprPath := getDaprPath ()
645
+ daprPath := GetDaprPath ()
646
646
args := []string {
647
647
"init" , "-k" ,
648
648
"--wait" ,
@@ -693,7 +693,7 @@ func kubernetesTestOnUninstall() func(t *testing.T) {
693
693
return func (t * testing.T ) {
694
694
_ , err := EnsureUninstall (true )
695
695
require .NoError (t , err , "uninstall failed" )
696
- daprPath := getDaprPath ()
696
+ daprPath := GetDaprPath ()
697
697
output , err := spawn .Command (daprPath , "uninstall" , "-k" )
698
698
require .NoError (t , err , "expected no error on uninstall without install" )
699
699
require .Contains (t , output , "Removing Dapr from your cluster..." , "expected output to contain message" )
@@ -704,7 +704,7 @@ func kubernetesTestOnUninstall() func(t *testing.T) {
704
704
705
705
func uninstallMTLSTest () func (t * testing.T ) {
706
706
return func (t * testing.T ) {
707
- daprPath := getDaprPath ()
707
+ daprPath := GetDaprPath ()
708
708
output , err := spawn .Command (daprPath , "mtls" , "-k" )
709
709
require .Error (t , err , "expected error to be return if dapr not installed" )
710
710
require .Contains (t , output , "error checking mTLS: system configuration not found" , "expected output to match" )
@@ -713,7 +713,7 @@ func uninstallMTLSTest() func(t *testing.T) {
713
713
714
714
func componentsTestOnUninstall (all bool ) func (t * testing.T ) {
715
715
return func (t * testing.T ) {
716
- daprPath := getDaprPath ()
716
+ daprPath := GetDaprPath ()
717
717
// On Dapr uninstall CRDs are not removed, consequently the components will not be removed.
718
718
// TODO Related to https://github.com/dapr/cli/issues/656.
719
719
// For now the components remain.
@@ -747,7 +747,7 @@ func componentsTestOnUninstall(all bool) func(t *testing.T) {
747
747
748
748
func statusTestOnUninstall () func (t * testing.T ) {
749
749
return func (t * testing.T ) {
750
- daprPath := getDaprPath ()
750
+ daprPath := GetDaprPath ()
751
751
output , err := spawn .Command (daprPath , "status" , "-k" )
752
752
t .Log ("checking status fails as expected" )
753
753
require .Error (t , err , "status check did not fail as expected" )
0 commit comments