Skip to content

Commit

Permalink
fix clone warning selector
Browse files Browse the repository at this point in the history
Fix RDP console tests

fix clicking over overlay
  • Loading branch information
Radim Hrazdil committed May 28, 2020
1 parent c09da79 commit 79b3c83
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@ metadata:
annotations:
kubevirt.io/latest-observed-api-version: v1alpha3
kubevirt.io/storage-observed-api-version: v1alpha3
name.os.template.kubevirt.io/win10: Microsoft Windows 10
name.os.template.kubevirt.io/win2k16: Microsoft Windows Server 2016
name: ${name}
labels:
app: fake-windows
flavor.template.kubevirt.io/medium: 'true'
os.template.kubevirt.io/win10: 'true'
vm.kubevirt.io/template: win2k12r2-server-medium-${commonTemplateVersion()}
app: ${name}
os.template.kubevirt.io/win2k16: 'true'
vm.kubevirt.io/template: win2k12r2-server-large-${commonTemplateVersion()}
vm.kubevirt.io/template.namespace: ${COMMON_TEMPLATES_NAMESPACE}
vm.kubevirt.io/template.revision: '${COMMON_TEMPLATES_REVISION}'
vm.kubevirt.io/template.version: ${commonTemplateVersion()}
Expand All @@ -29,10 +28,22 @@ spec:
creationTimestamp: null
labels:
kubevirt.io/domain: ${name}
kubevirt.io/size: medium
kubevirt.io/size: large
os.template.kubevirt.io/win2k16: 'true'
vm.kubevirt.io/name: ${name}
workload.template.kubevirt.io/server: 'true'
spec:
domain:
clock:
timer:
hpet:
present: false
hyperv: {}
pit:
tickPolicy: delay
rtc:
tickPolicy: catchup
utc: {}
cpu:
cores: 1
sockets: 1
Expand All @@ -41,36 +52,54 @@ spec:
disks:
- bootOrder: 1
disk:
bus: virtio
bus: sata
name: rootdisk
- disk:
bus: virtio
bus: sata
name: cloudinitdisk
- cdrom:
bus: sata
name: windows-guest-tools
inputs:
- bus: usb
name: tablet
type: tablet
interfaces:
- masquerade: {}
model: virtio
name: nic0
name: nic-0
- bridge: {}
model: virtio
name: nic1
name: nic-1
features:
acpi: {}
apic: {}
hyperv:
relaxed: {}
spinlocks:
spinlocks: 8191
vapic: {}
machine:
type: ''
type: q35
resources:
requests:
memory: 1Gi
evictionStrategy: LiveMigrate
hostname: fake-windows
hostname: ${name}
networks:
- name: nic0
- name: nic-0
pod: {}
- multus:
networkName: ${networkName}
name: nic1
name: nic-1
terminationGracePeriodSeconds: 0
volumes:
- containerDisk:
image: 'kubevirt/fedora-cloud-registry-disk-demo:latest'
name: rootdisk
- containerDisk:
image: kubevirt/virtio-container-disk
name: windows-guest-tools
- cloudInitNoCloud:
userData: |
#cloud-config
Expand All @@ -81,4 +110,5 @@ spec:
- dnf install -y qemu-guest-agent
- systemctl start qemu-guest-agent
name: cloudinitdisk
status: {}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
} from './utils/consts';
import { VirtualMachine } from './models/virtualMachine';
import { vmConfig, getProvisionConfigs } from './vm.wizard.configs';
import { ProvisionConfigName } from './utils/constants/wizard';
import { ProvisionConfigName, Flavor } from './utils/constants/wizard';
import { windowsVMConfig, multusNAD } from './utils/mocks';
import { getWindowsVM } from './utils/templates/windowsVMForRDPL2';
import { Wizard } from './models/wizard';
Expand Down Expand Up @@ -75,6 +75,7 @@ describe('KubeVirt VM console - RDP', () => {
windowsVMConfig,
true, // startOnCreation
);
windowsConfig.flavorConfig = { flavor: Flavor.CUSTOM, cpu: '1', memory: '2' };
const vm = await wizard.createVirtualMachine(windowsConfig);
await withResource(leakedResources, vm.asResource(), async () => {
await vm.navigateToConsoles();
Expand Down Expand Up @@ -113,11 +114,11 @@ describe('KubeVirt VM console - RDP', () => {
expect(launchRemoteDesktopButton.isEnabled()).toBe(true);

// there should be just the single laucher-pod
const hostIP = execSync("kubectl get pod -o yaml|grep hostIP| cut -d ':' -f 2")
const hostIP = execSync("kubectl get pod -o json | jq '.items[0].status.hostIP' -r")
.toString()
.trim();
const port = execSync(
`kubectl get service ${vm.name}-rdp -o yaml|grep nodePort| cut -d ':' -f 2`,
`kubectl get service ${vm.name}-rdp -o json | jq '.spec.ports[0].nodePort' -r`,
)
.toString()
.trim();
Expand Down Expand Up @@ -147,7 +148,7 @@ describe('KubeVirt VM console - RDP', () => {
'ID(CNV-1726) connects via L2 network',
async () => {
// created just for reusing the later navigation
const windowsConfig = vmConfig(configName.toLowerCase(), testName, provisionConfig);
const windowsConfig = vmConfig(`${configName.toLowerCase()}-l2`, testName, provisionConfig);
const vm = new VirtualMachine(windowsConfig);
await withResource(leakedResources, vm.asResource(), async () => {
/* Pre-requisite:
Expand Down Expand Up @@ -193,7 +194,7 @@ describe('KubeVirt VM console - RDP', () => {
await click(consoleTypeSelector); // close before re-opening
await selectDropdownOption(consoleTypeSelectorId, 'Desktop Viewer');

await selectDropdownOptionById(networkSelectorId, 'nic1-link');
await selectDropdownOptionById(networkSelectorId, 'nic-1-link');
await browser.wait(
until.textToBePresentInElement(manualConnectionTitle, 'Manual Connection'),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,12 @@ describe('Test network type presets and options', () => {
await click(wizardView.addNICButton);
expect((await getSelectOptions(nicType)).sort()).toEqual(bindingMethods);
await click(wizardView.modalCancelButton);

await wizard.addNIC(multusNetworkInterface);

await wizardView.clickKebabAction(multusNetworkInterface.name, 'Edit');
// expect masquerade is not available option
expect((await getSelectOptions(nicType)).sort()).toEqual(nonPodNetworkBindingMethods);
await click(wizardView.modalCancelButton);
await wizard.closeWizard();
});

xit('BZ(1828739) ID(CNV-4038) Test NIC default type in example VM', async () => {
Expand All @@ -185,6 +185,7 @@ describe('Test network type presets and options', () => {
await click(createNICButton);
await NICDialog.selectNetwork(multusNAD.metadata.name);
expect((await getSelectOptions(nicType)).sort()).toEqual(nonPodNetworkBindingMethods);
await vm.navigateToListView();
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ describe('Kubevirt create VM using wizard', () => {
testVMConfig.networkResources = [];
testVMConfig.operatingSystem = OperatingSystem.WINDOWS_10;
testVMConfig.flavorConfig.flavor = Flavor.MEDIUM;
testVMConfig.workloadProfile = WorkloadProfile.SERVER;
testVMConfig.workloadProfile = WorkloadProfile.DESKTOP;
testVMConfig.startOnCreation = false; // do not check as there is only medium/large profile present and we would get insufficient memory.
const osID = OSIDLookup[testVMConfig.operatingSystem];

Expand All @@ -122,11 +122,10 @@ describe('Kubevirt create VM using wizard', () => {

const requiredLabels = {
[`workload.template.kubevirt.io/${testVMConfig.workloadProfile}`]: 'true',
[`flavor.template.kubevirt.io/${testVMConfig.flavorConfig.flavor}`]: 'true',
[`os.template.kubevirt.io/${osID}`]: 'true',
'vm.kubevirt.io/template': `windows-${testVMConfig.workloadProfile}-${
testVMConfig.flavorConfig.flavor
}-${commonTemplateVersion()}`,
'vm.kubevirt.io/template': `windows10-${testVMConfig.workloadProfile.toLowerCase()}-${
testVMConfig.flavorConfig.flavor.toLowerCase()
}-${commonTemplateVersion()}`,
'vm.kubevirt.io/template.revision': COMMON_TEMPLATES_REVISION,
'vm.kubevirt.io/template.version': INNER_TEMPLATE_VERSION,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { $, element, by } from 'protractor';

export const modalDialog = $('.ReactModal__Content');

export const warningMessage = $('.kubevirt-clone-vm-modal__error-group--end');
export const warningMessage = $('[aria-label="Warning Alert"]');

export const nameHelperMessage = $('#clone-dialog-vm-name-helper');

Expand Down

0 comments on commit 79b3c83

Please sign in to comment.