Re: [PATCH v1 11/17] kunit: test: add test managed resource tests

2019-04-24 Thread Masayoshi Mizuma
On Thu, Apr 04, 2019 at 03:06:46PM -0700, Brendan Higgins wrote: > From: Avinash Kondareddy > > Tests how tests interact with test managed resources in their lifetime. > > Signed-off-by: Avinash Kondareddy > Signed-off-by: Brendan Higgins > --- > kunit/test-test.c | 122

Re: [PATCH v1 14/17] Documentation: kunit: add documentation for KUnit

2019-04-24 Thread Masayoshi Mizuma
Hi Brendan, KUNIT_ASSERT_NOT_ERR_OR_NULL() should be replaced to KUNIT_EXPECT_NOT_ERR_OR_NULL(), right? On Thu, Apr 04, 2019 at 03:06:49PM -0700, Brendan Higgins wrote: > Add documentation for KUnit, the Linux kernel unit testing framework. > - Add intro and usage guide for KUnit > - Add API

Question about unit test for acpi_nfit_notify().

2018-11-06 Thread Masayoshi Mizuma
Let me ask a question about unit test for acpi_nfit_notify(). The unit test was introduced by commit c14a868a5a14 ("tools/testing/nvdimm: unit test for acpi_nfit_notify()"), however, it seems that it doesn't work currently. When I road the nfit_test.ko, I got the following message. nfit_test

[PATCH v2] tools/testing/nvdimm: Fix the array size for dimm devices.

