configure: add checking jq command
PATCH 1/2 configure: add checking jq command
Add checking jq command since it is needed to validate tests
--- configure.ac | 6 ++++++ 1 file changed, 6 insertions(+)
configure.ac +6 -0
@@ -65,6 +65,12 @@ fi AC_SUBST([XMLTO]) fi +AC_CHECK_PROG(JQ, [jq], [$(which jq)], [missing]) +if test "x$JQ" = xmissing; then + AC_MSG_ERROR([jq command needed to validate tests]) +fi +AC_SUBST([JQ]) + AC_C_TYPEOF AC_DEFINE([HAVE_STATEMENT_EXPR], 1, [Define to 1 if you have statement expressions.])
--
2.29.2
_______________________________________________
Linux-nvdimm mailing list -- [email protected] To unsubscribe send an email to [email protected]
PATCH 2/2 ndctl/test: add checking the presence of jq command ahead
Due to the lack of jq command, the result of the test will be 'fail'. This patch adds checking the presence of jq commmand ahead.
If there is no jq command in the system, the test will be marked as 'skip'.
--- test/daxdev-errors.sh | 1 + test/inject-error.sh | 2 ++ test/inject-smart.sh | 1 + test/label-compat.sh | 1 + test/max_available_extent_ns.sh | 1 + test/monitor.sh | 2 ++ test/multi-dax.sh | 1 + test/sector-mode.sh | 2 ++ 8 files changed, 11 insertions(+)
test/daxdev-errors.sh +1 -0
@@ -9,6 +9,7 @@ rc=77 . $(dirname $0)/common check_min_kver "4.12" || do_skip "lacks dax dev error handling" +check_prereq "jq" trap 'err $LINENO' ERR
test/inject-error.sh +2 -0
@@ -11,6 +11,8 @@ err_count=8 . $(dirname $0)/common +check_prereq "jq" + trap 'err $LINENO' ERR # sample json:
test/inject-smart.sh +1 -0
@@ -166,6 +166,7 @@ do_tests() } check_min_kver "4.19" || do_skip "kernel $KVER may not support smart (un)injection" +check_prereq "jq" modprobe nfit_test rc=1
test/label-compat.sh +1 -0
@@ -10,6 +10,7 @@ BASE=$(dirname $0) . $BASE/common check_min_kver "4.11" || do_skip "may not provide reliable isetcookie values" +check_prereq "jq" trap 'err $LINENO' ERR
test/max_available_extent_ns.sh +1 -0
@@ -9,6 +9,7 @@ rc=77 trap 'err $LINENO' ERR check_min_kver "4.19" || do_skip "kernel $KVER may not support max_available_size" +check_prereq "jq" init() {
test/monitor.sh +2 -0
@@ -13,6 +13,8 @@ smart_supported_bus="" . $(dirname $0)/common +check_prereq "jq" + trap 'err $LINENO' ERR check_min_kver "4.15" || do_skip "kernel $KVER may not support monitor service"
test/multi-dax.sh +1 -0
@@ -9,6 +9,7 @@ rc=77 . $(dirname $0)/common check_min_kver "4.13" || do_skip "may lack multi-dax support" +check_prereq "jq" trap 'err $LINENO' ERR
test/sector-mode.sh +2 -0
@@ -6,6 +6,8 @@ rc=77 . $(dirname $0)/common +check_prereq "jq" + set -e trap 'err $LINENO' ERR
--
2.29.2
_______________________________________________
Linux-nvdimm mailing list -- [email protected] To unsubscribe send an email to [email protected]
Re: [ndctl PATCH 2/2] ndctl/test: add checking the presence of jq command ahead
Quoted 6 lines · QI Fuli
Due to the lack of jq command, the result of the test will be 'fail'. This patch adds checking the presence of jq commmand ahead.
If there is no jq command in the system, the test will be marked as 'skip'.Signed-off-by QI Fuli <[email protected]>
Though it looks slightly redundant after having the check in configure.ac, not against having additional checks.
Thanks,
Santosh
Quoted 111 lines
--- test/daxdev-errors.sh | 1 + test/inject-error.sh | 2 ++ test/inject-smart.sh | 1 + test/label-compat.sh | 1 + test/max_available_extent_ns.sh | 1 + test/monitor.sh | 2 ++ test/multi-dax.sh | 1 + test/sector-mode.sh | 2 ++ 8 files changed, 11 insertions(+)test/daxdev-errors.sh +1
-0@@ -9,6 +9,7 @@ rc=77 . $(dirname $0)/common check_min_kver "4.12" || do_skip "lacks dax dev error handling" +check_prereq "jq" trap 'err $LINENO' ERRtest/inject-error.sh +2
-0@@ -11,6 +11,8 @@ err_count=8 . $(dirname $0)/common +check_prereq "jq" + trap 'err $LINENO' ERR # sample json:test/inject-smart.sh +1
-0@@ -166,6 +166,7 @@ do_tests() } check_min_kver "4.19" || do_skip "kernel $KVER may not support smart (un)injection" +check_prereq "jq" modprobe nfit_test rc=1test/label-compat.sh +1
-0@@ -10,6 +10,7 @@ BASE=$(dirname $0) . $BASE/common check_min_kver "4.11" || do_skip "may not provide reliable isetcookie values" +check_prereq "jq" trap 'err $LINENO' ERRtest/max_available_extent_ns.sh +1
-0@@ -9,6 +9,7 @@ rc=77 trap 'err $LINENO' ERR check_min_kver "4.19" || do_skip "kernel $KVER may not support max_available_size" +check_prereq "jq" init() {test/monitor.sh +2
-0@@ -13,6 +13,8 @@ smart_supported_bus="" . $(dirname $0)/common +check_prereq "jq" + trap 'err $LINENO' ERR check_min_kver "4.15" || do_skip "kernel $KVER may not support monitor service"test/multi-dax.sh +1
-0@@ -9,6 +9,7 @@ rc=77 . $(dirname $0)/common check_min_kver "4.13" || do_skip "may lack multi-dax support" +check_prereq "jq" trap 'err $LINENO' ERRtest/sector-mode.sh +2
-1@@ -6,6 +6,8 @@ rc=77 . $(dirname $0)/common +check_prereq "jq" + set -e trap 'err $LINENO' ERR --
Quoted 4 lines
2.29.2
_______________________________________________
Linux-nvdimm mailing list -- [email protected] To unsubscribe send an email to [email protected]
_______________________________________________
Linux-nvdimm mailing list -- [email protected] To unsubscribe send an email to [email protected]
Hi Qi,
Quoted 27 lines · QI Fuli
Add checking jq command since it is needed to validate tests
Cc Santosh Sivaraj <[email protected]>Signed-off-by QI Fuli <[email protected]>--- configure.ac | 6 ++++++ 1 file changed, 6 insertions(+)configure.ac +6
-1@@ -65,6 +65,12 @@ fi AC_SUBST([XMLTO]) fi +AC_CHECK_PROG(JQ, [jq], [$(which jq)], [missing]) +if test "x$JQ" = xmissing; then + AC_MSG_ERROR([jq command needed to validate tests]) +fi +AC_SUBST([JQ]) + AC_C_TYPEOF AC_DEFINE([HAVE_STATEMENT_EXPR], 1, [Define to 1 if you have statement expressions.]) --
Quoted 1 line
2.29.2
Thanks,
Santosh
_______________________________________________
Linux-nvdimm mailing list -- [email protected] To unsubscribe send an email to [email protected]
Verma, Vishal L
maintainerQuoted 8 lines · QI Fuli
Add checking jq command since it is needed to validate tests
Cc Santosh Sivaraj <[email protected]>Signed-off-by QI Fuli <[email protected]>---
configure.ac | 6 ++++++1 file changed, 6 insertions(+)
Hm, I think I prefer how you did it in v1. i.e. no configure.ac check. In my view, configure.ac tests are for the core things needed to /run/ ndctl on a system. Development unit tests can just continue to use check_prereq as you did. So I'll pick up v1 of this for now - if you want me to do something else please let me know!
Quoted 18 lines
configure.ac +0
-0@@ -65,6 +65,12 @@ fi AC_SUBST([XMLTO])fi
configure.ac +6
-0+AC_CHECK_PROG(JQ, [jq], [$(which jq)], [missing]) +if test "x$JQ" = xmissing; then + AC_MSG_ERROR([jq command needed to validate tests]) +fi +AC_SUBST([JQ]) +AC_C_TYPEOF
AC_DEFINE([HAVE_STATEMENT_EXPR], 1, [Define to 1 if you have statement expressions.])
Quoted 5 lines
--
2.29.2
_______________________________________________
Linux-nvdimm mailing list -- [email protected] To unsubscribe send an email to [email protected]
_______________________________________________
Linux-nvdimm mailing list -- [email protected] To unsubscribe send an email to [email protected]