mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-10-22 12:29:49 +00:00
virtcontainers/tests: Disable selected tests for uid != 0
Skip a number of virtcontainers tests if not running as `root.` Fixes #70. Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
This commit is contained in:
@@ -279,6 +279,10 @@ func testGenerateCCProxySockDir() (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestCreatePodHyperstartAgentSuccessful(t *testing.T) {
|
func TestCreatePodHyperstartAgentSuccessful(t *testing.T) {
|
||||||
|
if os.Geteuid() != 0 {
|
||||||
|
t.Skip(testDisabledAsNonRoot)
|
||||||
|
}
|
||||||
|
|
||||||
cleanUp()
|
cleanUp()
|
||||||
|
|
||||||
config := newTestPodConfigHyperstartAgent()
|
config := newTestPodConfigHyperstartAgent()
|
||||||
@@ -308,6 +312,10 @@ func TestCreatePodHyperstartAgentSuccessful(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestCreatePodKataAgentSuccessful(t *testing.T) {
|
func TestCreatePodKataAgentSuccessful(t *testing.T) {
|
||||||
|
if os.Geteuid() != 0 {
|
||||||
|
t.Skip(testDisabledAsNonRoot)
|
||||||
|
}
|
||||||
|
|
||||||
cleanUp()
|
cleanUp()
|
||||||
|
|
||||||
config := newTestPodConfigKataAgent()
|
config := newTestPodConfigKataAgent()
|
||||||
@@ -383,6 +391,10 @@ func TestDeletePodNoopAgentSuccessful(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestDeletePodHyperstartAgentSuccessful(t *testing.T) {
|
func TestDeletePodHyperstartAgentSuccessful(t *testing.T) {
|
||||||
|
if os.Geteuid() != 0 {
|
||||||
|
t.Skip(testDisabledAsNonRoot)
|
||||||
|
}
|
||||||
|
|
||||||
cleanUp()
|
cleanUp()
|
||||||
|
|
||||||
config := newTestPodConfigHyperstartAgent()
|
config := newTestPodConfigHyperstartAgent()
|
||||||
@@ -422,6 +434,10 @@ func TestDeletePodHyperstartAgentSuccessful(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestDeletePodKataAgentSuccessful(t *testing.T) {
|
func TestDeletePodKataAgentSuccessful(t *testing.T) {
|
||||||
|
if os.Geteuid() != 0 {
|
||||||
|
t.Skip(testDisabledAsNonRoot)
|
||||||
|
}
|
||||||
|
|
||||||
cleanUp()
|
cleanUp()
|
||||||
|
|
||||||
config := newTestPodConfigKataAgent()
|
config := newTestPodConfigKataAgent()
|
||||||
@@ -527,6 +543,10 @@ func TestStartPodHyperstartAgentSuccessful(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestStartPodKataAgentSuccessful(t *testing.T) {
|
func TestStartPodKataAgentSuccessful(t *testing.T) {
|
||||||
|
if os.Geteuid() != 0 {
|
||||||
|
t.Skip(testDisabledAsNonRoot)
|
||||||
|
}
|
||||||
|
|
||||||
cleanUp()
|
cleanUp()
|
||||||
|
|
||||||
config := newTestPodConfigKataAgent()
|
config := newTestPodConfigKataAgent()
|
||||||
@@ -685,6 +705,10 @@ func TestStopPodHyperstartAgentSuccessful(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestStopPodKataAgentSuccessful(t *testing.T) {
|
func TestStopPodKataAgentSuccessful(t *testing.T) {
|
||||||
|
if os.Geteuid() != 0 {
|
||||||
|
t.Skip(testDisabledAsNonRoot)
|
||||||
|
}
|
||||||
|
|
||||||
cleanUp()
|
cleanUp()
|
||||||
|
|
||||||
config := newTestPodConfigKataAgent()
|
config := newTestPodConfigKataAgent()
|
||||||
@@ -791,6 +815,10 @@ func TestRunPodHyperstartAgentSuccessful(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestRunPodKataAgentSuccessful(t *testing.T) {
|
func TestRunPodKataAgentSuccessful(t *testing.T) {
|
||||||
|
if os.Geteuid() != 0 {
|
||||||
|
t.Skip(testDisabledAsNonRoot)
|
||||||
|
}
|
||||||
|
|
||||||
cleanUp()
|
cleanUp()
|
||||||
|
|
||||||
config := newTestPodConfigKataAgent()
|
config := newTestPodConfigKataAgent()
|
||||||
|
@@ -193,6 +193,10 @@ func cleanupFakeRootfsSetup(testRawFile, loopDev, mntDir string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestContainerAddDriveDir(t *testing.T) {
|
func TestContainerAddDriveDir(t *testing.T) {
|
||||||
|
if os.Geteuid() != 0 {
|
||||||
|
t.Skip(testDisabledAsNonRoot)
|
||||||
|
}
|
||||||
|
|
||||||
testRawFile, loopDev, fakeRootfs, err := testSetupFakeRootfs(t)
|
testRawFile, loopDev, fakeRootfs, err := testSetupFakeRootfs(t)
|
||||||
|
|
||||||
defer cleanupFakeRootfsSetup(testRawFile, loopDev, fakeRootfs)
|
defer cleanupFakeRootfsSetup(testRawFile, loopDev, fakeRootfs)
|
||||||
|
@@ -309,6 +309,10 @@ func TestCreateVirtualNetworkEndpointInvalidArgs(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestIsPhysicalIface(t *testing.T) {
|
func TestIsPhysicalIface(t *testing.T) {
|
||||||
|
if os.Geteuid() != 0 {
|
||||||
|
t.Skip(testDisabledAsNonRoot)
|
||||||
|
}
|
||||||
|
|
||||||
testNetIface := "testIface0"
|
testNetIface := "testIface0"
|
||||||
testMTU := 1500
|
testMTU := 1500
|
||||||
testMACAddr := "00:00:00:00:00:01"
|
testMACAddr := "00:00:00:00:00:01"
|
||||||
|
Reference in New Issue
Block a user