Files
Xen-Orchestra-xen-orchestra…/@xen-orchestra/web/src/test/create-vif.ts
Elise-F 5385f9f229 feat(xo6/VM): migrate action (#10615)
See XO-1758

The migration drawer has two steps:
1. Select the destination host (and optionally the migration network).
2. Map the VM disks to SRs and the VM interfaces to networks on the destination.
2026-10-28 10:59:25 +01:00

25 lines
737 B
TypeScript

import type { FrontXoVif } from '@/modules/vif/remote-resources/use-xo-vif-collection.ts'
/**
* Builds a fully-populated `FrontXoVif` for use in tests. Pass `overrides` to
* tweak only the fields relevant to the case under test.
*/
export function createVif(overrides: Partial<FrontXoVif> = {}): FrontXoVif {
return {
id: 'vif-123' as FrontXoVif['id'],
$VM: 'vm-123' as FrontXoVif['$VM'],
$network: 'network-123' as FrontXoVif['$network'],
$pool: 'pool-789' as FrontXoVif['$pool'],
attached: true,
device: '0',
txChecksumming: true,
lockingMode: 'network_default',
MAC: '00:00:00:00:00:00',
MTU: 1500,
rateLimit: undefined,
type: 'VIF',
other_config: {},
...overrides,
}
}