kata-containers/src/runtime/virtcontainers/hypervisor_linux_arm64_test.go
Samuel Ortiz 26b3f0017c virtcontainers: Split hypervisor into Linux and OS agnostic bits
Keep all the OS agnostic bits in the hypervisor.go and
hypervisor_ARCH.go files.

Fixes #3614

Signed-off-by: Eric Ernst <eric_ernst@apple.com>
Signed-off-by: Samuel Ortiz <s.ortiz@apple.com>
2022-02-16 19:15:31 +01:00

35 lines
621 B
Go

// Copyright (c) 2019 ARM Limited
//
// SPDX-License-Identifier: Apache-2.0
//
package virtcontainers
import (
"os"
"testing"
"github.com/stretchr/testify/assert"
)
func TestRunningOnVMM(t *testing.T) {
assert := assert.New(t)
expectedOutput := false
f, err := os.CreateTemp("", "cpuinfo")
assert.NoError(err)
defer os.Remove(f.Name())
defer f.Close()
running, err := RunningOnVMM(f.Name())
assert.NoError(err)
assert.Equal(expectedOutput, running)
}
func TestAvailableGuestProtection(t *testing.T) {
assert := assert.New(t)
out, _ := availableGuestProtection()
assert.Equal(out, noneProtection)
}