mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-26 02:24:21 +01:00
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>
31 lines
498 B
Go
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)
|
|
}
|