Skip to contentSkip to conversation

ndctl: tests must use local ndctl

PATCH In review Ross Zwisler 2 participants 3 messages Feb 21, 2018 libnvdimm: non-volatile memory device

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ndctl: tests must use local ndctl

Fix a few places in our unit tests where we were using the system ndctl instead of the locally built one. On my system this was leading to false positive test failures because my local ndctl didn't support this new command:

  ndctl check-namespace --rewrite-log --repair --force --verbose $dev
---
 test/btt-errors.sh     | 4 ++--
 test/btt-pad-compat.sh | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)
test/btt-errors.sh +2 -2
index 68e3652..383abb6 100755
@@ -47,9 +47,9 @@ force_raw()
 {
 	raw="$1"
 	if grep -q "$MNT" /proc/mounts; then umount $MNT; fi
-	ndctl disable-namespace "$dev"
+	$NDCTL disable-namespace "$dev"
 	echo "$raw" > "/sys/bus/nd/devices/$dev/force_raw"
-	ndctl enable-namespace "$dev"
+	$NDCTL enable-namespace "$dev"
 	echo "Set $dev to raw mode: $raw"
 	if [[ "$raw" == "1" ]]; then
 		raw_bdev=${blockdev%s}
test/btt-pad-compat.sh +4 -4
index faa773c..618e802 100755
@@ -112,9 +112,9 @@ cycle_ns()
 force_raw()
 {
 	raw="$1"
-	ndctl disable-namespace "$dev"
+	$ndctl disable-namespace "$dev"
 	echo "$raw" > "/sys/bus/nd/devices/$dev/force_raw"
-	ndctl enable-namespace "$dev"
+	$ndctl enable-namespace "$dev"
 	echo "Set $dev to raw mode: $raw"
 	if [[ "$raw" == "1" ]]; then
 		raw_bdev=${blockdev%s}
@@ -187,13 +187,13 @@ do_tests()
 	verify_idx 0 2
 
 	# rewrite log using ndctl, verify conversion to new format
-	ndctl check-namespace --rewrite-log --repair --force --verbose $dev
+	$ndctl check-namespace --rewrite-log --repair --force --verbose $dev
 	do_random_io "/dev/$blockdev"
 	cycle_ns "$dev"
 	verify_idx 0 1
 
 	# check-namespace again to make sure everything is ok
-	ndctl check-namespace --force --verbose $dev
+	$ndctl check-namespace --force --verbose $dev
 
 	# the old format btt metadata was created with a null parent uuid,
 	# making it 'stickier' than a normally created btt. Be sure to clean
Signature · 6 lines
2.14.3

_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm
#1 lore raw

PATCH 2/2 ndctl: add test files to .gitignore

---
 .gitignore | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
.gitignore +21 -0
index 3c2de0e..20a04de 100644
@@ -32,3 +32,24 @@ version.m4
 cscope.files
 cscope*.out
 tags
+test/*.log
+test/*.trs
+test/blk-ns
+test/dax-dev
+test/dax-errors
+test/dax-pmd
+test/daxdev-errors
+test/device-dax
+test/dpa-alloc
+test/dsm-fail
+test/hugetlb
+test/image
+test/libndctl
+test/mmap
+test/multi-pmem
+test/parent-uuid
+test/pmem-ns
+test/smart-listen
+test/smart-notify
+test/fio.job
+test/local-write-0-verify.state
Signature · 6 lines
2.14.3

_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm
Reviewed-by on v1 1/2
#2 lore raw
In reply to Ross Zwisler
Quoted 8 lines · Ross Zwisler

Fix a few places in our unit tests where we were using the system ndctl instead of the locally built one. On my system this was leading to false positive test failures because my local ndctl didn't support this new command:

  ndctl check-namespace --rewrite-log --repair --force --verbose $dev

Looks good to me:

_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm