Skip to content

Conversation

@yizhanglinux
Copy link
Contributor

No description provided.

@yizhanglinux yizhanglinux changed the title add new case for NVMe namespace management [draft]add new case for NVMe namespace management May 9, 2025
@yizhanglinux yizhanglinux force-pushed the ns-mgt branch 3 times, most recently from 70723e2 to 0e74c50 Compare May 11, 2025 05:53
tests/nvme/064 Outdated
nn=$(nvme id-ctrl /dev/"$ctrl_dev" | grep ^nn | awk '{ print $3}')
tnvmcap=$(nvme id-ctrl /dev/"$ctrl_dev" | grep tnvmcap | awk '{ print $3}')
lbaf=$(nvme id-ns "$TEST_DEV" | grep 'in use' | awk '{ print $2}')
lbads=$(nvme id-ns -H "$TEST_DEV" | grep 'in use' | awk '{ print $12}')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use --verbose instead of the old --human-readable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, to check the Data Size, the --verbose cannot output that value of 512[1], it only output "ds":9[2], not sure if it's something we can improve on nvme-cli.
[1]
LBA Format 1 : Metadata Size: 8 bytes - Data Size: 512 bytes - Relative Performance: 0x3 Degraded (in use)
[2]

 "lbafs":[
    {
      "ms":0,
      "ds":9,
      "rp":1
    },
    {
      "ms":8,
      "ds":9,
      "rp":3
    },
    {
      "ms":0,
      "ds":12,
      "rp":0
    },
    {
      "ms":8,
      "ds":12,
      "rp":2
    },
    {
      "ms":64,
      "ds":12,
      "rp":3
    }
  ],

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely something we can improve in nvme-cli. I understand that the verbose json output is lacking some information which is shown with stdout and verbose? Anyway, would you mind to open a bug report in nvme-cli so we don't forget about it. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I've filed below issue to track it.
linux-nvme/nvme-cli#2811

@igaw
Copy link
Contributor

igaw commented May 12, 2025

Generally I would prefer if we would start using the JSON output instead the STDOUT of nvme-cli. The JSON output is there for machine parsing.

This would mean we add dependency on something like jq but IMO this would be better than continuing with the screen scraping.

Signed-off-by: Yi Zhang <yi.zhang@redhat.com>
@yizhanglinux
Copy link
Contributor Author

Generally I would prefer if we would start using the JSON output instead the STDOUT of nvme-cli. The JSON output is there for machine parsing.

This would mean we add dependency on something like jq but IMO this would be better than continuing with the screen scraping.

Thanks, just update to get the value from json ouput.

@kawasaki
Copy link
Collaborator

kawasaki commented May 13, 2025

Thanks for the patch. I have two comments:

  1. I wanted to confirm the motivation to add this test case . Does it aim to test the kernel code? Or nvme devices? If it aim to cover kernel code, which part of the kernel code, or which feature of the kernel to cover? (Namespace detection feature?)

  2. Can we ensure that the test target device status does not change before and after the test case run? For example, I wonder what will happen when multiple namespaces belong to a single controller, and one of the namespaces is the test target device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants