ec4a34ae2f
- Updated TestInfoSecurityOptions to not rely on CLI output. Note that this test should be migrated to the integration suite, but that suite does not yet have checks for "Seccomp" and "AppArmor" - TestInfoAPIWarnings: don't start with busybox because we're not running containers in this test - Migrate TestInfoDebug to integration suite - Migrate TestInsecureRegistries to integration suite (renamed to TestInfoInsecureRegistries) - Migrate TestRegistryMirrors to integration suite (renamed to TestInfoRegistryMirrors) - Migrate TestInfoDiscoveryBackend to integration suite - Migrate TestInfoDiscoveryInvalidAdvertise to integration suite - Migrate TestInfoDiscoveryAdvertiseInterfaceName to integration suite - Remove TestInfoFormat, which is testing the CLI functionality, and there is an existing test in docker/cli (TestFormatInfo) covering this Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
32 lines
739 B
Go
32 lines
739 B
Go
// +build !windows
|
|
|
|
package main
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/docker/docker/client"
|
|
"gotest.tools/assert"
|
|
is "gotest.tools/assert/cmp"
|
|
)
|
|
|
|
func (s *DockerSuite) TestInfoSecurityOptions(c *testing.T) {
|
|
testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux)
|
|
if !seccompEnabled() && !Apparmor() {
|
|
c.Skip("test requires Seccomp and/or AppArmor")
|
|
}
|
|
|
|
cli, err := client.NewClientWithOpts(client.FromEnv)
|
|
assert.NilError(c, err)
|
|
defer cli.Close()
|
|
info, err := cli.Info(context.Background())
|
|
assert.NilError(c, err)
|
|
|
|
if Apparmor() {
|
|
assert.Check(c, is.Contains(info.SecurityOptions, "name=apparmor"))
|
|
}
|
|
if seccompEnabled() {
|
|
assert.Check(c, is.Contains(info.SecurityOptions, "name=seccomp,profile=default"))
|
|
}
|
|
}
|