2018-10-30 Thread Masayoshi Mizuma
From: Masayoshi Mizuma KASAN reports following global out of bounds access while nfit_test is being loaded. The out of bound access happens the following reference to dimm_fail_cmd_flags[dimm]. 'dimm' is over than the index value, NUM_DCR (==5). static int override_return_code(int dimm

Re: [PATCH] tools/testing/nvdimm: Fix the index for dimm devices.

2018-10-30 Thread Masayoshi Mizuma
On Tue, Oct 30, 2018 at 03:30:05PM -0700, Dan Williams wrote: > On Mon, Oct 29, 2018 at 12:11 PM Masayoshi Mizuma > wrote: > > > > From: Masayoshi Mizuma > > > > KASAN reports following global out of bounds access while > > nfit_test is being loa

[PATCH] tools/testing/nvdimm: Fix the index for dimm devices.

2018-10-29 Thread Masayoshi Mizuma
From: Masayoshi Mizuma KASAN reports following global out of bounds access while nfit_test is being loaded. The out of bound access happens the following reference to dimm_fail_cmd_flags[dimm]. 'dimm' is over than the index value, NUM_DCR (==5). --- static int override_return_code(int dimm

Re: [ndctl PATCH 2/4] ndctl, monitor: set default log destination to syslog if "--daemon" is specified

2018-08-08 Thread Masayoshi Mizuma
HiQi, On 08/07/2018 09:31 PM, Qi, Fuli wrote: ... >> On 08/07/2018 09:17 AM, QI Fuli wrote: >>> When running monitor as a daemon, if the log destination is "standard" >>> or a relative path for log file, the messages will not be able to be logged. >>> Sometimes, users may not notice that the

[PATCH v3] ndctl, test: add a new unit test for max_available_extent namespace

2018-08-07 Thread Masayoshi Mizuma
From: Masayoshi Mizuma Add a new unit test to test max_available_extent namespace. This feature is implemented by the following patches. kernel side: https://lists.01.org/pipermail/linux-nvdimm/2018-July/016731.html https://lists.01.org/pipermail/linux-nvdimm/2018-July/016732.html

Re: [ndctl PATCH 3/4] ndctl, monitor: add timestamp and pid to log messages in log_file()

2018-08-07 Thread Masayoshi Mizuma
On 08/07/2018 08:54 PM, Qi, Fuli wrote: >> -Original Message- >> From: Masayoshi Mizuma [mailto:msys.miz...@gmail.com] >> Sent: Wednesday, August 8, 2018 3:40 AM >> To: Qi, Fuli/斉 福利 ; linux-nvdimm@lists.01.org >> Subject: Re: [ndctl PATCH 3/4] ndctl,

Re: [ndctl PATCH 2/4] ndctl, monitor: set default log destination to syslog if "--daemon" is specified

2018-08-07 Thread Masayoshi Mizuma
Hi Qi, On 08/07/2018 09:17 AM, QI Fuli wrote: > When running monitor as a daemon, if the log destination is "standard" or > a relative path for log file, the messages will not be able to be logged. > Sometimes, users may not notice that the default log destination is "standard" > when they start

Re: [ndctl PATCH 1/4] ndctl, monitor: fix the lack of detection of invalid path of log file

2018-08-07 Thread Masayoshi Mizuma
ails. In my understanding here is that the fallback is needed to save in case of the monitor.log in trouble for example, the parent directory is removed. And, the new fopen() check, you have added by this patch, to inform the invalid log path for users. Is my understanding correct? I

Re: [ndctl PATCH 4/4] ndctl, monitor: add [Install] Section to systemd unit file of ndctl-monitor

2018-08-07 Thread Masayoshi Mizuma
Hi Qi, Looks good to me. Please free to add: Reviewed-by: Masayoshi Mizuma Thanks, Masa On 08/07/2018 09:17 AM, QI Fuli wrote: > This patch is used to add "[Install]" section to systemd unit file of > ndctl-monitor. Therefore, users can set ndctl-monitor unit enable.

Re: [ndctl PATCH 3/4] ndctl, monitor: add timestamp and pid to log messages in log_file()

2018-08-07 Thread Masayoshi Mizuma
Hi Qi, On 08/07/2018 09:17 AM, QI Fuli wrote: > This patch is used to add timestamp and process id to log messages when > logging > messages to a file. > > Signed-off-by: QI Fuli > --- > ndctl/monitor.c | 11 ++- > 1 file changed, 10 insertions(+), 1 deletion(-) > > diff --git

[PATCH] ndctl, documentation: Clarify the dimm id for ndctl list d option

2018-08-06 Thread Masayoshi Mizuma
From: Masayoshi Mizuma User may be confused the dimm id description of ndctl list -d option because ndctl list says id, but the id is not useful to d option. ]# ndctl list -d nmem7 | jq -r .id cdab-0a-07e0-fefffeff ]# ndctl list -d cdab-0a-07e0-fefffeff ]# The appropriate id here is X

Re: [PATCH v2] ndctl, test: add a new unit test for max_available_extent namespace

2018-08-06 Thread Masayoshi Mizuma
Hi Vishal, Thank you for your review! I'll fix and send v3. Thanks, Masa On 08/03/2018 05:35 PM, Verma, Vishal L wrote: > > On Fri, 2018-08-03 at 14:52 -0400, Masayoshi Mizuma wrote: >> From: Masayoshi Mizuma >> >> Add a new unit test to test max_available_extent na

[PATCH v2] ndctl, test: add a new unit test for max_available_extent namespace

2018-08-03 Thread Masayoshi Mizuma
From: Masayoshi Mizuma Add a new unit test to test max_available_extent namespace. This feature is implemented by the following patches. kernel side: https://lists.01.org/pipermail/linux-nvdimm/2018-July/016731.html https://lists.01.org/pipermail/linux-nvdimm/2018-July/016732.html

Re: [ndctl PATCHv4] ndctl: Use max_available_extent for namespace

2018-08-03 Thread Masayoshi Mizuma
Hi Vishal, On 08/02/2018 04:42 PM, Masayoshi Mizuma wrote: ... >> If you also wanted to package up this script as a unit test, I'd be >> happy to include it. Would be gated on KVER=4.19 > > Sounds great :-) > Here is the patch for unit test: > > ---- > From:

Re: [ndctl PATCHv4] ndctl: Use max_available_extent for namespace

2018-08-02 Thread Masayoshi Mizuma
Hi Keith, I tested your patch with the following test script. The result is good to me. Please feel free to add: Tested-by: Masayoshi Mizuma Test script: --- #!/bin/bash -Ex NDCTL=./ndctl/ndctl modprobe nfit_test region=$($NDCTL list -b nfit_test.0 -R -t pmem | jq -r .[].dev | head -1

Re: [ndclt PATCH] ndctl, monitor: Fix duplicate prefix in monitor.log

2018-08-02 Thread Masayoshi Mizuma
to set monitor.log. > a) setting the argument of [--log] option > b) setting the value of [log] key in configuration file > > When users set monitor.log by b, the prefix will not be added to monitor.log. > Therefore, we should do fix_filename() before strncmp(). Oh, my proposal

Re: [PATCH] ndctl, monitor: Change the fail log priority to err.

2018-08-02 Thread Masayoshi Mizuma
Hi QI, On 08/02/2018 07:42 AM, Qi, Fuli wrote: >> -Original Message- >> From: Masayoshi Mizuma [mailto:msys.miz...@gmail.com] >> Sent: Thursday, August 2, 2018 3:56 AM >> To: linux-nvdimm@lists.01.org >> Cc: Masayoshi Mizuma ; Qi, Fuli/斉 福利 >> ; Mizuma,

