mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Enable TestBuildWithHugeFile on Windows
This reproduces #40444, based on a suggestion from GitHub user @marosset Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
This commit is contained in:
parent
0bad48279e
commit
2dd9faaa16
1 changed files with 9 additions and 2 deletions
|
@ -488,15 +488,22 @@ RUN [ ! -f foo ]
|
||||||
}
|
}
|
||||||
|
|
||||||
// #37581
|
// #37581
|
||||||
|
// #40444 (Windows Containers only)
|
||||||
func TestBuildWithHugeFile(t *testing.T) {
|
func TestBuildWithHugeFile(t *testing.T) {
|
||||||
skip.If(t, testEnv.OSType == "windows")
|
|
||||||
ctx := context.TODO()
|
ctx := context.TODO()
|
||||||
defer setupTest(t)()
|
defer setupTest(t)()
|
||||||
|
|
||||||
dockerfile := `FROM busybox
|
dockerfile := `FROM busybox
|
||||||
# create a sparse file with size over 8GB
|
`
|
||||||
|
|
||||||
|
if testEnv.DaemonInfo.OSType == "windows" {
|
||||||
|
dockerfile += `# create a file with size of 8GB
|
||||||
|
RUN powershell "fsutil.exe file createnew bigfile.txt 8589934592 ; dir bigfile.txt"`
|
||||||
|
} else {
|
||||||
|
dockerfile += `# create a sparse file with size over 8GB
|
||||||
RUN for g in $(seq 0 8); do dd if=/dev/urandom of=rnd bs=1K count=1 seek=$((1024*1024*g)) status=none; done && \
|
RUN for g in $(seq 0 8); do dd if=/dev/urandom of=rnd bs=1K count=1 seek=$((1024*1024*g)) status=none; done && \
|
||||||
ls -la rnd && du -sk rnd`
|
ls -la rnd && du -sk rnd`
|
||||||
|
}
|
||||||
|
|
||||||
buf := bytes.NewBuffer(nil)
|
buf := bytes.NewBuffer(nil)
|
||||||
w := tar.NewWriter(buf)
|
w := tar.NewWriter(buf)
|
||||||
|
|
Loading…
Add table
Reference in a new issue