Files
kata-containers/virtcontainers/hypervisor_arm64_test.go
Penny Zheng e93fb0b3a0 unit-test: test func for RunningOnVMM should be arch-dependent
original tests for func RunningOnVMM are sort of amd64-specific,
since all other archs don't support nested VMM for now.

Fixes: #1200

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
2019-02-14 14:56:30 +08:00

31 lines
498 B
Go

// Copyright (c) 2019 ARM Limited
//
// SPDX-License-Identifier: Apache-2.0
//
package virtcontainers
import (
"io/ioutil"
"os"
"testing"
"github.com/stretchr/testify/assert"
)
func TestRunningOnVMM(t *testing.T) {
assert := assert.New(t)
expectedOutput := false
f, err := ioutil.TempFile("", "cpuinfo")
if err != nil {
t.Fatal(err)
}
defer os.Remove(f.Name())
defer f.Close()
running, err := RunningOnVMM(f.Name())
assert.NoError(err)
assert.Equal(expectedOutput, running)
}