Issuing Resets
issue_reset
in the Test API.get_vlun_nvme_update_controller
.issue_reset
issue_reset
provides a wrapper around XML_API.get_vlun_nvme_update_controller
.
It automatically handles and reports any errors that occur during execution, and parses the XML API response into a form that is easier to use.
issue_reset(dut, reset, reset_type=None, shutdown_mode=None, fail_type='error', skip_type='action')
dut
: XML_APIreset
: int or strreset_type
: int Optional0
: Normal (no shutdown)1
: Shut down before reset2
: Shut down after reset3
: Shut down before and wait after resetshutdown_mode
: int Optional0
: Normal, delete queues1
: Abrupt, preserve queues2
: Normal, preserve queues3
: Abrupt, delete queuesfail_type
: int or str Optional0
or 'pass'
: Log a PASS1
or 'notify'
: Log a NOTE2
or 'warn'
: Log a WARNING and increment the warnings counter3
or 'error'
: Log an ERROR and increment the errors counter4
or 'test'
: Log an ERROR and immediately fail the entire testskip_type
: int or str Optional0
or 'none'
: Do not skip. Proceed and attempt the reset1
or 'action'
: Do not attempt the reset. Return immediately2
or 'test'
: Immediately skip the remainder of the entire testReset Options
issue_reset
supports Controller Resets, NVM Subsystem Resets, PCIe Conventional Resets, and PCIe Function Resets.
For your convenience, there are multiple valid arguments that can be passed into the reset
parameter for each reset type.
The simplest method is to use an integer from 0-3. They will result in the following:
0
: Controller Reset1
: NVM Subsystem Reset2
: PCIe Conventional Reset3
: PCIe Function ResetIf you would like to be more descriptive, any passed string will be converted to lowercase and have all whitespace removed before being compared against the following options:
ncr
controller
controllerreset
resetcontroller
nvm
nvme
nssr
nvmsubsystem
nvmesubsystem
nvmreset
nvmereset
pci
pcie
pciconventional
pcieconventional
pciereset
pcireset
flr
pcifunction
pciefunction
pciefunctionreset
pcifunctionreset
All of the following are valid:
issue_reset(dut)
issue_reset(dut, 2)
issue_reset(dut, "ncr")
issue_reset(dut, "n v m e")
issue_reset(dut, "PCIe Reset")
issue_reset(dut, "pci FUNCTION reset")
issue_reset(dut, "pcireset")
Successful Reset
Here is a simple example of a NVM Subsystem Reset being issued in a single-port test:
# .. Test settings ..
def main(test_config):
@setup(test_config)
def test(dut):
result = issue_reset(dut, "NSSR")
print(result)
Printed result:
{'status': 0, 'reason': 'Successfully issued NVM subsystem reset on target 100'}
Logged messages:
Mon Jan 03 10:49:44 2022 ACTION: Issuing NVM subsystem reset on target 100
Mon Jan 03 10:49:44 2022 ACTION: Issuing API command: get_vlun_nvme_update_controller(valid_command='NvmeReset')
Mon Jan 03 10:49:45 2022 DETAIL: Successfully issued NVM subsystem reset on target 100