diff --git a/frontend/packages/kubevirt-plugin/integration-tests/tests/models/virtualMachine.ts b/frontend/packages/kubevirt-plugin/integration-tests/tests/models/virtualMachine.ts index b1d1e318b5d..15558a407a4 100644 --- a/frontend/packages/kubevirt-plugin/integration-tests/tests/models/virtualMachine.ts +++ b/frontend/packages/kubevirt-plugin/integration-tests/tests/models/virtualMachine.ts @@ -212,8 +212,10 @@ export class VirtualMachine extends KubevirtDetailView { } } if (provisionSource.method === ProvisionConfigName.DISK) { - // Select the last Disk as the source for booting - await wizard.selectBootableDisk(storageResources[storageResources.length - 1].name); + // Select the last Disk as the source for booting or let the template select one by default + if (storageResources.length > 0) { + await wizard.selectBootableDisk(storageResources[storageResources.length - 1].name); + } } await wizard.next(); diff --git a/frontend/packages/kubevirt-plugin/integration-tests/tests/models/virtualMachineTemplate.ts b/frontend/packages/kubevirt-plugin/integration-tests/tests/models/virtualMachineTemplate.ts index 4b4168fe58a..a01b848f5a9 100644 --- a/frontend/packages/kubevirt-plugin/integration-tests/tests/models/virtualMachineTemplate.ts +++ b/frontend/packages/kubevirt-plugin/integration-tests/tests/models/virtualMachineTemplate.ts @@ -57,6 +57,16 @@ export class VirtualMachineTemplate extends KubevirtDetailView { await wizard.addDisk(resource); } } + + if (provisionSource.method === ProvisionConfigName.DISK) { + // Select the last Disk as the source for booting + if (storageResources.length > 0) { + await wizard.selectBootableDisk(storageResources[storageResources.length - 1].name); + } else { + throw Error(`Provision source ${ProvisionConfigName.DISK} is missing a storage.`); + } + } + await wizard.next(); // Advanced - Cloud Init diff --git a/frontend/packages/kubevirt-plugin/integration-tests/tests/vmtemplate.wizard.scenario.ts b/frontend/packages/kubevirt-plugin/integration-tests/tests/vmtemplate.wizard.scenario.ts index 15cb0c072cc..fc1d5f1c101 100644 --- a/frontend/packages/kubevirt-plugin/integration-tests/tests/vmtemplate.wizard.scenario.ts +++ b/frontend/packages/kubevirt-plugin/integration-tests/tests/vmtemplate.wizard.scenario.ts @@ -3,18 +3,19 @@ import { testName } from '@console/internal-integration-tests/protractor.conf'; import { removeLeakedResources, withResource, - deleteResource, - createResource, + createResources, + deleteResources, } from '@console/shared/src/test-utils/utils'; import { VM_BOOTUP_TIMEOUT_SECS } from './utils/consts'; import { basicVMConfig, multusNAD } from './utils/mocks'; -import { getProvisionConfigs } from './vm.wizard.configs'; +import { getProvisionConfigs, getTestDataVolume } from './vm.wizard.configs'; import { VirtualMachine } from './models/virtualMachine'; import { VirtualMachineTemplate } from './models/virtualMachineTemplate'; describe('Kubevirt create VM Template using wizard', () => { const leakedResources = new Set(); const provisionConfigs = getProvisionConfigs(); + const testDataVolume = getTestDataVolume(); const commonSettings = { cloudInit: { useCloudInit: false, @@ -47,11 +48,11 @@ describe('Kubevirt create VM Template using wizard', () => { }; beforeAll(() => { - createResource(multusNAD); + createResources([multusNAD, testDataVolume]); }); afterAll(() => { - deleteResource(multusNAD); + deleteResources([multusNAD, testDataVolume]); }); afterEach(() => {