@@ -810,6 +810,24 @@ func TestGetAccountInfo(t *testing.T) {
810810 expectFileShareName : "test_sharename" ,
811811 expectDiskName : "" ,
812812 },
813+ {
814+ volumeID : "uniqe-volumeid-nfs-createfolder" ,
815+ rgName : "vol_nfs" ,
816+ secrets : emptySecret ,
817+ reqContext : map [string ]string {
818+ resourceGroupField : "vol_nfs" ,
819+ storageAccountField : "test_accountname" ,
820+ shareNameField : "test_sharename" ,
821+ protocolField : "nfs" ,
822+ createFolderIfNotExistField : "true" ,
823+ folderNameField : "testfolder" ,
824+ },
825+ expectErr : false ,
826+ err : nil ,
827+ expectAccountName : "test_accountname" ,
828+ expectFileShareName : "test_sharename" ,
829+ expectDiskName : "" ,
830+ },
813831 {
814832 volumeID : "invalid_getLatestAccountKey_value##" ,
815833 rgName : "vol_2" ,
@@ -858,9 +876,10 @@ func TestGetAccountInfo(t *testing.T) {
858876 mockStorageAccountsClient := mock_accountclient .NewMockInterface (ctrl )
859877 d .cloud .ComputeClientFactory = mock_azclient .NewMockClientFactory (ctrl )
860878 d .cloud .ComputeClientFactory .(* mock_azclient.MockClientFactory ).EXPECT ().GetAccountClient ().Return (mockStorageAccountsClient ).AnyTimes ()
879+ d .cloud .ComputeClientFactory .(* mock_azclient.MockClientFactory ).EXPECT ().GetAccountClientForSub (gomock .Any ()).Return (mockStorageAccountsClient , nil ).AnyTimes ()
861880 d .kubeClient = clientSet
862881 d .cloud .Environment = & azclient.Environment {StorageEndpointSuffix : "abc" }
863- mockStorageAccountsClient .EXPECT ().ListKeys (gomock .Any (), gomock .Any (), test . rgName ).Return (key , nil ).AnyTimes ()
882+ mockStorageAccountsClient .EXPECT ().ListKeys (gomock .Any (), gomock .Any (), gomock . Any () ).Return (key , nil ).AnyTimes ()
864883 rgName , accountName , _ , fileShareName , diskName , _ , _ , _ , err := d .GetAccountInfo (context .Background (), test .volumeID , test .secrets , test .reqContext )
865884 if test .expectErr && err == nil {
866885 t .Errorf ("Unexpected non-error" )
0 commit comments