mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-10-10 09:39:24 +00:00
When imported, the vc files carried in the 'full style' apache license text, but the standard for kata is to use SPDX style. Update the relevant files to SPDX. Fixes: #227 Signed-off-by: Graham whaley <graham.whaley@intel.com>
32 lines
783 B
Go
32 lines
783 B
Go
// Copyright (c) 2018 HyperHQ Inc.
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
|
|
package virtcontainers
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestSandboxListOperations(t *testing.T) {
|
|
p := &Sandbox{id: "testsandboxListsandbox"}
|
|
l := &sandboxList{sandboxes: make(map[string]*Sandbox)}
|
|
err := l.addSandbox(p)
|
|
assert.Nil(t, err, "addSandbox failed")
|
|
|
|
err = l.addSandbox(p)
|
|
assert.NotNil(t, err, "add same sandbox should fail")
|
|
|
|
np, err := l.lookupSandbox(p.id)
|
|
assert.Nil(t, err, "lookupSandbox failed")
|
|
assert.Equal(t, np, p, "lookupSandbox returns different sandbox %v:%v", np, p)
|
|
|
|
_, err = l.lookupSandbox("some-non-existing-sandbox-name")
|
|
assert.NotNil(t, err, "lookupSandbox for non-existing sandbox should fail")
|
|
|
|
l.removeSandbox(p.id)
|
|
}
|