ndctl: Add missing test dependencies and other fixups
cover ndctl: Add missing test dependencies and other fixups
Recently I stood up a new test system from scratch and discovered some gaps in the documentation and the tests.
Fix those up to get all tests passing with v6.16-rc2 and latest version of all test dependencies currently available in Fedora Rawhide.
Dan Williams (5):
build: Fix meson feature deprecation warnings
test: Fix 'ndctl' dependency in test/sub-section.sh
test: Fix dax.sh expectations
test: Update documentation with required packages to install
test: Fixup fwctl dependency
README.md | 5 +++++ contrib/meson.build | 2 +- meson.build | 5 +++-- test/dax.sh | 3 ++- test/meson.build | 1 + test/sub-section.sh | 2 +- 6 files changed, 13 insertions(+), 5 deletions(-)
base-commit: 74b9e411bf13e87df39a517d10143fafa7e2ea92
Signature · 1 line
2.49.0
PATCH 1/5 build: Fix meson feature deprecation warnings
There are a few instances of the warning:
"meson.build: WARNING: Project does not target a minimum version but uses feature deprecated since '0.56.0': dependency.get_pkgconfig_variable. use dependency.get_variable(pkgconfig : ...) instead"
Move to the new style and mark the project as needing at least that minimum version.
--- contrib/meson.build | 2 +- meson.build | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-)
contrib/meson.build +1 -1
@@ -2,7 +2,7 @@ bashcompletiondir = get_option('bashcompletiondir') if bashcompletiondir == '' bash_completion = dependency('bash-completion', required : false) if bash_completion.found() - bashcompletiondir = bash_completion.get_pkgconfig_variable('completionsdir') + bashcompletiondir = bash_completion.get_variable(pkgconfig : 'completionsdir') else bashcompletiondir = datadir / 'bash-completion/completions' endif
meson.build +3 -2
@@ -1,5 +1,6 @@ project('ndctl', 'c', version : '82', + meson_version: '>= 0.56.0', license : [ 'GPL-2.0', 'LGPL-2.1',
@@ -159,9 +160,9 @@ endif if get_option('systemd').enabled() systemd = dependency('systemd', required : true) - systemdunitdir = systemd.get_pkgconfig_variable('systemdsystemunitdir') + systemdunitdir = systemd.get_variable(pkgconfig : 'systemdsystemunitdir') udev = dependency('udev', required : true) - udevdir = udev.get_pkgconfig_variable('udevdir') + udevdir = udev.get_variable(pkgconfig : 'udevdir') udevrulesdir = udevdir / 'rules.d' endif
Signature · 1 line
2.49.0
Re: [ndctl PATCH 1/5] build: Fix meson feature deprecation warnings
Quoted 10 lines · Dan Williams
There are a few instances of the warning:
"meson.build: WARNING: Project does not target a minimum version but uses feature deprecated since '0.56.0': dependency.get_pkgconfig_variable. use
dependency.get_variable(pkgconfig : ...)instead"Move to the new style and mark the project as needing at least that minimum version.
Signed-off-by Dan Williams <[email protected]>
Quoted 41 lines
--- contrib/meson.build | 2 +- meson.build | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-)contrib/meson.build +1
-1@@ -2,7 +2,7 @@ bashcompletiondir = get_option('bashcompletiondir') if bashcompletiondir == '' bash_completion = dependency('bash-completion', required : false) if bash_completion.found() - bashcompletiondir = bash_completion.get_pkgconfig_variable('completionsdir') + bashcompletiondir = bash_completion.get_variable(pkgconfig : 'completionsdir') else bashcompletiondir = datadir / 'bash-completion/completions' endifmeson.build +3
-2@@ -1,5 +1,6 @@ project('ndctl', 'c', version : '82', + meson_version: '>= 0.56.0', license : [ 'GPL-2.0', 'LGPL-2.1',@@ -159,9 +160,9 @@ endif if get_option('systemd').enabled() systemd = dependency('systemd', required : true) - systemdunitdir = systemd.get_pkgconfig_variable('systemdsystemunitdir') + systemdunitdir = systemd.get_variable(pkgconfig : 'systemdsystemunitdir') udev = dependency('udev', required : true) - udevdir = udev.get_pkgconfig_variable('udevdir') + udevdir = udev.get_variable(pkgconfig : 'udevdir') udevrulesdir = udevdir / 'rules.d' endif
PATCH 2/5 test: Fix 'ndctl' dependency in test/sub-section.sh
In reply to Dan WilliamsThe test fails with:
"sub-section.sh: line 23: ndctl: command not found"
...it should be using the built ndctl program, not the one installed in the filesystem.
--- test/sub-section.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
test/sub-section.sh +1 -1
@@ -20,7 +20,7 @@ MIN_AVAIL=$((TEST_SIZE*4)) MAX_NS=10 NAME="subsection-test" -ndctl list -N | jq -r ".[] | select(.name==\"subsection-test\") | .dev" +$NDCTL list -N | jq -r ".[] | select(.name==\"subsection-test\") | .dev" rc=$FAIL cleanup() {
Signature · 1 line
2.49.0
Re: [ndctl PATCH 2/5] test: Fix 'ndctl' dependency in test/sub-section.sh
Quoted 8 lines · Dan Williams
The test fails with:
"
sub-section.sh: line 23: ndctl: command not found"...it should be using the built ndctl program, not the one installed in the filesystem.
Signed-off-by Dan Williams <[email protected]>
Quoted 17 lines
--- test/sub-section.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)test/sub-section.sh +1
-1@@ -20,7 +20,7 @@ MIN_AVAIL=$((TEST_SIZE*4)) MAX_NS=10 NAME="subsection-test" -ndctl list -N | jq -r ".[] | select(.name==\"subsection-test\") | .dev" +$NDCTL list -N | jq -r ".[] | select(.name==\"subsection-test\") | .dev" rc=$FAIL cleanup() {
PATCH 3/5 test: Fix dax.sh expectations
In reply to Dan WilliamsWith current kernel+tracecmd combinations stdout is no longer purely trace records and column "21" is no longer the vmfault_t result.
Drop, if present, the diagnostic print of how many CPUs are in the trace and use the more universally compatible assumption that the fault result is the last column rather than a specific column.
--- test/dax.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
test/dax.sh +2 -1
@@ -37,13 +37,14 @@ run_test() { rc=1 while read -r p; do [[ $p ]] || continue + [[ $p == cpus=* ]] && continue if [ "$count" -lt 10 ]; then if [ "$p" != "0x100" ] && [ "$p" != "NOPAGE" ]; then cleanup "$1" fi fi count=$((count + 1)) - done < <(trace-cmd report | awk '{ print $21 }') + done < <(trace-cmd report | awk '{ print $NF }') if [ $count -lt 10 ]; then cleanup "$1"
Signature · 1 line
2.49.0
Re: [ndctl PATCH 3/5] test: Fix dax.sh expectations
Quoted 8 lines · Dan Williams
With current kernel+tracecmd combinations stdout is no longer purely trace records and column "21" is no longer the
vmfault_tresult.Drop, if present, the diagnostic print of how many CPUs are in the trace and use the more universally compatible assumption that the fault result is the last column rather than a specific column.
Signed-off-by Dan Williams <[email protected]>
Quoted 24 lines
--- test/dax.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)test/dax.sh +2
-1@@ -37,13 +37,14 @@ run_test() { rc=1 while read -r p; do [[ $p ]] || continue + [[ $p == cpus=* ]] && continue if [ "$count" -lt 10 ]; then if [ "$p" != "0x100" ] && [ "$p" != "NOPAGE" ]; then cleanup "$1" fi fi count=$((count + 1)) - done < <(trace-cmd report | awk '{ print $21 }') + done < <(trace-cmd report | awk '{ print $NF }') if [ $count -lt 10 ]; then cleanup "$1"
Alison Schofield
maintainerRe: [ndctl PATCH 3/5] test: Fix dax.sh expectations
In reply to Dan WilliamsQuoted 17 lines · Dan Williams
With current kernel+tracecmd combinations stdout is no longer purely trace records and column "21" is no longer the
vmfault_tresult.Drop, if present, the diagnostic print of how many CPUs are in the trace and use the more universally compatible assumption that the fault result is the last column rather than a specific column.
Signed-off-by Dan Williams <[email protected]>--- test/dax.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)test/dax.sh +0
-0
test/dax.sh run_test() { · line 40
Quoted 4 lines
test/dax.sh +1
-0@@ -37,13 +37,14 @@ run_test() { rc=1 while read -r p; do [[ $p ]] || continue + [[ $p == cpus=* ]] && continue
remove above line
test/dax.sh run_test() { · line 47
Quoted 8 lines
test/dax.sh +1
-1if [ "$count" -lt 10 ]; then if [ "$p" != "0x100" ] && [ "$p" != "NOPAGE" ]; then cleanup "$1" fi fi count=$((count + 1)) - done < <(trace-cmd report | awk '{ print $21 }') + done < <(trace-cmd report | awk '{ print $NF }')
replace above line w
done < <(trace-cmd report | grep dax_pmd_fault_done | awk '{ print $NF }')
Thanks for all of these Dan!
For this one, I ran into more metadata in the trace file, other than 'cpu=' causing the test to fail. I've tested what I'm showing above, which makes it immune to other things in the trace file.
Tell me you are OK w this and I'll apply this set to pending.
FYI the more metadata was:
version = 7
CPU 0 is empty
cpus=8
Quoted 6 lines
test/dax.sh +0
-0if [ $count -lt 10 ]; then cleanup "$1"Signature · 1 line
2.49.0
Re: [ndctl PATCH 3/5] test: Fix dax.sh expectations
Quoted 35 lines · Alison Schofield
Quoted 17 lines · Dan Williams
With current kernel+tracecmd combinations stdout is no longer purely trace records and column "21" is no longer the
vmfault_tresult.Drop, if present, the diagnostic print of how many CPUs are in the trace and use the more universally compatible assumption that the fault result is the last column rather than a specific column.
Signed-off-by Dan Williams <[email protected]>--- test/dax.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)test/dax.sh +0
-0test/dax.sh run_test() { · line 40
Quoted 4 lines
test/dax.sh +1
-0@@ -37,13 +37,14 @@ run_test() { rc=1 while read -r p; do [[ $p ]] || continue + [[ $p == cpus=* ]] && continueremove above line
test/dax.sh run_test() { · line 47
Quoted 8 lines
test/dax.sh +1
-1if [ "$count" -lt 10 ]; then if [ "$p" != "0x100" ] && [ "$p" != "NOPAGE" ]; then cleanup "$1" fi fi count=$((count + 1)) - done < <(trace-cmd report | awk '{ print $21 }') + done < <(trace-cmd report | awk '{ print $NF }')replace above line w
done < <(trace-cmd report | grepdax_pmd_fault_done| awk '{ print $NF }')
Quoted 7 lines
Thanks for all of these Dan!
For this one, I ran into more metadata in the trace file, other than 'cpu=' causing the test to fail. I've tested what I'm showing above, which makes it immune to other things in the trace file.
Tell me you are OK w this and I'll apply this set to pending.
Yup, looks good to me and is even more robust. Thanks for the fixups!
Verma, Vishal L
maintainerRe: [ndctl PATCH 3/5] test: Fix dax.sh expectations
In reply to Alison SchofieldQuoted 23 lines · Alison Schofield
Quoted 20 lines · Dan Williams
With current kernel+tracecmd combinations stdout is no longer purely trace records and column "21" is no longer the
vmfault_tresult.Drop, if present, the diagnostic print of how many CPUs are in the trace and use the more universally compatible assumption that the fault result is the last column rather than a specific column.
Signed-off-by Dan Williams <[email protected]>---
test/dax.sh | 3 ++-1 file changed, 2 insertions(+), 1 deletion(-)test/dax.sh +0
-0@@ -37,13 +37,14 @@ run_test() {rc=1
while read -r p; do
[[ $p ]] || continuetest/dax.sh run_test() { · line 40
Quoted 1 line
test/dax.sh +1
-0+ [[ $p == cpus=* ]] && continueremove above line
Quoted 10 lines
test/dax.sh run_test() { · line 47
Quoted 8 lines
if [ "$count" -lt 10 ]; then
if [ "$p" != "0x100" ] && [ "$p" != "NOPAGE" ]; then cleanup "$1"
fi
fi
count=$((count + 1))test/dax.sh +1
-1- done < <(trace-cmd report | awk '{ print $21 }') + done < <(trace-cmd report | awk '{ print $NF }')replace above line w
done < <(trace-cmd report | grepdax_pmd_fault_done| awk '{ print $NF }')
Very minor nit, but since you're already using awk, no need to grep first, instead you can use awk's 'first part' to do the filtering -
done < <(trace-cmd report | awk '/dax_pmd_fault_done/{ print $NF }')
You can stick any regex between the /../ and it will only act on lines matching that.
Alison Schofield
maintainerRe: [ndctl PATCH 3/5] test: Fix dax.sh expectations
Quoted 35 lines · Vishal Verma
Quoted 23 lines · Alison Schofield
Quoted 20 lines · Dan Williams
With current kernel+tracecmd combinations stdout is no longer purely trace records and column "21" is no longer the
vmfault_tresult.Drop, if present, the diagnostic print of how many CPUs are in the trace and use the more universally compatible assumption that the fault result is the last column rather than a specific column.
Signed-off-by Dan Williams <[email protected]>---
test/dax.sh | 3 ++-1 file changed, 2 insertions(+), 1 deletion(-)test/dax.sh +0
-0@@ -37,13 +37,14 @@ run_test() {rc=1
while read -r p; do
[[ $p ]] || continuetest/dax.sh run_test() { · line 40
Quoted 1 line
test/dax.sh +1
-0+ [[ $p == cpus=* ]] && continueremove above line
Quoted 10 lines
test/dax.sh run_test() { · line 47
Quoted 8 lines
if [ "$count" -lt 10 ]; then
if [ "$p" != "0x100" ] && [ "$p" != "NOPAGE" ]; then cleanup "$1"
fi
fi
count=$((count + 1))test/dax.sh +1
-1- done < <(trace-cmd report | awk '{ print $21 }') + done < <(trace-cmd report | awk '{ print $NF }')replace above line w
done < <(trace-cmd report | grepdax_pmd_fault_done| awk '{ print $NF }')
Quoted 7 lines
Very minor nit, but since you're already using awk, no need to grep first, instead you can use awk's 'first part' to do the filtering -
done < <(trace-cmd report | awk '/dax_pmd_fault_done/{ print $NF }')
You can stick any regex between the /../ and it will only act on lines matching that.
Thanks Vishal! I hope to remember that for 'next time' I see grep and awk used together. Not rev'ing this one.
PATCH 4/5 test: Update documentation with required packages to install
In reply to Dan WilliamsAfter recently needing to manually rebuild a test environment I discovered the dependencies that need to be installed. Add a section to the README for package dependencies.
--- README.md | 5 +++++ 1 file changed, 5 insertions(+)
README.md +5 -0
@@ -85,6 +85,11 @@ loaded. To build and install nfit_test.ko: CONFIG_TRANSPARENT_HUGEPAGE=y ``` +1. Install the following packages, (Fedora instructions): + ``` + dnf install e2fsprogs xfsprogs parted jq trace-cmd hostname fio fio-engine-dev-dax + ``` + 1. Build and install the unit test enabled libnvdimm modules in the following order. The unit test modules need to be in place prior to the `depmod` that runs during the final `modules_install`
Signature · 1 line
2.49.0
Re: [ndctl PATCH 4/5] test: Update documentation with required packages to install
Quoted 5 lines · Dan Williams
After recently needing to manually rebuild a test environment I discovered the dependencies that need to be installed. Add a section to the README for package dependencies.
Signed-off-by Dan Williams <[email protected]>
Quoted 20 lines
--- README.md | 5 +++++ 1 file changed, 5 insertions(+)README.md +5
-0@@ -85,6 +85,11 @@ loaded. To build and install nfit_test.ko: CONFIG_TRANSPARENT_HUGEPAGE=y ``` +1. Install the following packages, (Fedora instructions): + ``` + dnf install e2fsprogs xfsprogs parted jq trace-cmd hostname fio fio-engine-dev-dax + ``` + 1. Build and install the unit test enabled libnvdimm modules in the following order. The unit test modules need to be in place prior to the `depmod` that runs during the final `modules_install`
PATCH 5/5 test: Fixup fwctl dependency
In reply to Dan WilliamsEnsure the 'fwctl' test binary is always built for test runs.
--- test/meson.build | 1 + 1 file changed, 1 insertion(+)
test/meson.build +1 -0
@@ -275,6 +275,7 @@ foreach t : tests dax_errors, daxdev_errors, dax_dev, + fwctl, mmap, ], suite: t[2],
Signature · 1 line
2.49.0
Re: [ndctl PATCH 5/5] test: Fixup fwctl dependency
Quoted 4 lines · Dan Williams
Ensure the 'fwctl' test binary is always built for test runs.
Fixes e461c7e2da63 ("test/cxl-features.sh: add test for CXL features device")Signed-off-by Dan Williams <[email protected]>
thanks for the fix
Quoted 16 lines
--- test/meson.build | 1 + 1 file changed, 1 insertion(+)test/meson.build +1
-0@@ -275,6 +275,7 @@ foreach t : tests dax_errors, daxdev_errors, dax_dev, + fwctl, mmap, ], suite: t[2],
Alison Schofield
maintainerQuoted 5 lines · Dan Williams
Recently I stood up a new test system from scratch and discovered some gaps in the documentation and the tests.
Fix those up to get all tests passing with v6.16-rc2 and latest version of all test dependencies currently available in Fedora Rawhide.
Thanks and applied to pending at: https://github.com/pmem/ndctl/
[ commit msg updates and the mentioned dax.sh awk change ]
Quoted 21 lines
Dan Williams (5):
build: Fix meson feature deprecation warnings
test: Fix 'ndctl' dependency intest/sub-section.sh
test: Fixdax.shexpectations
test: Update documentation with required packages to install
test: Fixup fwctl dependencyREADME.md | 5 +++++ contrib/meson.build | 2 +- meson.build | 5 +++-- test/dax.sh | 3 ++- test/meson.build | 1 + test/sub-section.sh | 2 +- 6 files changed, 13 insertions(+), 5 deletions(-)base-commit:
74b9e411bf13e87df39a517d10143fafa7e2ea92Signature · 1 line
2.49.0