"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "integration/container/run_linux_test.go" between
moby-20.10.6.tar.gz and moby-20.10.7.tar.gz

About: Moby is a framework to assemble specialized container systems (formerly project name Docker; see here to clarify the relationship between the projects).

run_linux_test.go  (moby-20.10.6):run_linux_test.go  (moby-20.10.7)
package container // import "github.com/docker/docker/integration/container" package container // import "github.com/docker/docker/integration/container"
import ( import (
"context" "context"
"strconv"
"strings" "strings"
"testing" "testing"
"time" "time"
containertypes "github.com/docker/docker/api/types/container" containertypes "github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/versions" "github.com/docker/docker/api/types/versions"
"github.com/docker/docker/integration/internal/container" "github.com/docker/docker/integration/internal/container"
net "github.com/docker/docker/integration/internal/network" net "github.com/docker/docker/integration/internal/network"
"gotest.tools/v3/assert" "gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp" is "gotest.tools/v3/assert/cmp"
"gotest.tools/v3/poll" "gotest.tools/v3/poll"
"gotest.tools/v3/skip" "gotest.tools/v3/skip"
) )
func TestKernelTCPMemory(t *testing.T) {
skip.If(t, testEnv.DaemonInfo.OSType != "linux")
skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.40"), "skip t
est from new feature")
skip.If(t, testEnv.DaemonInfo.CgroupDriver == "none")
skip.If(t, !testEnv.DaemonInfo.KernelMemoryTCP)
defer setupTest(t)()
client := testEnv.APIClient()
ctx := context.Background()
const (
kernelMemoryTCP int64 = 200 * 1024 * 1024
)
cID := container.Run(ctx, t, client, func(c *container.TestContainerConfi
g) {
c.HostConfig.Resources = containertypes.Resources{
KernelMemoryTCP: kernelMemoryTCP,
}
})
poll.WaitOn(t, container.IsInState(ctx, client, cID, "running"), poll.Wit
hDelay(100*time.Millisecond))
inspect, err := client.ContainerInspect(ctx, cID)
assert.NilError(t, err)
assert.Check(t, is.Equal(kernelMemoryTCP, inspect.HostConfig.KernelMemory
TCP))
res, err := container.Exec(ctx, client, cID,
[]string{"cat", "/sys/fs/cgroup/memory/memory.kmem.tcp.limit_in_b
ytes"})
assert.NilError(t, err)
assert.Assert(t, is.Len(res.Stderr(), 0))
assert.Equal(t, 0, res.ExitCode)
assert.Check(t, is.Equal(strconv.FormatInt(kernelMemoryTCP, 10), strings.
TrimSpace(res.Stdout())))
}
func TestNISDomainname(t *testing.T) { func TestNISDomainname(t *testing.T) {
// Older versions of the daemon would concatenate hostname and domainname , // Older versions of the daemon would concatenate hostname and domainname ,
// so hostname "foobar" and domainname "baz.cyphar.com" would produce // so hostname "foobar" and domainname "baz.cyphar.com" would produce
// `foobar.baz.cyphar.com` as hostname. // `foobar.baz.cyphar.com` as hostname.
skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.40"), "skip t est from new feature") skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.40"), "skip t est from new feature")
skip.If(t, testEnv.DaemonInfo.OSType != "linux") skip.If(t, testEnv.DaemonInfo.OSType != "linux")
// Rootless supports custom Hostname but doesn't support custom Domainnam e // Rootless supports custom Hostname but doesn't support custom Domainnam e
// OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused \ // OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused \
// "write sysctl key kernel.domainname: open /proc/sys/kernel/domainname : permission denied\"": unknown. // "write sysctl key kernel.domainname: open /proc/sys/kernel/domainname : permission denied\"": unknown.
 End of changes. 2 change blocks. 
41 lines changed or deleted 0 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)