]> www.infradead.org Git - users/hch/blktests.git/commitdiff
block/022: skip test when only 1 cpu available master
authorXiao Liang <xiliang@redhat.com>
Fri, 9 Oct 2020 13:55:37 +0000 (21:55 +0800)
committerShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Mon, 30 May 2022 01:05:59 +0000 (10:05 +0900)
Below is fail log in single cpu node.
block/022 (Test hang caused by freeze/unfreeze sequence)     [failed]
    runtime    ...  30.138s
    --- tests/block/022.out 2020-10-09 12:43:48.000000000 +0000
    +++ /usr/local/blktests/results/nodev/block/022.out.bad 2020-10-09 13:45:18.594417401 +0000
    @@ -1,2 +1,3 @@
     Running block/022
    +taskset: failed to set pid 13212's affinity: Invalid argument
     Test complete

Signed-off-by: Xiao Liang <xiliang@redhat.com>
[Shin'ichiro: fixed commit message typo and resolved merge conflict]
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
common/rc
tests/block/022

index 0528ce8082563211a8aaea4cc286a7e8ccb8dd2d..5e35e217247624afd1fd9dbb30ece01bca28c580 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -189,6 +189,14 @@ _have_fs() {
        fi
 }
 
+_require_min_cpus() {
+       if [[ $(nproc) -ge $1 ]]; then
+               return 0
+       fi
+       SKIP_REASON="minimum $1 cpus required"
+       return 1
+}
+
 _test_dev_is_rotational() {
        [[ $(cat "${TEST_DEV_SYSFS}/queue/rotational") -ne 0 ]]
 }
index b2c53e266d81abd3552c6565787626f1c5e5500c..30b2a6814fb85acb4b08d31086d2c70651c7b467 100755 (executable)
@@ -13,6 +13,7 @@ TIMED=1
 
 requires() {
        _have_null_blk && _have_module_param null_blk shared_tags
+       _require_min_cpus 2
 }
 
 hotplug_test() {