1
0
Fork 0
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:
Paul "TBBle" Hampson 2020-09-10 00:50:59 +10:00
parent 0bad48279e
commit 2dd9faaa16

View file

@ -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)