Skip to content

Commit

Permalink
tests: make sure nvmetcli and nvme-cli are up to date
Browse files Browse the repository at this point in the history
Otherwise jobs end up with the following failure:

```
2024-06-25T14:22:18.659 INFO:teuthology.orchestra.run.smithi098.stderr:Failed to write to /dev/nvme-fabrics: Invalid argument
```

Also, the output of nvme list has changed so we have to update
qa/tasks/nvme_loop.py accordingly.

Fixes: https://tracker.ceph.com/issues/66707

Signed-off-by: Guillaume Abrioux <[email protected]>
  • Loading branch information
guits committed Jun 27, 2024
1 parent 6fc2885 commit d707c41
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
4 changes: 4 additions & 0 deletions qa/distros/container-hosts/centos_9.stream.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ overrides:
allowlist:
- scontext=system_u:system_r:logrotate_t:s0

tasks:
- pexec:
all:
- sudo dnf install nvmetcli nvme-cli -y
2 changes: 1 addition & 1 deletion qa/distros/container-hosts/centos_9.stream_runc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ overrides:
tasks:
- pexec:
all:
- sudo dnf install runc -y
- sudo dnf install runc nvmetcli nvme-cli -y
- sudo sed -i 's/^#runtime = "crun"/runtime = "runc"/g' /usr/share/containers/containers.conf
- sudo sed -i 's/runtime = "crun"/#runtime = "crun"/g' /usr/share/containers/containers.conf
30 changes: 27 additions & 3 deletions qa/tasks/nvme_loop.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import contextlib
import logging
import json

from io import StringIO
from teuthology import misc as teuthology
Expand Down Expand Up @@ -66,10 +67,33 @@ def task(ctx, config):

with contextutil.safe_while(sleep=1, tries=15) as proceed:
while proceed():
p = remote.run(args=['sudo', 'nvme', 'list'], stdout=StringIO())
p = remote.run(args=['sudo', 'nvme', 'list', '-o', 'json'], stdout=StringIO())
new_devs = []
for line in p.stdout.getvalue().splitlines():
dev, _, vendor = line.split()[0:3]
# `nvme list -o json` will return the following output:
'''{
"Devices" : [
{
"DevicePath" : "/dev/nvme0n1",
"Firmware" : "8DV101H0",
"Index" : 0,
"ModelNumber" : "INTEL SSDPEDMD400G4",
"ProductName" : "Unknown Device",
"SerialNumber" : "PHFT620400WB400BGN"
},
{
"DevicePath" : "/dev/nvme1n1",
"Firmware" : "5.15.0-1",
"Index" : 1,
"ModelNumber" : "Linux",
"ProductName" : "Unknown Device",
"SerialNumber" : "7672ce414766ba44a8e5"
}
]
}'''
nvme_list = json.loads(p.stdout.getvalue())
for device in nvme_list['Devices']:
dev = device['DevicePath']
vendor = device['ModelNumber']
if dev.startswith('/dev/') and vendor == 'Linux':
new_devs.append(dev)
log.info(f'new_devs {new_devs}')
Expand Down

0 comments on commit d707c41

Please sign in to comment.