UNH-IOL Reservation 一致性测试用例【7】- 清除Reservation

Reservation 系列导航

UNH-IOL Reservation 一致性测试用例【1】- Reservation Report 命令验证
UNH-IOL Reservation 一致性测试用例【2】- Reservation注册
UNH-IOL Reservation 一致性测试用例【3】- 取消注册
UNH-IOL Reservation 一致性测试用例【4】- Reservation Acquire 验证
UNH-IOL Reservation 一致性测试用例【5】- Reservation Release
UNH-IOL Reservation 一致性测试用例【6】- 抢占 Reservation
UNH-IOL Reservation 一致性测试用例【7】- 清除Reservation
UNH-IOL Reservation 一致性测试用例【8】- 在不同 Reservation Types 下的命令行为
UNH-IOL Reservation 一致性测试用例【9】- Reservation Notification Log Page(LID 0x80)

Test 7.7 -- Clearing a Reservation (M, OF-FYI)

作为 Registrant 的 Host 可以通过执行一个 Reservation Release 命令来清除 reservation(强制解除对 namespace 的 reservation,并取消对所有 Registrants 的注册),其中 Reservation Release Action (RRELA) 字段设为 001b (Clear),Current Reservation Key (CRKEY) 字段设为 host 当前的 reservation key

清除 reservation 时,会发生以下原子操作:

  1. 释放 namespace 上的保留
  2. 所有 registrants 都从 namespace 中注销

Case 1: Basic Operation with Reservation Release Command (M, OF-FYI)

测试步骤

  1. 检查 Identify controller data structure(CNS 01) ONCS 字段确定 controller 是否支持 reservation
  2. 针对 NVMe Subsystem 里的每个 NVMe Controller:
    1. NVMe Host 向 Controller 发出 Set Features Host Identifier, 以便为该 Controller 注册一个 Host Identifier
    2. 对于 atttach 到该 Controller 的每个 active namespace:
      1. Host 发 Reservation Register 命令,Register Action (RREGA) 字段设为 000b (即. Register Reservation Key),在 New Reservation Key (NRKEY) 字段中向 namesapce 的 NVMe Controller 提供 reservation key,以使 host 成为该 namespace 的 registrant。
      2. Host 发出 Reservation Acquire 命令,将 Reservation Acquire Action (RACQA) 字段设为 000b (Acquire),向 Current Reservation Key (CRKEY) 字段提供当前的 reservation key,并将 Reservation Type (RTYPE) 字段设为支持的 reservation type,以便 host 在 namespace 获取该 reservation 类型的 reservation
      3. Host 发送 Reservation Release 命令来清除 reservation,其中 Reservation Release Action (RRELA) 字段设为 001b (Clear),Current Reservation Key (CRKEY) 字段设为 host 当前的 reservation key
      4. Host 向 Controller 发送 Reservation Report 命令。
        对所有 Reservation Controllers 执行 Reservation Release 命令,将 RRELA 字段设为 1(Clear)

预期结果

在 Reservation Report 完成后,检查 Reservation Status data structure, host 成功从该 namespace 取消注册,并不再持有 reservation

注意事项

在支持NVMe 2.0 或以上的版本的 driver 中,当要设置 Host Identifier 时,如果它在测试开始时是非零值,set feature 将被 abort,Status Code 为 Command Sequence Error

Case 2: Error Conditions (M, OF-FYI)

如果 CRKEY 值与 Host 向 namespace 注册时使用的 CRKEY 值不匹配,则应终止命令,状态为 Reservation Conflict。 Host 可通过将命令中的 Ignore Existing Key(IEKEY) 位置为 "1",在不考虑当前 reservation key 值的情况下清除 reservation。

果 Host 不是 Registrant,则应终止该命令,并显示 Reservation Conflict 状态。

测试步骤

  1. 检查 Identify controller data structure(CNS 01) ONCS 字段确定 controller 是否支持 reservation
  2. 针对 NVMe Subsystem 里的每个 NVMe Controller:
    1. NVMe Host 向 Controller 发出 Set Features Host Identifier, 以便为该 Controller 注册一个 Host Identifier
    2. 对于 atttach 到该 Controller 的每个 active namespace:
      1. Host 发送一个 Reservation Release 命令,Reservation Release Action (RRELA) 字段设为 001b (Clear),并提供一个随机的 reservation key 给 Current Reservation Key (CRKEY)。
      2. Host 发 Reservation Register 命令,Register Action (RREGA) 字段设为 000b (即. Register Reservation Key),在 New Reservation Key (NRKEY) 字段中向 namesapce 的 NVMe Controller 提供 reservation key,以使 host 成为该 namespace 的 registrant。
      3. Host 发送一个 Reservation Release 命令,Reservation Release Action (RRELA) 字段设为 001b (Clear),并提供一个不是 Host 当前的 reservation key 给 Current Reservation Key (CRKEY)。
      4. Host 向 Controller 发送 Reservation Report 命令。
      5. Host 发送一个 Reservation Release 命令,Reservation Release Action (RRELA) 字段设为 001b (Clear),提供一个不是 Host 当前的 reservation key 给 Current Reservation Key (CRKEY),将 IEKEY 置为 1。
      6. Host 向 Controller 发送 Reservation Report 命令。

预期结果

  1. 2.2.1 的 Reservation Release 命令失败,返回状态 Reservation Conflict
  2. 2.2.3 的 Reservation Release 命令失败,返回状态 Reservation Conflict
  3. 2.2.4 Reservation Report 返回的 Reservation Status data structure 表明:Host 依然是该 namespace 的 registrant
  4. 2.2.6 Reservation Report 返回的 Reservation Status data structure 表明:Host 不再是该 namespace 的 registrant,已成功取消注册

注意事项

  1. 在支持NVMe 2.0 或以上的版本的 driver 中,当要设置 Host Identifier 时,如果它在测试开始时是非零值,set feature 将被 abort,Status Code 为 Command Sequence Error
  2. 目前尚未确定进行此项检测的可靠方法。因此,这项测试不应纳入任何行业批准的一致性认定中。
相关推荐
小四的快乐生活7 小时前
Hive 存储管理测试用例设计指南
hive·hadoop·测试用例
MYZR119 小时前
车载中控:汽车的数字大脑与交互核心
汽车·核心板·ssd2351
格林威20 小时前
Baumer工业相机堡盟工业相机如何通过YoloV8深度学习模型和EasyOCR实现汽车牌照动态检测和识别(C#代码,UI界面版)
人工智能·深度学习·数码相机·yolo·c#·汽车·视觉检测
测试19981 天前
Web自动化测试:测试用例流程设计
自动化测试·软件测试·python·selenium·测试工具·职场和发展·测试用例
Teamhelper_AR1 天前
AR技术:重塑汽车制造的未来
汽车·ar·制造
旦莫2 天前
MTSC2025参会感悟:AI 驱动的测试用例生成
人工智能·python·测试开发·测试用例·ai测试·mtsc2025
@半良人3 天前
Deepseek+python自动生成禅道测试用例
开发语言·python·测试用例
3DVisionary3 天前
工业级蓝光三维扫描仪:助力汽车零部件高精度检测与质量提升
汽车·智能手表·汽车零部件检测·蓝光三维扫描技术·高精度测量·质量控制与优化·智能制造解决方案
元直数字电路验证3 天前
MOESI FSM的全路径测试用例
测试用例·moesi