> -----Original Message----- > From: Dan Williams [mailto:dan.j.willi...@intel.com] > Sent: Saturday, July 7, 2018 12:58 PM > To: Qi, Fuli/斉 福利 <qi.f...@jp.fujitsu.com> > Cc: linux-nvdimm <linux-nvdimm@lists.01.org> > Subject: Re: [ndctl PATCH v2] ndctl, test: add a new unit test for monitor > > On Thu, Jul 5, 2018 at 10:22 PM, QI Fuli <qi.f...@jp.fujitsu.com> 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 <y-g...@jp.fujitsu.com> > > Acked-by: Masayoshi Mizuma <m.miz...@jp.fujitsu.com> > > Signed-off-by: QI Fuli <qi.f...@jp.fujitsu.com> > > --- > > v1 -> v2: > > - Add init() > > - Add get_filter_dimm() to get the filter dimms by ndctl list command > > instead of hard-cording > > - Add sleep to call_notify() > > > > test/Makefile.am | 3 +- > > test/monitor.sh | 131 > > +++++++++++++++++++++++++++++++++++++++++++++++ > > 2 files changed, 133 insertions(+), 1 deletion(-) create mode 100755 > > test/monitor.sh > > > > diff --git a/test/Makefile.am b/test/Makefile.am index > > cd451e9..8c76462 100644 > > --- a/test/Makefile.am > > +++ b/test/Makefile.am > > @@ -21,7 +21,8 @@ TESTS =\ > > btt-pad-compat.sh \ > > firmware-update.sh \ > > ack-shutdown-count-set \ > > - rescan-partitions.sh > > + rescan-partitions.sh \ > > + monitor.sh > > > > check_PROGRAMS =\ > > libndctl \ > > diff --git a/test/monitor.sh b/test/monitor.sh new file mode 100755 > > index 0000000..dbd2013 > > --- /dev/null > > +++ b/test/monitor.sh > > @@ -0,0 +1,131 @@ > > +#!/bin/bash -Ex > > + > > +# SPDX-License-Identifier: GPL-2.0 > > +# Copyright(c) 2018, FUJITSU LIMITED. All rights reserved. > > + > > +rc=77 > > +logfile="" > > +conf_file="" > > +filter_dimms="" > > +monitor_pid=65536 > > +FILTER_DIMM="nmem1" > > +FILTER_REGION="region1" > > +FILTER_NAMESPACE="namespace1.0" > > +CONF_FILE_SET_DIMM="nmem1:nmem3" > > I thought this was going to be changed to not use hard coded values? > For example on my platform nmem1 is on ACPI.NFIT > > # ndctl list -BD -d nmem1 > { > "provider":"ACPI.NFIT", > "dev":"ndbus1", > "dimms":[ > { > "dev":"nmem1", > "id":"8680-57341200", > "handle":2, > "phys_id":0 > } > ] > } > > > Are you looking to test one of DIMMs on nfit_test.0? > > Why not just do this? > > FILTER_DIMM=$(ndctl list -D -b nfit_test.0 | jq -r .[0].dev) > FILTER_REGION=$(ndctl > list -R -b nfit_test.0 | jq -r .[0].dev) FILTER_NAMESPACE=$(ndctl list -N -b > nfit_test.0 | jq -r .[0].dev) >
OK, I will fix it. Thank you very much. QI _______________________________________________ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm