From: Hannes Reinecke Date: Thu, 17 Jun 2021 11:08:20 +0000 (+0200) Subject: test/tree.py: add test script for the python binding X-Git-Tag: v1.0-rc0~124^2~1 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=c3759fcf96281a7f1f79a5cb7f045d4e8ff377c4;p=users%2Fsagi%2Flibnvme.git test/tree.py: add test script for the python binding Add a simple test script for the python binding which just prints out details about the NVMe subsystem. Signed-off-by: Hannes Reinecke --- diff --git a/test/tree.py b/test/tree.py new file mode 100644 index 00000000..626a0aaf --- /dev/null +++ b/test/tree.py @@ -0,0 +1,23 @@ +#!/usr/bin/python3 +''' +SPDX-License-Identifier: LGPL-3.1-or-later + +This file is part of libnvme. +Copyright (c) 2021 SUSE Software Solutions AG + +Authors: Hannes Reinecke + +Scans the NVMe subsystem and prints out all found hosts, +subsystems, and controllers +''' + +import libnvme + +r = libnvme.nvme_root() +for h in r.hosts(): + print (h) + for s in h.subsystems(): + print (s) + for c in s.controllers(): + print (c) +