virtcontainers: Reduce sandbox test noise

We need to set the sandbox context before calling into its API.

Fixes: #1211

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
Samuel Ortiz 2019-02-05 12:17:51 +01:00
parent 799ac6edf6
commit e402601cf8

View File

@ -1759,7 +1759,10 @@ func TestStartNetworkMonitor(t *testing.T) {
}
func TestSandboxStopStopped(t *testing.T) {
s := &Sandbox{state: types.State{State: types.StateStopped}}
s := &Sandbox{
ctx: context.Background(),
state: types.State{State: types.StateStopped},
}
err := s.Stop()
assert.Nil(t, err)