github.com/skanehira/moby@v17.12.1-ce-rc2+incompatible/cmd/dockerd/config_unix_test.go (about)

     1  // +build linux freebsd
     2  
     3  package main
     4  
     5  import (
     6  	"testing"
     7  
     8  	"github.com/docker/docker/daemon/config"
     9  	"github.com/spf13/pflag"
    10  	"github.com/stretchr/testify/assert"
    11  )
    12  
    13  func TestDaemonParseShmSize(t *testing.T) {
    14  	flags := pflag.NewFlagSet("test", pflag.ContinueOnError)
    15  
    16  	conf := &config.Config{}
    17  	installConfigFlags(conf, flags)
    18  	// By default `--default-shm-size=64M`
    19  	assert.Equal(t, int64(64*1024*1024), conf.ShmSize.Value())
    20  	assert.NoError(t, flags.Set("default-shm-size", "128M"))
    21  	assert.Equal(t, int64(128*1024*1024), conf.ShmSize.Value())
    22  }