OCP_DatacenterSSD_2_5
OCP_DCSSD_2_5_AER_BasicVerification.py
The objectives for the Basic Verification of Asynchronous Event Requests Test Case are as follows:
- a.) Verify that the value of bit-3 in the LPA field is set to 1b, indicating the support for sending
Telemetry Log Notices.
- b.) Verify that the value of bit-8 in the OAES field shall be set to 1b, indicating the support for
Namespace Attribute Notices event and the associated Changed Namespace List log page.
- c.) Verify that the value of bit-9 in the OAES field shall be set to 1b, indicating the support for the
Firmware Activation Notices event.
- d.) Verify that when attempting to an NVMe Asynchronous Event Request command when there are
already AERL+1 Asynchronous Event Request commands pending, the latest Asynchronous Event Request command shall fail because the number of outstanding Asynchronous Event Request commands has been exceeded.
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
NVMe-OPT-8/9/10/11, NVMe-AD-24
OCP_DCSSD_2_5_AER_FWActivationNotice.py
The objectives for the Firmware Activation Notice AE Test Case are as follows:
- a.) Verify that if an event occurs for which reporting is enabled and there are no Asynchronous Event
Request commands pending, the device retains the event information for that Asynchronous Event Type and reports it once an Asynchronous Event Request command is submitted.
- b.) Verify that if duplicate events are queued while no Asynchronous Event Request commands are
pending, the duplicate events are reported as a single response to a future Asynchronous Event Request command.
- c.) Verify that, if an AER is pending, after sending the NVMe Firmware Commit command with CA=3
and slot = 0, an AEN is sent to the host with the following information:
Event Type: Notice
Asynchronous Event Information: Firmware Activation Starting
Log Page Identifier: Firmware Slot Information log (03h)
- d.) Verify that, if an AER is pending, after sending the NVMe Firmware Commit command with CA=3
and firmware slot specified, an AEN is sent to the host with the following information:
Event Type: Notice
Asynchronous Event Information: Firmware Activation Star
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
NVMe-OPT-10/11, NVMe-AD-24/25
OCP_DCSSD_2_5_AER_NSAttributeNotice.py
This script will run the following tests: The objectives for the Namespace Attribute Notices AE Test Case are to verify that the device completes an Asynchronous Event Request command for the “Namespace Attribute Changed” event when there is a change to one or more of the following:
LBA format has been changed by Format NVM command, the AEN will be triggered because of the Identify Namespace data structure (CNS = 00h).
The namespace is currently write-protected because of the Write Protection Config Set Feature Command, the AEN will be triggered because of the change of the I/O Command Set Independent Identify Namespace data structure (CNS = 08h).
The namespace has been detached/attached/deleted, the AENs will be triggered because of the change of the Active Namespace ID list (CNS = 02h).
The LBA format has been changed by Format NVM command, the AEN will be triggered because of the change of the Identify Namespace data structure for an Allocated Namespace ID (CNS = 11h).
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
NVMe-OPT-9
OCP_DCSSD_2_5_CmdTimeout_FormatNVMExtendedTime.py
- This script will run the following tests:
Verify each Format NVM commands completes within these timeout settings. 1. The Format NVM Command for Cryptographic Erase shall complete within 10 seconds. 2. The Format NVM Command for No Secure Erase shall complete within the per TB specific timeout parameter provided by the supplier in the Adaptation Data. 3. The Format NVM Command for User Data Erase shall complete within 10 seconds per TB of device capacity.
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
CTO-2, CTO-11
OCP_DCSSD_2_5_CmdTimeout_IOCmdTime.py
- This script will run the following tests:
Run I/O profile for 1 hour
Verify 7 or fewer I/Os took more than 2 seconds to complete
Verify remaining I/Os took 2 or less seconds to complete
Repeat previous steps for each I/O profile
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
CTO-3, CTO-6
OCP_DCSSD_2_5_ContConfig_Arbitration.py
- This script will run the following tests:
Verify that the device’s default arbitration is Round-Robin by reading CC.AMS.
Verify that the device supports Weighted round robin with urgent class priority by reading CAP.AMS.
Verify that the arbitration can be changed to Weighted Round Robin by changing CC.AMS field.
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
NVMe-CFG-1
- clear_bit(value, bit)
Clears a bit to 0
- Parameters:
value (int) – value to be modified
bit (int) – index to be modified
- Return type:
int
- set_cc_ams(dut, ams)
Sets CC.AMS value
- Parameters:
dut (XML_API) – Device object under test
ams (int) – Arbitration Mechanism Selected for setting
- Return type:
None
- verify_bit(value, bit, on=True)
Verifies if a bit is set to 1 or cleared to 0
- Parameters:
value (int) – value to be checked
bit (int) – index to be checked
on (bool) – If checking against 1, true, if 0, false
- Return type:
bool
- verify_cc_ams(dut, expected_ams)
Verifies arbitration mechanism selected is set as expected
- Parameters:
value (int) – Controller Configuration return bits
expected_ams (int) – expected arbitration mechanism selected
- Return type:
None
- verify_cc_en(dut, on, timeout)
Verifies CC.EN is set to a particular value
- Parameters:
dut (XML_API) – Device object under test
on (bool) – If CC.EN should be 1 or 0
timeout (int) – Expected timeout in seconds
- Returns:
end_time – time that CSTS.RDY is expected to transition by
- Return type:
int
- wait_csts_rdy(dut, end_time, rdy_bit)
Waits timeout / 2 seconds for CSTS.RDY bit to transition after changing CC.EN
- Parameters:
dut (XML_API) – Device object under test
end_time (int) – Expected timeout limit (timeout + time.time())
rdy_bit (int) – Expected value for CSTS.RDY to transition to
- Return type:
None
OCP_DCSSD_2_5_ContConfig_CMB.py
- This script will run the following tests:
Verify that if the value of CMBMSC.CRE is 0b, both values of CMBLOC and CMBSZ are cleared to 00h.
Verify that if the value of CMBMSC.CRE is NOT 0b, either CMBMSC.CMSE or CMBSTS.CBAI has 0b value
Pass/Fail: Script passes if all model number characters are ASCII
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
NVMe-CFG-11
OCP_DCSSD_2_5_ContConfig_ConfigBehavior.py
- This script will run the following tests:
Verify the stride between doorbell properties is 4 bytes as set by CAP.DSTRD
Verify the device is NVM subsystem scope as set by CAP.CPS
Verify the device supports the NVM Command Set as set by CAP.CSS and CNTRLTYPE
Verify the minimum memory page size is 2^12
Verify the maximum memory page size is at least 2 ^ (12 + 1)
Verify the maximum number of Error Information log entries that are stored by the controller is 256 as set by ELPE
Verify the device does NOT support the Host Memory Buffer by checking HMMIN and HMPRE fields are set to zero
Verify the device shall NOT support the Controller Ready Independent of Media mode, by checking CAP.CRMS.CRIMS is set to zero
Pass/Fail: Script passes if all model number characters are ASCII
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
NVMe-CFG-9/12/13/16/17/18/19/20
OCP_DCSSD_2_5_ContConfig_EUI64_NGUID.py
- This script will run the following tests:
Verify that if the device comes from the factory, the namespace has a nonzero value for EIU64.
Verify that for all subsequent namespace creations after the first created namespace, the EUI64 field is 0.
Verify that for all namespace creations, the NGUID field is nonzero and contains a value that is different from the default and from all other NGUID values. Also verify UIDREUSE bit is set to 1.
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
NVMe-CFG-7/8
OCP_DCSSD_2_5_ContConfig_FatalStatus.py
- This script will run the following tests:
Obtain CSTS.CFS and verify it’s set to zero
Pass/Fail: Script passes if register value is set to zero
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
NVMe-CFG-3
OCP_DCSSD_2_5_ContConfig_MDTS.py
- This script will run the following tests:
Verify MDTS >= 256KB
Verify NPWG and NOWS <= MDTS
Do Write command with transfer size < MDTS and > NPWG, and verify it passes
Do Write command with transfer size = MDTS, and verify it passes
Do Write command with transfer size > MDTS, and verify it fails
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
NVMe-CFG-2
OCP_DCSSD_2_5_ContConfig_Queues.py
- This script will run the following tests:
Verify SQES = 6 and CQES = 4
Set controller configuration IOSQES = 6
Set controller configuration IOCQES = 4
Do Set Features for FID 7h with NCQR = NSQR = 511
Verify CAP.MQES >= 1023
Create 512 queues with queue size = 1023
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
NVMe-CFG-5/6/14/15
OCP_DCSSD_2_5_DSSDAsyncEvent_FeatureVerification.py
- This script will run the following tests:
For Set feature: Get factory default value of feature 0xC9 and it should be cleared to 0.
Change “Enable Panic Notices” field to 1 using set feature and using get feature check that the current state is set to 1 no later than next power cycle.
Current state should be cleared to 0 after drive goes through power cycle
Default state should be cleared to 0
Change “Enable Panic Notices” field to 0 using set feature and using get feature check that the current state is cleared to 0 no later than next power cycle.
Current should be cleared to 0 after drive goes through power cycle.
Default state should be cleared to 0.
If setting this feature is not supported, then a status error code of 0x2 (Invalid Field in Command) shall be returned.
For Get feature: Check the default state of 0xC9 with SEL=01b.It should be cleared to 0 and should not change over a power cycle. Current state selection should not affect the default state.
Check the capabilities of 0xC9 with SEL=11b and it should be 100b indicating that this feature is not savable, changeable, and not namespace specific.
Check the current state of 0xC9 with SEL=00b and it should match with selection made with set feature.
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
SDAEC-1 to SDAEC-15, GDAEC-1/2
- get_feat_c9_and_check(dut, sel, expected, step_num)
Retrieves the stored values in a Get-Feature for FID = C9h, and verifies the feature command’s execution
- Parameters:
dut (XML_API) – Device object under test
sel (int) – The Selection field for the Get-Feature command
expected (int) – Expected value for DWORD-0 bits [2:0] of the completion queue entry
step_num (int) – The current test step number
- Return type:
None
OCP_DCSSD_2_5_DSSDAsyncEvent_NSIDValue.py
- This script will run the following tests:
Using NSID = 0 in the set features command passes as expected.
Using NSID = FFFFFFFFh in the set features command passes as expected.
Using NSID = NN+1 (invalid NSID) fails with Invalid Field in Command status.
NSID = any NSID between 1 and NN (valid NSID) fails with Feature Not Namespace Specific status.
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
SDAEC-6
OCP_DCSSD_2_5_Dealloc_GarbageCollection.py
- This script will run the following tests:
Precondition the namespace once with 128KiB sequential writes and twice with 4KiB random writes
Run 4KiB random writes for 5 minutes
Verify QoS values match with those in adaptation data
Deallocate 2% of the namespace
Run 4KiB random writes for 1 minute
Verify QoS values match with those in adaptation data
Repeat steps 4-6 49 times, deallocating a different 2% of the namespace each time (so that 100% of the namespace will eventually be deallocated)
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
TRIM-7
- collect_performance_logs(dut, io_test, perf_field)
Collects logs from the ADP and prints the performance logs for a given IO command
- Parameters:
dut (XML_API) – Device object under test
io_test (dict) – Custom IO dict
perf_field (str) – Performance field to be collected. Either “TestReadBytes”, “TestWriteBytes” or “TestLatencyQoS”
- Returns:
perf_vals – Parsed QoS latency values or Number of read/write bytes
- Return type:
dict | int
- compare_QOS_performance_logs(qos_base_values, read_io_latency)
Checks the performance log using the qos list to determine if “QoS” warning needs to be issued
- Parameters:
qos_base_values (list | dict) – The base performance Latency values either from the ADP or a Read IO test
read_io_latency (dict) – The performance read latency values to be compared to io metric
- Return type:
None
- execute_IO_Profile(dut, test_type, io_profile, io_runtime=-1, io_pattern=0)
- Executes each of the IO Profiles listed in Table 4
Sequential Read (MiB/s) (128kiB, QD = 128)
Sequential Write (MiB/s) (128kiB, QD = 128)
Random Read (KIOPS) (4kiB, QD = 128)
Random Writes (KIOPS) (4kiB, QD = 128)
Random 70R:30W mix (KIOPS) (4kiB, QD = 128)
- Parameters:
dut (XML_API) – Device object under test
test_type (str) – Either ‘Sequential’ | ‘Random’
io_profile (str) – IO Profile to be executed
io_runtime (int) – Time in seconds for IO to execute
io_pattern (int) – Pattern for io to be executed
- Return type:
dict
- verify_io(io_test, is_verify_step=True)
Verifies the successful execution and wait for the completion of an I/O command
- Parameters:
io_test (dict) – I/O Command
is_verify_step (bool) – Determines whether to execute resting action in method or not (Special case for if the verify logging on an IO comes in a later step)
- Returns:
result_msg – msg for later fail_action, or none if passed
- Return type:
tuple(func, msg) | none
OCP_DCSSD_2_5_Dealloc_Trim.py
- This script will run the following tests:
Precondition the namespace once with 128KiB sequential writes and twice with 4KiB random writes
Verify support for dataset management by checking ONCS field of identify controller command
Send dataset management with IDR, IWR, and AD attributes and verify they’re successful
Verify NPDG is an exact multiple of NPDA
Run 4KiB random writes for 5 minutes
Verify read performance and latency does not change more than 5% from baseline
Run 4KiB random reads
Deallocate 20% of the namespace starting from LBA=0
Verify read performance and latency does not change more than 5% from baseline
Read a randomly chosen LBA from the deallocated region
Verify LBA data is all 0h
Repeat steps 10-11 ten more times
Perform an unsafe power cycle
Read a randomly chosen LBA from the deallocated region
Verify LBA data is all 0h
Repeat steps 14-15 ten more times
Randomly choose a LBA from the deallocated region and write the pattern DEADBEEFh to it
Read the same LBA and verify the data has the pattern DEADBEEFh
Repeat steps 16-17 ten more times
Perform an unsafe power cycle
Read the same LBAs from steps 17-18 and verify the data has the pattern DEADBEEFh
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
NVMe-IO-2, TRIM-1/2/6/8
- collect_performance_logs(dut, test_id)
Collects and prints the performance logs for both a Read and a Write command
- Parameters:
dut (XML_API) – Device object under test
test_id (int) – IO test ID
perf_field (str) – Performance field to be collected
- Returns:
perf_vals – Performance values of I/O
- Return type:
dict
- precondition(dut, pattern=17)
Drive shall be preconditioned using 1x128KiB sequential writes over the whole drive followed by 2x4KiB random writes using a known pattern, e.g. 0x5A5A5A5A. The drive is assumed to be freshly booted and in an error free state. Performance values (Bandwidth/Throughput/Latency) and read behavior of deallocated block, 0-3, are accessible via the Adaptation data.
- Parameters:
dut (XML_API) – Device object under test
pattern (int) – Known pattern to write to drive
- Return type:
None
- verify_dlfeat_consistency(read_results)
Verifies data that was read is all zeroes
- Parameters:
read_results – Results dictionary from random read
- Returns:
pass – If passing or failing the step
- Return type:
bool
OCP_DCSSD_2_5_EnduranceGroup_LogPage.py
- This script will run the following tests:
Verify support for endurance groups
Read the endurance group information log page and sanity check fields
Compare endurance estimate values
Sanity check remaining fields
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
STD-LOG-17
- compare_values(field_name, output_lid_02, output_lid_09)
Compare field values from two log pages and verify they match
- Parameters:
field_name (str) – Field name to compare
output_lid_02 (dict) – Output of LID 2h
output_lid_09 (dict) – Output of LID 9h
- Return type:
None
OCP_DCSSD_2_5_FWUpdate_FWActivationNoReset.py
- This script will run the following tests:
Firmware activation without reset should not change feature state and Log page contents.
Firmware activation without reset should not change PCIe Link Status.
Firmware activation without reset should not change the setting of IO SQ/CQ queues.
Firmware activation without reset should not change LBA format.
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
FWUP-11
- compare_feat(data_a, data_b)
Compares data between 2 Get Feature commands with the same FID
- Parameters:
data_a (dict) – data returned from first Get Log Page command
data_b (dict) – data returned from second Get Log Page command
- Returns:
True or False
- Return type:
bool
- compare_result(page_a, page_b, key, isStatic)
Compares values between 2 Get Log Page results with the same LID
- Parameters:
page_a (dict) – Result dictionary a
page_b (dict) – Result dictionary b
key (string) – Key associated with values to compare
isStatic (bool) – Boolean flag to determine if comparing static or dynamic if static, check if equal if dynamic, check if a >= b
- Returns:
True or False
- Return type:
bool
- execute_IO_Profile(dut, test_type, io_profile, io_runtime=-1, io_pattern=17, extra_config=None)
- Executes each of the IO Profiles listed in Table 4
Sequential Read (MiB/s) (128kiB, QD = 128)
Sequential Write (MiB/s) (128kiB, QD = 128)
Random Read (KIOPS) (4kiB, QD = 128)
Random Writes (KIOPS) (4kiB, QD = 128)
Random 70R:30W mix (KIOPS) (4kiB, QD = 128)
- Parameters:
dut (XML_API) – Device object under test
test_type (str) – Either ‘Sequential’ | ‘Random’
io_profile (str) – IO Profile to be executed
io_runtime (int) – Time in seconds for IO to execute
io_pattern (int) – Pattern for io to be executed
extra_config (dict) – Extra I/O configuration
- Returns:
result – Dictionary that holds the I/O type and the result dictionary from running the I/O
- Return type:
dict
- get_keys(result, less, ignore, sk_list, dk_list, add_to_static)
Sorts keys from passed dictionary into static and dynamic lists using recursion
- Parameters:
result (dict) – Result dictionary from Get Log Page command
less (list) – List of keys that are the static or dynamic, whichever is less
ignore (list) – List of keys that should be ignored
sk_list (list) – Static key list
dk_list (list) – Dynamic key list
add_to_static (bool) – Boolean flag to determine which list to insert to
- Returns:
sk_list (list) – Static key list
dk_list (list) – Dynamic key list
- verify_ios(io_tests)
Checks if I/O tests passed or failed
- Parameters:
io_tests (list) – list of I/O test dicts
- Returns:
io_failed – Returns failed if any I/O test failed
- Return type:
bool
OCP_DCSSD_2_5_FWUpdate_FirmwareUpdate.py
- This script will run the following tests:
Verify the Firmware Commit command with Commit Action (CA) 000b, 001b, 010b, 011b are supported.
A minimum of 2 slots for firmware update shall be supported by verifying that the value of bits 3:1 in the Firmware Updates (FRMW) field is greater than or equal to 2.
The device shall complete the Firmware Activation process and be ready to accept host IO and admin commands within 1 second from the receipt of the firmware commit command. Verify that the value of Maximum Time for Firmware Activation (MTFA) field is less than or equal to Ah.
The device should support a read-only firmware slot (slot 1).
If the Firmware Slot field in the Firmware Commit command is cleared to 0h, verify that the device commits the firmware image to a firmware slot that is not currently active.
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
FWUP-3/4/6/7/20/21
OCP_DCSSD_2_5_FWUpdate_NoDataLoss.py
- This script will run the following tests:
Device supports repeated Firmware Downloads and Commit operations.
Repeated Firmware Download and Commits shall not cause data to be lost or destroyed.
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
FWUP-2/10
- download_commit(dut, prev_fw_fn, numd, alt_slot, start_step)
Downloads previous firmware and executes a FW commit command
- Parameters:
dut (XML_API) – Device object under test
prev_fw_fn (str) – Previous firmware filename
numd (int) – Value of NUMD
alt_slot (int) – Alternate firmware slot
start_step (int) – Number of the first test step in the function
- Returns:
fw_commit_flag – True if the FW commit command failed, else False
- Return type:
bool
OCP_DCSSD_2_5_FWUpdate_PowerLossAndReset.py
- This script will run the following tests:
Even if the firmware activation process is interrupted by the following events, the device shall either abort the firmware activation and continue running with the firmware revision that was running at the start of the firmware update process; or it and start running with the new firmware revision. a. Unsafe power loss b. Controller level reset c. NVM Subsystem Reset d. Function Level reset
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
FWUP-18
- do_fwcommit(dut, slot, thread_flag)
Execute FW Commit command until it fails due to a controller reset
- Parameters:
dut (XML_API) – Device object under test
slot (int) – FW slot for FW Commit
thread_flag (threading.Event) – Flag to stop the thread in case the FW Commit never fails
- Return type:
None
- do_fwcommit_step(dut, slot, reset)
Uses threading to make sure that the FW Commit is interrupted when a reset occurs
- Parameters:
dut (XML_API) – Device object under test
slot (int) – FW slot for FW commit
reset (lambda function) – Reset function to execute: unsafe, controller level, subsystem, function level
- Return type:
None
- step_23to30(dut, prev_fw_rev, orig_fw_rev, alt_slot, orig_active_slot)
Run steps 23 to 30 to verify reset for revision changes
- Parameters:
dut (XML_API) – Device object under test
prev_fw_rev (str) – The previous Firmware Revision
orig_fw_rev (str) – The current Firmware Revision
alt_slot (int) – Alternate writable firmware slot chosen
orig_active_slot (int) – Originally active firmware slot
- Returns:
test_slot – The slot to use for the next iteration
- Return type:
int
OCP_DCSSD_2_5_FactoryDefault_DefaultValue.py
- This script will run the following tests:
Verify MDTS >= 256KB
Verify NPWG and NOWS <= MDTS
Do Write command with transfer size < MDTS and > NPWG, and verify it passes
Do Write command with transfer size = MDTS, and verify it passes
Do Write command with transfer size > MDTS, and verify it fails
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
FDEF-1/2/3/4/5, NVMe-AD-22
- check_logpage_value(log_page_data, field_name, expected_value)
Verify log page field value matches the expected value
- Parameters:
log_page_data (dict) – Log page output
field_name (str) – Log page field name
expected_value (int) – Expected value of the log page field
- Return type:
None
OCP_DCSSD_2_5_FormFactor_E1L_PCIeSpeedLaneWidth.py
- This script will run the following tests:
Verify PCI Express Link Capabilities register (0Ch) lane width and speed
Verify PCI Express Link Status register (12h) lane width and speed
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
FFE1L-2
OCP_DCSSD_2_5_FormFactor_E1L_PWRDIS.py
- This script will run the following tests:
Assert PWRDIS and wait for device to shutdown
De-assert PWRDIS and wait for device to come up
Start sequential write I/O test and assert PWRDIS and wait for device to shutdown
De-assert PWRDIS and wait for device to come up
Run sequential read I/O test for 5 minutes and verify there are no miscompares
Run sequential write I/O test for 5 minutes
Run sequential read I/O test for 5 minutes
Verify performance is within 5% of performance numbers supplied in adaptation parameters
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
FFE1L-9
- wait_assert(dut)
Wait for PWRDIS signal to be asserted
- Parameters:
dut (XML_API) – Device object under test
- Return type:
None
- wait_deassert(dut)
Wait for PWRDIS signal to be de-asserted
- Parameters:
dut (XML_API) – Device object under test
- Return type:
None
OCP_DCSSD_2_5_FormFactor_E1S_PCIeSpeedLaneWidth.py
- This script will run the following tests:
Verify PCI Express Link Capabilities register (0Ch) lane width and speed
Verify PCI Express Link Status register (12h) lane width and speed
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
FFE1S-2
OCP_DCSSD_2_5_FormFactor_E1S_PWRDIS.py
- This script will run the following tests:
Assert PWRDIS and wait for device to shutdown
De-assert PWRDIS and wait for device to come up
Start sequential write I/O test and assert PWRDIS and wait for device to shutdown
De-assert PWRDIS and wait for device to come up
Run sequential read I/O test for 5 minutes and verify there are no miscompares
Run sequential write I/O test for 5 minutes
Run sequential read I/O test for 5 minutes
Verify performance is within 5% of performance numbers supplied in adaptation parameters
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
FFE1S-9
- wait_assert(dut)
Wait for PWRDIS signal to be asserted
- Parameters:
dut (XML_API) – Device object under test
- Return type:
None
- wait_deassert(dut)
Wait for PWRDIS signal to be de-asserted
- Parameters:
dut (XML_API) – Device object under test
- Return type:
None
OCP_DCSSD_2_5_FormFactor_M2_PCIeSpeedLaneWidth.py
- This script will run the following tests:
Verify PCI Express Link Capabilities register (0Ch) lane width and speed
Verify PCI Express Link Status register (12h) lane width and speed
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
FFM2-5
OCP_DCSSD_2_5_FormatNVM_CmdsReceivedDuringFormat.py
- This script will run the following tests:
Verify that admin commands supported during Format NVM operation are not aborted by DUT
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
NVMe v2.0d Section 5.14, NVMe v2.0d Figure 141
- do_format(dut, nsid, lbaf, ses, pil, pi, mset, format_results, test_running, do_not_reissue)
Execute format command and put the results into a dictionary (since the format is done as part of a thread, a dictionary will allow the main part of the program to access the results)
- Parameters:
dut (XML_API) – Device object under test
nsid (int) – Namespace under test
lbaf (int) – LBAF to use in the format
ses (int) – SES to use in the format
pil (int) – PIL to use in the format
pi (int) – PI to use in the format
mset (int) – MSET to use in the format
format_results (dict) – Dictionary to hold the results of the format command
test_running (threading.Event) – thread bool to help short-circuit function at end of test
do_not_reissue (threading.Event) – thread bool to pause restarting of formats until end of step
- Return type:
None
OCP_DCSSD_2_5_FormatNVM_CryptoErase.py
- This script will run the following tests:
Verify support for Format NVM command
Get and save current LBA size
Delete and recreate smaller fixed size namespace
Precondition namespace
Start Format NVM command (SES=2)
Verify the Format NVM results
Delete and restore the original namespace
Verify namespace recreation and attachment
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
NVMe-AD-2/5/8, SEC-4, NVMe v2.0d Section 5.14
- do_format(dut, nsid, lbaf, ses, pil, pi, mset, format_results)
Execute format command and put the results into a dictionary (since the format is done as part of a thread, a dictionary will allow the main part of the program to access the results)
- Parameters:
dut (XML_API) – Device object under test
nsid (int) – Namespace under test
lbaf (int) – LBAF to use in the format
ses (int) – SES to use in the format
pil (int) – PIL to use in the format
pi (int) – PI to use in the format
mset (int) – MSET to use in the format
format_results (dict) – Dictionary to hold the results of the format command
- Return type:
None
OCP_DCSSD_2_5_FormatNVM_NoSecureErase.py
- This script will run the following tests:
Verify DUT indicates support for Format NVM command in the OACS field
Verify DUT accepts and processes Format NVM command with SES=0
Verify that the Format NVM command completes successfully
Verify that previously written namespace data cannot be read back after the Format NVM command with SES=0 completes successfully
Verify that reads to reformatted LBAs complete successfully and return data that is all 0s or all 1s, regardless of their previous state
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
NVMe-AD-2/5, SEC-4, NVMe v2.0d Section 5.14
- do_format(dut, nsid, lbaf, ses, pil, pi, mset, format_results)
Execute format command and put the results into a dictionary (since the format is done as part of a thread, a dictionary will allow the main part of the program to access the results)
- Parameters:
dut (XML_API) – Device object under test
nsid (int) – Namespace under test
lbaf (int) – LBAF to use in the format
ses (int) – SES to use in the format
pil (int) – PIL to use in the format
pi (int) – PI to use in the format
mset (int) – MSET to use in the format
format_results (dict) – Dictionary to hold the results of the format command
- Return type:
None
OCP_DCSSD_2_5_FormatNVM_PerNamespace.py
- This script will run the following tests:
Verify Support for Format NVM Command
Verify support for Format NVM Command on a per namespace basis
Verify previously written namespace data cannot be read back after Format NVM Command with SES=1 completes successfully
Verify that reads to reformatted LBAs complete successfully and return zero-filled data
Verify unformatted namespaces data can be read back after Format NVM Command with SES=1 completes on another namespace
Verify that the DUT processes Format NVM Command with SES=1 with specific PI, MSET
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
NVMe-AD-23, NVMe v2.0d Section 5.14
- do_format(dut, nsid, lbaf, ses, pil, pi, mset, format_results)
Execute format command and put the results into a dictionary (since the format is done as part of a thread, a dictionary will allow the main part of the program to access the results)
- Parameters:
dut (XML_API) – Device object under test
nsid (int) – Namespace under test
lbaf (int) – LBAF to use in the format
ses (int) – SES to use in the format
pil (int) – PIL to use in the format
pi (int) – PI to use in the format
mset (int) – MSET to use in the format
format_results (dict) – Dictionary to hold the results of the format command
- Return type:
None
- gen_2_ran(range_start, range_end)
Generates 2 random numbers between range_start, range_end
- Parameters:
range_start (int) – Start of range (inclusive)
range_end (int) – End of range (inclusive)
- Returns:
num1 (int) – First unique integer
num2 (int) – Second unique integer
- postcondition(dut, orig_config, fail_test, message)
The test case should restore the DUT to its starting condition regardless of whether the test fails or succeeds.
- Parameters:
dut (XML_API) – Device object under test
orig_config (dict) – Original device configuration to restore
fail_test (bool) – Indicates need for critical test failure
message – failure message to print
OCP_DCSSD_2_5_FormatNVM_SecureErase.py
- This script will run the following tests:
Verify support for Format NVM command
Get and save current LBA size
Format NVM command (SES=1)
Delete and recreate smaller fixed size namespace
Verify namespace creation and attachment
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
NVMe-AD-2/5/8, SEC-4, NVMe v2.0d Section 5.14
- do_format(dut, nsid, lbaf, ses, pil, pi, mset, format_results)
Execute format command and put the results into a dictionary (since the format is done as part of a thread, a dictionary will allow the main part of the program to access the results)
- Parameters:
dut (XML_API) – Device object under test
nsid (int) – Namespace under test
lbaf (int) – LBAF to use in the format
ses (int) – SES to use in the format
pil (int) – PIL to use in the format
pi (int) – PI to use in the format
mset (int) – MSET to use in the format
format_results (dict) – Dictionary to hold the results of the format command
- Return type:
None
OCP_DCSSD_2_5_HWComponent_LogPage.py
Test objectives are to verify the following:
That the Hardware Component log page is returned, and the command completes with status success.
That the Hardware Component log page format for recording the hardware components on the device matches OCP requirements.
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
HWCOMP-1/2/3/4/5
OCP_DCSSD_2_5_IO_Commands.py
- This script will run the following tests:
Verify Read/Write/Flush commands are successful
Verify sequential write I/O performance with FUA=0 and FUA=1 is within 5% of each other
Execute Flush during sequential write I/O and verify both pass
Do sequential write/read I/O with FUA=0 for both; then do sequential write/read I/O with FUA=0 for write and FUA=1 for read, and verify performance is within 5% of each other
If supported, disable volatile write cache, do sequential write I/O, and verify performance is within 5% of the value in step 2
If supported, enable volatile write cache and verify it was successful
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
NVMe-IO-1/3, GETF-2
- collect_performance_logs(dut, io_test, perf_field)
Collects logs from the ADP and prints the performance logs for a given IO command
- Parameters:
dut (XML_API) – Device object under test
io_test (dict) – Custom IO dict
perf_field (str | list) – Performance field to be collected. Either “TestReadBytes” | “TestWriteBytes” | “TestLatencyQoS” | “TestWriteIOs” | “TestReadIOs”
- Returns:
perf_val_dict – Parsed QoS latency values or dict for Number of read/write bytes
- Return type:
dict
- compare_performance_logs(base_io_bytes, other_io_bytes, compare_msg)
Checks the performance log using the perf_metrics dict to determine if a “Performance Not Met” warning needs to be issued
- Parameters:
base_io_bytes (dict) – baseline values, dict of either the read, write or flush bytes to be compared to io metric
other_io_bytes (dict) – actual values from I/O, dict of either the read, write or flush bytes to be compared to io metric
compare_msg (List) – List tuple of two strings respectively associated with the base_io and other_io to print the params run with that io, such as [(‘with FUA’, ‘without FUA’)]
- Return type:
None
- get_test_timestamp(dut, test_id, timestamp_type)
Get the starting or ending timestamp and format it for use in sb_filter
- Parameters:
dut (XML_API) – Device object under test
test_id (str) – I/O testname
timestamp_type (str) – “StartTime” or “EndTime”
- Returns:
timestamp – Timestamp formatted in seconds
- Return type:
int
- issue_io(dut, seektype, io_profile, threads, blocks, iosperpass=0, io_runtime=-1, io_pattern=0, extra_config=None)
Executes an IO Test
- Parameters:
dut (XML_API) – Device object under test
seektype (str) – Either ‘Sequential’ | ‘Random’
io_profile (str) – IO Profile to be executed
threads (int | str) – Threads (QD) to execute IO on
blocks (int | str) – Number of Logical Blocks
iosperpass (int | str) – Param to determine what the IO does on the drive ‘0’: unlimited, ‘-1’: Iterate once over drive, ‘-2’: Iterate twice over drive
io_runtime (int) – Time in seconds for IO to execute
io_pattern (int) – Pattern for io to be executed
extra_config (dict | None) – Optional parameter for running IO test with additional configurations
- Return type:
dict
- verify_ios(io_tests, is_verify_step=True)
Verifies the successful execution and wait for the completion of an I/O command
- Parameters:
io_tests (list) – list of I/O test dicts
is_verify_step (bool) – Determines whether to execute resting action in method or not (Special case for if the IO verify logging comes in a later step)
- Returns:
result_msg (tuple(func, msg) | none) – msg for later fail_action, or none if passed
bool – boolean to determine whether any I/O test failed
OCP_DCSSD_2_5_IO_Compare.py
- This script will run the following tests:
Confirm support and determine maximum I/O size to use
Determine and validate the maximum LBA transfer size
Test individual non-fused commands
Test valid fused operation
Test valid fused operation scenario with incorrect compare pattern
Test fused operation using nonmatching values for NLBs and verify no update performed
Test fused operation using FUSE=1 for both commands and verify no update performed
Test fused operation where first command has FUSE=2 and second command has FUSE=1 and verify no update performed
Test fused operation where second command has FUSE=0
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
NVMe-IO-8/9
- check_cmd_status(cmd_result, exp_sct, exp_sc, fail_type='error')
Extract SCT and SC fields from command result and verify if the values are correct or not
- Parameters:
cmd_result (dict) – command output
exp_sct (str) – Expected status code type in the form (Xh)
exp_sc (str) – Expected status code in the form (Xh)
fail_type (str) – Result status for the step (default is ‘error’)
- Return type:
None
- check_fused_cmd_status(command, expected_type=0, expected_status=0, any_fail=False)
Check status of the fused command
- Parameters:
command (str) – command to execute (calls fused_compare_and_write() with appropriate parameter values)
expected_type (int) – Error response type in SCT field
expected_status (int) – Error response status code in SCT field
any_fail (bool) – Whether the type of failure matters, only use for checking failures
- Return type:
None
- execute_command(command, result_queue)
Execute a command and get the results
- Parameters:
command (str) – command to execute
result_queue (list) – Response and status code
- Return type:
None
- fused_compare_and_write(dut, compare_slba=0, compare_nlba=1, compare_data='5a', compare_fuse=1, write_slba=0, write_nlba=1, write_data='5a', write_fuse=2)
Execute a fused compare and write command and get the results
- Parameters:
dut (XML_API) – Device object under test
compare_slba (int) – Starting LBA for compare command
compare_nlba (int) – Number of LBAs for compare command
compare_data (str) – Pattern to use for compare command
compare_fuse (int) – Value of FUSE field in Dword 0 for compare command
write_slba (int) – Starting LBA for write command
write_nlba (int) – Number of LBAs for write command
write_data (str) – Pattern to use for write command
write_fuse (int) – Value of FUSE field in Dword 0 for write command
- Return type:
A list containing status code and response for the compare and write commands
- verify_data_buffer(dut, data_pattern, nlb=1, slba=0)
Check status of the fused command
- Parameters:
dut (XML_API) – Device object under test
data_pattern (str) – Pattern to use in the I/O test
nlb (int) – Number of LBAs
slba (int) – Starting LBA
- Returns:
True or False
- Return type:
bool
OCP_DCSSD_2_5_IO_WriteUncorrectable.py
- This script will run the following tests:
Verify DCLP-6 is set to 800Fh in LID C4h
Verify ONCS bit 1 is set to 1
Determine the largest supported data transfer in blocks
Execute Write Uncorrectable on a single LBA and verify a Read to that LBA fails
Recover the LBA by doing a Write to it
Execute Write Uncorrectable on an LBA range by setting NLB=MaxLbas and verify a Read to that LBA range fails
Recover the LBA range by doing a Write to it
Execute Write Uncorrectable on the entire namespace and verify Reads to the entire namespace fail
Recover the entire namespace by doing Writes to it
Verify Write Uncorrectable is aborted due to “invalid field in command” error (if possible)
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
NVMe-IO-10/11/12/13/14
- get_RanLBA(maxlbas)
Get a random SLBA number
- Parameters:
maxlbas (int) – Max range of LBA
- Returns:
lba_x – Random SLBA value
- Return type:
int
- read_range_with_error(dut, maxlbas)
Read a range of LBAs and verify “unrecovered read error” status is returned
- Parameters:
dut (XML_API) – Device object under test
maxlbas (int) – Number of blocks to use in the I/O test
- Returns:
True or False
- Return type:
bool
OCP_DCSSD_2_5_IO_WriteZeroes.py
The objective of this test case is to verify the NVME IO requirements NVMe-IO-4, NVMe-IO-5, NVMe-IO-6 and NVMe-IO-7.
The device’s support for NVMe write zeroes commands is checked by issuing NVMe Write Zeros command.
Verify that the NVMe read command send after the NVMe Write Zeroes command with DEAC=0 and FUA=0 returns all zeros.
Verify that the NVMe read command send after the NVMe Write Zeroes command with DEAC=0 and FUA=1 returns all zeros.
Verify that the NVMe read command send after the NVMe Write Zeroes command with DEAC=1 and FUA=0 returns all zeros.
Verify that the NVMe read command send after the NVMe Write Zeroes command with DEAC=1 and FUA=0 returns all zeros.
Verify that the repetitive sending of the NVMe Write Zeroes command with DEAC=1, FUA=0, NLB=MAXLBAS and SLBA = successive increments of MAXLBAS can deallocate the full capacity of the DUT in less than 1 minute.
The case where the WZSL field in the Identify Controller dataset(CNS==6) is 0 and bit-3 of the ONCS field in the Identify Controller dataset(CNS==1) is also 0 shall be treated as a controller error and test case failure.
In the case where the WZSL field in the Identify Controller dataset(CNS==6) is greater than 0, WZSL shall be used to set the value of MAXLBAS using Identify Controller(CNS==1) and Identify Namespace(CNS==0) data as 2^(WZSL + 12 + CAP.MPSMIN) / 2^LBA Format[FLBAS].
Verify that when the WZSL field in the Identify controller dataset(CNS==6) is greater than 0 and bit-3 of the ONCS field in the Identify Controller dataset is 0 and the host sends a Write Zeroes command with an NLB value greater than that specified by the value of WZSL, the controller shall abort the Write Zeroes command with Invalid Field in Command.
The case where the WZSL field in the Identify Controller dataset(CNS==6) is 0 and bit-3 of the ONCS field in the Identify Controller dataset(CNS==1) is 1 shall be treated as the controller is not specifying a maximum size. In this scenario, MAXLBAS shall be computed using Identify Controller(CNS==1) and Identify Namespace(CNS==0) data as 2^(MDTS + 12 + CAP.MPSMIN) / 2^LBA Format[FLBAS].
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
NVMe-IO-4/5/6/7
- verify_data_buffer(dut, data_pattern, nlb=1, slba=0)
Run reverify I/O test and check whether it passed or failed
- Parameters:
dut (XML_API) – Device object under test
data_pattern (int) – Data pattern to be verified
nlb (int) – Number of logical blocks
slba (hex) – Starting LBA value
- Returns:
True (test passed) or False (test failed)
- Return type:
boolean
OCP_DCSSD_2_5_LowPowerModes_Requirements.py
- This script will run the following tests:
Verify that ASPM Optionality Compliance (AOC) bit is set to 1
Verify that ASPM Support (ASPMS) field is set to 10b or 11b
Execute PCIe reset
Verify that ASPM Control (ASPMC) field is cleared to 00b
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
LPWR-1/2
OCP_DCSSD_2_5_NSMgmt_NSAttachCommand.py
- This script will run the following tests:
Verify Identify data appropriately updates based on current state of namespaces.
Verify that when attaching an namespace to a controller that it shifts to active.
Verify that when deleting an attached namespace from an controller that it shifts to inactive.
Verify maximum allowed namespaces can be created, attached, and appropriate Identify data reflects changes.
Based on support, see if EUI64 and NGUID differs from stored namespace data of vendor parameters file.
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
NVMe-AD-4, NUSE-1, NSM-1/2/3/4/5/6/7, NVMe v2.0d Section 3.2.1/5.22/8.11
- namespace_management(dut, id_ns, sel, format_index, mset, new_ns_capacity=0, max_ns_count=1, is_private=0)
Helper function to create a new Namespace with specific field information
- Parameters:
dut (XML) – Device object under test
id_ns (dict) – Identify Namespace command dictionary
sel (int) – Select Field for namespace management action
new_ns_capacity (int) – Create Size capacity
max_ns_count (int) – Count of namespaces to be made
format_index (int)
mset (int) – Metadata Settings
is_private (int) – Determines if namespace is private or not
- Returns:
create_namespace
- Return type:
dict
OCP_DCSSD_2_5_NSMgmt_NSBasicData.py
- This script will run the following tests:
Verify that new drives come from the factory configured with exactly one active namespace sized to the maximum capacity of the device.
Verify that the FLBAS for this namespace corresponds to the default set at the factory and as specified per the device profile contained in the Adaptation data.
Verify that for a valid namespace, the namespace data returned from the Identify command exactly matches the namespace data as provided in the Adaptation data for the drive.
Verify that the values of NN and MNAN reported in the Identify Controller Dataset are set correctly per the device profile setting in the Adaptation data.
Verify that support for the NSWG field is indicated in the NSFEAT field in adaptation data.
Verify that the NSWG field in Namespace data is populated and, that the value matches the indirection unit value in Adaptation data.
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
NSM-4/5/6, NVMe-OPT-7, SECTOR-3
OCP_DCSSD_2_5_NSMgmt_NSMgmtCommand.py
- This script will run the following tests:
Verify ability to create maxmimum allowed namespaces on DUT, accounting for NS Granularity
Verify namespace management behavior across all namespaces.
Verify Identify data updates accordingly with unattached namespaces.
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
NVMe-AD-3, NSM-1/2/3/4/5/6/7, NVMe v2.0d Section 3.2.1/5.23/8.11
- namespace_management(dut, id_ns, sel, format_index, mset, new_ns_capacity=0, max_ns_count=1, is_private=0, pi=0, pil=0)
Helper function to create a new Namespace with specific field information
- Parameters:
dut (XML) – Device object under test
id_ns (dict) – Identify Namespace command dictionary
sel (int) – Select Field for namespace management action
new_ns_capacity (int) – Create Size capacity
max_ns_count (int) – Count of namespaces to be made
format_index (int)
mset (int) – Metadata Settings
is_private (int) – Determines if namespace is private or not
pi (int) – Protection Information
pil (int) – Protection Information Location
- Returns:
create_namespace
- Return type:
dict
OCP_DCSSD_2_5_PEL_DataPersist_Format.py
The objectives for this test case are to verify the following:
That the device processes the Get Log Page commands to backup Persistent Event Log as the baseline.
That the data in the Persistent Event Log Page (LID 0Dh) persists across Format NVM commands by performing the following checks:
That all reserved and unsupported fields are cleared to 0 and do not change.
That all statically defined fields remain unchanged.
Verify that the Total Number of Events field in the Log Page data following successful Format NVM completion has increased as expected.
Verify that the event data in the Log Page has persisted.
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
STD-LOG-23
OCP_DCSSD_2_5_PEL_DataPersist_Sanitize.py
The objectives for the Data Persistence during Sanitize Operation test case are to verify the following:
That the device processes the Get Log Page commands to backup Persistent Event Log Page as the baseline.
That the data in Persistent Event Log Page (LID 0Dh) persists across the Sanitize operations by performing the following checks:
That all reserved and unsupported fields are cleared to 0 and do not change.
That all statically defined fields remain unchanged.
Verify that the Total Number of Events field in Log Page data following successful Sanitize completion has increased as expected.
Verify that the event data in the Log Page has persisted.
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
STD-LOG-23
OCP_DCSSD_2_5_Power_ExpectedValue.py
- This test case will verify the following:
Using NSID = 0 in the set features command passes as expected.
Using NSID = FFFFFFFFh in the set features command passes as expected.
Using NSID = NN+1 (invalid NSID) fails with Invalid Field in Command status.
NSID = any NSID between 1 and NN (valid NSID) fails with Feature Not Namespace Specific status.
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
SDSSDPS-6
OCP_DCSSD_2_5_Power_IdlePower.py
- This script will run the following tests:
Loop over power states from 0 to NPSS
Verify IDLP multiplied by IPS = 5W
Set power state to the current power state in the loop and verify it was set correctly
Collect 30 idle power measurements at 1 second intervals
Compute average idle power of the measurements and verify it’s <= 5W + 5% margin
Repeat steps 2-5 for each operational power state
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
PWR-1/6
OCP_DCSSD_2_5_Power_PowerManagement.py
The objective of this test case is to verify the following:
That the power state descriptors provided as parameterization data are supported and returned by the Identify command controller dataset populated as expected.
Verify that the device uses a unique Maximum Power (MP) value in each supported NVMe Power State Descriptor.
That the Get/Set Features 02h and C7h commands are supported for the Power Management Feature.
That when a new power state is set using the set features command with the SV bit set, the new power state setting is retained through power cycles and is reported as the current value following a power cycle.
That all valid power states reported in the power state descriptor table are supported by the device by setting the power state via the set features command and verifying the power consumption changes to reflect the MP for the new power state.
That when an NVMe power state is set using set features 02h, the power state value is returned when using get features 02h, but the corresponding DSSD power state is reported when using get features C7.
That when a DSSD power state is set using set features C7h, the DSSD power state is reported using get features C7, but the corresponding NVMe power state is reported when using get features 02h.
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
PWR-1/5/8, DSSDPSS-1/2/3, SDSSDPS-1 to SDSSDPS-15, DSSDPSG-1/2, GDSSDPS-1/2, OCP 2.5 Section 4.8.11
- get_dssd_power_state(result, nvme_power_state)
Return the DSSD Power State corresponding to the given NVMe Power State.
Multiple DSSD Power States may reference a single NVMe Power State. The purpose of this function is to return the DSSD Power State a drive should report upon the selection of an NVMe Power State as defined by DSSDPSG-2:
OCP 2.5 Requirement DSSDPSG-2 If a DSSD Power State (Feature Identifier C7h) Get Feature command is executed and the current NVMe Power State was not selected because of a DSSD Power State Set Feature command, the device shall report the lowest power DSSD Power State whose number is greater than or equal to the Maximum Power in watts of the current NVMe Power State
- get_maximum_power_watts(result, nvme_power_state)
Calculate the Maximum Power, in watts, of the given NVMe Power State
- get_nvme_power_state(result, dssd_power_state)
Return the NVMe Power State corresponding to the given DSSD Power State
- postcondition(dut, ps)
Sets the current power state back to the default value
- Parameters:
dut (XML_API) – Device object under test
ps (int) – Power State to set device to
- Return type:
None
OCP_DCSSD_2_5_ROWTM_ExpectedValue.py
- This script will run the following tests:
Issue Identify Controller command and get value of NN field
Issue Get Features command for FID = C2h and save Dword0 bits 2:0
Issue Set Features command for FID = C2h with NSID = FFFFFFFFh to set drive to EOL behavior from Get Features and verify it’s successful
Repeat step 3 with NSID = 1 and verify it fails
Repeat step 3 with NSID = NN + 1 and verify it fails
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
SROWTM-6
OCP_DCSSD_2_5_ROWTM_Feature.py
- This script will run the following tests:
Issue Get Features commands for FID = C2h with SEL = 01b and 11b and verify the results
Issue Set Features command for FID = C2h to set drive to WT mode
Issue Get Features commands for FID = C2h with SEL = 01b, 00b, and 10b and verify the results
Power cycle the device
Repeat step 3
Issue Set Features command for FID = C2h to set drive to Normal mode in case of PLP failure and RO mode at EOL
Repeat step 3
Power cycle the device
Repeat step 3
Issue Set Features command for FID = C2h to set drive to RO mode
Repeat step 3
Power cycle the device
Repeat step 3
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
ROWTM-1, SROWTM-1 to SROWTM-15, GROWTM-1 to GROWTM-15, GETF-1/2
- check_set_feature_result(dut, set_feature_cmd, fid, sv=0, data=None, cdw11=None)
Receives the values stored in a Set-Feature Log, and verifies the feature command’s execution
- Parameters:
dut (XML_API) – Device object under test
set_feature_cmd (dict) – Set-Feature command output
fid (int) – FID field value for the set-feature command
sv (int) – The Selection field for the set-feature command
data (int|None) – Data Pointer for the Set-feature, intended for original set-feature value at start of test
cdw11 (int|None) – Command DWord 11 for the Set-Feature, intended for original set-feature value at start of test
- Return type:
None
OCP_DCSSD_2_5_ReliabilityPowerTTR_ControllerStatus.py
- This script will run the following tests:
Reset the controller by clearing CC.EN field to zero.
Enable the controller, CC.EN=1.
Device will set CSTS.RDY to 1 when it is ready.
Device should service ADMIN commands as soon as CSTS.RDY = 1.
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
TTR-3/4
OCP_DCSSD_2_5_ReliabilityPowerTTR_DeviceStability.py
- This script will run the following tests:
Precondition the namespace twice with 128KiB sequential writes
Perform sequential reads and writes on the device for 5 minutes
Do a normal shutdown on the device
Power device back on
Perform sequential reads and verify no there’s no data corruption
Perform sequential reads and writes on the device for 5 minutes and check performance
Do an abrupt shutdown on the device
Repeat steps 4-6
Start a sequential write test
Do an ungraceful shutdown on the device
Repeat steps 4-6
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
TTR-7/8/12/15/16
- check_performance_logs(perf_metrics, io_bytes, io_type, rebuild=False)
Checks the performance log using the perf_metrics dict to determine if a “Performance Not Met” warning needs to be issued
- Parameters:
perf_metrics (list) – Performance metrics of read and write expected throughput
io_bytes (float) – Either the read or write bytes to be compared to I/O metric
io_type (int) – 0: Read, 1: Write
rebuild (boolean) – If rebuild allowance error message should be printed or not
- Returns:
performance_met – If measured performance was less than 5% below the performance requirement
- Return type:
boolean
- collect_performance_logs(dut, seq_read, seq_write, io_runtime)
Collects and prints the performance logs for reads and writes in an I/O test
- Parameters:
dut (XML_API) – Device object under test
seq_read (dict) – Custom read I/O test dict
seq_write (dict) – Custom write I/O test dict
io_runtime (int) – Time in seconds for IO to execute
- Returns:
read_bytes (int) – Number of bytes read
write_bytes (int) – Number of bytes written
- execute_IO_Profile(dut, test_type, io_profile, extra_config=None, io_runtime=-1, io_pattern=17)
- Executes each of the IO Profiles listed in Table 4
Sequential Read (MiB/s) (128kiB, QD = 128)
Sequential Write (MiB/s) (128kiB, QD = 128)
Random Read (KIOPS) (4kiB, QD = 128)
Random Writes (KIOPS) (4kiB, QD = 128)
Random 70R:30W mix (KIOPS) (4kiB, QD = 128)
- Parameters:
dut (XML_API) – Device object under test
test_type (str) – Either ‘Sequential’ | ‘Random’
io_profile (str) – IO Profile to be executed
io_runtime (int) – Time in seconds for IO to execute
io_pattern (int) – Pattern for io to be executed
- Return type:
dict
- set_shn_bit(dut, set_value)
Sets the CC.SHN bit
- Parameters:
dut (XML_API) – Device object under test
set_value (int) – Value you want to set the CC field to (zeros based)
- Return type:
None
- verify_ios(io_tests)
Checks if I/O tests passed or failed
- Parameters:
io_tests (list) – list of I/O test dicts
- Returns:
io_failed – Returns failed if any I/O test failed
- Return type:
bool
- verify_reverify(dut, io_test)
Checks if reverify I/O test passed or failed
- Parameters:
io_test (dict) – reverify I/O test dict
- Return type:
None
OCP_DCSSD_2_5_ReliabilityPowerTTR_PERST.py
- This script will run the following tests:
Assert and de-assert PERST on the drive
Verify CSTS.RDY transitions to 0 within one second
Verify Identify command is successful
Perform sequential write and read for five minutes and collect performance logs
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
TTR-20
OCP_DCSSD_2_5_ReliabilityPowerTTR_ShutdownNotification.py
- This script will run the following tests:
Do Identify Controller and verify it’s successful
Check RTD3 Entry Latency field value
Execute normal shutdown process and verify CC.SHN and CSTS.SHST values
Execute abrupt shutdown process and verify CC.SHN and CSTS.SHST values
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
TTR-5/6/23
OCP_DCSSD_2_5_ReliabilityPowerTTR_TimeToIdentify.py
- This script will run the following tests:
Disable the controller by setting CC.EN=0
Enable the controller by setting CC.EN=1
Verify that the device responds to identify command and read/write commands within Time defined by DP-CFG-8 and DP-CFG-9, respectively
Verify device complies with TTR-4 and DP-CFG-10 if column B is supported
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
TTR-1/2/4, DP-CFG-8/9/10
- set_shn_bit(dut, set_value)
Sets the CC.SHN bit
- Parameters:
dut (XML_API) – Device object under test
set_value (int) – Value you want to set the CC field to (zeros based)
- Return type:
None
OCP_DCSSD_2_5_SMARTExtendedLog_Endianness.py
- This script will run the following tests:
Do GetLogPage for LID C0h
Check that byte 0 of Security Version Number and Log Page Version fields is correct
Verify Log Page GUID is correct
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
SLOG-3, SMART-22/27/28
OCP_DCSSD_2_5_SMARTExtendedLog_EnduranceEstimate.py
- This script will run the following tests:
Do GetLogPage for LID C0h and get Endurance Estimate field value
If endurance groups are supported, do GetLogPage for LID 9h and get Endurance Estimate field value
Verify both values are the same
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
SMART-25
OCP_DCSSD_2_5_SMARTExtendedLog_NUSE.py
- This script will run the following tests:
Precondition the device to have a single namespace
Verify that the values of NUSE in Identify Namespace and Total NUSE in LID C0h are the same
Calculate the temporary namespace capacity to use, factoring in the namespace granularity descriptor size
Delete the namespace
Create, attach and write to namespaces, from 1 to MNAN/NN value
Power cycle the device and delay for 10 minutes
Verify that the Total NUSE value reported in LID C0h is equal to the value of total NUSE summed over all the namespaces created
Delete all of the namespaces
Create and attach a new namespace
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
SMART-23
- get_ID_NS_DATA_1(params)
Helper function to retrieve and parse the ADP’s ID_NS_DATA_1 field information
- Parameters:
params (dict) – ADP parameter values
- Returns:
adp_id_ns (dict) – Dictionary of parsed values from the ADP’s ID_NS_DATA_1 field
create_Namespace (dict)
- namespace_management(dut, sel, format_index, mset, nvmsetid, anagrpid, new_ns_capacity=0, max_ns_count=1, pi=0, pil=0, is_private=0)
Helper function to create a new Namespace with specific field information
- Parameters:
dut (XML) – Device object under test
sel (int) – Select Field for namespace management action
new_ns_capacity (int) – Create Size capacity
max_ns_count (int) – Count of namespaces to be made
format_index (int)
mset (int) – Metadata Settings
nvmsetid (int) – NVM Set identifier associated with the submission queue
anagrpid (int) – ANA Group Identifier
pi (int) – Protection Information
pil (int) – Protection Information Location
is_private (int) – Determines if namespace is private or not
- Returns:
create_Namespace
- Return type:
dict
OCP_DCSSD_2_5_SMARTExtendedLog_PLPCount.py
- This script will run the following tests:
Do GetLogPage for LID C0h and get PLP Start Count field value
Power cycle the drive
Do GetLogPage for LID C0h and get PLP Start Count field value and verify it increased by 1
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
SMART-24
OCP_DCSSD_2_5_SMARTExtendedLog_PowerStateChangeCount.py
- This script will run the following tests:
Verify Power State Change Count reported in the SMART/Health Information Extended Log has increased by the number of NVMe Power state changes
Verify Power State Change Count reported in the SMART/Health Information Extended Log has increased by the number of DSSD Power State changes
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
SMART-31
- postcondition(dut)
Sets the current power state back to the default NVMe Power State 0
- Parameters:
dut (XML_API) – Device object under test
- Return type:
None
OCP_DCSSD_2_5_SMARTExtendedLog_SecVerNumber.py
- This script will run the following tests:
Do GetLogPage for LID C0h
Check Security Version field against parameterization data
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
SMART-22
OCP_DCSSD_2_5_SMARTExtendedLog_UnalignedIO.py
- This script will run the following tests:
Power cycle the device
Do GetLogPage for LID C0h and verify Unaligned I/O field is 0
Send 10 4KB sequential write I/O commands starting at LBA 1
Do GetLogPage for LID C0h and verify Unaligned I/O field increased by at least 10
Power cycle the device
Do GetLogPage for LID C0h and verify Unaligned I/O field is 0
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
SMART-21
- perform_cleanup(dut, orig_lbaf)
Used to postcondition drive in the event of a test-wide failure
- Parameters:
dut (XML_API) – Device object under test
orig_lbaf (int) – Original LBA to re-format drive to
- Returns:
‘test’ – fail_action=’test’
- Return type:
str
OCP_DCSSD_2_5_SMARTExtendedLog_UnitsRW.py
- This script will run the following tests:
Do GetLogPage for LID C0h and get physical media units written and read values
Perform 128KB sequential writes for 5 minutes
Perform 128KB sequential reads for 5 minutes
Do GetLogPage for LID C0h and verify physical media units written and read values increased
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
SMART-1/2
- get_logpage_fields(dut, lid, field_name1, field_name2)
- Parameters:
dut
lid
field_name1
field_name2
OCP_DCSSD_2_5_SMARTLog_BasicCommand.py
- This script will run the following tests:
Do GetLogPage for LID 2h with different NSIDs
Check various field values
Do controller reset and repeat steps 1-2
Do FLR and repeat steps 1-2
Do NSSR and repeat steps 1-2
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
STD-LOG-2/3/18/23, SLOG-1/4/5/11
- compare_buffer_data(result1, result2, name_attribute, method=0)
- Parameters:
result1 – First data structure to compare
result2 – Second data structure to compare
name_attribute – Log page field name
method – Testing method to use. 0 = verify values match, 1 = allow for second value to be less than the first, 2 = allow second value to be greater than the first, 3 = allow for possible increment by 1
- step_4_to_step_14(dut, num_flag=0, base_line=None)
- Parameters:
num_flag – 0 = first loop only compare NSI= 0 with NSID = FFFFFFFFh. 1 = Repeat loop, compare baseline with NSI= 0 and NSID = FFFFFFFFh.
base_line – log page datasets as the baseline data
OCP_DCSSD_2_5_SMARTLog_DataPersist_Format.py
The objective for the Data Persistence Across Format NVM Operations test case is to verify that the data in the SMART / Health Information Log Page (LID 02h) persists across Format NVM operations by performing the following checks:
Verify that all reserved and unsupported fields are cleared to 0 and do not change.
Verify that all statically defined fields remain unchanged.
Verify that all dynamically updated counter attribute values that are highly unlikely to change in the absence of specific HW events persist across the Format NVM Commands are either unchanged or have increased in value. The notable exception to this would be fields such as the Available Spares attribute that should persist through the Format NVM Commands but may decrease in value due to the nature of what is being reported.
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
STD-LOG-23
OCP_DCSSD_2_5_SMARTLog_DataPersist_Sanitize.py
The objective for the Data Persistence Across Sanitize Operations test case is to verify that the data in the SMART / Health Information Log Page (LID 02h) persists across Sanitize Operations by performing the following checks:
Verify that all reserved and unsupported fields are cleared to 0 and do not change.
Verify that all statically defined fields remain unchanged.
Verify that all dynamically updated counter attribute values that are highly unlikely to change in the absence of specific HW events persist across the sanitize process are either unchanged or have increased in value. The notable exception to this would be fields such as the Available Spares attribute that should persist through Sanitize Commands but may decrease in value due to the nature of what is being reported.
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
STD-LOG-23
- postcondition(dut)
Data Persistence Across Sanitize Operations Test Case - Postcondition
DUT should be restored to its starting condition. If the Sanitize command should fail at any point the steps to exit Sanitize Failure Mode must be performed. If the test case itself should fail at some step while the Sanitize Operation is in progress the Sanitize Operation must be allowed to complete prior to exiting the failed test case. In all test case outcomes namespace recreation steps shall be performed before exiting the test case.
OCP_DCSSD_2_5_SMARTLog_LittleEndian.py
- This script will run the following tests:
Do GetLogPage for LID 2h and get values of Data Units Read/Written, Host Read/Write Commands, Controller Busy Time, Power Cycles, Power On Hours, and Unsafe Shutdowns fields
Issue four write and read commands, each with 251 blocks
Power cycle the drive
Do GetLogPage for LID 2h and verify Data Units Read/Written and Host Read/Write Commands values increased by at least 1
Surprise power cycle the drive
Do GetLogPage for LID 2h and verify Power Cycle Count and Unsafe Shutdowns values increased by at least 1
Perform 4KB random reads and writes for 65 minutes
Do GetLogPage for LID 2h and verify Power On Hours value increased by at least 1
Verify Controller Busy Time value stayed the same or increased by at least 1
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
STD-LOG-2, SLOG-3, SLOG-5
- compare_values(field_name, baseline_dict, new_values_dict)
Compare field values before and after various testing
- Parameters:
field_name (str) – Field name
baseline_dict (dict) – Original field value
new_values_dict (dict) – New field value
- Return type:
None
- verify_io(io_test, io_type, seektype)
Verifies the succession of an I/O command
- Parameters:
io_test (dict) – I/O Command
io_type (str) – Name of I/O test
seektype (int) – 0: ‘Sequential’, 1: ‘Random’
- Returns:
io_test_failed – bool on the status of IO test completion
- Return type:
bool
OCP_DCSSD_2_5_SMARTLog_UnsafeShutdowns.py
- This script will run the following tests:
Do GetLogPage for LID 2h and get Unsafe Shutdowns field value
Surprise power cycle the drive 10 times
Do GetLogPage for LID 2h and get Unsafe Shutdowns field value and verify it increased by 1
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
STD-LOG-2, SLOG-5
OCP_DCSSD_2_5_SMARTLog_WriteRead.py
- This script will run the following tests:
Do GetLogPage for LID 2h and get values of various fields
Perform 4KB random reads and writes for 65 minutes
Do GetLogPage for LID 2h and verify the various fields increased
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
STD-LOG-2, SLOG-5
OCP_DCSSD_2_5_Sanitize_BlockErase.py
- This script will run the following tests:
Verify support for sanitize block erase command
Verify initial sanitize state
Delete and recreate smaller fixed size namespace
Setup AENs
Verify Sanitize command with No-Deallocate After Sanitize = 0 first
Precondition namespace for sanitize
Start block erase sanitize operation
Block erase sanitize operation has ended
Verify the block erase sanitize operation
Verify sanitize command with No-Deallocate After Sanitize = 1
Delete and recreate original namespace
Verify that block erase completes within 10s per TB of capacity
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
NVMe-AD-7/8/17/18, SEC-4, STD-LOG-9/10, CTO-8, NVMe v2.0d Section 5.16.1.25/5.27.1.19/5.24/8.21
- exit_sanitize_failure(dut)
Performs the necessary steps to exit sanitize failure mode
- Parameters:
dut (XML_API) – Device object under test
- Return type:
None
- postcondition(dut, wait=7200, fail=True)
Performs the necessary postcondition steps to restore DUT back to original state
- Parameters:
dut (XML_API) – Device object under test
wait (int) – Estimated time to wait for Sanitize Operation if Get Log Page with LID=81h fails
fail (bool) – If True, print ERROR message and exit the script; if False, print DETAIL message
- Return type:
None
- verify_data_buffer(dut, params, config)
Start an IO test, wait for it to finish, check test status
- Parameters:
dut (XML_API) – Device object under test
params (dict) – Parameters for IO test
config (dict) – Configuration for IO test
- Return type:
None
OCP_DCSSD_2_5_Sanitize_CmdsReceivedDuringSanitize.py
- This script will run the following tests:
Verify support for sanitize crypto erase command
Verify initial sanitize state
Delete and recreate smaller fixed size namespace
Verify that a format NVM command in progress is aborted when DUT receives sanitize command
Wait until sanitize operation completes
Verify that pending I/Os are aborted when DUT receives sanitize command
Verify that all other NVM commands are aborted by DUT while sanitize operation is in progress
Verify that admin commands not supported during sanitize are aborted by DUT when received
Verify that DST during sanitize are aborted by DUT when received
Verify that admin commands supported during sanitize operation are not aborted by DUT
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
NVMe v2.0d 5.16.1.25/5.27.1.19/5.24/8.21
- check_cmd_fail(dut, result, cmd, expected_status, sanact, wait=7200)
Checks for command failure during Sanitize
- Parameters:
dut (XML_API) – Device object under test
result (dict) – The dictionary returned by an XML_API call
cmd (str) – Command name to print
expected_status (int) – Expected status to return
sanact (bin) – Sanitize action to use when starting sanitize operation
- Returns:
True if the command needs to be resent, False otherwise
- Return type:
bool
- check_sanitize(dut, cmd, sanact, wait=7200)
Restart sanitize operation if it has completed
- Parameters:
dut (XML_API) – Device object under test
cmd (str) – Command name to print
sanact (bin) – Sanitize action to use when starting sanitize operation
- Returns:
True if the command needs to be resent, False otherwise
- Return type:
bool
- do_format(dut, nsid, lbaf, ses, format_results)
Execute format command and put the results into a dictionary (since the format is done as part of a thread, a dictionary will allow the main part of the program to access the results)
- Parameters:
dut (XML_API) – Device object under test
nsid (int) – Namespace under test
lbaf (int) – LBAF to use in the format
ses (int) – SES to use in the format
format_results (dict) – Dictionary to hold the results of the format command
- Return type:
None
- do_sanitize(dut, sanact, sanitize_results)
Execute sanitize command and put the results into a dictionary (since the sanitize is done as part of a thread, a dictionary will allow the main part of the program to access the results)
- Parameters:
dut (XML_API) – Device object under test
sanact (bin) – Sanitize action to use when starting sanitize operation
sanitize_results (dict) – Dictionary to hold the results of the sanitize command
- Return type:
None
- exit_sanitize_failure(dut)
Performs the necessary steps to exit sanitize failure mode
- Parameters:
dut (XML_API) – Device object under test
ndi (int) – NDI bit from SANICAP
- Return type:
None
- postcondition(dut, wait=7200, fail=True)
Performs the necessary postcondition steps to restore DUT back to original state
- Parameters:
dut (XML_API) – Device object under test
wait (int) – Estimated time to wait for Sanitize Operation if Get Log Page with LID=81h fails
fail (bool) – If True, print ERROR message and exit the script; if False, print DETAIL message
- Return type:
None
- verify_io_status(test_id, sc)
Checks an IO test for a particular status code being returned
- Parameters:
test_id (string) – IO Test identifier
sc (string) – Status code to check for, should be in hex format
- Returns:
True or False
- Return type:
bool
OCP_DCSSD_2_5_Sanitize_CryptoErase.py
- This script will run the following tests:
Verify support for sanitize crypto erase command
Verify initial sanitize state
Delete and recreate smaller fixed size namespace
Setup AENs
Verify Sanitize command with No-Deallocate After Sanitize = 0 first
Precondition namespace for sanitize
Start crypto erase sanitize operation
Crypto erase sanitize operation has ended
Verify the crypto erase sanitize operation
Verify sanitize command with No-Deallocate After Sanitize = 1
Delete and recreate original namespace
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
NVMe-AD-7/8/18, SEC-4, STD-LOG-9/10, NVMe v2.0d Section 5.16.1.25/5.27.1.19/5.24/8.21
- execute_IO_Profile(dut, test_type, io_profile, io_runtime=-1, io_pattern=1, config=None)
- Executes each of the IO Profiles listed in Table 4
Sequential Read (MiB/s) (128kiB, QD = 128)
Sequential Write (MiB/s) (128kiB, QD = 128)
Random Read (KIOPS) (4kiB, QD = 128)
Random Writes (KIOPS) (4kiB, QD = 128)
Random 70R:30W mix (KIOPS) (4kiB, QD = 128)
- Parameters:
dut (XML_API) – Device object under test
test_type (str) – Either ‘Sequential’ | ‘Random’
io_profile (str) – IO Profile to be executed
io_runtime (int) – Time in seconds for IO to execute
io_pattern (int) – Pattern for io to be executed
config (dict) – Configuration parameters for the I/O
- Return type:
dict
- exit_sanitize_failure(dut)
Performs the necessary steps to exit sanitize failure mode
- Parameters:
dut (XML_API) – Device object under test
- Return type:
None
- postcondition(dut, wait=7200, fail=True)
Performs the necessary postcondition steps to restore DUT back to original state
- Parameters:
dut (XML_API) – Device object under test
wait (int) – Estimated time to wait for Sanitize Operation if Get Log Page with LID=81h fails
fail (bool) – If True, print ERROR message and exit the script; if False, print DETAIL message
- Return type:
None
- verify_ios(io_tests, fail_type='warn')
Verifies the succession of an I/O command
- Parameters:
io_tests (list) – list of I/O Command dicts
fail_type (str) – fail type upon I/O failure
- Returns:
io_failed – Returns failed if any io test failed
- Return type:
bool
OCP_DCSSD_2_5_Sanitize_FailedOperations.py
- This script will run the following tests:
Verify support for sanitize block erase command
Verify initial sanitize state
Delete and recreate smaller fixed size namespace
Precondition namespace for sanitize
If namespace write protection is supported, verify sanitize command fails if sent while namespace is write-protected
Verify sanitize command fails while firmware update is pending
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
NVMe v2.0d 5.16.1.25/5.27.1.19/5.24/8.21
- exit_sanitize_failure(dut)
Performs the necessary steps to exit sanitize failure mode
- Parameters:
dut (XML_API) – Device object under test
- Return type:
None
- postcondition(dut, wait=7200, fail=True)
Performs the necessary postcondition steps to restore DUT back to original state
- Parameters:
dut (XML_API) – Device object under test
wait (int) – Estimated time to wait for Sanitize Operation if Get Log Page with LID=81h fails
fail (bool) – If True, print ERROR message and exit the script; if False, print DETAIL message
- Return type:
None
- verify_data_buffer(dut, params, config)
Start an IO test, wait for it to finish, check test status
- Parameters:
dut (XML_API) – Device object under test
params (dict) – Parameters for IO test
config (dict) – Configuration for IO test
- Return type:
None
OCP_DCSSD_2_5_Sanitize_OverwriteErase.py
- This script will run the following tests:
Verify support for sanitize overwrite command
Verify initial sanitize state
Delete and recreate smaller fixed size namespace
Setup AENs
Verify Sanitize command with No-Deallocate After Sanitize = 0 first
Precondition namespace for sanitize
Start overwrite sanitize operation
Overwrite sanitize operation has ended
Verify the overwrite sanitize operation
Verify sanitize command with No-Deallocate After Sanitize = 1
Delete and recreate original namespace
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
NVMe-AD-7/8/18, SEC-4, STD-LOG-9/10, NVMe v2.0d Section 5.16.1.25/5.27.1.19/5.24/8.21
- execute_IO_Profile(dut, test_type, io_profile, io_runtime=-1, io_pattern=1, config=None)
- Executes each of the IO Profiles listed in Table 4
Sequential Read (MiB/s) (128kiB, QD = 128)
Sequential Write (MiB/s) (128kiB, QD = 128)
Random Read (KIOPS) (4kiB, QD = 128)
Random Writes (KIOPS) (4kiB, QD = 128)
Random 70R:30W mix (KIOPS) (4kiB, QD = 128)
- Parameters:
dut (XML_API) – Device object under test
test_type (str) – Either ‘Sequential’ | ‘Random’
io_profile (str) – IO Profile to be executed
io_runtime (int) – Time in seconds for IO to execute
io_pattern (int) – Pattern for io to be executed
config (dict) – Configuration parameters for the I/O
- Return type:
dict
- exit_sanitize_failure(dut)
Performs the necessary steps to exit sanitize failure mode
- Parameters:
dut (XML_API) – Device object under test
- Return type:
None
- postcondition(dut, wait=7200, fail=True)
Performs the necessary postcondition steps to restore DUT back to original state
- Parameters:
dut (XML_API) – Device object under test
wait (int) – Estimated time to wait for Sanitize Operation if Get Log Page with LID=81h fails
fail (bool) – If True, print ERROR message and exit the script; if False, print DETAIL message
- Return type:
None
- verify_ios(io_tests, fail_type='warn')
Verifies the succession of an I/O command
- Parameters:
io_tests (list) – list of I/O Command dicts
fail_type (str) – fail type upon I/O failure
- Returns:
io_failed – Returns failed if any io test failed
- Return type:
bool
OCP_DCSSD_2_5_SecureBoot_RollbackPrevention.py
For rollback prevention the test objectives are to verify the following:
That when attempting to perform a firmware update on a secure drive using a validly signed firmware image that has a security version number equal to the current security version number the commit action step succeeds, the secured drive is updated with the new firmware, and the current security version number is unchanged.
That when attempting to perform a firmware update on a secure drive using a validly signed firmware image that has a security version number greater than the current security version number the commit action step succeeds, the secured drive is updated with the new firmware, and the current security version number reported in C0h log page is updated to the new security version number.
That when attempting to perform a firmware update on a secure drive using a validly signed firmware image that has a security version number less than the current security version number the commit action step fails, and the secured drive is not updated with the new firmware.
That the security version number is not the same as the firmware version.
That a firmware image that increases the security version is successfully activated, the read-only slot 1 is also updated with the new firmware image.
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
SEC-1, SEC-3, SEC-5, FWUP-8, FWUP-20
OCP_DCSSD_2_5_SecureBoot_UnsecuredDrive.py
For an unsecured drive, the secure boot test objectives are to verify the following:
That when attempting to perform a firmware update on an unsecured drive using a valid and signed firmware image, the firmware update fails, and the drive firmware is unchanged.
That when attempting to perform a firmware update using a valid unsigned firmware image, the firmware update succeeds, and the drive firmware is updated to the new unsigned firmware image.
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
SEC-1/5
OCP_DCSSD_2_5_TelemetryProfile_SetGetFeature.py
- This script will run the following tests:
Send the Set Feature command with FID C8h to set each telemetry profile type
Verify that the correct profile is then reported in the Telemetry Area 1 data.
Verify that the SEL field is ignored with the Get Feature command with FID C8h
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.5 requirements referenced by this script:
TEL-16/17, TEL-CFG-SF-1/2/3/4/5/6/7/8/9/10/11/12/13/14/15/16/17, TEL-CFG-GF-1
- cleanup_action(filenames)
Deletes temporary files before ending script
- Parameters:
list[str] (filenames) – temporary file names to remove
- Return type:
None
- get_data_area_1_fields(filename)
Parses OCP 2.5 Telemetry Data Format (see Datacenter NVMe SSD spec section 4.9.16.1)
- Parameters:
filename (str) – Filename of raw binary output from get log page command
- Returns:
result – Result dictionary with fields parsed out similar to api_core.py and core.json
- Return type:
dict
- parse_thi_output(cmd_output, filename)
Parses out the data from the GetLogPage hexdump and appends it to the proper file. Ignores data that is not hex-dumped like CQE.
- Parameters:
cmd_output (List) – List of hex-dump strings to parse
filename (str) – File to append to
- Returns:
Number of blocks read
- Return type:
int
- read_seq_blocks_from_log(dut, mdtsb, data_area_blks, depth, filename)
Reads data_area_blks from the telemetry host log. Assumes the header (512 Bytes) has already been parsed. A MDTS value that is not a multiple of 512 bytes will produce undefined behavior, although all valid MDTS alues should be multiples of 512 bytes.
- Parameters:
dut (XML_API) – Device Object Under Test
mdtsb (int) – Maximum Data Transfer Size in Bytes
data_area_blks (int) – Number of data area blocks left to read
depth (int) – multiplier for offset for subsequent get log page command calls
filename – File to append binary data from get log page command to
- Returns:
True if all-around success, else False
- Return type:
bool