ltp: replace the retry loops by new exponential backoff macro
PATCH 1/1 ltp: replace the retry loops by new exponential backoff macro
--- testcases/commands/mkswap/mkswap01.sh | 17 ++++------ testcases/kernel/numa/numa01.sh | 58 +++++++++++++++-------------------- 2 files changed, 31 insertions(+), 44 deletions(-)
testcases/commands/mkswap/mkswap01.sh +6 -11
@@ -37,25 +37,20 @@ setup() DEVICE_SIZE=$((($real_size/$PAGE_SIZE * $PAGE_SIZE)/1024)) } -wait_for_file() +check_for_file() { local path="$1" - local retries=10 if [ -z "$path" ]; then return fi - while [ $retries -gt 0 ]; do - if [ -e "$path" ]; then - return - fi - tst_res TINFO "Waiting for $path to appear" - retries=$((retries - 1)) - tst_sleep 10ms - done + if [ -e "$path" ]; then + return 0 + fi tst_res TINFO "The file $path haven't appeared" + return 1 } mkswap_verify()
@@ -75,7 +70,7 @@ mkswap_verify() local pagesize=$PAGE_SIZE fi - wait_for_file "$dev_file" + TST_RETRY_FUNC "check_for_file "$dev_file"" 0 swapon $swapfile 2>/dev/null
testcases/kernel/numa/numa01.sh +25 -33
135 lines not on this page · raw message
Signature · 1 line
2.9.5
PATCH 1/1 ltp: replace the retry loops by new exponential backoff macro
Hi Li,
Quoted 6 lines
Signed-off-by Li Wang <[email protected]>Cc Petr Vorel <[email protected]>Cc Cyril Hrubis <[email protected]>--- testcases/commands/mkswap/mkswap01.sh | 17 ++++------ testcases/kernel/numa/numa01.sh | 58 +++++++++++++++--------------------
Thanks for your patch, applied with diff bellow.
I changed:
* fix mixing quotes when calling check_for_file. This was also broken on dash (testing with /bin/sh as symlink to /bin/dash and using checkbashisms.pl script helps).
* simplify check_for_file + remove TINFO message as it was unnecessarily verbose (see bellow)
Kind regards,
Petr
tst_device.c:83: INFO: Found free device '/dev/loop0'
mkswap01 1 TPASS: 'mkswap /dev/loop0 ' passed.
mkswap01 2 TPASS: 'mkswap /dev/loop0 262140' passed.
mkswap01 3 TINFO: Can not do swapon on /dev/loop0.
mkswap01 3 TINFO: Device size specified by 'mkswap' greater than real size. mkswap01 3 TINFO: Swapon failed expectedly.
mkswap01 3 TPASS: 'mkswap -f /dev/loop0 262148' passed.
mkswap01 4 TPASS: 'mkswap -c /dev/loop0 ' passed.
mkswap01 5 TINFO: Can not do swapon on /dev/loop0.
mkswap01 5 TINFO: Page size specified by 'mkswap -p' is not equal to system's page size. mkswap01 5 TINFO: Swapon failed expectedly.
mkswap01 5 TPASS: 'mkswap -p 2048 /dev/loop0 ' passed.
mkswap01 6 TINFO: The file /dev/disk/by-label/ltp_testswap haven't appeared mkswap01 6 TINFO: The file /dev/disk/by-label/ltp_testswap haven't appeared mkswap01 6 TINFO: The file /dev/disk/by-label/ltp_testswap haven't appeared mkswap01 6 TINFO: The file /dev/disk/by-label/ltp_testswap haven't appeared mkswap01 6 TINFO: The file /dev/disk/by-label/ltp_testswap haven't appeared mkswap01 6 TINFO: The file /dev/disk/by-label/ltp_testswap haven't appeared mkswap01 6 TINFO: The file /dev/disk/by-label/ltp_testswap haven't appeared mkswap01 6 TINFO: The file /dev/disk/by-label/ltp_testswap haven't appeared mkswap01 6 TINFO: The file /dev/disk/by-label/ltp_testswap haven't appeared mkswap01 6 TINFO: The file /dev/disk/by-label/ltp_testswap haven't appeared mkswap01 6 TINFO: The file /dev/disk/by-label/ltp_testswap haven't appeared mkswap01 6 TINFO: The file /dev/disk/by-label/ltp_testswap haven't appeared mkswap01 6 TINFO: The file /dev/disk/by-label/ltp_testswap haven't appeared mkswap01 6 TPASS: 'mkswap -L ltp_testswap /dev/loop0 ' passed.
mkswap01 7 TPASS: 'mkswap -v1 /dev/loop0 ' passed.
mkswap01 8 TINFO: The file /dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794 haven't appeared mkswap01 8 TINFO: The file /dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794 haven't appeared mkswap01 8 TINFO: The file /dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794 haven't appeared mkswap01 8 TINFO: The file /dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794 haven't appeared mkswap01 8 TINFO: The file /dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794 haven't appeared mkswap01 8 TINFO: The file /dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794 haven't appeared mkswap01 8 TINFO: The file /dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794 haven't appeared mkswap01 8 TINFO: The file /dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794 haven't appeared mkswap01 8 TINFO: The file /dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794 haven't appeared mkswap01 8 TINFO: The file /dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794 haven't appeared mkswap01 8 TINFO: The file /dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794 haven't appeared mkswap01 8 TINFO: The file /dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794 haven't appeared mkswap01 8 TPASS: 'mkswap -U b20a69ef-cf9d-49fb-a313-284df6ddd794 /dev/loop0 ' passed. mkswap01 9 TPASS: 'mkswap -V /dev/loop0 ' passed.
mkswap01 10 TPASS: 'mkswap -h /dev/loop0 ' passed.
commands/mkswap/mkswap01.sh +2 -8
@@ -41,15 +41,9 @@ check_for_file() { local path="$1" - if [ -z "$path" ]; then + if [ -z "$path" -o -e "$path" ]; then return fi - - if [ -e "$path" ]; then - return 0 - fi - - tst_res TINFO "The file $path haven't appeared" return 1 }
@@ -70,7 +64,7 @@ mkswap_verify() local pagesize=$PAGE_SIZE fi - TST_RETRY_FUNC "check_for_file "$dev_file"" 0 + TST_RETRY_FUNC "check_for_file $dev_file" 0 swapon $swapfile 2>/dev/null
kernel/numa/numa01.sh +1 -5
@@ -302,11 +302,7 @@ test7() check_ltp_numa_test8_log() { - if grep -m1 -q '.' ltp_numa_test8.log; then - return 0 - fi - - return 1 + grep -m1 -q '.' ltp_numa_test8.log } # Verification of memhog with interleave policy
PATCH 1/1 ltp: replace the retry loops by new exponential backoff macro
Hi,
Referring to commit 8435d0c7283,some version of swapon will not create the symlink of the device.
So it changed TWARN to TINFO so that the test will not break by it. We need to handler such situation in the new patch,or revert the change for swap01.sh.
Thanks
Shuang
Quoted 111 lines · Petr Vorel
Hi Li,
Quoted 6 lines
Signed-off-by Li Wang <[email protected]>Cc Petr Vorel <[email protected]>Cc Cyril Hrubis <[email protected]>--- testcases/commands/mkswap/mkswap01.sh | 17 ++++------ testcases/kernel/numa/numa01.sh | 58 +++++++++++++++--------------------Thanks for your patch, applied with diff bellow.
I changed:
* fix mixing quotes when callingcheck_for_file. This was also broken on dash (testing with/bin/shas symlink to/bin/dashand using checkbashisms.pl script helps).
* simplifycheck_for_file+ remove TINFO message as it was unnecessarily verbose (see bellow)Kind regards,
Petrtst_device.c:83: INFO: Found free device '
/dev/loop0'
mkswap01 1 TPASS: 'mkswap/dev/loop0' passed.
mkswap01 2 TPASS: 'mkswap/dev/loop0262140' passed.
mkswap01 3 TINFO: Can not do swapon on/dev/loop0.
mkswap01 3 TINFO: Device size specified by 'mkswap' greater than real size. mkswap01 3 TINFO: Swapon failed expectedly.
mkswap01 3 TPASS: 'mkswap -f/dev/loop0262148' passed.
mkswap01 4 TPASS: 'mkswap -c/dev/loop0' passed.
mkswap01 5 TINFO: Can not do swapon on/dev/loop0.
mkswap01 5 TINFO: Page size specified by 'mkswap -p' is not equal to system's page size. mkswap01 5 TINFO: Swapon failed expectedly.
mkswap01 5 TPASS: 'mkswap -p 2048/dev/loop0' passed.
mkswap01 6 TINFO: The file/dev/disk/by-label/ltp_testswaphaven't appeared mkswap01 6 TINFO: The file/dev/disk/by-label/ltp_testswaphaven't appeared mkswap01 6 TINFO: The file/dev/disk/by-label/ltp_testswaphaven't appeared mkswap01 6 TINFO: The file/dev/disk/by-label/ltp_testswaphaven't appeared mkswap01 6 TINFO: The file/dev/disk/by-label/ltp_testswaphaven't appeared mkswap01 6 TINFO: The file/dev/disk/by-label/ltp_testswaphaven't appeared mkswap01 6 TINFO: The file/dev/disk/by-label/ltp_testswaphaven't appeared mkswap01 6 TINFO: The file/dev/disk/by-label/ltp_testswaphaven't appeared mkswap01 6 TINFO: The file/dev/disk/by-label/ltp_testswaphaven't appeared mkswap01 6 TINFO: The file/dev/disk/by-label/ltp_testswaphaven't appeared mkswap01 6 TINFO: The file/dev/disk/by-label/ltp_testswaphaven't appeared mkswap01 6 TINFO: The file/dev/disk/by-label/ltp_testswaphaven't appeared mkswap01 6 TINFO: The file/dev/disk/by-label/ltp_testswaphaven't appeared mkswap01 6 TPASS: 'mkswap -Lltp_testswap/dev/loop0' passed.
mkswap01 7 TPASS: 'mkswap -v1/dev/loop0' passed.
mkswap01 8 TINFO: The file/dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794haven't appeared mkswap01 8 TINFO: The file/dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794haven't appeared mkswap01 8 TINFO: The file/dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794haven't appeared mkswap01 8 TINFO: The file/dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794haven't appeared mkswap01 8 TINFO: The file/dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794haven't appeared mkswap01 8 TINFO: The file/dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794haven't appeared mkswap01 8 TINFO: The file/dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794haven't appeared mkswap01 8 TINFO: The file/dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794haven't appeared mkswap01 8 TINFO: The file/dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794haven't appeared mkswap01 8 TINFO: The file/dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794haven't appeared mkswap01 8 TINFO: The file/dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794haven't appeared mkswap01 8 TINFO: The file/dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794haven't appeared mkswap01 8 TPASS: 'mkswap -U b20a69ef-cf9d-49fb-a313-284df6ddd794/dev/loop0' passed. mkswap01 9 TPASS: 'mkswap -V/dev/loop0' passed.
mkswap01 10 TPASS: 'mkswap -h/dev/loop0' passed.commands/mkswap/mkswap01.sh +2
-8@@ -41,15 +41,9 @@ check_for_file() { local path="$1" - if [ -z "$path" ]; then + if [ -z "$path" -o -e "$path" ]; then return fi - - if [ -e "$path" ]; then - return 0 - fi - - tst_res TINFO "The file $path haven't appeared" return 1 }@@ -70,7 +64,7 @@ mkswap_verify() local pagesize=$PAGE_SIZE fi - TST_RETRY_FUNC "check_for_file "$dev_file"" 0 + TST_RETRY_FUNC "check_for_file $dev_file" 0 swapon $swapfile 2>/dev/nullkernel/numa/numa01.sh +1
-5@@ -302,11 +302,7 @@ test7() check_ltp_numa_test8_log() { - if grep -m1 -q '.' ltp_numa_test8.log; then - return 0 - fi - - return 1 + grep -m1 -q '.' ltp_numa_test8.log } # Verification of memhog with interleave policy
PATCH 1/1 ltp: replace the retry loops by new exponential backoff macro
Hi Shuang,
Which LTP version do you use?
If I remember correctly, YANG Xiao has already reported this issue and fixed in:
commit 72c52581747301939340af5b1971dea569248226
Author: Xiao Yang <[email protected]> Date: Sun Jun 24 13:59:43 2018 +0800
commands/mkswap01.sh: Fix unexisted "/dev/disk/by-*" files on old
kernels
Quoted 155 lines · Shuang Qiu
Hi,
Referring to commit 8435d0c7283,some version of swapon will not create the symlink of the device.
So it changed TWARN to TINFO so that the test will not break by it. We need to handler such situation in the new patch,or revert the change forswap01.sh.Thanks
ShuangQuoted 140 lines · Petr Vorel
Hi Li,
Signed-off-by Li Wang <[email protected]>Quoted 7 lines
Cc Petr Vorel <[email protected]>Cc Cyril Hrubis <[email protected]>--- testcases/commands/mkswap/mkswap01.sh | 17 ++++------ testcases/kernel/numa/numa01.sh | 58+++++++++++++++--------------------
Thanks for your patch, applied with diff bellow.
I changed:
* fix mixing quotes when callingcheck_for_file. This was also broken on dash
(testing with/bin/shas symlink to/bin/dashand using
checkbashisms.pl
script helps).
* simplifycheck_for_file+ remove TINFO message as it was unnecessarily verbose
(see bellow)Kind regards,
Petrtst_device.c:83: INFO: Found free device '
/dev/loop0'
mkswap01 1 TPASS: 'mkswap/dev/loop0' passed.
mkswap01 2 TPASS: 'mkswap/dev/loop0262140' passed.
mkswap01 3 TINFO: Can not do swapon on/dev/loop0.
mkswap01 3 TINFO: Device size specified by 'mkswap' greater than real size.
mkswap01 3 TINFO: Swapon failed expectedly.
mkswap01 3 TPASS: 'mkswap -f/dev/loop0262148' passed.
mkswap01 4 TPASS: 'mkswap -c/dev/loop0' passed.
mkswap01 5 TINFO: Can not do swapon on/dev/loop0.
mkswap01 5 TINFO: Page size specified by 'mkswap -p' is not equal to system's page size.
mkswap01 5 TINFO: Swapon failed expectedly.
mkswap01 5 TPASS: 'mkswap -p 2048/dev/loop0' passed.
mkswap01 6 TINFO: The file/dev/disk/by-label/ltp_testswaphaven't appeared
mkswap01 6 TINFO: The file/dev/disk/by-label/ltp_testswaphaven't appeared
mkswap01 6 TINFO: The file/dev/disk/by-label/ltp_testswaphaven't appeared
mkswap01 6 TINFO: The file/dev/disk/by-label/ltp_testswaphaven't appeared
mkswap01 6 TINFO: The file/dev/disk/by-label/ltp_testswaphaven't appeared
mkswap01 6 TINFO: The file/dev/disk/by-label/ltp_testswaphaven't appeared
mkswap01 6 TINFO: The file/dev/disk/by-label/ltp_testswaphaven't appeared
mkswap01 6 TINFO: The file/dev/disk/by-label/ltp_testswaphaven't appeared
mkswap01 6 TINFO: The file/dev/disk/by-label/ltp_testswaphaven't appeared
mkswap01 6 TINFO: The file/dev/disk/by-label/ltp_testswaphaven't appeared
mkswap01 6 TINFO: The file/dev/disk/by-label/ltp_testswaphaven't appeared
mkswap01 6 TINFO: The file/dev/disk/by-label/ltp_testswaphaven't appeared
mkswap01 6 TINFO: The file/dev/disk/by-label/ltp_testswaphaven't appeared
mkswap01 6 TPASS: 'mkswap -Lltp_testswap/dev/loop0' passed. mkswap01 7 TPASS: 'mkswap -v1/dev/loop0' passed.
mkswap01 8 TINFO: The file/dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794haven't appeared
mkswap01 8 TINFO: The file/dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794haven't appeared
mkswap01 8 TINFO: The file/dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794haven't appeared
mkswap01 8 TINFO: The file/dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794haven't appeared
mkswap01 8 TINFO: The file/dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794haven't appeared
mkswap01 8 TINFO: The file/dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794haven't appeared
mkswap01 8 TINFO: The file/dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794haven't appeared
mkswap01 8 TINFO: The file/dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794haven't appeared
mkswap01 8 TINFO: The file/dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794haven't appeared
mkswap01 8 TINFO: The file/dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794haven't appeared
mkswap01 8 TINFO: The file/dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794haven't appeared
mkswap01 8 TINFO: The file/dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794haven't appeared
mkswap01 8 TPASS: 'mkswap -U b20a69ef-cf9d-49fb-a313-284df6ddd794/dev/loop0' passed.
mkswap01 9 TPASS: 'mkswap -V/dev/loop0' passed.
mkswap01 10 TPASS: 'mkswap -h/dev/loop0' passed.(quoted diff) +0
-0
testcases/commands/mkswap/mkswap01.sh
indexfc07933ae..5ead4cdc5100755commands/mkswap/mkswap01.sh +2
-6@@ -41,15 +41,9 @@ check_for_file() { local path="$1" - if [ -z "$path" ]; then + if [ -z "$path" -o -e "$path" ]; then return fi - - if [ -e "$path" ]; then - return 0 - fi - - tst_res TINFO "The file $path haven't appeared" return 1 } @@ -70,7 +64,7 @@ mkswap_verify() local pagesize=$PAGE_SIZE fi - TST_RETRY_FUNC "check_for_file "$dev_file"" 0 + TST_RETRY_FUNC "check_for_file $dev_file" 0 swapon $swapfile 2>/dev/null diff --git testcases/kernel/numa/numa01.sh
testcases/kernel/numa/numa01.sh
indexf8d8f303c..da2f80ddd100755kernel/numa/numa01.sh +1
-5@@ -302,11 +302,7 @@ test7() check_ltp_numa_test8_log() { - if grep -m1 -q '.' ltp_numa_test8.log; then - return 0 - fi - - return 1 + grep -m1 -q '.' ltp_numa_test8.log } # Verification of memhog with interleave policy
Signature · 5 lines
Regards, Li Wang -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.linux.it/pipermail/ltp/attachments/20180808/fb78323e/attachment.html>
PATCH 1/1 ltp: replace the retry loops by new exponential backoff macro
Oh,yes,Xiao's patch is related to it.
===cut===
if tst_kvcmp -lt "2.6.35" && [ -n "$dev_file" ]; then
===
But looks like the missing symlink issue is not only related with kernel version or loop devices,but sometimes related with mkswap version or udev rules.
The testcase sometimes will also fail with new version of kernels.
Thanks
Shuang
Quoted 175 lines · Li Wang
Hi Shuang,
Which LTP version do you use?
If I remember correctly, YANG Xiao has already reported this issue and fixed in:
commit
72c52581747301939340af5b1971dea569248226
Author: Xiao Yang <[email protected]
<mailto:[email protected]>>
Date: Sun Jun 24 13:59:43 2018 +0800
commands/mkswap01.sh: Fix unexisted "/dev/disk/by-*" files on old kernelsOn Wed, Aug 8, 2018 at 5:35 AM, Shuang Qiu <[email protected] <mailto:[email protected]>> wrote:
Hi,
Referring to commit 8435d0c7283,some version of swapon will not create the symlink of the device.
So it changed TWARN to TINFO so that the test will not break by it. We need to handler such situation in the new patch,or revert the change forswap01.sh.Thanks
ShuangOn 06/12/2018 11:56 PM, Petr Vorel wrote:
Hi Li,
Signed-off-by Li Wang <[email protected]<mailto:[email protected]>>
Cc: Petr Vorel <[email protected] <mailto:[email protected]>>
Cc: Cyril Hrubis <[email protected] <mailto:[email protected]>>
---
testcases/commands/mkswap/mkswap01.sh| 17 ++++------ testcases/kernel/numa/numa01.sh | 58
+++++++++++++++--------------------Thanks for your patch, applied with diff bellow.
I changed:
* fix mixing quotes when callingcheck_for_file. This was also broken on dash
(testing with/bin/shas symlink to/bin/dashand using checkbashisms.pl <http://checkbashisms.pl>
script helps).
* simplifycheck_for_file+ remove TINFO message as it was unnecessarily verbose
(see bellow)Kind regards,
Petrtst_device.c:83: INFO: Found free device '
/dev/loop0' mkswap01 1 TPASS: 'mkswap /dev/loop0 ' passed. mkswap01 2 TPASS: 'mkswap /dev/loop0 262140' passed. mkswap01 3 TINFO: Can not do swapon on/dev/loop0. mkswap01 3 TINFO: Device size specified by 'mkswap' greater than real size.
mkswap01 3 TINFO: Swapon failed expectedly. mkswap01 3 TPASS: 'mkswap -f/dev/loop0262148' passed. mkswap01 4 TPASS: 'mkswap -c/dev/loop0' passed. mkswap01 5 TINFO: Can not do swapon on/dev/loop0. mkswap01 5 TINFO: Page size specified by 'mkswap -p' is not equal to system's page size.
mkswap01 5 TINFO: Swapon failed expectedly. mkswap01 5 TPASS: 'mkswap -p 2048/dev/loop0' passed. mkswap01 6 TINFO: The file/dev/disk/by-label/ltp_testswaphaven't appeared
mkswap01 6 TINFO: The file/dev/disk/by-label/ltp_testswaphaven't appeared
mkswap01 6 TINFO: The file/dev/disk/by-label/ltp_testswaphaven't appeared
mkswap01 6 TINFO: The file/dev/disk/by-label/ltp_testswaphaven't appeared
mkswap01 6 TINFO: The file/dev/disk/by-label/ltp_testswaphaven't appeared
mkswap01 6 TINFO: The file/dev/disk/by-label/ltp_testswaphaven't appeared
mkswap01 6 TINFO: The file/dev/disk/by-label/ltp_testswaphaven't appeared
mkswap01 6 TINFO: The file/dev/disk/by-label/ltp_testswaphaven't appeared
mkswap01 6 TINFO: The file/dev/disk/by-label/ltp_testswaphaven't appeared
mkswap01 6 TINFO: The file/dev/disk/by-label/ltp_testswaphaven't appeared
mkswap01 6 TINFO: The file/dev/disk/by-label/ltp_testswaphaven't appeared
mkswap01 6 TINFO: The file/dev/disk/by-label/ltp_testswaphaven't appeared
mkswap01 6 TINFO: The file/dev/disk/by-label/ltp_testswaphaven't appeared
mkswap01 6 TPASS: 'mkswap -Lltp_testswap/dev/loop0' passed. mkswap01 7 TPASS: 'mkswap -v1/dev/loop0' passed. mkswap01 8 TINFO: The file/dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794haven't appeared
mkswap01 8 TINFO: The file/dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794haven't appeared
mkswap01 8 TINFO: The file/dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794haven't appeared
mkswap01 8 TINFO: The file/dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794haven't appeared
mkswap01 8 TINFO: The file/dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794haven't appeared
mkswap01 8 TINFO: The file/dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794haven't appeared
mkswap01 8 TINFO: The file/dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794haven't appeared
mkswap01 8 TINFO: The file/dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794haven't appeared
mkswap01 8 TINFO: The file/dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794haven't appeared
mkswap01 8 TINFO: The file/dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794haven't appeared
mkswap01 8 TINFO: The file/dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794haven't appeared
mkswap01 8 TINFO: The file/dev/disk/by-uuid/b20a69ef-cf9d-49fb-a313-284df6ddd794haven't appeared
mkswap01 8 TPASS: 'mkswap -U b20a69ef-cf9d-49fb-a313-284df6ddd794/dev/loop0' passed. mkswap01 9 TPASS: 'mkswap -V/dev/loop0' passed. mkswap01 10 TPASS: 'mkswap -h/dev/loop0' passed.diff --git
testcases/commands/mkswap/mkswap01.shtestcases/commands/mkswap/mkswap01.sh
indexfc07933ae..5ead4cdc5100755
---testcases/commands/mkswap/mkswap01.sh
+++testcases/commands/mkswap/mkswap01.sh
@@ -41,15 +41,9 @@check_for_file()
{
local path="$1"
- if [ -z "$path" ]; then
+ if [ -z "$path" -o -e "$path" ]; then return
fi
-
- if [ -e "$path" ]; then
- return 0
- fi
-
- tst_res TINFO "The file $path haven't appeared" return 1
}
@@ -70,7 +64,7 @@mkswap_verify()
local pagesize=$PAGE_SIZE
fi
- TST_RETRY_FUNC "check_for_file"$dev_file"" 0 + TST_RETRY_FUNC "check_for_file$dev_file" 0 swapon $swapfile 2>/dev/null
diff --gittestcases/kernel/numa/numa01.shtestcases/kernel/numa/numa01.sh
indexf8d8f303c..da2f80ddd100755
---testcases/kernel/numa/numa01.sh
+++testcases/kernel/numa/numa01.sh
@@ -302,11 +302,7 @@test7()check_ltp_numa_test8_log()
{
Quoted 16 lines
- if grep -m1 -q '.' ltp_numa_test8.log; then - return 0
- fi
-
- return 1
+ grep -m1 -q '.' ltp_numa_test8.log }
# Verification of memhog with interleave policySignature · 2 lines
Regards, Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20180808/558bfa9f/attachment-0001.html>
PATCH 1/1 ltp: replace the retry loops by new exponential backoff macro
Quoted 9 lines · Shuang Qiu
Oh,yes,Xiao's patch is related to it.
===cut===
iftst_kvcmp-lt "2.6.35" && [ -n "$dev_file" ]; then
===
But looks like the missing symlink issue is not only related with kernel version or loop devices,but sometimes related with mkswap version or udev rules.
The testcase sometimes will also fail with new version of kernels.
Hmm, if that is true. We may need to rewrite the judgement according the real situation.
check_symlink_support()
{
if support symlink
return 0
else
return 1
}
if ! check_symlink_support ; then
tst_res TINFO "Waiting for $dev_file to appear" tst_sleep 100ms
else
TST_RETRY_FUNC "check_for_file $dev_file" 0
fi
Or, any better idea?
Signature · 5 lines
Regards, Li Wang -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.linux.it/pipermail/ltp/attachments/20180808/52f395c7/attachment.html>
PATCH 1/1 ltp: replace the retry loops by new exponential backoff macro
Quoted 24 lines · Li Wang
Shuang Qiu <[email protected] <mailto:[email protected]>> wrote:
Oh,yes,Xiao's patch is related to it.
===cut===
iftst_kvcmp-lt "2.6.35" && [ -n "$dev_file" ]; then
===
But looks like the missing symlink issue is not only related with kernel version or loop devices,but sometimes related with mkswap version or udev rules.
The testcase sometimes will also fail with new version of kernels.Hmm, if that is true. We may need to rewrite the judgement according the real situation.
check_symlink_support()
{
if support symlink
return 0
else
return 1
}
Quoted 8 lines
if !
check_symlink_support; then
tst_resTINFO "Waiting for $dev_file to appear"tst_sleep100ms
else
TST_RETRY_FUNC"check_for_file$dev_file" 0 fiOr, any better idea?
Yes,this is a great solution.
But it is really hard to define the support symlink situation for different releases and userspace versions.
The simplest way is revert the patch for mkswap01
Thanks
Shuang
Quoted 4 lines
Signature · 3 lines
-- Regards, Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20180810/78bf866a/attachment.html>