progress: set --cache-max-size in osbuild
This commit allows controlling the `osbuild --cache-max-size` option. By default it will set the cache to 20GiB but allows this to be controlled by the user. Thanks to Simon for raising this.
This commit is contained in:
parent
2cfe043f5e
commit
958f95f634
2 changed files with 45 additions and 25 deletions
|
|
@ -263,3 +263,21 @@ osbuild-stderr-output
|
|||
`
|
||||
assert.Equal(t, expectedOutput, buildLog.String())
|
||||
}
|
||||
|
||||
func TestRunOSBuildCacheMaxSize(t *testing.T) {
|
||||
fakeOsbuildBinary := makeFakeOsbuild(t, `echo "$@" > "$0".cmdline`)
|
||||
restore := progress.MockOsbuildCmd(fakeOsbuildBinary)
|
||||
defer restore()
|
||||
|
||||
pbar, err := progress.New("debug")
|
||||
assert.NoError(t, err)
|
||||
|
||||
osbuildOpts := &progress.OSBuildOptions{
|
||||
CacheMaxSize: 77,
|
||||
}
|
||||
err = progress.RunOSBuild(pbar, []byte(`{"fake":"manifest"}`), nil, osbuildOpts)
|
||||
assert.NoError(t, err)
|
||||
cmdline, err := os.ReadFile(fakeOsbuildBinary + ".cmdline")
|
||||
assert.NoError(t, err)
|
||||
assert.Contains(t, string(cmdline), "--cache-max-size=77")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue