2
Most read
6
Most read
10
Most read
Pynvme:
test NVMe devices in Python
https://github.com/cranechu/pynvme
<date/time> <footer> 2
Pynvme
Pynvme is a python extension module. Users can operate NVMe SSD
intuitively by Python scripts. It is designed for NVMe SSD testing
with performance considered. With third-party tools, e.g. emacs,
pycharm and pytest, pynvme is a convenient and professional NVMe
device test solution.
<date/time> <footer> 3
Pynvme in Python IDLE
SPDK
pynvme
<date/time> <footer> 4
Pynvme is based on SPDK
<date/time> <footer> 5
Pynvme Architecture
Test driver
(driver.c)
Python interface
(driver_wrap.pyx)
Python library
(nvme.so)
Build python library with Cython:
• setup.py
• driver.c
• driver.h
• cdriver.pxd
• driver_wrap.pyx
• Makefile
<date/time> <footer> 6
Pynvme Architecture
Test driver
(driver.c)
Python interface
(driver_wrap.pyx)
Python library
(nvme.so)
Organize test cases in
pytest:
• mvme.so
• pytest.ini
• conftest.py
• driver_test.py
Python test scripts
(driver_test.py)
Pytest fixtures
(conftest.py)
<date/time> <footer> 7
Why Python?
√ Many beautiful mature libraries
• pytest
• logging
• multiprocessing
• numpy
• matplotlib
• pydoc
• os, io, time, pytemperature, statistics, yaml, json, struct, ...
√ Friendly IDEs for developing, debugging, and testing
• Pycharm, emacs, vscode
√ CI: develop firmware softly
<date/time> <footer> 8
Pynvme CI Status
<date/time> <footer> 9
Config and Compile
− git clone https://github.com/cranechu/pynvme; cd pynvme
− git submodule update --init –recursive
− sudo ./spdk/scripts/pkgdep.sh
− sudo dnf install python3-pip -y
− sudo python3 -m pip install -r requirements.txt
− cd spdk; ./configure --without-isal; cd ..
− make spdk; make
− Fedora29 is recommended.
− find script examples in driver_test.py.
− find more => https://github.com/cranechu/pynvme
<date/time> <footer> 10
Test Scripts
pytest cases are
started with
test_
create qpair and
buffer for write
commands
write data, and
then read in the
callback
pytest fixtures
callback functions
called when cmds are
completed
fill buffer with
identify data
<date/time> <footer> 11
IOWorker
send IO in a
separated process
define IO patterns in
ioworker's parameter
list
wait ioworkers till
finish, and collect
result data
<date/time> <footer> 12
Fixtures of Pynvme
• create/delete test objects. in conftest.py:
• nvme0
• nvme0n1
• pcie
• ...
• parametrize of tests
• @pytest.mark.parametrize("qcount", [1, 2, 4, 8, 15])
• @pytest.mark.parametrize("repeat", range(10))
• test control
• @pytest.mark.skip("nvme over tcp")
• doc: https://docs.pytest.org/en/latest/fixture.html
<date/time> <footer> 13
Test Files
import pytest
import nvme
test functions
test file name
pytest collects test
files and cases before
execution
<date/time> <footer> 14
Pytest Execution
• '''The pytest framework makes it easy to write small tests, yet scales to
support complex functional testing for applications and libraries.'''
• '''pytest fixtures offer dramatic improvements over the classic xUnit
style of setup/teardown functions'''
• pytest test_mod.py # run tests in a module
• pytest testing/ # run tests in a directory
• pytest test_mod.py::test_func # run a specific test case
• pytest test_mod.py -s # run tests without log capturing
• https://media.readthedocs.org/pdf/pytest/latest/pytest.pdf
<date/time> <footer> 15
Pycharm: show case
Test
status
Test log
Test scripts
<date/time> <footer> 16
Welcome to use and contribute
https://github.com/cranechu/pynvme

More Related Content

PDF
System Software Guide to CXL - Linux Kernel Meetup 2024.pdf
PPT
Лекція №13
PDF
PCI Express* based Storage: Data Center NVM Express* Platform Topologies
PDF
/proc/irq/&lt;irq>/smp_affinity
PDF
HTTP and 5G (fixed1)
PDF
Linux Performance Tools
PPTX
Access control list acl - permissions in linux
PPTX
plotnetcfg入門 | Introduction to plotnetcfg
System Software Guide to CXL - Linux Kernel Meetup 2024.pdf
Лекція №13
PCI Express* based Storage: Data Center NVM Express* Platform Topologies
/proc/irq/&lt;irq>/smp_affinity
HTTP and 5G (fixed1)
Linux Performance Tools
Access control list acl - permissions in linux
plotnetcfg入門 | Introduction to plotnetcfg

What's hot (20)

