diff --git a/virtcontainers/types/sandbox_test.go b/virtcontainers/types/sandbox_test.go index 875eee1a13..05075e4495 100644 --- a/virtcontainers/types/sandbox_test.go +++ b/virtcontainers/types/sandbox_test.go @@ -44,12 +44,17 @@ func TestSandboxStateRunningStopped(t *testing.T) { assert.NoError(t, err) } -func TestSandboxStateReadyPaused(t *testing.T) { +func TestSandboxStateReadyStopped(t *testing.T) { err := testSandboxStateTransition(t, StateReady, StateStopped) assert.NoError(t, err) } -func TestSandboxStatePausedReady(t *testing.T) { +func TestSandboxStateStoppedRunning(t *testing.T) { + err := testSandboxStateTransition(t, StateStopped, StateRunning) + assert.NoError(t, err) +} + +func TestSandboxStateStoppedReady(t *testing.T) { err := testSandboxStateTransition(t, StateStopped, StateReady) assert.Error(t, err) } @@ -104,6 +109,15 @@ func TestVolumesSetSuccessful(t *testing.T) { assert.Exactly(t, *volumes, expected) } +func TestVolumesSetFailingEmptyString(t *testing.T) { + volumes := &Volumes{} + + volStr := "" + + err := volumes.Set(volStr) + assert.Error(t, err) +} + func TestVolumesSetFailingTooFewArguments(t *testing.T) { volumes := &Volumes{} @@ -174,6 +188,15 @@ func TestSocketsSetSuccessful(t *testing.T) { assert.Exactly(t, *sockets, expected) } +func TestSocketsSetFailingEmptyString(t *testing.T) { + sockets := &Sockets{} + + sockStr := "" + + err := sockets.Set(sockStr) + assert.Error(t, err) +} + func TestSocketsSetFailingWrongArgsAmount(t *testing.T) { sockets := &Sockets{}