mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-29 08:47:56 +00:00
ut: skip TestStartNetworkMonitor for non-root
It requires root to manipulate netns and otherwise fails like below: === RUN TestStartNetworkMonitor --- FAIL: TestStartNetworkMonitor (0.00s) Error Trace: sandbox_test.go:1481 Error: Expected nil, but got: &errors.errorString{s:"Error switching to ns /proc/6648/task/6651/ns/net: operation not permitted"} Signed-off-by: Peng Tao <bergwolf@hyper.sh>
This commit is contained in:
parent
d987a30367
commit
c4583f4486
@ -1458,6 +1458,9 @@ func TestGetNetNs(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestStartNetworkMonitor(t *testing.T) {
|
func TestStartNetworkMonitor(t *testing.T) {
|
||||||
|
if os.Getuid() != 0 {
|
||||||
|
t.Skip("Test disabled as requires root user")
|
||||||
|
}
|
||||||
trueBinPath, err := exec.LookPath("true")
|
trueBinPath, err := exec.LookPath("true")
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
assert.NotEmpty(t, trueBinPath)
|
assert.NotEmpty(t, trueBinPath)
|
||||||
|
Loading…
Reference in New Issue
Block a user