@@ -2405,7 +2405,7 @@ func TestConstructOntapNASVolumeAccessPath_SecureSMBDisabled(t *testing.T) {
24052405 for _ , test := range tests {
24062406 t .Run (test .smbShare , func (t * testing.T ) {
24072407 result := ConstructOntapNASVolumeAccessPath (ctx , test .smbShare , test .volName , volConfig , test .protocol )
2408- assert .Equal (t , test .expectedPath , result , "unable to construct Ontap-NAS volume access path" )
2408+ assert .Equal (t , test .expectedPath , result , "the constructed Ontap-NAS volume access path is incorrect " )
24092409 })
24102410 }
24112411}
@@ -2431,7 +2431,7 @@ func TestConstructOntapNASVolumeAccessPath_SecureSMBEnabled(t *testing.T) {
24312431 for _ , test := range tests {
24322432 t .Run (test .smbShare , func (t * testing.T ) {
24332433 result := ConstructOntapNASVolumeAccessPath (ctx , test .smbShare , test .volName , volConfig , test .protocol )
2434- assert .Equal (t , test .expectedPath , result , "unable to construct Ontap-NAS volume access path" )
2434+ assert .Equal (t , test .expectedPath , result , "the constructed Ontap-NAS volume access path is incorrect " )
24352435 })
24362436 }
24372437}
@@ -2459,7 +2459,35 @@ func TestConstructOntapNASVolumeAccessPath_ROClone(t *testing.T) {
24592459 for _ , test := range tests {
24602460 t .Run (test .smbShare , func (t * testing.T ) {
24612461 result := ConstructOntapNASVolumeAccessPath (ctx , test .smbShare , "/vol" , volConfig , test .protocol )
2462- assert .Equal (t , test .expectedPath , result , "unable to construct Ontap-NAS volume access path" )
2462+ assert .Equal (t , test .expectedPath , result , "the constructed Ontap-NAS volume access path is incorrect" )
2463+ })
2464+ }
2465+ }
2466+
2467+ func TestConstructOntapNASVolumeAccessPath_ROCloneSecureSMBEnabled (t * testing.T ) {
2468+ ctx := context .Background ()
2469+
2470+ volConfig := & storage.VolumeConfig {
2471+ InternalName : "vol" ,
2472+ ReadOnlyClone : true ,
2473+ CloneSourceVolumeInternal : "sourceVol" ,
2474+ CloneSourceSnapshot : "snapshot-abcd-1234-wxyz" ,
2475+ SecureSMBEnabled : true ,
2476+ }
2477+
2478+ tests := []struct {
2479+ smbShare string
2480+ protocol string
2481+ expectedPath string
2482+ }{
2483+ {"test_share" , "smb" , "\\ vol\\ ~snapshot\\ snapshot-abcd-1234-wxyz" },
2484+ {"" , "smb" , "\\ vol\\ ~snapshot\\ snapshot-abcd-1234-wxyz" },
2485+ }
2486+
2487+ for _ , test := range tests {
2488+ t .Run (test .smbShare , func (t * testing.T ) {
2489+ result := ConstructOntapNASVolumeAccessPath (ctx , test .smbShare , "/vol" , volConfig , test .protocol )
2490+ assert .Equal (t , test .expectedPath , result , "the constructed Ontap-NAS volume access path is incorrect" )
24632491 })
24642492 }
24652493}
@@ -2478,7 +2506,7 @@ func TestConstructOntapNASFlexGroupSMBVolumePath(t *testing.T) {
24782506 for _ , test := range tests {
24792507 t .Run (test .smbShare , func (t * testing.T ) {
24802508 result := ConstructOntapNASFlexGroupSMBVolumePath (ctx , test .smbShare , "vol" )
2481- assert .Equal (t , test .expectedPath , result , "unable to construct Ontap-NAS-QTree SMB volume path" )
2509+ assert .Equal (t , test .expectedPath , result , "the constructed Ontap-NAS-QTree SMB volume access path is incorrect " )
24822510 })
24832511 }
24842512}
@@ -2576,7 +2604,7 @@ func TestConstructOntapNASQTreeVolumePath(t *testing.T) {
25762604 for _ , test := range tests {
25772605 t .Run (test .smbShare , func (t * testing.T ) {
25782606 result := ConstructOntapNASQTreeVolumePath (ctx , test .smbShare , "flex-vol" , test .volConfig , test .protocol )
2579- assert .Equal (t , test .expectedPath , result , "unable to construct Ontap-NAS-QTree SMB volume path" )
2607+ assert .Equal (t , test .expectedPath , result , "the constructed Ontap-NAS-QTree SMB volume path is incorrect " )
25802608 })
25812609 }
25822610}
0 commit comments