diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2022-09-05 19:20:14 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2022-09-21 11:31:15 +0200 |
| commit | 2ec5e8f1e44239916779655d4d68a9c6dae8e894 (patch) | |
| tree | f9c3cf0f6e0e76590818939e01a710fd271d9bf8 /opendc-simulator/opendc-simulator-compute/src/test | |
| parent | a7510e0708b6e5435f8440e588c762d6e6cd8a22 (diff) | |
refactor(sim/compute): Pass interference key via parameter
This change updates the signature of the `SimHypervisor` interface to
accept a `VmInterferenceKey` when creating a new virtual machine,
instead of providing a string identifier. This is in preparation for
removing the dependency on the `VmInterferenceModel` in the
`SimAbstractHypervisor` class.
Diffstat (limited to 'opendc-simulator/opendc-simulator-compute/src/test')
| -rw-r--r-- | opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/kernel/SimFairShareHypervisorTest.kt | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/kernel/SimFairShareHypervisorTest.kt b/opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/kernel/SimFairShareHypervisorTest.kt index 5f3c3b17..ab2a6d76 100644 --- a/opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/kernel/SimFairShareHypervisorTest.kt +++ b/opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/kernel/SimFairShareHypervisorTest.kt @@ -191,12 +191,13 @@ internal class SimFairShareHypervisorTest { .addGroup(targetLoad = 0.0, score = 0.6, members = setOf("a", "c")) .addGroup(targetLoad = 0.1, score = 0.8, members = setOf("a", "n")) .build() + val interferenceDomain = interferenceModel.newDomain() val platform = FlowEngine(coroutineContext, clock) val machine = SimBareMetalMachine( platform, model, SimplePowerDriver(ConstantPowerModel(0.0)) ) - val hypervisor = SimFairShareHypervisor(platform, null, interferenceModel.newDomain()) + val hypervisor = SimFairShareHypervisor(platform, null, interferenceDomain) val duration = 5 * 60L val workloadA = @@ -224,11 +225,11 @@ internal class SimFairShareHypervisorTest { coroutineScope { launch { - val vm = hypervisor.newMachine(model, "a") + val vm = hypervisor.newMachine(model, interferenceDomain.createKey("a")) vm.runWorkload(workloadA) hypervisor.removeMachine(vm) } - val vm = hypervisor.newMachine(model, "b") + val vm = hypervisor.newMachine(model, interferenceDomain.createKey("b")) vm.runWorkload(workloadB) hypervisor.removeMachine(vm) } |
