Skip to content

Commit

Permalink
Update tests to use new default storage mapping
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Lucidi <slucidi@redhat.com>
  • Loading branch information
mansam committed Dec 12, 2024
1 parent 6d857b1 commit e6fcebf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
14 changes: 7 additions & 7 deletions tests/suit/framework/ova.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func (r *OvaClient) LoadSourceDetails() (vm *OvaVM, err error) {

r.vmData.testVMId = "c5686650854d1e69b4123f4bf2e70fe1ed2a"
r.vmData.testNetworkID = "ae1badc8c693926f492a01e2f357d6af321b"
r.vmData.testStorageName = "Dummy storage for source provider ova-provider"
r.vmData.testStorageID = "default"
return &r.vmData, nil
}

Expand All @@ -39,7 +39,7 @@ func (r *OvaClient) GetNfsServerForOva(k8sClient *kubernetes.Clientset) (string,
}
nfsShare := server + ":" + share
if nfsShare == "" {
return "", errors.New("failed to fatch NFS settings")
return "", errors.New("failed to fetch NFS settings")
}

r.nfsPath = nfsShare
Expand All @@ -52,8 +52,8 @@ func (r *OvaVM) GetNetworkId() string {
}

// GetVolumeId - return storage domain IDs
func (r *OvaVM) GetStorageName() string {
return r.testStorageName
func (r *OvaVM) GetStorageID() string {
return r.testStorageID
}

// GetTestVMId - return the test VM ID
Expand All @@ -69,7 +69,7 @@ type OvaClient struct {
}

type OvaVM struct {
testVMId string
testNetworkID string
testStorageName string
testVMId string
testNetworkID string
testStorageID string
}
2 changes: 1 addition & 1 deletion tests/suit/ova_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ var _ = Describe("[level:component]Migration tests for OVA provider", func() {
err = utils.WaitForNetworkMapReadyWithTimeout(f.CrClient, namespace, networkMapName, 30*time.Second)
Expect(err).ToNot(HaveOccurred())
By("Create Storage Map")
storageMapDef := utils.NewStorageMap(namespace, *provider, test_storage_map_name, []string{vmData.GetStorageName()}, ovaStorageClass)
storageMapDef := utils.NewStorageMap(namespace, *provider, test_storage_map_name, []string{vmData.GetStorageID()}, ovaStorageClass)
err = utils.CreateStorageMapFromDefinition(f.CrClient, storageMapDef)
Expect(err).ToNot(HaveOccurred())
err = utils.WaitForStorageMapReadyWithTimeout(f.CrClient, namespace, test_storage_map_name, 10*time.Second)
Expand Down
9 changes: 1 addition & 8 deletions tests/suit/utils/storagemap.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,8 @@ func NewStorageMap(namespace string, providerIdentifier forkliftv1.Provider, sto
Destination: forkliftv1.DestinationStorage{
StorageClass: storageClass,
},
Source: ref.Ref{ID: sd},
}

switch providerIdentifier.Type() {
case forkliftv1.Ova:
pair.Source = ref.Ref{Name: sd}
default:
pair.Source = ref.Ref{ID: sd}
}

sdPairs = append(sdPairs, pair)
}

Expand Down

0 comments on commit e6fcebf

Please sign in to comment.