OCP_DatacenterSSD
OCP_DCSSD_AdminCmds_ExtTimeVerification.py
- This script will run the following tests:
Format NVM command with various SES values
TCG Revert command
TCG RevertSP command
TCG GenKey command
Verify each command completes within a given time limit
NOTE: Modify “tcg_password” variable if the DUT uses a password other than ‘12345678’
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
CTO-2
- check_cmd_status(output_cmd)
Check command output and print the success or error string
- Parameters:
output_cmd (list) – Command output
- Returns:
cmd_flag – 0 = command failed, 1 = commmand passed
- Return type:
int
OCP_DCSSD_AdminCmds_NSAttach.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.0 requirements referenced by this script:
NSM-2, NVMe-AD-4, NUSE-1
OCP_DCSSD_AdminCmds_NSBasic.py
- This script will run the following tests:
- If from Factory:
Verify DUT namespace data matches one to one with vendor provided ADP data file.
Verify LBAF0 is in use.
Verify DUT only has one namespace created.
- If not from Factory:
Verify static fields of DUT namespace data match one to one with vendor provided ADP data file.
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
NSM-2
OCP_DCSSD_AdminCmds_NSManagement.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.0 requirements referenced by this script:
NVMe-AD-3, NSM-1/2
OCP_DCSSD_AdminCmds_TimeVerification.py
- This script will run the following tests:
NVMe Abort command
NVMe Get Feature
NVMe Set Feature
NVMe Identify
NVMe Get Log
NVMe Namespace Detach/Attach
NVMe Namespace Delete/Create
NVMe Firmware Download
NVMe Firmware Commit
Create/Delete IO Submission/Completion Queue
Verify each command completes within a given time limit
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
CTO-1
OCP_DCSSD_ContConfig_Arbitration.py
- This script will run the following tests:
Verify CAP.AMS=1b and CC.AMS=0b
Set number of Urgent queues > 0, restart controller, verify CC.AMS=1b
Set number of Urgent queues = 0, restart controller, verify CC.AMS=0b
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
NVMe-CFG-1
- set_cc_ams(dut, reg_bin_final)
Set CC.AMS value in CC register
- Parameters:
dut (XML_API) – Device object under test
reg_bin_final (int) – Integer value to set CC register to
- Return type:
None
- verify_cc_ams(dut, ams_val)
Verify CC.AMS=0 or 1
- Parameters:
dut (XML_API) – Device object under test
ams_val (int) – CC.AMS value to check (0 or 1)
- Return type:
None
- verify_cc_en_csts_rdy_0(dut, start_step)
Verify CC.EN=0 and CSTS.RDY=0
- Parameters:
dut (XML_API) – Device object under test
start_step (int) – Number of the first test step in the function
- Returns:
cc_reg
- Return type:
str
- verify_cc_en_csts_rdy_1(dut, start_step)
Verify CC.EN=1 and CSTS.RDY=1
- Parameters:
dut (XML_API) – Device object under test
start_step (int) – Number of the first test step in the function
- Return type:
None
OCP_DCSSD_ContConfig_EUI64_NGUID.py
- This script will run the following tests:
Verify Number of Namespaces (NN) >= number of valid NSIDs (from Identify with CNS=2h)
Verify EUI64 and NGUID are both non-zero for each active namespace
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
NVMe-CFG-7, NVMe-CFG-8
OCP_DCSSD_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.0 requirements referenced by this script:
NVMe-CFG-3
OCP_DCSSD_ContConfig_MDTS.py
- This script will run the following tests:
Verify MDTS >= 256KB
Verify NPWG and NOWS <= MDTS
Do Write commands with transfer size < MDTS, = MDTS and > MDTS
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
NVMe-CFG-2
OCP_DCSSD_ContConfig_ModelNumber.py
- This script will run the following tests:
Obtain model number from Identify Controller and verify it contains only ASCII characters
Pass/Fail: Script passes if all model number characters are ASCII
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
NVMe-CFG-4, LABL-11
OCP_DCSSD_ContConfig_Queues.py
- This script will run the following tests:
Verify SQES and CQES values
Verify CC.IOSQES and CC.IOCQES values
Verify CAP.MQES value
Create 64 queues with a queue depth of 1024
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
NVMe-CFG-5, NVMe-CFG-6
OCP_DCSSD_Endurance_Data.py
- This script will run the following tests:
Do GetLogPage for LID 2h and get values of Percentage Used and Data Units Written fields
Verify Percentage Used >= 100
Verify Data Units Written >= adapation parameter Total Bytes Written at EOL value
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
ENDUD-3
- get_smart_logpage_fields(dut, logpage_nsid)
Get log page field values
- Parameters:
dut (XML_API) – Device object under test
logpage_nsid (int) – NSID to use
- Returns:
Various fields
- Return type:
int
OCP_DCSSD_FWActHistory.py
- This script will run the following tests:
SMBUS Basic management command with Command Code 90, length 6
Read and write from/to registers
Get Log Page commands with LIDs 02h, 03h, and C2h
Set-Features with FID C1h
Firmware Commit Commands with actions 02h, and 03h
Firmware Download Command
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
FWUP-1, FWHST-LOG-1, FWHST-LOG-3, FWHST-LOG-4, MS-CONF-6
- commit_and_check(dut, timeout)
Send FW Commit Command and check register values :param dut: Device object under test :type dut: XML_API :param timeout: timeout value recorded from CAP.TO :type timeout: int
- Return type:
None
OCP_DCSSD_FWActHistory_EntryFormat.py
- This script will run the following tests:
Send MI Basic Management Command for Command Code 90 and Verify Firmware Update Flags
Issue Identify Controller and check Firmware Revision
Retrieve Current Firmware Slot with Get Log using LID 03h
Clear FW Update History
Do SMART Health Log (Controller Scope) and Record Power Cycles
Firmware Download/Commit
Record timestamp
Do Get Log with LID C2h, verify static fields
Verify previously recorded fields match fields in LID C2h
Clear FW Update History
Firmware Download/Commit
Do Get Log with LID C2h, verify Firmware Activation Count has incremented by 1
Clear FW Update History
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
FAHE-1/2/3/4/5/6/7/8/9/10/11/12/13, MS-CONF-6
OCP_DCSSD_FWActHistory_EntryFormat_Factory.py
- This script will run the following tests:
Get Log Page Command with LID = C2h
Parse all 20 FW Activation History Entries
Verify every entry is cleared to 0
Pass/Fail: Script passes if all Firmware Activation History Entry are cleared to 0x0
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
FAHE-4
OCP_DCSSD_FWActHistory_Factory.py
- This script will run the following tests:
Get Log Page Command with LID = C2h and record Valid Firmware Activation History Entries field
Verify value is 0 if factory state flag is set
Pass/Fail: Script passes if the Valid Firmware Activation History Entries field is cleared to 0x0
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
FWHST-LOG2
OCP_DCSSD_FWActHistory_LogPage_Format.py
- This script will run the following tests:
SMBUS Basic management command with Command Code 90, length 6
Read and write from/to registers
Get Log Page commands with LIDs 03h, and C2h
Set-Features with FID C1h
Firmware Commit Commands with actions 02h, and 03h
Firmware Download Command
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
FAHL-1, FAHL-2, FAHL-3, FAHL-4, FAHL-5, FAHL-6, FAHL-7, MS-CONF-6
OCP_DCSSD_FWSlotInfo_LogPage.py
- This script will run the following tests:
Send MI Basic Management Command for Command Code 90 and Verify Firmware Update Flags
Get firmware slot info from LID 3h
Get FRMW from Identify Controller and compare to number of firmware slots supported in adaptation parameters
Get firmware slot info from LID 3h
Download and commit the previous firmware image to the starting firmware slot
Verify FRS field for appropriate slot in LID 3h matches the previous firmware image
Verify current and next active firmware slots in LID 3h
Disable/enable controller
Verify current firmware slot in LID 3h
Repeat steps 4-9 for all supported firmware slots
Download and commit the current firmware image to the current firmware slot
Clear firmware update history (FID C1h) and verify it’s successful
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
STD-LOG-5, MS-CONF-6
- verify_slot(dut, timeout, start_fw_slot, PARAMS, prev_fw_fn)
Verifies that
- Parameters:
dut (XML_API) – Device object under test
timeout (int) – timeout value recorded from CAP.TO
start_fw_slot (int) – Initial FW slot being tested
PARAMS (dict) – Adaptation Parmeters
- Returns:
numd_flag
- Return type:
int
OCP_DCSSD_FWUpdate_NoDataLoss.py
- This script will run the following tests:
Get Log Page command with Log Page ID = 03h
Identify Namespace with CNS = 0 and NSID under test
Identify command with CNS = 1
Firmware Download command
Firmware Commit command
128KB Sequential Reads
128k Sequential Writes using QD 128 using data pattern 5A5A5A5Ah
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
FWUP-10, FWUP-2, MS-CONF-6
- download_commit(dut, prev_fw_fn, numd, alt_slot, start_step)
Display the value of a log page field, and if it’s a static value, verify it’s correct
- 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
- Return type:
None
OCP_DCSSD_FW_Update.py
- This script will run the following tests:
Verify FWUP-7 Partial
Verify FWUP-6, FWUP-4
Verify FWUP-3 Commit Action 0, FWUP-4
Verify FWUP-3 Commit Action 1, FWUP-4
Verify FWUP-3 Commit Action 2
Verify FWUP-3 Commit Action 3, FWUP-4, FWUP-7 Partial
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
FWUP-3/4/5/6/7, MS-CONF-6
OCP_DCSSD_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.0 requirements referenced by this script:
FFE1L-2
OCP_DCSSD_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_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.0 requirements referenced by this script:
FFE1S-2
OCP_DCSSD_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_FormFactor_IdlePower.py
- This script will run the following tests:
Verify NPSS >= 9
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.0 requirements referenced by this script:
PWR-1/6
OCP_DCSSD_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_FormFactor_PowerManagement.py
- This script will run the following tests:
Do SetFeaturesSave to set power state to the current power state in the loop
Do GetFeatures and verify saved and current feature value is the power state that was set previously
Power cycle the drive
Do GetFeatures and verify current feature value is the power state that was set previously
Repeat previous steps for each operational power state
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
PWR-1/2/5
OCP_DCSSD_IOCmds_ReadWriteFlushVWC.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.0 requirements referenced by this script:
NVMe-IO-1/3, GETF-2
- calc_difference(value1, value2)
- Args:
value1: Float value value2: Float value
- Returns:
Percentage change between values 1 and 2
FORMULA:
( value1 - value2 )—————————- * 100 = % diff( value1 + value 2 ) * 2
OCP_DCSSD_IOCmds_TimeVerification.py
- This script will run the following tests:
Run I/O profile for 1 hour
Verify no I/Os took longer than 8 seconds to complete
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
- check_io_test_status(dut, test_id)
Check I/O test status result
- Parameters:
dut (XML_API) – Device object under test
test_id (str) – I/O testname
- Returns:
io_test_flag – 0 = test failed, 1 = test didn’t fail
- Return type:
int
- get_sb_filter_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 for sb_filter
- Return type:
str
OCP_DCSSD_LogPage_CmdsSupportedEffects.py
- This script will run the following tests:
Do GetLogPage for LID 5h
Check UUID, CSE, CCC, NIC, NCC, LBCC, CSUPP field values for admin and I/O commands
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
STD-LOG-6
- LogPageCheckBitValue(cmd_dict, tag, bit_fieldname, exp_value)
Check value of a particular bit
- Parameters:
cmd_dict (dict) – Command dictionary to use
tag (str) – Bit field name
bit_fieldname (str) – Bit field abbreviation
exp_value (int) – Expected bit value
- Return type:
None
OCP_DCSSD_LogPage_ErrorInfo.py
- This script will run the following tests:
Get ELPE field
Do GetLogPage for LID 1h to get error count for each entry
Reset controller
Do IdentifyController
Do GetLogPage for LID 1h to get error count for each entry
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
STD-LOG-1
OCP_DCSSD_LogPage_SMART.py
- This script will run the following tests:
Do GetLogPage for LID 2h with different NSIDs
Check various field values
Wait 10 minutes and then power cycle the drive
Repeat steps 1-2
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, SLOG-1/4/5/10/11
- get_smart_logpage(dut, logpage_nsid)
Issue SMART log page command and return the data structure
- Parameters:
dut (XML_API) – Device object under test
logpage_nsid (int) – NSID to use
- Returns:
output_cmd
- Return type:
list
- smart_logpage_compare_field_values(data_struct1, data_struct2, start_byte, end_byte, tag, method)
Compare SMART log page field value between two data structures
- Parameters:
data_struct1 (list) – First data structure to compare
data_struct2 (list) – Second data structure to compare
start_byte (int) – Starting byte number in list
end_byte (int) – Ending byte number in list
tag (str) – Log page field name
method (int) – 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 second value to be one greater than the first)
- Return type:
None
- smart_logpage_field_value_is_zero(data_struct, start_byte, end_byte, tag, method)
Check if SMART log page field value is set to zero
- Parameters:
data_struct (list) – Data structure to check
start_byte (int) – Starting byte number in list
end_byte (int) – Ending byte number in list
tag (str) – Log page field name
method (int) – Testing method to use (1 = check single byte, 2 = check multiple bytes)
- Return type:
None
OCP_DCSSD_LogPage_SMARTCloudHealth_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.0 requirements referenced by this script:
SLOG-3, SMART-22/27/28
OCP_DCSSD_LogPage_SMARTCloudHealth_EnduranceEst.py
- This script will run the following tests:
Do GetLogPage for LID C0h and get Endurance Estimate field value
If endurance groups are suppoted, 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.0 requirements referenced by this script:
SMART-25
OCP_DCSSD_LogPage_SMARTCloudHealth_NUSE.py
- This script will run the following tests:
Do GetLogPage for LID C0h and Identify Namespace and verify NUSE field values are identical if only a single NS exists; otherwise report the values if multiple NS exist
Delete all NSIDs and create a single NS
Do GetLogPage for LID C0h and Identify Namespace and verify NUSE field values are identical
Attach NS and perform 128KB sequential writes for 10 minutes
Do GetLogPage for LID C0h and Identify Namespace and verify NUSE field values are identical and > 0
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
SMART-23
- get_nuse_values(dut, step_num)
Get NUSE value from LID C0h and Identify Namespace
- Parameters:
dut (XML_API) – Device object under test
step_num (int) – Step number from testplan for doing GetLogPage for LID C0h
- Returns:
lid_flag (int) – 0 = Get Log Page failed, 1 = Get Log Page passed
ident_flag (int) – 0 = Identify Namespace failed, 1 = Identify Namespace passed
field_value1 (int) – Field value
field_value2 (int) – NUSE value
OCP_DCSSD_LogPage_SMARTCloudHealth_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.0 requirements referenced by this script:
SMART-24
OCP_DCSSD_LogPage_SMARTCloudHealth_Persistence.py
- This script will run the following tests:
Do GetLogPage for LID C0h and verify various fields match expected fixed or reserved values
Check Throttling Status and Capacitor Health fields
Check Security Version field against parameterization data
Wait 10 minutes and then power cycle the drive
Verify fixed or reserved values are unchanged
Verify dynamic values are unchanged or have increased
Do controller reset and repeat steps 5-6
Do NSSR and repeat steps 5-6
Do FLR and repeat steps 5-6
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
SLOG-1/4/10, SMART-12/13/15/16/18-20/22/25-28
- check_csts_rdy(dut)
Verify CSTS.RDY=1 after reset or power cycle
- Parameters:
dut (XML_API) – Device object under test
- Return type:
None
- compare_field_value(field_name, field_value, field_value_expected)
Display the value of a log page field, and if it’s a static value, verify it’s correct
- Parameters:
field_name (str) – Name of log page field
field_value (int) – Value of log page field
field_value_expected (int) – Expected value of log page field
- Return type:
None
- display_value(field_name, field_value, ocp_ver=100)
Display the value of a log page field
- Parameters:
field_name (str) – Name of log page field
field_value (int) – Value of log page field
- Return type:
None
- verify_dynamic_fields(value_orig, value_new, field_name)
Verify dynamic field values either increased or didn’t change
- Parameters:
value_orig (int) – Field’s original value
value_new (int) – Field’s new value
field_name (str) – Name of log page field
- Return type:
None
- verify_static_fields(value_orig, value_new, field_name)
Verify static field values didn’t change
- Parameters:
value_orig (int) – Field’s original value
value_new (int) – Field’s new value
field_name (str) – Name of log page field
- Return type:
None
OCP_DCSSD_LogPage_SMARTCloudHealth_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.0 requirements referenced by this script:
SMART-22
OCP_DCSSD_LogPage_SMARTCloudHealth_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.0 requirements referenced by this script:
SMART-21
- verify_logpage_field(dut, lid, field_name, method)
Verify log page field value is correct
- Parameters:
dut (XML_API) – Device object under test
lid (int) – LID value
field_name (str) – Log page field name
method (int) – Whether to check if field value is 100% or not (0 = verify value is not 0, 1 = verify value is 0)
- Return type:
None
OCP_DCSSD_LogPage_SMARTCloudHealth_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.0 requirements referenced by this script:
SMART-1/2
- get_logpage_fields(dut, lid, field_name1, field_name2, print_msgs)
Verify log page field value is correct
- Parameters:
dut (XML_API) – Device object under test
lid (int) – LID value
field_name1 (str) – First log page field name
field_name2 (str) – Second log page field name
print_msgs (int) – 1 = print messages, 0 = don’t print messages
- Returns:
lid_flag (int) – 1 = pass, 0 = fail
logpage_field1 (int) – Physical Media Units Written value
logpage_field2 (int) – Physical Media Units Read value
OCP_DCSSD_LogPage_SMART_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
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.0 requirements referenced by this script:
STD-LOG-2, SLOG-3/5
- compare_values(field_name, field_value1, field_value2)
Compare field values before and after various testing
- Parameters:
field_name (str) – Field name
field_value1 (int) – Original field value
field_value2 (int) – New field value
- Return type:
None
- get_smart_logpage_fields(dut, logpage_nsid)
Get log page field values
- Parameters:
dut (XML_API) – Device object under test
logpage_nsid (int) – NSID to use
- Returns:
Various fields
- Return type:
int
OCP_DCSSD_LogPage_SMART_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.0 requirements referenced by this script:
STD-LOG-2, SLOG-5
OCP_DCSSD_LogPage_SMART_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.0 requirements referenced by this script:
STD-LOG-2, SLOG-5
- compare_fields(field_name, value_before, value_after)
Compare field values before and after I/O test
- Parameters:
field_name (str) – Field name
value_before (int) – Field value before I/O
value_after (int) – Field value after I/O
- Returns:
Various fields
- Return type:
list
- get_smart_logpage_fields(dut, logpage_nsid)
Get log page field values
- Parameters:
dut (XML_API) – Device object under test
logpage_nsid (int) – NSID to use
- Returns:
Various fields
- Return type:
list
OCP_DCSSD_NS_Support.py
- This script will run the following tests:
Issue Identify Controller, verify NN of of id-ctrl is >= 1.
Issue Identify Active NSID List, verify list contains only one entry.
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
SECTOR-3
OCP_DCSSD_PCIe_BootRequirements.py
- This script will run the following tests:
Read “Expansion ROM Base Address” register and verify that “Option ROM” is not included.
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
BOOT-2
OCP_DCSSD_PCIe_ErrorLogging.py
- This script will run the following tests:
Record PCIe Correctable Error Statuses from AERCAP + 10h register and verify sum is equal to PCIe Correctable Error Count of LID C0h
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
PCIERR-1/2/3/4/5/6/7/8/9/10/11/12/13/14/15/16
OCP_DCSSD_PCIe_LowPowerModes.py
- This script will run the following tests:
If Active State Power Management (ASPM) is supported, the default firmware state shall be disabled. Verify this by reading ASPMS and ASPMC.
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
LWPR-1
OCP_DCSSD_PCIe_MaxPayloadSize.py
- This script will run the following tests:
Verify PCI express Device Capabilities register (04h) max payload size
Verify PCI Express Link Status register (08h) max read request size through power cycle
Pass/Fail: Script passes if all tests pass
- Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
PCI-1
OCP_DCSSD_PCIe_TLPCompletionTimeout.py
- This script will run the following tests:
The TLP completion timeout is programmable to different supportable ranges by programming the timeout to a different subset range.
Disable the TLP completion timeout and verify that it was successful.
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
PCI-2/3/4
OCP_DCSSD_Reliability_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.0 requirements referenced by this script:
NVMe-CFG-3
OCP_DCSSD_Reliability_ShutdownNotificationStatus.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.0 requirements referenced by this script:
TTR-5, TTR-6
OCP_DCSSD_Reset_ContReset.py
- This script will run the following tests:
Execute controller reset
Verify AQA, ASQ, ACQ, CMBMSC and PMRMSC registers didn’t change
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
NVMeR-2
- CompareRegisters(reg_name, reg1, reg2, flag1, flag2, cont_reset, nvme_ver_cap=140)
Compare register values from before and after a reset
- Parameters:
reg_name (str) – Register name
reg1 (int) – First register value
reg2 (int) – Second register value
flag1 (int) – Flag value corresponding to the first register value
flag2 (int) – Flag value corresponding to the second register value
cont_reset (int) – 1 = controller reset was executed, 0 = controller disable was executed
nvme_ver_cap (int) – NVMe version supported by the controller for use with CAP register (default is v1.4.0)
- Return type:
None
- GetRegisterValue(dut, reg_name, reg_offset, num_bits)
Get register value and return it along with a pass/fail value
- Parameters:
dut (XML_API) – Device object under test
reg_name (str) – Register name
reg_offset (int) – Register offset
num_bits (int) – Register size (32 or 64)
- Returns:
reg_val, flag
- Return type:
list
- VerifyRegisterIsZero(reg_name, reg1, flag1)
Verify register value is set to zero
- Parameters:
reg_name (str) – Register name
reg1 (int) – Register value
flag1 (int) – Flag value corresponding to the register value
- Return type:
None
OCP_DCSSD_Reset_NSSR.py
- This script will run the following tests:
Execute NSSR
Pass/Fail: Script passes if NSSR is successful
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
NVMeR-1
- CompareRegisters(reg_name, reg1, reg2, flag1, flag2, nvme_ver_cap=140)
Compare register values from before and after a reset
- Parameters:
reg_name (str) – Register name
reg1 (int) – First register value
reg2 (int) – Second register value
flag1 (int) – Flag value corresponding to the first register value
flag2 (int) – Flag value corresponding to the second register value
nvme_ver_cap (int) – NVMe version supported by the controller for use with CAP register (default is v1.4.0)
- Return type:
None
- GetRegisterValue(dut, reg_name, pci, output_cmd, regex)
Get register value from the register dump that occurs during NSSR
- Parameters:
dut (XML_API) – Device object under test
reg_name (str) – Register name
pci (str) – PCI ID of DUT
output_cmd (str) – Output of NSSR command
regex (str) – Regular expression to extract register value from output_cmd
- Returns:
reg_val, flag
- Return type:
tuple
- GetRegisterValueBaseline(dut, reg_name, reg_offset, num_bits)
Get register value and return it along with a pass/fail value
- Parameters:
dut (XML_API) – Device object under test
reg_name (str) – Register name
reg_offset (int) – Register offset
num_bits (int) – Register size (32 or 64)
- Returns:
reg_val, flag
- Return type:
list
- VerifyRegisterIsZero(reg_name, reg1, flag1)
Verify register value is set to zero
- Parameters:
reg_name (str) – Register name
reg1 (int) – Register value
flag1 (int) – Flag value corresponding to the register value
- Return type:
None
OCP_DCSSD_SMBus_CmdCode00.py
- This script will run the following tests:
Get MI Basic subsystem management data structure command code 0 and verify it returns correct info
Pass/Fail: Script passes if all info is correct
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
SMBUS-1/2/3
OCP_DCSSD_SMBus_CmdCode00_255.py
- This script will run the following tests:
Get MI Basic subsystem management data structure with offset 0 and length 154 bytes
Get MI Basic subsystem management data structure with offset 154 and length 102 bytes
Verify various fields return correct info
Pass/Fail: Script passes if all info is correct
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
SMBUS-1/2/3/5/6
- check_basic_mgmt_value(output_cmd, field_name, field_name_descr, exp_value)
Verify a field value is correct
- Parameters:
output_cmd (dict) – Data structure to check
field_name (str) – Name of parameter in data structure to check
field_name_descr (str) – Name of parameter to print in the report
exp_value (int) – Expected value of parameter
- Return type:
None
- check_cmdcode_154_167(output_cmd, field_name, field_name_descr, exp_value)
Check field value and return flag value based on success/failure
- Parameters:
output_cmd (dict) – Data structure to check
field_name (str) – Name of parameter in data structure to check
field_name_descr (str) – Name of parameter to print in the report
exp_value (int) – Expected value of parameter
- Return type:
Flag value (1 = passed, 0 = failed)
OCP_DCSSD_SMBus_CmdCode08.py
- This script will run the following tests:
Get MI Basic subsystem management data structure command code 8 and verify it returns correct info
Pass/Fail: Script passes if all info is correct
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
SMBUS-1/2/3
OCP_DCSSD_SMBus_CmdCode242.py
- This script will run the following tests:
Get MI Basic subsystem management data structure command code 242 and verify it returns correct info
Pass/Fail: Script passes if all info is correct
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
SMBUS-1/2/3/5
- check_basic_mgmt_value(output_cmd, field_name, field_name_descr, exp_value)
Verify a field value is correct
- Parameters:
output_cmd (dict) – Data structure to check
field_name (str) – Name of parameter in data structure to check
field_name_descr (str) – Name of parameter to print in the report
exp_value (int) – Expected value of parameter
- Return type:
None
OCP_DCSSD_SMBus_CmdCode248.py
- This script will run the following tests:
Get MI Basic subsystem management data structure command code 248 and verify it returns correct info
Pass/Fail: Script passes if all info is correct
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
SMBUS-1/2/3
- check_basic_mgmt_value(output_cmd, field_name, field_name_descr, exp_value)
Verify a field value is correct
- Parameters:
output_cmd (dict) – Data structure to check
field_name (str) – Name of parameter in data structure to check
field_name_descr (str) – Name of parameter to print in the report
exp_value (int) – Expected value of parameter
- Return type:
None
OCP_DCSSD_SMBus_CmdCode32.py
- This script will run the following tests:
Get MI Basic subsystem management data structure command code 32 and verify it returns correct info
Pass/Fail: Script passes if all info is correct
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
SMBUS-1/2/3
OCP_DCSSD_SMBus_CmdCode50.py
- This script will run the following tests:
Get MI Basic subsystem management data structure command code 50 and verify it returns correct info
Pass/Fail: Script passes if all info is correct
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
SMBUS-1/2/3
OCP_DCSSD_SMBus_CmdCode90.py
- This script will run the following tests:
Get MI Basic subsystem management data structure command code 90 and verify it returns correct info
Pass/Fail: Script passes if all info is correct
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
SMBUS-1/2/3/4
OCP_DCSSD_SMBus_CmdCode96.py
- This script will run the following tests:
Get MI Basic subsystem management data structure command code 96 and verify it returns correct info
Pass/Fail: Script passes if all info is correct
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
SMBUS-1/2/3
OCP_DCSSD_SMBus_DataTTRVerify.py
- This script will run the following tests:
Get timestamp
Do a power cycle
Poll MI Basic subsystem management data structure command code 0 until it’s successful
Get timestamp
Verify MI Basic subsystem management data structure command code 0 info is correct
Verify difference between timestamps is within CAP.TO
Repeat steps 1-6 using controller reset
Repeat steps 1-6 using NSSR
Repeat steps 1-6 using FLR
Pass/Fail: Script passes if all info is correct
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
SMBUS-1/2/3/4/7
- basic_mgmt_status_during_reset(dut, mi_dut, step_num, mi_ver, cap_to_secs)
Do Basic Management Status command during a reset and verify it finished within CAP.TO
- verify_basic_mgmt_status_output(dut, mi_output_cmd, mi_ver, power_cycle_flag)
Do GetFeatures with SEL value and verify returned info is correct
- Parameters:
dut (XML_API) – Device object under test
mi_output_cmd (dict) – Output of MI command
mi_ver (int) – MI version supported by the controller
power_cycle_flag (int) – 1 = power cycle was executed, 0 = other reset was executed
- Return type:
None
OCP_DCSSD_SMBus_FW_Update.py
- This script will run the following tests:
Verify disabling Firmware Update using Basic Management SMBus Block Write command and verifying using SMBus Read Byte command.
Verify enabling Firmware Update using the SMBus Write Byte protocol
Pass/Fail: Script passes if all info is correct
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
SMBUS-1/3/4/5/6/7
OCP_DCSSD_Sector_Size.py
- This script will run the following tests:
Check for LBA Formats with LBADS fields set to indicate support for 512 and 4096 bytes.
Format DUT for 4096 byte LBA size and check Identify Namespace reports used LBA Format in FLBAS.
Format DUT for 512 byte LBA size and check Identify Namespace reports used LBA Format in FLBAS.
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
SECTOR-4, MS-CONF-1/2
OCP_DCSSD_SecureBoot_UnsecuredDrive.py
- This script will run the following tests:
Verify firmware update fails and DUT firmware remains unchanged with a signed firmware image on an unsecure drive.
Verify firmware update passes and DUT firmware changes with an unsigned firmware image on an unsecured drive.
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
SEC-1/5
- check_c2_fw_rev(log_page, expected_value, skip_flag)
Check latest FAHE of log page C2h for expected firmware revision.
- Parameters:
log_page (Dict) – C2h Log Page
expected_value (String) – Firmware Revision expected to be found in latest FAHE
skip_flag (int) – Flag value
- Returns:
Firmware Activation Count (int)
skip_flag (int)
OCP_DCSSD_Security_UnsuppCmds.py
- This script will run the following tests:
Do a generic command for every unsupported Admin and NVM command opocde in the table and verify “invalid command opcode” error is returned
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
SEC-19
- check_unsupp_cmd(dut, nvme_ver, ocp_ver, num_cmds_supp, cmds_supp, cmds_supp_len, range_start, range_end, admin_nvm_flag)
Verify unsupported command opcode returns INVALID_OPCODE error
- Parameters:
dut (XML_API) – Device object under test
nvme_ver (int) – NVMe version supported by the controller
ocp_ver (int) – OCP version supported by the controller
num_cmds_supp (int) – Value of NUM_OPT_ADM_CMDS_SUPPORTED or NUM_OPT_NVM_CMDS_SUPPORTED or NUM_VU_ADM_CMDS_SUPPORTED or NUM_VU_NVM_CMDS_SUPPORTED
cmds_supp (list) – List of OPT_ADM_CMD_OPCODES or OPT_NVM_CMD_OPCODES or VU_ADM_CMD_OPCODES or VU_NVM_CMD_OPCODES
cmds_supp_len (int) – Length of OPT_ADM_CMD_OPCODES or OPT_NVM_CMD_OPCODES or VU_ADM_CMD_OPCODES or VU_NVM_CMD_OPCODES
range_start (int) – First command opcode in range to test
range_end (int) – Last command opcode in range to test
admin_nvm_flag (int) – 0 = Admin command, 1 = NVM command
- Return type:
None
- print_cmds_supp_hex(param_name, cmds_supp_hex, cmds_supp_len_hex)
Print a hexadecimal list of controller-supported opcodes
- Parameters:
param_name (str) – Parameter name (e.g. OPT_ADM_CMD_OPCODES or OPT_NVM_CMD_OPCODES or VU_ADM_CMD_OPCODES or VU_NVM_CMD_OPCODES)
cmds_supp_hex (list) – List of OPT_ADM_CMD_OPCODES or OPT_NVM_CMD_OPCODES or VU_ADM_CMD_OPCODES or VU_NVM_CMD_OPCODES
cmds_supp_len_hex (int) – Length of OPT_ADM_CMD_OPCODES or OPT_NVM_CMD_OPCODES or VU_ADM_CMD_OPCODES or VU_NVM_CMD_OPCODES
- Return type:
None
OCP_DCSSD_Security_UnsuppFIDs.py
- This script will run the following tests:
Do SetFeatures and GetFeatures for every unsupported FID in the table and verify “invalid field in command” error is returned
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
SEC-19
- check_unsupp_fid(dut, nvme_ver, ocp_ver, num_fids_supp, fids_supp, fids_supp_len, range_start, range_end)
Verify unsupported FID returns INVALID_FIELD error
- Parameters:
dut (XML_API) – Device object under test
nvme_ver (int) – NVMe version supported by the controller
ocp_ver (int) – OCP version supported by the controller
num_fids_supp (int) – Value of NUM_OPT_FIDS_SUPPORTED or NUM_VU_FIDS_SUPPORTED
fids_supp (list) – List of OPT_FIDS_SUPPORTED or VU_FIDS_SUPPORTED
fids_supp_len (int) – Length of OPT_FIDS_SUPPORTED or VU_FIDS_SUPPORTED
range_start (int) – First FID in range to test
range_end (int) – Last FID in range to test
- Return type:
None
- print_fids_supp_hex(param_name, fids_supp_hex, fids_supp_len_hex)
Print a hexadecimal list of controller-supported FIDs
- Parameters:
param_name (str) – Parameter name (e.g. OPT_FIDS_SUPPORTED or VU_FIDS_SUPPORTED)
fids_supp_hex (list) – List of OPT_FIDS_SUPPORTED or VU_FIDS_SUPPORTED
fids_supp_len_hex (int) – Length of OPT_FIDS_SUPPORTED or VU_FIDS_SUPPORTED
- Return type:
None
OCP_DCSSD_Security_UnsuppLIDs.py
- This script will run the following tests:
Do GetLogPage for every unsupported LID in the table and verify “invalid log page” error is returned
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
SEC-19
- check_unsupp_lid(dut, nvme_ver, ocp_ver, num_lids_supp, lids_supp, lids_supp_len, range_start, range_end)
Verify unsupported LID returns INVALID_LOG_PAGE error
- Parameters:
dut (XML_API) – Device object under test
nvme_ver (int) – NVMe version supported by the controller
ocp_ver (int) – OCP version supported by the controller
num_lids_supp (int) – Value of NUM_OPT_LIDS_SUPPORTED or NUM_VU_LIDS_SUPPORTED
lids_supp (list) – List of OPT_LIDS_SUPPORTED or VU_LIDS_SUPPORTED
lids_supp_len (int) – Length of OPT_LIDS_SUPPORTED or VU_LIDS_SUPPORTED
range_start (int) – First LID in range to test
range_end (int) – Last LID in range to test
- Return type:
None
- print_lids_supp_hex(param_name, lids_supp_hex, lids_supp_len_hex)
Print a hexadecimal list of controller-supported LIDs
- Parameters:
param_name (str) – Parameter name (e.g. OPT_LIDS_SUPPORTED or VU_LIDS_SUPPORTED)
lids_supp_hex (list) – List of OPT_LIDS_SUPPORTED or VU_LIDS_SUPPORTED
lids_supp_len_hex (int) – Length of OPT_LIDS_SUPPORTED or VU_LIDS_SUPPORTED
- Return type:
None
OCP_DCSSD_SetGetFeatures_CPCIE.py
- This script will run the following tests:
Do GetLogPage for LID C0h and get PCIe Correctable Error Count field value
Issue Set Features to clear PCIe correctable error count
Verify the command was successful or that an INVALID_FIELD error was returned if the feature isn’t supported (at which point, exit the test)
Do GetLogPage for LID C0h and verify PCIe Correctable Error Count is zero
Power cycle the drive
Do GetLogPage for LID C0h and verify PCIe Correctable Error Count is zero
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
CPCIE-1-15, GETF-2
OCP_DCSSD_SetGetFeatures_ClearFW_UpdateHist.py
- This script will run the following tests:
Get Log Page commands with LIDs 03h and C2h
Set-Features with FID C1h
Firmware Commit Commands with action 03h
Power cycles
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
OCP CFUH-1 to OCP CFUH-15, GETF-2
OCP_DCSSD_SetGetFeatures_IEEE1667.py
- This script will run the following tests:
Check default state of IEEE1667 from Adaptation Parameter File
Disable/Enable IEEE1667 Silo, check from get feature that current state and saved state match
Check again after power cycle
Default state should match
Reverse state of IEEE1667 (Disable/Enable), check from get feature that current state and saved state match
Check again after power cycle
Default state should match
Pass/Fail: Script passes if all tests pass
Open Compute Project Datacenter NVMe SSD Spec v2.0 requirements referenced by this script:
S1667-1/2/3/4/5/6/7/8/9/10/11/12/13/14/15, GETF-1/2
OCP_DCSSD_SetGetFeatures_ROWTM.py
This script will run the following tests:
Issue Get Features with various SEL values and verify returned values
Issue Set Features to set write through mode
Issue Get Features with various SEL values and verify returned values
Power cycle the drive
Issue Get Features with various SEL values and verify returned values
Issue Set Features to set read only mode
Issue Get Features with various SEL values and verify returned values
Power cycle the drive
Issue Get Features with various SEL values and verify returned values
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-15, GROWTM-1-15, GETF-1/2
- get_feat_fid_c2(dut, step_num, sel_val, ocp_ver)
Do GetFeatures with SEL value and verify returned info is correct
- Parameters:
dut (XML_API) – Device object under test
step_num (int) – Step number from testplan
sel_val (int) – SEL value
ocp_ver (int) – OCP version supported by the controller
- Return type:
None
- set_feat_fid_c2(dut, dword11_val)
Do SetFeatures with Dword 11 value and verify it passed
- Parameters:
dut (XML_API) – Device object under test
dword11_val (hex) – Dword11 value
- Return type:
None
OCP_Library.py
This script contains common functions for use in OCP scripts
- calculate_numd(dut)
Calculate NUMD for Firmware Download based on id-ctrl FWUG field
- Parameters:
dut (XML_API) – Device object under test
- Returns:
numd (int)
numd_flag (int)
- check_fw_file_exists(fw_filename)
Checks to see if a firmware image file exists in /virtualun/firmware/nvme/
- Parameters:
fw_filename (str) – Firmware image filename to check
- Returns:
True or False
- Return type:
bool
- check_io_test_status(dut, test_id)
Check I/O test status result
- Parameters:
dut (XML_API) – Device object under test
test_id (str) – I/O testname
- Return type:
None
- check_mi_basic_bit_value(mi_output_cmd, tag, expected_value)
Check value of a particular bit
- Parameters:
mi_output_cmd (dict) – Output of MI command
tag (str) – Parameter name
expected_value (int) – Parameter expected value
- Return type:
None
- check_mi_basic_mgmt_support(mi_dut, num_mi_ports)
Determine if basic management is supported and return the bit value
- Parameters:
mi_dut (XML_API) – MI device object under test
num_mi_ports (int) – Number of MI ports supported by the device
- Returns:
basic_mgmt
- Return type:
int
- check_user_input(dut, script_name, question, msg_pass, msg_fail)
Ask user a question and wait for input. It will also check to see if SBExpress Manager is being used to run the script.
- Parameters:
dut (XML_API) – Device object under test
script_name (str) – Name of script being executed
question (str) – Question to ask the user
msg_pass (str) – Message to print if answer is yes
msg_fail (str) – Message to print if answer is no
- Returns:
gui_flag (int) – 1 = script executed from gui, 0 = script not executed from gui
answer_flag (int) – 1 = user answered “N”, 0 = user answered “Y”
- check_vdm_hardware_support(mi_dut)
Check to see if VDM hardware is present on the system and return a flag value reflecting this
- Parameters:
mi_dut (XML_API) – MI device object under test
- Returns:
vdm_hw_flag
- Return type:
int
- clear_io_test(dut, test_id)
Clear an I/O test
- Parameters:
dut (XML_API) – Device object under test
test_id (str) – I/O testname
- Return type:
None
- compare_csts_rdy_to_cap_timeout(csts_rdy_value, pci, num_lines_msgs, timeout)
Copy new lines in /var/log/messages to a new file, then verify transition to CSTS.RDY=0 is within CAP.TO Return a flag value based on the result of the comparison Call get_num_lines_var_log_messages() to get num_lines_msgs before calling this function Call get_cap_to() to get CAP.TO value before calling this function
- Parameters:
csts_rdy_value (int) – CSTS.RDY value to check (0 or 1)
pci (str) – PCI ID of the DUT
num_lines_msgs (int) – Number of lines in /var/log/messages from get_num_lines_var_log_messages()
timeout (int) – CAP.TO in seconds from get_cap_to()
- Returns:
continue_test_flag
- Return type:
int
- determine_flr_support(dut)
Determine if FLR is supported
- Parameters:
dut (XML_API) – The device from which to read the bits
- Returns:
PXDCAP bit 28 value
- Return type:
int
- determine_mi_support(dut, mi_slot, filename)
Determine if MI is supported or not on the controller and return the transport to use
- Parameters:
dut (XML_API) – Device object under test
mi_slot (int) – Slot number of dut
filename (os.path.basename() method) – Filename of calling script
- Returns:
mi_support (int)
mi_transport (str)
- determine_mi_transport(filename)
Return the MI transport to use
- Parameters:
filename (os.path.basename() method) – Filename of calling script
- Returns:
mi_transport
- Return type:
str
- disable_controller(dut)
Disable controller and return flag value based on outcome
- Parameters:
dut (XML_API) – Device object under test
- Returns:
disable_cont_flag – 1 = success, 0 = failure
- Return type:
int
- do_controller_reset(dut)
Reset controller and return flag value based on outcome
- Parameters:
dut (XML_API) – Device object under test
- Returns:
reset_cont_flag – 1 = success, 0 = failure
- Return type:
int
- do_flush_cmd(dut, error_code, method=1)
Execute a Flush command
- Parameters:
dut (XML_API) – Device object under test
error_code (str) – Expected error code to be returned
method (int) – 1 = expect command to pass, 2 = expect command to fail
- Return type:
None
- do_read_cmd(dut, num_blocks, error_code, method=1)
Execute a Read command
- Parameters:
dut (XML_API) – Device object under test
num_blocks (hex) – Number of LBAs per I/O
error_code (str) – Expected error code to be returned
method (int) – 1 = expect command to pass, 2 = expect command to fail
- Return type:
None
- do_write_cmd(dut, num_blocks, hex_data, error_code, method=1)
Execute a Write command
- Parameters:
dut (XML_API) – Device object under test
num_blocks (hex) – Number of LBAs per I/O
hex_data (str) – The data to write
error_code (str) – Expected error code to be returned
method (int) – 1 = expect command to pass, 2 = expect command to fail
- Return type:
None
- get_block_size(dut)
Get block size from proc and return it
- Parameters:
dut (XML_API) – Device object under test
- Returns:
block_size
- Return type:
int
- get_cap_to(dut)
Get CAP.TO value and return it (in seconds and microseconds)
- Parameters:
dut (XML_API) – Device object under test
- Returns:
cap_to_secs (int)
cap_to_usecs (int)
- get_cc_en(dut)
Get CC.EN value and return it
- Parameters:
dut (XML_API) – Device object under test
- Returns:
cc_reg_bit0
- Return type:
int
- get_ctratt_bit_value(dut, bit_num)
Get CTRATT bit value and return it
- Parameters:
dut (XML_API) – Device object under test
bit_num (int) – CTRATT bit number to check
- Returns:
ctratt_bit
- Return type:
int
- get_dataset_mgmt_limits(dut)
Get Dataset Management Ranges/Range Size/Size Limit (DMRL/DMRSL/DMSL) values
- Parameters:
dut (XML_API) – Device object under test
- Returns:
dmrl (int) – Dataset Management Ranges Limit (DMRL)
dmrsl (int) – Dataset Management Range Size Limit (DMRSL)
dmsl (int) – Dataset Management Size Limit (DMSL)
dsm_skip_flag (int) – 1 = Couldn’t get DSM limit values, 0 = Did get DSM limit values
- get_entire_logpage_ocp(dut, lid, logpage_nsid)
Get the entire OCP log page and return it, along with a flag value
- Parameters:
dut (XML_API) – Device object under test
lid (int) – LID value
logpage_nsid (int) – NSID to use
- Returns:
lid_flag (int)
output_cmd (dict)
- get_lpa_bit0(dut)
Get LPA bit 0 from Identify Controller
- Parameters:
dut (XML_API) – Device object under test
- Returns:
lpa_bit0
- Return type:
int
- get_max_blocks(dut, mdts, mdts_size)
Get maximum number of blocks supported and return it as a decimal and hex value; also return block size Call get_mdts() to get MDTS proc and size values before calling this function
- Parameters:
dut (XML_API) – Device object under test
mdts (int) – MDTS proc value determined from get_mdts()
mdts_size (int) – MDTS size value determined from get_mdts()
- Returns:
max_io_blocks (int)
max_io_blocks_hex (hex)
block_size (int)
- get_mdts(dut)
Get maximum number of I/O bytes supported (MDTS) and return it
- Parameters:
dut (XML_API) – Device object under test
- Returns:
mdts (int)
mdts_size (int)
- get_mi_version(mi_dut)
Get MI spec version supported by the controller and return its value and the number of supported ports
- Parameters:
mi_dut (XML_API) – MI device object under test
- Returns:
mi_ver (int)
num_mi_ports (int)
- get_num_lines_var_log_messages()
Get the current number of lines in /var/log/messages and return the value
- Parameters:
None
- Returns:
num_lines_msgs
- Return type:
int
- get_nvme_version(dut)
Get NVMe spec version supported by the controller and return its value
- Parameters:
dut (XML_API) – Device object under test
- Returns:
nvme_ver
- Return type:
int
- get_oacs_oncs_bit_value(dut, field, bit_num)
Get OACS/ONCS bit value and return it
- Parameters:
dut (XML_API) – Device object under test
field (str) – Either ‘OACS=’ or ‘ONCS=’
bit_num (int) – OACS/ONCS bit number to check
- Returns:
oacs_oncs_bit
- Return type:
int
- get_ocp_logpage_raw_bytes(dut, lid, logpage_nsid, txlen_val=200)
Issue OCP log page command using GetLogPage and return the raw hex data
- Parameters:
dut (XML_API) – Device object under test
lid (int) – LID value
logpage_nsid (int) – NSID to use
txlen_val (hex) – Number of bytes (in hex) to request from the log page
- Returns:
data_struct
- Return type:
list
- get_ocp_version(dut)
Get OCP spec version supported by the controller and return its value
- Parameters:
dut (XML_API) – Device object under test
- Returns:
ocp_ver
- Return type:
int
- get_one_field_from_logpage(dut, lid, field_name, logpage_nsid, method)
Get one field value from a non-OCP log page and return it, along with a flag value
- Parameters:
dut (XML_API) – Device object under test
lid (int) – LID value
field_name (str) – Log page field name
logpage_nsid (int) – NSID to use
method (int) – 1 = print error, 0 = print note
- Returns:
lid_flag (int)
logpage_field_value (int)
- get_one_field_from_logpage_ocp(dut, lid, field_name, logpage_nsid)
Get one field value from an OCP log page and return it, along with a flag value
- Parameters:
dut (XML_API) – Device object under test
lid (int) – LID value
field_name (str) – Log page field name
logpage_nsid (int) – NSID to use
- Returns:
lid_flag (int)
logpage_field_value (int)
- get_pci_id(slot)
Return the PCI ID of the DUT
- Parameters:
slot (int) – Slot number of device object under test
- Returns:
PCI ID if found
- Return type:
str
- get_slot(dut)
Return the slot number of the DUT
- Parameters:
dut (XML_API) – Device object under test
- Returns:
drive_slot
- Return type:
int
- get_smart_cloud_health_logpage_values(output_cmd)
Get SMART cloud health log page field values and return them
- Parameters:
output_cmd (dict) – Log page data structure
- Return type:
Various field values with appropriate types
- get_test_avg_latency(dut, test_id, tag)
Get TestLatency, TestReadLatency, and TestWriteLatency from an I/O test and return them
- Parameters:
dut (XML_API) – Device object under test
test_id (str) – I/O testname
tag (str) – Parameter name containing latency value (‘TestLatency’ or ‘TestReadLatency’ or ‘TestWriteLatency’)
- Returns:
value – Latency value in usec
- Return type:
int
- get_test_bytes_value(dut, test_id, tag, io_testtime)
Get MBs value from an I/O test and return it
- Parameters:
dut (XML_API) – Device object under test
test_id (str) – I/O testname
tag (str) – Parameter name containing IOs value (‘TestBytes’ or ‘TestReadBytes’ or ‘TestWriteBytes’)
io_testtime (int) – I/O test time length in seconds
- Returns:
value
- Return type:
float
- get_test_iops_value(dut, test_id, tag, io_testtime)
Get IOs value from an I/O test and return it
- Parameters:
dut (XML_API) – Device object under test
test_id (str) – I/O testname
tag (str) – Parameter name containing IOs value (‘TestIOs’ or ‘TestReadIOs’ or ‘TestWriteIOs’)
io_testtime (int) – I/O test time length in seconds
- Returns:
value
- Return type:
float
- is_gui_being_used(dut, script_name)
Check to see if SBExpress Manager is being used to run the script. This function is useful to call at the start of a manual intervention script when the initial steps aren’t a call to input().
- Parameters:
dut (XML_API) – Device object under test
script_name (str) – Name of script being executed
- Returns:
gui_flag – 1 = script executed from gui, 0 = script not executed from gui
- Return type:
int
- power_on_drive_to_recover(dut)
Attempts to power on a drive using HP_PWREN to recover it (like after a surprise power cycle if it fails, for example)
- Parameters:
dut (XML_API) – Device object under test
- Returns:
wait_cont – 0 = controller became ready, 1 = timeout was reached
- Return type:
int
- read_bits_return_reg_value(dut, offset=0, start=0, end=None, is_64=False, fail_type='error')
Read bits [start, end] from the controller property at offset
- Parameters:
dut (XML_API) – The device from which to read the bits
offset (int) – Hexadecimal offset to read from. MUST take form 0x.. or be equivalent decimal value
start (int) – 0-63. Starting bit of range to read
end (int) – 0-63. Ending bit of range to read. Optional
is_64 (boolean) – True = Call Read64Reg False = Call Read32Reg
fail_type (int or str) – Specifies the action to be taken if the reading the bits fails
- Returns:
int – Value of bits read, or None if read failed
str – Register value
- surprise_power_cycle(dut, fail_type='error')
Perform a surprise power cycle of a single or dual port device (this is a slightly modified version of power_cycle() from sanblaze_test_api_actions.py)
- Parameters:
dut (XML_API) – Device object under test
fail_type (str) – At which level to fail the test
- Return type:
None
- verify_cc_en(dut, cc_en, expected_value)
Verify CC.EN value is correct Call get_cc_en() to get CC.EN value before calling this function
- Parameters:
dut (XML_API) – Device object under test
cc_en (int) – CC.EN from get_cc_en()
expected_value (int) – Expected value of CC.EN (1 or 0)
- Return type:
None
- verify_reserved_bits_are_zero(data_struct, start_byte, end_byte, start_bit, end_bit)
Verify reserved field bits are all zero
- Parameters:
data_struct (list) – Data structure to check
start_byte (int) – Starting byte number in list
end_byte (int) – Ending byte number in list
start_bit (int) – Starting bit number in list
end_bit (int) – Ending bit number in list
- Return type:
None
- verify_reserved_bytes_are_zero(data_struct, start_byte, end_byte)
Verify reserved field bytes are all zero
- Parameters:
data_struct (list) – Data structure to check
start_byte (int) – Starting byte number in list
end_byte (int) – Ending byte number in list
- Return type:
None
- wait_ns_ready_read(dut, interval, loop_timeout, fail_type, msg)
Execute a Read command every X seconds in a loop and return the flag value
- Parameters:
dut (XML_API) – Device object under test
interval (int) – Do a read every “interval” seconds
loop_timeout (int) – Max amount of time to try the read in seconds
fail_type (int) – 0 = pass, 1 = note, 2 = warning, 3 = error, 4 = test
msg (str) – Message to print
- Returns:
read_flag
- Return type:
int