-
Notifications
You must be signed in to change notification settings - Fork 20
nvme test
NOTE: nvme-test can not be built since latest DDK doesn't provide libraries needed by it.
The source code of nvme-test is under #nvme/native/user/nvme-test. This test binary is the single binary that is used for running unit testing for the nvme driver. As part of the infrastructure, the following building blocks are added to this binary for the build process:
a. link to nvme-lib under #nvme/native/user/nvme-cli
By linking to nvme-lib, nvme-test binary can submit admin passthru commands into
the nvme driver directly without executing external commands (e.g. nvme-cli).
b. link to boost/regex library (statically)
Many things that nvme-test would do is to execute some command parse the output,
linking to boost/regex could simplify text processing for the nvme-test binary.
By linking to boost statically, the nvme-test binary would require no additional
libs to run on an ESXi system.
c. link to libsgutils2 library (statically)
Since the libsgutils2 library is not available in the toolchain, it is currently
compiled from source code as well. This allows nvme-test binary to submit SCSI
commands into the nvme driver using the SG interface.
The libsgutils2 library is downloaded at http://sg.danny.cz/sg/sg3_utils.html
and the library source code itself is distributed under BSD-like license.
d. link to gtest-1.6.0 library (statically)
nvme-test uses Google Test framework. gtest-1.6.0 is the only version available
in the VMware toolchain.
The nvme-test binary is currently compiled using Makefile only and the Makefile
is optimized for VMKAPI DDK 5.5. More work needs to be done to compile the
nvme-test binary from DBC or from VMKAPI DDK 6.0. However, the binary compiled
using VMKAPI DDK 5.5 can run on ESXi 6.0 as well.
To compile the nvme-test binary, the following two packages are needed, in
addition to the toolchain packages available in VMKAPI DDK 5.5 already:
gtest-1.6.0
boost-1.42.0
You can copy the two packages from VMware official toolchain directly under
/build/toolchain/lin32/gtest-1.6.0 and /build/toolchain/lin32/boost-1.42.0.
As references, 6 test cases are added in nvme-test for demonstration purpose:
BasicTest::VmhbaCount
- Validates if the number of vmhbas shown in `esxcfg-scsidevs -a` matches the
number of NVMe devices found in `lspci -v`;
BasicTest::VmhbaCoundByAdminPassthru
- Validates if the number of vmhbas shown in management interface matches the
number of NVMe devices found in `lspci -v`;
ScsiTest::ReadCapacity
- Validates if the LBA Count and Logical Block Size in Bytes of READ CAPACITY (10)
command is correct (compared to IDENITFY NAMESPACE response)
ScsiTest::ReadCapacity16
- Validates if the LBA Count and Logical Block Size in Bytes of READ CAPACITY (16)
command is correct (compared to IDENTIFY NAMESPACE response)
ScsiTest::ReadWrite6_Basic
- Validates if the data written can be read back successfully via issuing a series
SCSI WRITE 6 and READ 6 to the frist, last and some random blocks.
ScsiTest::ReadWrite10_Basic
- Validates if the data written can be read back successfully via issuing a series
SCSI WRITE 10 and READ 10 to the frist, last and some random blocks.
ScsiTest::SyncCache10
- Validates if the sync cache command can be executed successfully via issuing a
SYNC CACHE 10 command.
ScsiTest::FUA_ReadWrite10
- Validates if the data written can be read back successfully via issuing a series
SCSI WRITE 10 and READ 10 with setting FUA into the device.
ScsiTest::Unmap
- Issue an unmap command to deallocate part of allocated blocks, and validate if
the data on the other blocks can be read back.