Page MenuHomeFreeBSD

Add a basic test for nvmecontrol
ClosedPublic

Authored by dab on Apr 3 2020, 12:23 AM.

Details

Summary

I recently made some bug fixes in nvmecontrol. It occurred to
me that since nvmecontrol lacks any kyua tests, I should convert the
informal testing I did into a more formal automated test. The test in
this change should be considered just a starting point; it is neither
complete nor thorough. While converting the test to ATF/kyua, I
discovered a small bug in nvmecontrol; the nvmecontrol devlist
command would always exit with an unsuccessful status. So I included
the fix for that, too, so that the test won't fail.

Test Plan

Run the test.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Fix a problem in the devlist test when /dev/nvme0 does _not_ exist.

Modify the test to handle the nvme drives not starting at 0. I don't
think that is likely, but it is easy enough to handle.

Let's try uploading that diff again...

In D24269#534897, @dab wrote:

Modify the test to handle the nvme drives not starting at 0. I don't
think that is likely, but it is easy enough to handle.

We wire our drives to specific PCI locations, so it can and will happen often. Don't know if we'll be running these tests there, but it's a widely used feature.

I'm not an expert in atf tests, but this seems reasonable to my eye as a good set of smoke tests.

sbin/nvmecontrol/devlist.c
130 ↗(On Diff #70274)

This change is good, but I'd be tempted to commit it separately.

This revision is now accepted and ready to land.Apr 6 2020, 9:38 PM
This revision was automatically updated to reflect the committed changes.