Daniel Wagner [Fri, 17 Jun 2022 08:31:42 +0000 (10:31 +0200)]
tests: Port to nose2 and unittest
The test are still using nose which has been superseeded by
nose2. Update the tests to use the nose2 and unittest.
To minimize errors in most of the porting is done using sed, e.g
's/TestNVMeIO.__init__(self)/super().setUp()/g'.
While at it also update the build system and move the test files to
the build dir. This avoids in tree exectution of the Python files
which leaves the __pycache__ dir in the source tree.
This also fixes the problem, that the config file is not found when
'meson test -C .build' is used. We have the prober dir structure for
Python and nose2 to find all resources in the build root. Furthermore,
when running the tests the output is captured in the nvmetests
dir. This dir is also created under the build root dir.
Ankit Kumar [Thu, 9 Jun 2022 15:42:06 +0000 (21:12 +0530)]
print: Update power descriptor fields
1. Add missing active power workload field.
2. Use enums for power scale.
3. Fix indentation.
4. Update json entry for active power workload and
fix idle scale.
Daniel Wagner [Thu, 2 Jun 2022 13:26:11 +0000 (15:26 +0200)]
fabrics: Already connected uses a different error code
The libnvme library reports connection errors with it's own error
codes, e.g. ENVME_CONNECT_ALREADY stands for already connected. Update
the connect-all call so that it prints 'already connected' again.
Daniel Wagner [Thu, 2 Jun 2022 08:58:42 +0000 (10:58 +0200)]
nvme-print: Show ANA state only for one namespace
'nvme list-subsys' shows the state of all controllers belonging to a
subsystem. The ANA state is a per namespace attribute hence it only
makes sense to show it if the user lists the subsystem for a
namespace.
Fixes: 7435ed9ae6a6 ("nvme-print: Show paths from the first namespace only") Signed-off-by: Daniel Wagner <dwagner@suse.de>
Daniel Wagner [Wed, 1 Jun 2022 13:53:18 +0000 (15:53 +0200)]
docs: Don't confuse asciidoc with asciidoctor
Apparently, asciidoc and asciidoctor are two different
projects. nvme-cli depends on the former. Depend on asciidoc only and
make it a hard dependency when the user ask to build the doc.
Fixes: 6b18babf40d4 ("docs: Search for 'asciidoctor' as alternative") Signed-off-by: Daniel Wagner <dwagner@suse.de>
Daniel Wagner [Wed, 25 May 2022 15:33:08 +0000 (17:33 +0200)]
nvme-print: Show paths from the first namespace only
When listing the subsystem, show the path from the first namespace
only. Every namespace has the same paths for a subsystem. This avoids
listening the same controllers for each namespace.
Daniel Wagner [Thu, 19 May 2022 12:14:47 +0000 (14:14 +0200)]
fabrics: Honor config file for connect-all
The command line option -J config.json allows to provide a
configuration via a JSON file. We handle this correctly for the
'connect' case but fail to apply the configuration for 'connect-all'
because we missed to add nvme_read_config() in this path.
Daniel Wagner [Wed, 18 May 2022 06:19:23 +0000 (08:19 +0200)]
build: Clarify current main project license
The original desired license for the project was GPL-2.0-or-later
but during the development a few files (e.g. fabrics.c and nvme.h)
got added which are licensed as GPL-2.0-only, which renders the
whole project to GPL-2.0-only.
Update the meson license field and the nvme.spec license field.
While at it mentions this in the contributions notes as well.
Daniel Wagner [Tue, 17 May 2022 06:02:56 +0000 (08:02 +0200)]
ocp: Update license to GPL-2.0-or-later
When I reviewed the plugin I asked wrongly for GPL-2.0-only. The
project is using the GPL-2.0-or-later license. Relax the license
requirement to GPL-2.0-or-later.
Brad Mouring [Tue, 3 May 2022 03:38:24 +0000 (22:38 -0500)]
completions: Collapse declaration and attribute assignment
Previously, the associative arrays for the vendor/subcommands and
vendor/functions listings were split into a declaration of type
(using "typeset") and attribute definition (using "readonly"). On
bash 5.1.16 (at least), this lead to the following error (reported
after enabling -xv to expand and print shell inputs)
...
+ . /usr/share/bash-completion/completions/nvme
# bash tab completion for the nvme command line utility
# (unfortunately, bash won't let me add descriptions to cmds)
# Kelly Kaoudis kelly.n.kaoudis at intel.com, Aug. 2015
# Constant to indicate command has no options
readonly NO_OPTS=""
++ readonly NO_OPTS=
++ NO_OPTS=
# Associative array of plugins and associated subcommands
# Order here is same as PLUGIN_OBJS in Makefile
typeset -A _plugin_subcmds
++ typeset -A _plugin_subcmds
readonly _plugin_subcmds=(
[intel]="id-ctrl internal-log lat-stats \
...
++ _plugin_subcmds=(['intel']='id-ctrl internal-log lat-stats...
bash: 'intel': syntax error: operand expected (error token is "'intel'")
...
Using the available flags for "typeset" to declare the variables as
readonly arrays resolved the issue (and allows for bash completion
to work as-expected)
Hannes Reinecke [Fri, 22 Apr 2022 11:10:01 +0000 (13:10 +0200)]
plugins/seagate: fixup byte calculation
When calculating the number of bytes from the number of blocks one
has to ensure that the values can't overflow, so use a large data
type for the number of bytes than for the number of blocks.
Hannes Reinecke [Fri, 22 Apr 2022 11:04:37 +0000 (13:04 +0200)]
plugins/wdc: coverity fixes
Coverity found an off-by-one error when printing raw values; looks
like someone forgot convert the 1-based NVMe spec convention into
the 0-based C convention.
And, of course, various resource leaks.