]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: mkfs-endianness test use iflag=fullblock to fill block completely with string
authorMasami Ichikawa <masami256@gmail.com>
Thu, 3 Sep 2020 01:04:36 +0000 (10:04 +0900)
committerMasami Ichikawa <masami256@gmail.com>
Thu, 3 Sep 2020 01:41:18 +0000 (10:41 +0900)
When run mkfs-endianness test on lowend machine, sometimes dd didn't
fill block with string then test failed.
So, it's nice to add iflag=fullblock option to fill a block with
string read from stdin.

Tested on Raspberry Pi 3 B+(using 1core to simulate lowend environment)
 with iflag=fullblock option didn't get test failure.

Without iflag=fullblock option.
$ sudo sh -c 'for i in $(seq 1 500); do taskset -c 0 ./ts/cramfs/mkfs-endianness ;  done' | grep FAILED | wc -l
49

With iflag=fullblock option.
$ sudo sh -c 'for i in $(seq 1 500); do taskset -c 0 ./ts/cramfs/mkfs-endianness ;  done' | grep FAILED | wc -l
0

Signed-off-by: Masami Ichikawa <masami256@gmail.com>
tests/ts/cramfs/mkfs-endianness

index e3913d65ebf0b7f7390394adb4be7a96f08433b2..e3e3ffc2dbddaaa89cfc8c79bdcba9f3a8a208b3 100755 (executable)
@@ -45,9 +45,9 @@ test_image() {
 rm -rf "$IMAGE_DATA"
 mkdir -p $IMAGE_DATA/dirA/dirB
 yes "Testing cramfs 1234567890 Endianness check 1234567890 Endianness check" \
-       | dd of=$IMAGE_DATA/dirA/dirB/a bs=512 count=1 &> /dev/null
+       | dd of=$IMAGE_DATA/dirA/dirB/a iflag=fullblock bs=512 count=1 &> /dev/null
 yes "Testing cramfs 1234567890 Endianness check 1234567890 Endianness check" \
-       | dd of=$IMAGE_DATA/dirA/dirB/b bs=512 count=30 &> /dev/null
+       | dd of=$IMAGE_DATA/dirA/dirB/b iflag=fullblock bs=512 count=30 &> /dev/null
 # sudo may use whatever group
 chgrp -R 0 $IMAGE_DATA