MCPcopy Create free account
hub / github.com/docker/cli / TestRunFlagsParseShmSize

Function TestRunFlagsParseShmSize

cli/command/container/opts_test.go:791–805  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

789}
790
791func TestRunFlagsParseShmSize(t *testing.T) {
792 // shm-size ko
793 flags, _ := setupRunFlags()
794 args := []string{"--shm-size=a128m", "img", "cmd"}
795 expectedErr := `invalid argument "a128m" for "--shm-size" flag:`
796 err := flags.Parse(args)
797 assert.ErrorContains(t, err, expectedErr)
798
799 // shm-size ok
800 _, hostconfig, _, err := parseRun([]string{"--shm-size=128m", "img", "cmd"})
801 assert.NilError(t, err)
802 if hostconfig.ShmSize != 134217728 {
803 t.Fatalf("Expected a valid ShmSize, got %d", hostconfig.ShmSize)
804 }
805}
806
807func TestParseRestartPolicy(t *testing.T) {
808 tests := []struct {

Callers

nothing calls this directly

Calls 2

setupRunFlagsFunction · 0.85
parseRunFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…