From 0679f6fa591137837503afb28c6fa3713899b865 Mon Sep 17 00:00:00 2001 From: Penny Zheng Date: Thu, 31 Jan 2019 14:50:32 +0800 Subject: [PATCH] unit-test: refine qemu_arm64_test.go refine a set of test functions under qemu_arm64_test.go. e.g. test func for memoryTopology shouldn't be the same one on amd64, since for now, we don't support nvdimm on arm64. Fixes: #1200 Signed-off-by: Penny Zheng --- virtcontainers/qemu_arm64_test.go | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/virtcontainers/qemu_arm64_test.go b/virtcontainers/qemu_arm64_test.go index 30f3568010..ceb0699ad7 100644 --- a/virtcontainers/qemu_arm64_test.go +++ b/virtcontainers/qemu_arm64_test.go @@ -26,32 +26,27 @@ func newTestQemu(machineType string) qemuArch { func TestQemuArm64CPUModel(t *testing.T) { assert := assert.New(t) - arm64 := newTestQemu(virt) + arm64 := newTestQemu(QemuVirt) expectedOut := defaultCPUModel model := arm64.cpuModel() assert.Equal(expectedOut, model) - - arm64.enableNestingChecks() - expectedOut = defaultCPUModel + ",pmu=off" - model = arm64.cpuModel() - assert.Equal(expectedOut, model) } func TestQemuArm64MemoryTopology(t *testing.T) { assert := assert.New(t) - arm64 := newTestQemu(virt) - memoryOffset := 1024 + arm64 := newTestQemu(QemuVirt) - hostMem := uint64(1024) - mem := uint64(120) + hostMem := uint64(4096) + mem := uint64(1024) + slots := uint8(3) expectedMemory := govmmQemu.Memory{ Size: fmt.Sprintf("%dM", mem), - Slots: defaultMemSlots, - MaxMem: fmt.Sprintf("%dM", hostMem+uint64(memoryOffset)), + Slots: slots, + MaxMem: fmt.Sprintf("%dM", hostMem), } - m := arm64.memoryTopology(mem, hostMem) + m := arm64.memoryTopology(mem, hostMem, slots) assert.Equal(expectedMemory, m) }