PDF
Process Synchronization
PDF
LISA17 Container Performance Analysis
PDF
DPDKを拡張してみた話し
PDF
【第26回Elasticsearch勉強会】Logstashとともに振り返る、やっちまった事例ごった煮
PPT
Лекція №1
ODP
Linux Internals - Kernel/Core
PDF
Play with UEFI
PDF
Linux-HA Japanプロジェクトのこれまでとこれから
PPTX
CXL Fabric Management Standards
PDF
October OpenNTF Webinar - What we like about Domino/Notes 12, recommended new...
PPTX
Linux Device Tree
PDF
Device tree
PDF
Process Management
PDF
Introduction to char device driver
PDF
DiskStorage_BasicFileStructuresandHashing.pdf
PDF
Linux systems - Getting started with setting up and embedded platform
PDF
Testing real-time Linux. What to test and how
PDF
Cellular technology with Embedded Linux - COSCUP 2016
PDF
SIP Attack Handling (Kamailio World 2021)
PPTX
U-Boot Porting on New Hardware
Process Synchronization
LISA17 Container Performance Analysis
DPDKを拡張してみた話し
【第26回Elasticsearch勉強会】Logstashとともに振り返る、やっちまった事例ごった煮
Лекція №1
Linux Internals - Kernel/Core
Play with UEFI
Linux-HA Japanプロジェクトのこれまでとこれから
CXL Fabric Management Standards
October OpenNTF Webinar - What we like about Domino/Notes 12, recommended new...
Linux Device Tree
Device tree
Process Management
Introduction to char device driver
DiskStorage_BasicFileStructuresandHashing.pdf
Linux systems - Getting started with setting up and embedded platform
Testing real-time Linux. What to test and how
Cellular technology with Embedded Linux - COSCUP 2016
SIP Attack Handling (Kamailio World 2021)
U-Boot Porting on New Hardware
Ad

Similar to Pynvme introduction (20)

PDF
EuroPython 2024 - Streamlining Testing in a Large Python Codebase
PDF
PyCon JP 2024 Streamlining Testing in a Large Python Codebase .pdf
PDF
PPT
Simple tools to fight bigger quality battle
PDF
Test Kitchen and Infrastructure as Code
PPT
Performance and Scalability Testing with Python and Multi-Mechanize
PPTX
Django Architecture Introduction
PDF
Software development practices in python
ODP
RichFaces - Testing on Mobile Devices
PDF
Making the most of your Test Suite
PDF
Yaetos Tech Overview
PPTX
Django rest framework
PDF
Development of a Cisco ACI device package for NGINX as a Load-Balancer
PPTX
FV04_MostoviczT_RAD
PPTX
Test-Driven Infrastructure with Puppet, Test Kitchen, Serverspec and RSpec
PDF
php & performance
PDF
PDF
Regain Control Thanks To Prometheus
PDF
Monitoring the Dynamic Resource Usage of Scala and Python Spark Jobs in Yarn:...
PDF
Strategy-driven Test Generation with Open Source Frameworks
EuroPython 2024 - Streamlining Testing in a Large Python Codebase
PyCon JP 2024 Streamlining Testing in a Large Python Codebase .pdf
Simple tools to fight bigger quality battle
Test Kitchen and Infrastructure as Code
Performance and Scalability Testing with Python and Multi-Mechanize
Django Architecture Introduction
Software development practices in python
RichFaces - Testing on Mobile Devices
Making the most of your Test Suite
Yaetos Tech Overview
Django rest framework
Development of a Cisco ACI device package for NGINX as a Load-Balancer
FV04_MostoviczT_RAD
Test-Driven Infrastructure with Puppet, Test Kitchen, Serverspec and RSpec
php & performance
Regain Control Thanks To Prometheus
Monitoring the Dynamic Resource Usage of Scala and Python Spark Jobs in Yarn:...
Strategy-driven Test Generation with Open Source Frameworks
Ad

Recently uploaded (20)

