This repository has been archived by the owner on Mar 24, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: Add some volume test for large number of files in a single dir…
…ectory Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
- Loading branch information
Showing
21 changed files
with
427 additions
and
0 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
tests/cases/900_perf/100_volume/020_single_dir/010_stat_5000_files/run.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#! /bin/sh | ||
|
||
set -e | ||
# don't set -x as it creates a lot of noise | ||
|
||
DIR=$1 | ||
|
||
# find calls lstat() | ||
find "$DIR" -type f > dev/null |
22 changes: 22 additions & 0 deletions
22
tests/cases/900_perf/100_volume/020_single_dir/010_stat_5000_files/test.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# SUMMARY: Stat 5000 files in a single directory created on the host | ||
# LABELS: | ||
# REPEAT: | ||
|
||
$libBase = Join-Path -Path $env:RT_PROJECT_ROOT -ChildPath _lib | ||
$lib = Join-Path -Path $libBase -ChildPath lib.ps1 | ||
. $lib | ||
|
||
$ret = 0 | ||
|
||
$testPath = Join-Path -Path $env:TEST_TMP_ROOT -ChildPath "single-dir-stat" | ||
|
||
$p = [string]$pwd.Path | ||
docker run --platform linux --rm ` | ||
-v $testPath`:/test ` | ||
-v $p`:/script ` | ||
alpine:3.7 sh /script/run.sh /test | ||
if ($lastexitcode -ne 0) { | ||
$ret = 1 | ||
} | ||
|
||
exit $ret |
11 changes: 11 additions & 0 deletions
11
tests/cases/900_perf/100_volume/020_single_dir/015_stat_5000_non_existing_files/run.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#! /bin/sh | ||
|
||
# set -e | ||
# don't set -x as it creates a lot of noise | ||
|
||
DIR=$1 | ||
|
||
for i in $(seq 5000); do | ||
stat "$DIR/file-$i" 2> /dev/null | ||
done | ||
exit 0 |
24 changes: 24 additions & 0 deletions
24
tests/cases/900_perf/100_volume/020_single_dir/015_stat_5000_non_existing_files/test.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# SUMMARY: Stat 5000 non-existing files in a single directory on a shared volume | ||
# LABELS: | ||
# REPEAT: | ||
|
||
$libBase = Join-Path -Path $env:RT_PROJECT_ROOT -ChildPath _lib | ||
$lib = Join-Path -Path $libBase -ChildPath lib.ps1 | ||
. $lib | ||
|
||
$ret = 0 | ||
|
||
Remove-Item -Force -Recurse -ErrorAction Ignore -Path $env:TEST_TMP | ||
New-Item -ItemType Directory -Force -Path $env:TEST_TMP | ||
|
||
$p = [string]$pwd.Path | ||
docker run --platform linux --rm ` | ||
-v $env:TEST_TMP`:/test ` | ||
-v $p`:/script ` | ||
alpine:3.7 sh /script/run.sh /test | ||
if ($lastexitcode -ne 0) { | ||
$ret = 1 | ||
} | ||
|
||
Remove-Item -Force -Recurse -ErrorAction Ignore -Path $env:TEST_TMP | ||
exit $ret |
10 changes: 10 additions & 0 deletions
10
tests/cases/900_perf/100_volume/020_single_dir/020_touch_5000_files/run.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#! /bin/sh | ||
|
||
set -e | ||
# don't set -x as it creates a lot of noise | ||
|
||
DIR=$1 | ||
|
||
for i in $(seq 5000); do | ||
touch "$DIR/file-$i" | ||
done |
24 changes: 24 additions & 0 deletions
24
tests/cases/900_perf/100_volume/020_single_dir/020_touch_5000_files/test.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# SUMMARY: Create 5000 files in a single directory on a shared volume | ||
# LABELS: | ||
# REPEAT: | ||
|
||
$libBase = Join-Path -Path $env:RT_PROJECT_ROOT -ChildPath _lib | ||
$lib = Join-Path -Path $libBase -ChildPath lib.ps1 | ||
. $lib | ||
|
||
$ret = 0 | ||
|
||
Remove-Item -Force -Recurse -ErrorAction Ignore -Path $env:TEST_TMP | ||
New-Item -ItemType Directory -Force -Path $env:TEST_TMP | ||
|
||
$p = [string]$pwd.Path | ||
docker run --platform linux --rm ` | ||
-v $env:TEST_TMP`:/test ` | ||
-v $p`:/script ` | ||
alpine:3.7 sh /script/run.sh /test | ||
if ($lastexitcode -ne 0) { | ||
$ret = 1 | ||
} | ||
|
||
Remove-Item -Force -Recurse -ErrorAction Ignore -Path $env:TEST_TMP | ||
exit $ret |
13 changes: 13 additions & 0 deletions
13
tests/cases/900_perf/100_volume/020_single_dir/030_touch_stat_5000_files/run.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#! /bin/sh | ||
|
||
set -e | ||
# don't set -x as it creates a lot of noise | ||
|
||
DIR=$1 | ||
|
||
for i in $(seq 5000); do | ||
touch "$DIR/file-$i" | ||
done | ||
|
||
# find calls lstat() | ||
find "$DIR" -type f > dev/null |
24 changes: 24 additions & 0 deletions
24
tests/cases/900_perf/100_volume/020_single_dir/030_touch_stat_5000_files/test.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# SUMMARY: Create 5000 files in a single directory on a shared volume and then stat them | ||
# LABELS: | ||
# REPEAT: | ||
|
||
$libBase = Join-Path -Path $env:RT_PROJECT_ROOT -ChildPath _lib | ||
$lib = Join-Path -Path $libBase -ChildPath lib.ps1 | ||
. $lib | ||
|
||
$ret = 0 | ||
|
||
Remove-Item -Force -Recurse -ErrorAction Ignore -Path $env:TEST_TMP | ||
New-Item -ItemType Directory -Force -Path $env:TEST_TMP | ||
|
||
$p = [string]$pwd.Path | ||
docker run --platform linux --rm ` | ||
-v $env:TEST_TMP`:/test ` | ||
-v $p`:/script ` | ||
alpine:3.7 sh /script/run.sh /test | ||
if ($lastexitcode -ne 0) { | ||
$ret = 1 | ||
} | ||
|
||
Remove-Item -Force -Recurse -ErrorAction Ignore -Path $env:TEST_TMP | ||
exit $ret |
9 changes: 9 additions & 0 deletions
9
tests/cases/900_perf/100_volume/020_single_dir/040_stat_touch_5000_files/run.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#! /bin/sh | ||
|
||
set -e | ||
# don't set -x as it creates a lot of noise | ||
|
||
DIR=$1 | ||
|
||
# find calls lstat() | ||
find "$DIR" -type f -print0 | xargs -0 touch > dev/null |
22 changes: 22 additions & 0 deletions
22
tests/cases/900_perf/100_volume/020_single_dir/040_stat_touch_5000_files/test.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# SUMMARY: Stat and then touch 5000 files in a single directory created on the host | ||
# LABELS: | ||
# REPEAT: | ||
|
||
$libBase = Join-Path -Path $env:RT_PROJECT_ROOT -ChildPath _lib | ||
$lib = Join-Path -Path $libBase -ChildPath lib.ps1 | ||
. $lib | ||
|
||
$ret = 0 | ||
|
||
$testPath = Join-Path -Path $env:TEST_TMP_ROOT -ChildPath "single-dir-touch" | ||
|
||
$p = [string]$pwd.Path | ||
docker run --platform linux --rm ` | ||
-v $testPath`:/test ` | ||
-v $p`:/script ` | ||
alpine:3.7 sh /script/run.sh /test | ||
if ($lastexitcode -ne 0) { | ||
$ret = 1 | ||
} | ||
|
||
exit $ret |
9 changes: 9 additions & 0 deletions
9
tests/cases/900_perf/100_volume/020_single_dir/050_stat_touch_stat_5000_files/run.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#! /bin/sh | ||
|
||
set -e | ||
|
||
DIR=$1 | ||
|
||
# find calls lstat() | ||
find "$DIR" -type f -print0 | xargs -0 touch > dev/null | ||
find "$DIR" -type f > dev/null |
22 changes: 22 additions & 0 deletions
22
tests/cases/900_perf/100_volume/020_single_dir/050_stat_touch_stat_5000_files/test.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# SUMMARY: Stat, touch and then stat again 5000 files on a shared volume | ||
# LABELS: | ||
# REPEAT: | ||
|
||
$libBase = Join-Path -Path $env:RT_PROJECT_ROOT -ChildPath _lib | ||
$lib = Join-Path -Path $libBase -ChildPath lib.ps1 | ||
. $lib | ||
|
||
$ret = 0 | ||
|
||
$testPath = Join-Path -Path $env:TEST_TMP_ROOT -ChildPath "single-dir-touch-stat" | ||
|
||
$p = [string]$pwd.Path | ||
docker run --platform linux --rm ` | ||
-v $testPath`:/test ` | ||
-v $p`:/script ` | ||
alpine:3.7 sh /script/run.sh /test | ||
if ($lastexitcode -ne 0) { | ||
$ret = 1 | ||
} | ||
|
||
exit $ret |
10 changes: 10 additions & 0 deletions
10
tests/cases/900_perf/100_volume/020_single_dir/060_write_5000_files_512B/run.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#! /bin/sh | ||
|
||
set -e | ||
|
||
DIR=$1 | ||
SIZE=$2 | ||
|
||
for i in $(seq 5000); do | ||
dd if=/dev/zero of="$DIR/file-$i" bs="$SIZE" count=1 | ||
done |
24 changes: 24 additions & 0 deletions
24
tests/cases/900_perf/100_volume/020_single_dir/060_write_5000_files_512B/test.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# SUMMARY: Write 5000 small files in a single directory | ||
# LABELS: | ||
# REPEAT: | ||
|
||
$libBase = Join-Path -Path $env:RT_PROJECT_ROOT -ChildPath _lib | ||
$lib = Join-Path -Path $libBase -ChildPath lib.ps1 | ||
. $lib | ||
|
||
$ret = 0 | ||
|
||
Remove-Item -Force -Recurse -ErrorAction Ignore -Path $env:TEST_TMP | ||
New-Item -ItemType Directory -Force -Path $env:TEST_TMP | ||
|
||
$p = [string]$pwd.Path | ||
docker run --platform linux --rm ` | ||
-v $env:TEST_TMP`:/test ` | ||
-v $p`:/script ` | ||
alpine:3.7 sh /script/run.sh /test 512 | ||
if ($lastexitcode -ne 0) { | ||
$ret = 1 | ||
} | ||
|
||
Remove-Item -Force -Recurse -ErrorAction Ignore -Path $env:TEST_TMP | ||
exit $ret |
14 changes: 14 additions & 0 deletions
14
tests/cases/900_perf/100_volume/020_single_dir/065_write_write_5000_files_512B/run.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#! /bin/sh | ||
|
||
set -e | ||
|
||
DIR=$1 | ||
SIZE=$2 | ||
|
||
for i in $(seq 5000); do | ||
dd if=/dev/zero of="$DIR/file-$i" bs="$SIZE" count=1 | ||
done | ||
|
||
for i in $(seq 5000); do | ||
dd if=/dev/zero of="$DIR/file-$i" bs="$SIZE" count=1 | ||
done |
24 changes: 24 additions & 0 deletions
24
tests/cases/900_perf/100_volume/020_single_dir/065_write_write_5000_files_512B/test.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# SUMMARY: Write twice over the 5000 small files in a single directory | ||
# LABELS: | ||
# REPEAT: | ||
|
||
$libBase = Join-Path -Path $env:RT_PROJECT_ROOT -ChildPath _lib | ||
$lib = Join-Path -Path $libBase -ChildPath lib.ps1 | ||
. $lib | ||
|
||
$ret = 0 | ||
|
||
Remove-Item -Force -Recurse -ErrorAction Ignore -Path $env:TEST_TMP | ||
New-Item -ItemType Directory -Force -Path $env:TEST_TMP | ||
|
||
$p = [string]$pwd.Path | ||
docker run --platform linux --rm ` | ||
-v $env:TEST_TMP`:/test ` | ||
-v $p`:/script ` | ||
alpine:3.7 sh /script/run.sh /test 512 | ||
if ($lastexitcode -ne 0) { | ||
$ret = 1 | ||
} | ||
|
||
Remove-Item -Force -Recurse -ErrorAction Ignore -Path $env:TEST_TMP | ||
exit $ret |
9 changes: 9 additions & 0 deletions
9
tests/cases/900_perf/100_volume/020_single_dir/070_stat_read_5000_files_512B/run.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#! /bin/sh | ||
|
||
set -e | ||
# don't set -x as it creates a lot of noise | ||
|
||
DIR=$1 | ||
|
||
# find calls lstat() | ||
find "$DIR" -type f -print0 | xargs -0 cat > dev/null |
22 changes: 22 additions & 0 deletions
22
tests/cases/900_perf/100_volume/020_single_dir/070_stat_read_5000_files_512B/test.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# SUMMARY: Stat and then read 5000 files in a single directory created on the host | ||
# LABELS: | ||
# REPEAT: | ||
|
||
$libBase = Join-Path -Path $env:RT_PROJECT_ROOT -ChildPath _lib | ||
$lib = Join-Path -Path $libBase -ChildPath lib.ps1 | ||
. $lib | ||
|
||
$ret = 0 | ||
|
||
$testPath = Join-Path -Path $env:TEST_TMP_ROOT -ChildPath "single-dir-read" | ||
|
||
$p = [string]$pwd.Path | ||
docker run --platform linux --rm ` | ||
-v $testPath`:/test ` | ||
-v $p`:/script ` | ||
alpine:3.7 sh /script/run.sh /test | ||
if ($lastexitcode -ne 0) { | ||
$ret = 1 | ||
} | ||
|
||
exit $ret |
9 changes: 9 additions & 0 deletions
9
...s/cases/900_perf/100_volume/020_single_dir/075_stat_read_stat_read_5000_files_512B/run.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#! /bin/sh | ||
|
||
set -e | ||
|
||
DIR=$1 | ||
|
||
# find calls lstat() | ||
find "$DIR" -type f -print0 | xargs -0 cat > dev/null | ||
find "$DIR" -type f -print0 | xargs -0 cat > dev/null |
22 changes: 22 additions & 0 deletions
22
...cases/900_perf/100_volume/020_single_dir/075_stat_read_stat_read_5000_files_512B/test.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# SUMMARY: Stat, read, stat, read 5000 files in a single directory created on the host | ||
# LABELS: | ||
# REPEAT: | ||
|
||
$libBase = Join-Path -Path $env:RT_PROJECT_ROOT -ChildPath _lib | ||
$lib = Join-Path -Path $libBase -ChildPath lib.ps1 | ||
. $lib | ||
|
||
$ret = 0 | ||
|
||
$testPath = Join-Path -Path $env:TEST_TMP_ROOT -ChildPath "single-dir-read-read" | ||
|
||
$p = [string]$pwd.Path | ||
docker run --platform linux --rm ` | ||
-v $testPath`:/test ` | ||
-v $p`:/script ` | ||
alpine:3.7 sh /script/run.sh /test | ||
if ($lastexitcode -ne 0) { | ||
$ret = 1 | ||
} | ||
|
||
exit $ret |
Oops, something went wrong.