(t *testing.T)
| 789 | } |
| 790 | |
| 791 | func 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 | |
| 807 | func TestParseRestartPolicy(t *testing.T) { |
| 808 | tests := []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…