PPTX
assetexplorer- product-overview - presentation
PDF
MCP Security Tutorial - Beginner to Advanced
DOCX
Modern SharePoint Intranet Templates That Boost Employee Engagement in 2025.docx
PPTX
Patient Appointment Booking in Odoo with online payment
PDF
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
PDF
iTop VPN Crack Latest Version Full Key 2025
PDF
EaseUS PDF Editor Pro 6.2.0.2 Crack with License Key 2025
PPTX
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
PPTX
Introduction to Windows Operating System
PDF
The Dynamic Duo Transforming Financial Accounting Systems Through Modern Expe...
PPTX
Cybersecurity: Protecting the Digital World
PDF
DNT Brochure 2025 – ISV Solutions @ D365
PDF
Website Design Services for Small Businesses.pdf
PPTX
Weekly report ppt - harsh dattuprasad patel.pptx
PPTX
CNN LeNet5 Architecture: Neural Networks
PPTX
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
PDF
Cost to Outsource Software Development in 2025
PDF
Wondershare Recoverit Full Crack New Version (Latest 2025)
PDF
DuckDuckGo Private Browser Premium APK for Android Crack Latest 2025
PDF
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
assetexplorer- product-overview - presentation
MCP Security Tutorial - Beginner to Advanced
Modern SharePoint Intranet Templates That Boost Employee Engagement in 2025.docx
Patient Appointment Booking in Odoo with online payment
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
iTop VPN Crack Latest Version Full Key 2025
EaseUS PDF Editor Pro 6.2.0.2 Crack with License Key 2025
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
Introduction to Windows Operating System
The Dynamic Duo Transforming Financial Accounting Systems Through Modern Expe...
Cybersecurity: Protecting the Digital World
DNT Brochure 2025 – ISV Solutions @ D365
Website Design Services for Small Businesses.pdf
Weekly report ppt - harsh dattuprasad patel.pptx
CNN LeNet5 Architecture: Neural Networks
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
Cost to Outsource Software Development in 2025
Wondershare Recoverit Full Crack New Version (Latest 2025)
DuckDuckGo Private Browser Premium APK for Android Crack Latest 2025
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf

Pynvme introduction

  • 1. Pynvme: test NVMe devices in Python https://github.com/cranechu/pynvme
  • 2. <date/time> <footer> 2 Pynvme Pynvme is a python extension module. Users can operate NVMe SSD intuitively by Python scripts. It is designed for NVMe SSD testing with performance considered. With third-party tools, e.g. emacs, pycharm and pytest, pynvme is a convenient and professional NVMe device test solution.
  • 3. <date/time> <footer> 3 Pynvme in Python IDLE SPDK pynvme
  • 4. <date/time> <footer> 4 Pynvme is based on SPDK
  • 5. <date/time> <footer> 5 Pynvme Architecture Test driver (driver.c) Python interface (driver_wrap.pyx) Python library (nvme.so) Build python library with Cython: • setup.py • driver.c • driver.h • cdriver.pxd • driver_wrap.pyx • Makefile
  • 6. <date/time> <footer> 6 Pynvme Architecture Test driver (driver.c) Python interface (driver_wrap.pyx) Python library (nvme.so) Organize test cases in pytest: • mvme.so • pytest.ini • conftest.py • driver_test.py Python test scripts (driver_test.py) Pytest fixtures (conftest.py)
  • 7. <date/time> <footer> 7 Why Python? √ Many beautiful mature libraries • pytest • logging • multiprocessing • numpy • matplotlib • pydoc • os, io, time, pytemperature, statistics, yaml, json, struct, ... √ Friendly IDEs for developing, debugging, and testing • Pycharm, emacs, vscode √ CI: develop firmware softly
  • 9. <date/time> <footer> 9 Config and Compile − git clone https://github.com/cranechu/pynvme; cd pynvme − git submodule update --init –recursive − sudo ./spdk/scripts/pkgdep.sh − sudo dnf install python3-pip -y − sudo python3 -m pip install -r requirements.txt − cd spdk; ./configure --without-isal; cd .. − make spdk; make − Fedora29 is recommended. − find script examples in driver_test.py. − find more => https://github.com/cranechu/pynvme
  • 10. <date/time> <footer> 10 Test Scripts pytest cases are started with test_ create qpair and buffer for write commands write data, and then read in the callback pytest fixtures callback functions called when cmds are completed fill buffer with identify data
  • 11. <date/time> <footer> 11 IOWorker send IO in a separated process define IO patterns in ioworker's parameter list wait ioworkers till finish, and collect result data
  • 12. <date/time> <footer> 12 Fixtures of Pynvme • create/delete test objects. in conftest.py: • nvme0 • nvme0n1 • pcie • ... • parametrize of tests • @pytest.mark.parametrize("qcount", [1, 2, 4, 8, 15]) • @pytest.mark.parametrize("repeat", range(10)) • test control • @pytest.mark.skip("nvme over tcp") • doc: https://docs.pytest.org/en/latest/fixture.html
  • 13. <date/time> <footer> 13 Test Files import pytest import nvme test functions test file name pytest collects test files and cases before execution
  • 14. <date/time> <footer> 14 Pytest Execution • '''The pytest framework makes it easy to write small tests, yet scales to support complex functional testing for applications and libraries.''' • '''pytest fixtures offer dramatic improvements over the classic xUnit style of setup/teardown functions''' • pytest test_mod.py # run tests in a module • pytest testing/ # run tests in a directory • pytest test_mod.py::test_func # run a specific test case • pytest test_mod.py -s # run tests without log capturing • https://media.readthedocs.org/pdf/pytest/latest/pytest.pdf
  • 15. <date/time> <footer> 15 Pycharm: show case Test status Test log Test scripts
  • 16. <date/time> <footer> 16 Welcome to use and contribute https://github.com/cranechu/pynvme