mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-27 07:48:55 +00:00
runtime: fix TestNewConsole UT failure
It needs root. Signed-off-by: Peng Tao <bergwolf@hyper.sh>
This commit is contained in:
parent
0479a4cb29
commit
6c275c9262
@ -10,6 +10,7 @@ import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
ktu "github.com/kata-containers/kata-containers/src/runtime/pkg/katatestutils"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
@ -22,6 +23,9 @@ func TestConsoleFromFile(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestNewConsole(t *testing.T) {
|
||||
if tc.NotValid(ktu.NeedRoot()) {
|
||||
t.Skip(testDisabledAsNonRoot)
|
||||
}
|
||||
assert := assert.New(t)
|
||||
|
||||
console, err := newConsole()
|
||||
@ -34,6 +38,9 @@ func TestNewConsole(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestIsTerminal(t *testing.T) {
|
||||
if tc.NotValid(ktu.NeedRoot()) {
|
||||
t.Skip(testDisabledAsNonRoot)
|
||||
}
|
||||
assert := assert.New(t)
|
||||
|
||||
var fd uintptr = 4
|
||||
|
Loading…
Reference in New Issue
Block a user