Skip to contentSkip to conversation

Test improvements

PATCH In review Glenn Washburn 2 participants 6 messages Apr 9, 2022 – Apr 26, 2022

lore
Share & tools
lore
#0 lore raw

cover Test improvements

A couple improvements to the grub-fs-tester. I was seeing the issue with the blkid cache when running many parallel UML instances.

Glenn

Glenn Washburn (2):
tests: Disable blkid cache usage
tests: Give grub-fs-tester temp directory a better name

 tests/util/grub-fs-tester.in | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/2 tests: Disable blkid cache usage

Using the blkid cache can cause issues when running many file system tests in parallel. We do not need it, as its only there to improve performance, and using the cache does not provide significant performance improvements.

---
 tests/util/grub-fs-tester.in | 1 +
 1 file changed, 1 insertion(+)
tests/util/grub-fs-tester.in +1 -0
index 65633c7f81..868199109f 100644
@@ -1,6 +1,7 @@
 #!@BUILD_SHEBANG@
 
 set -e
+export BLKID_FILE=/dev/null
 
 fs="$1"
 
Signature · 1 line
2.25.1
#2 lore raw

PATCH 2/2 tests: Give grub-fs-tester temp directory a better name

In reply to Glenn Washburn

Instead of "tmp" the name is prefixed by the name of the scripts (eg. grub-fs-tester). A timestamp is added in the name to allow for easily seeing a chronological sorting of runs and the name of the filesystem being tested. The random component is set to the minimal possible, 3 characters, because the timestamp should provide enough uniqueness.

---
 tests/util/grub-fs-tester.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/util/grub-fs-tester.in +1 -1
index 868199109f..02edcf897f 100644
@@ -7,7 +7,7 @@ fs="$1"
 
 GRUBFSTEST="@builddir@/grub-fstest"
 
-tempdir=`mktemp -d "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` ||
+tempdir=`mktemp -d "${TMPDIR:-/tmp}/${0##*/}.$(date '+%Y%m%d%H%M%S%N').${fs}.XXX"` ||
 { echo "Failed to make temporary directory"; exit 99; }
 
 # xorriso -as mkisofs options to ignore locale when processing file names and
Signature · 1 line
2.25.1
#3 lore raw

Re: [PATCH 2/2] tests: Give grub-fs-tester temp directory a better name

Quoted 16 lines · Glenn Washburn

Instead of "tmp" the name is prefixed by the name of the scripts (eg. grub-fs-tester). A timestamp is added in the name to allow for easily seeing a chronological sorting of runs and the name of the filesystem being tested. The random component is set to the minimal possible, 3 characters, because the timestamp should provide enough uniqueness.

---
 tests/util/grub-fs-tester.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/util/grub-fs-tester.in +0 -0
index 868199109f..02edcf897f 100644

tests/util/grub-fs-tester.in fs="$1" · line 10

Quoted 5 lines
tests/util/grub-fs-tester.in +1 -1
@@ -7,7 +7,7 @@ fs="$1"
 
 GRUBFSTEST="@builddir@/grub-fstest"
 
-tempdir=`mktemp -d "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` ||
+tempdir=`mktemp -d "${TMPDIR:-/tmp}/${0##*/}.$(date '+%Y%m%d%H%M%S%N').${fs}.XXX"` ||

I would just s/XXX/tmp/. Otherwise LGTM...

For both patches Reviewed-by: Daniel Kiper <[email protected]>

Daniel

#4 lore raw

Re: [PATCH 2/2] tests: Give grub-fs-tester temp directory a better name

Quoted 18 lines · Daniel Kiper
Quoted 17 lines · Glenn Washburn

Instead of "tmp" the name is prefixed by the name of the scripts (eg. grub-fs-tester). A timestamp is added in the name to allow for easily seeing a chronological sorting of runs and the name of the filesystem being tested. The random component is set to the minimal possible, 3 characters, because the timestamp should provide enough uniqueness.

---
  tests/util/grub-fs-tester.in | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
tests/util/grub-fs-tester.in +0 -0
index 868199109f..02edcf897f 100644
@@ -7,7 +7,7 @@ fs="$1"
 
Quoted 6 lines

tests/util/grub-fs-tester.in fs="$1" · line 10

Quoted 4 lines
tests/util/grub-fs-tester.in +1 -1
  GRUBFSTEST="@builddir@/grub-fstest"
 
-tempdir=`mktemp -d "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` ||
+tempdir=`mktemp -d "${TMPDIR:-/tmp}/${0##*/}.$(date '+%Y%m%d%H%M%S%N').${fs}.XXX"` ||

I would just s/XXX/tmp/. Otherwise LGTM...

mktemp fails with "too few X's in template" if the minimum number of X's (which is 3) are not provided.

Quoted 3 lines

For both patches Reviewed-by: Daniel Kiper <[email protected]>

Daniel

Glenn

#5 lore raw

Re: [PATCH 2/2] tests: Give grub-fs-tester temp directory a better name

Quoted 21 lines · Glenn Washburn
Quoted 20 lines · Daniel Kiper
Quoted 19 lines · Glenn Washburn

Instead of "tmp" the name is prefixed by the name of the scripts (eg. grub-fs-tester). A timestamp is added in the name to allow for easily seeing a chronological sorting of runs and the name of the filesystem being tested. The random component is set to the minimal possible, 3 characters, because the timestamp should provide enough uniqueness.

---
  tests/util/grub-fs-tester.in | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
tests/util/grub-fs-tester.in +0 -0
index 868199109f..02edcf897f 100644
@@ -7,7 +7,7 @@ fs="$1"
 
  GRUBFSTEST="@builddir@/grub-fstest"
 
Quoted 7 lines
Quoted 4 lines

tests/util/grub-fs-tester.in fs="$1" · line 10

Quoted 2 lines
tests/util/grub-fs-tester.in +1 -1
-tempdir=`mktemp -d "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` ||
+tempdir=`mktemp -d "${TMPDIR:-/tmp}/${0##*/}.$(date '+%Y%m%d%H%M%S%N').${fs}.XXX"` ||

I would just s/XXX/tmp/. Otherwise LGTM...

mktemp fails with "too few X's in template" if the minimum number of X's (which is 3) are not provided.

Ugh... Well, I should read mktemp man first. Sorry for the noise. Applied without change...

Thank you for fixing this.

Daniel