api: add sandbox Status API

It returns the status of current sandbox.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
This commit is contained in:
Peng Tao
2018-04-20 15:52:46 +08:00
parent b3d9683743
commit 488c3ee353
4 changed files with 40 additions and 0 deletions

View File

@@ -1356,3 +1356,11 @@ func TestStatusContainer(t *testing.T) {
_, err = s.DeleteContainer(contID)
assert.Nil(t, err, "Failed to delete container %s in sandbox %s: %v", contID, s.ID(), err)
}
func TestStatusSandbox(t *testing.T) {
s, err := testCreateSandbox(t, testSandboxID, MockHypervisor, newHypervisorConfig(nil, nil), NoopAgentType, NoopNetworkModel, NetworkConfig{}, nil, nil)
assert.Nil(t, err, "VirtContainers should not allow empty sandboxes")
defer cleanUp()
s.Status()
}