mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-28 08:17:37 +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"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
ktu "github.com/kata-containers/kata-containers/src/runtime/pkg/katatestutils"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -22,6 +23,9 @@ func TestConsoleFromFile(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestNewConsole(t *testing.T) {
|
func TestNewConsole(t *testing.T) {
|
||||||
|
if tc.NotValid(ktu.NeedRoot()) {
|
||||||
|
t.Skip(testDisabledAsNonRoot)
|
||||||
|
}
|
||||||
assert := assert.New(t)
|
assert := assert.New(t)
|
||||||
|
|
||||||
console, err := newConsole()
|
console, err := newConsole()
|
||||||
@ -34,6 +38,9 @@ func TestNewConsole(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestIsTerminal(t *testing.T) {
|
func TestIsTerminal(t *testing.T) {
|
||||||
|
if tc.NotValid(ktu.NeedRoot()) {
|
||||||
|
t.Skip(testDisabledAsNonRoot)
|
||||||
|
}
|
||||||
assert := assert.New(t)
|
assert := assert.New(t)
|
||||||
|
|
||||||
var fd uintptr = 4
|
var fd uintptr = 4
|
||||||
|
Loading…
Reference in New Issue
Block a user