[PATCH] ndctl, monitor: Change the fail log priority to err.

2018-08-01 Thread Masayoshi Mizuma
From: Masayoshi Mizuma fail() is called if an error happens, but the log priority is debug, so user may not notice the error. Let's change the priority to err. Cc: QI Fuli Signed-off-by: Masayoshi Mizuma --- ndctl/monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [ndclt PATCH] ndctl, monitor: Fix duplicate prefix in monitor.log

2018-08-01 Thread Masayoshi Mizuma
Hi QI, On 07/31/2018 01:15 AM, QI Fuli wrote: > When a monitor runs with [--log] option, the prefix will be dually > added to monitor.log. Therefore, the monitor cannot log the smart > notification to syslog. This patch is used to prevent prefix from > being dually added to monitor.log. > >

Re: [ndctl PATCH v12 5/5] ndctl, test: add a new unit test for monitor

2018-07-13 Thread Masayoshi Mizuma
Hi Qi, On 07/13/2018 11:54 AM, QI Fuli wrote: > Add a new unit test to test all options of the monitor command. > > Based-on-patch-by: Yasunori Goto > Acked-by: Masayoshi Mizuma > Signed-off-by: QI Fuli [...] > +test_filter_dimmevent() > +{ > + monitor_dimms=&

Re: [ndctl PATCH v12 3/5] ndctl, monitor: add the unit file of systemd for ndctl-monitor service

2018-07-13 Thread Masayoshi Mizuma
Hi Qi, On 07/13/2018 11:54 AM, QI Fuli wrote: > This patch adds the systemd unit file for ndctl-monitor service. > The systemd unit directory can be configured by setting environment > variable "--with-systemd-unit-dir[=DIR]". > > A monitor daemon can be started as a system service: >#

Re: [ndctl PATCH v11 3/5] ndctl, monitor: add the unit file of systemd for ndctl-monitor service

2018-07-13 Thread Masayoshi Mizuma
Hi Qi, On 07/13/2018 08:57 AM, Qi, Fuli wrote: >> -Original Message- >> From: Verma, Vishal L [mailto:vishal.l.ve...@intel.com] >> Sent: Friday, July 13, 2018 11:47 AM >> To: linux-nvdimm@lists.01.org; Qi, Fuli/斉 福利 >> Subject: Re: [ndctl PATCH v11 3/5] ndctl, monitor: add the unit file

Re: [ndctl PATCH 2/2] ndctl, test: convert remaining tests to use test/common

2018-07-12 Thread Masayoshi Mizuma
Hi Vishal, Looks good to me. Please feel free to add: Reviewed-by: Masayoshi Mizuma Thanks, Masa On 07/11/2018 07:56 PM, Vishal Verma wrote: > The original test/common conversions missed the --enable-destructive > class of tests. The json single object vs. array changes prompted >

Re: [ndctl PATCH v11 5/5] ndctl, test: add a new unit test for monitor

2018-07-12 Thread Masayoshi Mizuma
Hi Qi, Nice work! Let me ask some comments. On 07/10/2018 11:00 PM, QI Fuli wrote: [...] > diff --git a/test/monitor.sh b/test/monitor.sh > new file mode 100755 > index 000..43cb11f > --- /dev/null > +++ b/test/monitor.sh > @@ -0,0 +1,177 @@ > +#!/bin/bash -Ex > + > +#

Re: [ndctl PATCH v4] ndctl, test: add a new unit test for monitor

2018-07-10 Thread Masayoshi Mizuma
On 07/10/2018 06:04 AM, QI Fuli wrote: > Add a new unit test to test the following options of the monitor command. >--dimm >--bus >--region >--namespace >--logfile >--config-file Why don't you add '-D' option test? Like as: test_filter_dimmevent() {

Re: [ndctl PATCH v10 1/4] ndctl, monitor: add a new command - monitor

2018-07-10 Thread Masayoshi Mizuma
On 07/09/2018 10:17 AM, QI Fuli wrote: [...] > +static void log_file(struct ndctl_ctx *ctx, int priority, const char *file, > + int line, const char *fn, const char *format, va_list args) > +{ > + FILE *f; > + char *buf; > + > + if (vasprintf(, format, args) < 0) { > +

[ndctl PATCH] ndctl, test: remove the firmware image file before the test end

2018-07-06 Thread Masayoshi Mizuma
From: Masayoshi Mizuma Remove test/update-fw.img before test/firmware-update.sh end. Signed-off-by: Masayoshi Mizuma --- test/firmware-update.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/test/firmware-update.sh b/test/firmware-update.sh index 50674a6..7852e58 100755 --- a/test

Re: [ndctl PATCH v2] ndctl, test: add a new unit test for monitor

2018-07-06 Thread Masayoshi Mizuma
Hi Qi, On 07/06/2018 01:22 AM, QI Fuli wrote: > Add a new unit test to test the following options of the monitor command. >--dimm >--bus >--region >--namespace >--logfile >--config-file > > Based-on-patch-by: Yasunori Goto > Acked-

Re: [ndctl PATCH] ndctl, test: add a new unit test for monitor

2018-07-05 Thread Masayoshi Mizuma
Hi Qi, I tried this test after I applied your latest monitor patches [1]. I found some points. Could you check the following? [1] https://lists.01.org/pipermail/linux-nvdimm/2018-June/016562.html On 07/05/2018 07:23 AM, QI Fuli wrote: > Add a new unit test to test the follow options of the

[PATCH] ndctl: add a test file to .gitignore

2018-06-19 Thread Masayoshi Mizuma
From: Masayoshi Mizuma Add test/ack-shutdown-count-set to .gitignore. Signed-off-by: Masayoshi Mizuma --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index c7d11d9..1016b3b 100644 --- a/.gitignore +++ b/.gitignore @@ -55,3 +55,4 @@ test/smart-listen

[PATCH v3 1/2] ndctl, test: Add NFIT_TEST_BUS[01] variable and some helper funtions to common

2018-06-19 Thread Masayoshi Mizuma
From: Masayoshi Mizuma Add following global variable and functions to test/common file. - NFIT_TEST_BUS[01] (global variable) Buses are created when nfit_test module is loaded. - NDCTL (global variable) ndctl command path (renamed). - _cleanup Helper function cleans up nfit_test

[PATCH v3 2/2] ndctl, test: cleanup test scripts

2018-06-19 Thread Masayoshi Mizuma
From: Masayoshi Mizuma Cleanup some test scripts by using helper functions. Signed-off-by: Masayoshi Mizuma --- test/blk-exhaust.sh | 21 ++-- test/btt-check.sh | 52 ++- test/btt-errors.sh| 30 +++--- test

[PATCH v3 0/2] ndctl, test: Add some global variables and functions to cleanup.

2018-06-19 Thread Masayoshi Mizuma
path (renamed). - _cleanup Helper function cleans up nfit_test module. - json2var Helper function (filter) converts json to var. Changelog: - Fix missing '-b' before $NFIT_TEST_BUS*. - Fix the subject to "ndctl, test:...". Masayoshi Mizuma (2): nfit, test: Add NFIT_T

Re: [PATCH v2 0/2] nfit, test: Add some global variables and functions to cleanup.

2018-06-19 Thread Masayoshi Mizuma
I think the subject is wrong... I'll resend them, sorry. - Masa On 06/19/2018 03:30 PM, Masayoshi Mizuma wrote: > This is additional cleanup patches for test scripts. > Add following global variable and functions to test/common file. > Then, cleanup test script to use them. > >

[PATCH v2 1/2] nfit, test: Add NFIT_TEST_BUS[01] variable and some helper funtions to common

2018-06-19 Thread Masayoshi Mizuma
From: Masayoshi Mizuma Add following global variable and functions to test/common file. - NFIT_TEST_BUS[01] (global variable) Buses are created when nfit_test module is loaded. - NDCTL (global variable) ndctl command path (renamed). - _cleanup Helper function cleans up nfit_test

[PATCH v2 0/2] nfit, test: Add some global variables and functions to cleanup.

2018-06-19 Thread Masayoshi Mizuma
path (renamed). - _cleanup Helper function cleans up nfit_test module. - json2var Helper function (filter) converts json to var. Changelog: - Fix missing '-b' before $NFIT_TEST_BUS*. Masayoshi Mizuma (2): nfit, test: Add NFIT_TEST_BUS[01] variable and some helper funtions to common

[PATCH v2 2/2] nfit, test: cleanup test scripts

2018-06-19 Thread Masayoshi Mizuma
From: Masayoshi Mizuma Cleanup some test scripts by using helper functions. Signed-off-by: Masayoshi Mizuma --- test/blk-exhaust.sh | 21 ++-- test/btt-check.sh | 52 ++- test/btt-errors.sh| 30 +++--- test

Re: [PATCH 2/2] nfit, test: cleanup test scripts

2018-06-19 Thread Masayoshi Mizuma
On 06/19/2018 12:36 AM, Verma, Vishal L wrote: > On Thu, 2018-06-14 at 15:43 -0400, Masayoshi Mizuma wrote: >> From: Masayoshi Mizuma >> >> Cleanup some test scripts by using helper functions. >> >> Signed-off-by: Masayoshi Mizuma >>

[PATCH 2/2] nfit, test: cleanup test scripts

2018-06-14 Thread Masayoshi Mizuma
From: Masayoshi Mizuma Cleanup some test scripts by using helper functions. Signed-off-by: Masayoshi Mizuma --- test/blk-exhaust.sh | 21 ++-- test/btt-check.sh | 52 ++- test/btt-errors.sh| 7 +++--- test/btt-pad

[PATCH 1/2] nfit, test: Add NFIT_TEST_BUS[01] variable and some helper funtions to common

2018-06-14 Thread Masayoshi Mizuma
From: Masayoshi Mizuma Add following global variable and functions to test/common file. - NFIT_TEST_BUS[01] (global variable) Buses are created when nfit_test module is loaded. - NDCTL (global variable) ndctl command path (renamed). - _cleanup Helper function cleans up nfit_test

[PATCH 0/2] nfit, test: Add some global variables and functions to cleanup.

2018-06-14 Thread Masayoshi Mizuma
path (renamed). - _cleanup Helper function cleans up nfit_test module. - json2var Helper function (filter) converts json to var. Masayoshi Mizuma (2): nfit, test: Add NFIT_TEST_BUS[01] variable and some helper funtions to common nfit, test: cleanup test scripts test/blk-exhaust.sh

[PATCH v2 0/2] ndctl, test: add some helper function and cleanup test script

2018-06-12 Thread Masayoshi Mizuma
/firmware-update.sh Masayoshi Mizuma (2): ndctl, test: add some helper function for test script ndctl, test: cleanup test scripts test/blk-exhaust.sh | 21 +++--- test/btt-check.sh | 35 +++ test/btt-errors.sh| 20 - test/btt-pad

[PATCH v2 1/2] ndctl, test: add some helper function for test script

2018-06-12 Thread Masayoshi Mizuma
From: Masayoshi Mizuma Some test scripts have same function. So, this patch introduces the functions to 'test/common' new file. Signed-off-by: Masayoshi Mizuma --- test/common | 60 + 1 file changed, 60 insertions(+) create mode 100644 test

[PATCH v2 2/2] ndctl, test: cleanup test scripts

2018-06-12 Thread Masayoshi Mizuma
From: Masayoshi Mizuma Include 'common' file to use some functions for test scritps. Signed-off-by: Masayoshi Mizuma --- test/blk-exhaust.sh | 21 +++- test/btt-check.sh | 35 -- test/btt-errors.sh| 20 --- test/btt-pad

[PATCH 0/2] test: add some helper function and cleanup test script

2018-06-11 Thread Masayoshi Mizuma
Some test scripts have same function. So, let's cleanup to stop the duplication by intoducing 'test/common' file. Test scripts includes the common file to use the functions. Masayoshi Mizuma (2): test: add some helper function for test script test: cleanup test scripts test/blk-exhaust.sh

[PATCH 1/2] test: add some helper function for test script

2018-06-11 Thread Masayoshi Mizuma
From: Masayoshi Mizuma Some test scripts have same function. So, this patch introduces the functions to 'test/common' new file. Signed-off-by: Masayoshi Mizuma --- test/common | 57 + 1 file changed, 57 insertions(+) create mode 100644 test

[PATCH 2/2] test: cleanup test scripts

2018-06-11 Thread Masayoshi Mizuma
From: Masayoshi Mizuma Include 'common' file to use some fucntions for test scripts. Signed-off-by: Masayoshi Mizuma --- test/blk-exhaust.sh | 21 +++- test/btt-check.sh | 35 -- test/btt-errors.sh| 20 --- test/btt-pad

Re: [PATCH v5 4/4] ndctl, monitor: add the unit file of systemd for ndctl-monitor service

2018-05-01 Thread Masayoshi Mizuma
Hello QI, I think the systemd service is nice, however, it seems that it does not work fine... because ndctl-monitor.service was not installed to systemd dir. On 04/26/2018 07:30 AM, QI Fuli wrote: > This patch adds the systemd unit file for ndctl-monitor service. > The systemd unit directory