mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-10-10 09:39:24 +00:00
Convert virtcontainers tests to testify/assert to make the virtcontainers tests more readable. fixes #156 Signed-off-by: Julio Montes <julio.montes@intel.com>
29 lines
484 B
Go
29 lines
484 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")
|
|
assert.NoError(err)
|
|
defer os.Remove(f.Name())
|
|
defer f.Close()
|
|
|
|
running, err := RunningOnVMM(f.Name())
|
|
assert.NoError(err)
|
|
assert.Equal(expectedOutput, running)
|
|
}
|