pmem / ndctl

A "device memory" enabling project encompassing tools and libraries for CXL, NVDIMMs, DAX, memory tiering and other platform memory device topics.
Other
262 stars 135 forks source link

how to skip test/cxl-* tests during meson test -C build #221

Closed yizhanglinux closed 1 year ago

yizhanglinux commented 2 years ago

Hello

Just wondering whether there is a method to skip the test/cxl-* tests during meson test -C build, my kernel was not enable cxl_test module, and when I execute the test suite, it will report failure for these cases.

23/27 ndctl:cxl / cxl-topology.sh                  FAIL             0.08s   exit status 1
>>> NDCTL=/root/rpmbuild/BUILD/ndctl-74/build/ndctl/ndctl DATA_PATH=/root/rpmbuild/BUILD/ndctl-74/test DAXCTL=/root/rpmbuild/BUILD/ndctl-74/build/daxctl/daxctl TEST_PATH=/root/rpmbuild/BUILD/ndctl-74/build/test MALLOC_PERTURB_=31 /bin/bash /root/rpmbuild/BUILD/ndctl-74/test/cxl-topology.sh

24/27 ndctl:cxl / cxl-region-sysfs.sh              FAIL             0.08s   exit status 1
>>> NDCTL=/root/rpmbuild/BUILD/ndctl-74/build/ndctl/ndctl DATA_PATH=/root/rpmbuild/BUILD/ndctl-74/test DAXCTL=/root/rpmbuild/BUILD/ndctl-74/build/daxctl/daxctl MALLOC_PERTURB_=243 TEST_PATH=/root/rpmbuild/BUILD/ndctl-74/build/test /bin/bash /root/rpmbuild/BUILD/ndctl-74/test/cxl-region-sysfs.sh

25/27 ndctl:cxl / cxl-labels.sh                    FAIL             0.08s   exit status 1
>>> MALLOC_PERTURB_=180 NDCTL=/root/rpmbuild/BUILD/ndctl-74/build/ndctl/ndctl DATA_PATH=/root/rpmbuild/BUILD/ndctl-74/test DAXCTL=/root/rpmbuild/BUILD/ndctl-74/build/daxctl/daxctl TEST_PATH=/root/rpmbuild/BUILD/ndctl-74/build/test /bin/bash /root/rpmbuild/BUILD/ndctl-74/test/cxl-labels.sh

26/27 ndctl:cxl / cxl-create-region.sh             FAIL             0.08s   exit status 1
>>> MALLOC_PERTURB_=104 NDCTL=/root/rpmbuild/BUILD/ndctl-74/build/ndctl/ndctl DATA_PATH=/root/rpmbuild/BUILD/ndctl-74/test DAXCTL=/root/rpmbuild/BUILD/ndctl-74/build/daxctl/daxctl TEST_PATH=/root/rpmbuild/BUILD/ndctl-74/build/test /bin/bash /root/rpmbuild/BUILD/ndctl-74/test/cxl-create-region.sh
27/27 ndctl:ndctl / security.sh                    OK               3.84s
Ok:                 23  
Expected Fail:      0   
Fail:               4   
Unexpected Pass:    0   
Skipped:            0   
Timeout:            0   

I know the old ndctl has such options to execute one specific test case one by one, do we still have similar method?

make TESTS=$test_case check
stellarhopper commented 2 years ago

@yizhanglinux You can use --no-suite cxl to skip the cxl suite.

djbw commented 2 years ago

@stellarhopper but for cases where cxl_test is missing we need to skip, not fail i.e.:

diff --git a/test/cxl-create-region.sh b/test/cxl-create-region.sh
index 8e297caf6a0d..aae180dd7b54 100644
--- a/test/cxl-create-region.sh
+++ b/test/cxl-create-region.sh
@@ -4,7 +4,7 @@

 . $(dirname $0)/common

-rc=1
+rc=77

 set -ex

@@ -14,6 +14,7 @@ check_prereq "jq"

 modprobe -r cxl_test
 modprobe cxl_test
+rc=1
 udevadm settle

 destroy_regions()
diff --git a/test/cxl-labels.sh b/test/cxl-labels.sh
index e782e2dec246..3bf1e6e995b6 100644
--- a/test/cxl-labels.sh
+++ b/test/cxl-labels.sh
@@ -4,7 +4,7 @@

 . $(dirname $0)/common

-rc=1
+rc=77

 set -ex

@@ -14,6 +14,7 @@ check_prereq "jq"

 modprobe -r cxl_test
 modprobe cxl_test
+rc=1
 udevadm settle

 test_label_ops()
diff --git a/test/cxl-region-sysfs.sh b/test/cxl-region-sysfs.sh
index ae0f55653814..63186b60dfec 100644
--- a/test/cxl-region-sysfs.sh
+++ b/test/cxl-region-sysfs.sh
@@ -4,7 +4,7 @@

 . $(dirname $0)/common

-rc=1
+rc=77

 set -ex

@@ -14,6 +14,7 @@ check_prereq "jq"

 modprobe -r cxl_test
 modprobe cxl_test
+rc=1
 udevadm settle

 # THEORY OF OPERATION: Create a x8 interleave across the pmem capacity
diff --git a/test/cxl-topology.sh b/test/cxl-topology.sh
index f7da83e60f7a..5148e6dd79f4 100644
--- a/test/cxl-topology.sh
+++ b/test/cxl-topology.sh
@@ -4,7 +4,7 @@

 . $(dirname $0)/common

-rc=1
+rc=77

 set -ex

@@ -14,6 +14,7 @@ check_prereq "jq"

 modprobe -r cxl_test
 modprobe cxl_test
+rc=1
 udevadm settle

 # THEORY OF OPERATION: Validate the hard coded assumptions of the
stellarhopper commented 2 years ago

@djbw ah yes true - will you send that as a proper patch?

yizhanglinux commented 2 years ago

@yizhanglinux You can use --no-suite cxl to skip the cxl suite.

Thanks for the info, BTW, I've tested Dan's patch and it works well, feel free to close this ticket, thanks.

yizhanglinux commented 2 years ago

Another question, is there any method to skip "firmware-update.sh", this test case seems will trigger system suspend and my terminal interrupt.

djbw commented 2 years ago

Hmm, yes, I think it would make sense to move the firmware-update.sh test to the "destructive" set since it affects the host system:

diff --git a/test/meson.build b/test/meson.build
index 5953c286d13f..c31d8eac66c5 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -170,7 +170,6 @@ tests = [
   [ 'btt-errors.sh',          btt_errors,        'ndctl' ],
   [ 'hugetlb',                hugetlb,           'ndctl' ],
   [ 'btt-pad-compat.sh',      btt_pad_compat,    'ndctl' ],
-  [ 'firmware-update.sh',     firmware_update,   'ndctl' ],
   [ 'ack-shutdown-count-set', ack_shutdown_count, 'ndctl' ],
   [ 'rescan-partitions.sh',   rescan_partitions,  'ndctl' ],
   [ 'inject-smart.sh',        inject_smart,      'ndctl' ],
@@ -196,6 +195,7 @@ if get_option('destructive').enabled()
   mmap_test = find_program('mmap.sh')

   tests += [
+    [ 'firmware-update.sh',     firmware_update,         'ndctl' ],
     [ 'pmem-ns',           pmem_ns,       'ndctl' ],
     [ 'sub-section.sh',    sub_section,           'dax'   ],
     [ 'dax-dev',           dax_dev,       'dax'   ],
yizhanglinux commented 2 years ago

Yeah, that's fine, thanks for update.