Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion test/e2e/default_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ testData:
vmConfiguration: "/tmp/testdata/vm-configuration"
vmMigration: "/tmp/testdata/vm-migration"
vmMigrationCancel: "/tmp/testdata/vm-migration-cancel"
vmEvacuation: "/tmp/testdata/vm-evacuation"
vdSnapshots: "/tmp/testdata/vd-snapshots"
sshKey: "/tmp/testdata/sshkeys/id_ed"
sshUser: "cloud"
Expand Down
1 change: 0 additions & 1 deletion test/e2e/internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ type TestData struct {
ImageHotplug string `yaml:"imageHotplug"`
VMMigration string `yaml:"vmMigration"`
VMMigrationCancel string `yaml:"vmMigrationCancel"`
VMEvacuation string `yaml:"vmEvacuation"`
VdSnapshots string `yaml:"vdSnapshots"`
Sshkey string `yaml:"sshKey"`
SSHUser string `yaml:"sshUser"`
Expand Down
31 changes: 29 additions & 2 deletions test/e2e/internal/util/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ func RebootVirtualMachineByVMOP(f *framework.Framework, vm *v1alpha2.VirtualMach
func RebootVirtualMachineByPodDeletion(f *framework.Framework, vm *v1alpha2.VirtualMachine) {
GinkgoHelper()

activePodName, err := getActivePodName(vm)
activePodName, err := GetActivePodName(vm)
Expect(err).NotTo(HaveOccurred())
Expect(activePodName).NotTo(BeEmpty())

Expand All @@ -323,7 +323,34 @@ func RebootVirtualMachineByPodDeletion(f *framework.Framework, vm *v1alpha2.Virt
Expect(err).NotTo(HaveOccurred())
}

func getActivePodName(vm *v1alpha2.VirtualMachine) (string, error) {
func GetVirtualMachineAndActivePod(ctx context.Context, f *framework.Framework, vm *v1alpha2.VirtualMachine) (*v1alpha2.VirtualMachine, *corev1.Pod, error) {
var currentVM v1alpha2.VirtualMachine
err := f.GenericClient().Get(ctx, client.ObjectKey{
Namespace: vm.Namespace,
Name: vm.Name,
}, &currentVM)
if err != nil {
return nil, nil, err
}

activePodName, err := GetActivePodName(&currentVM)
if err != nil {
return nil, nil, err
}

var activePod corev1.Pod
err = f.GenericClient().Get(ctx, client.ObjectKey{
Namespace: vm.Namespace,
Name: activePodName,
}, &activePod)
if err != nil {
return nil, nil, err
}

return &currentVM, &activePod, nil
}

func GetActivePodName(vm *v1alpha2.VirtualMachine) (string, error) {
for _, pod := range vm.Status.VirtualMachinePods {
if pod.Active {
return pod.Name, nil
Expand Down
14 changes: 0 additions & 14 deletions test/e2e/legacy/testdata/vm-evacuation/kustomization.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions test/e2e/legacy/testdata/vm-evacuation/ns.yaml

This file was deleted.

52 changes: 0 additions & 52 deletions test/e2e/legacy/testdata/vm-evacuation/transformer.yaml

This file was deleted.

This file was deleted.

This file was deleted.

54 changes: 0 additions & 54 deletions test/e2e/legacy/testdata/vm-evacuation/vm/base/transformer.yaml

This file was deleted.

This file was deleted.

13 changes: 0 additions & 13 deletions test/e2e/legacy/testdata/vm-evacuation/vm/base/vd-root.yaml

This file was deleted.

24 changes: 0 additions & 24 deletions test/e2e/legacy/testdata/vm-evacuation/vm/base/vm.yaml

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading