2018-03-19 18:56:51 -04:00
|
|
|
package containerized
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/containerd/containerd/containers"
|
|
|
|
specs "github.com/opencontainers/runtime-spec/specs-go"
|
2020-02-22 12:12:14 -05:00
|
|
|
"gotest.tools/v3/assert"
|
2018-03-19 18:56:51 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestWithAllCapabilities(t *testing.T) {
|
|
|
|
c := &containers.Container{}
|
|
|
|
s := &specs.Spec{
|
|
|
|
Process: &specs.Process{},
|
|
|
|
}
|
|
|
|
ctx := context.Background()
|
|
|
|
err := WithAllCapabilities(ctx, nil, c, s)
|
|
|
|
assert.NilError(t, err)
|
|
|
|
assert.Assert(t, len(s.Process.Capabilities.Bounding) > 0)
|
|
|
|
}
|