Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dlpar_vscsi: get device node for lscfg #2762

Merged
merged 1 commit into from
Feb 15, 2024

Conversation

abdhaleegit
Copy link
Collaborator

lscfg -vl do not support device id input, so
get the node name for given device id to fix
device not found error

lscfg -vl do not support device id input, so
get the node name for given device id to fix
device not found error

Signed-off-by: Abdul Haleem <[email protected]>
@abdhaleegit
Copy link
Collaborator Author

Before fix

avocado run --max-parallel-tasks=1 /home/OpTest/avocado-fvt-wrapper/tests/avocado-misc-tests/io/disk/dlpar_vscsi.py -m /tmp/mux/io_vscsi_dlpar_vscsi_dlpar_vscsi.yaml --force-job-id cf8f00c34cf8678a88d05e55b8ce8e21196a4135  --job-results-dir /home/OpTest/avocado-fvt-wrapper/results
JOB ID     : cf8f00c34cf8678a88d05e55b8ce8e21196a4135
JOB LOG    : /home/OpTest/avocado-fvt-wrapper/results/job-2024-02-14T19.33-cf8f00c/job.log
 (1/1) /home/OpTest/avocado-fvt-wrapper/tests/avocado-misc-tests/io/disk/dlpar_vscsi.py:DlparTest.test_dlpar;run-num_of_dlpar-e61e: STARTED
 (1/1) /home/OpTest/avocado-fvt-wrapper/tests/avocado-misc-tests/io/disk/dlpar_vscsi.py:DlparTest.test_dlpar;run-num_of_dlpar-e61e:  ERROR: Command 'lscfg -l /dev/disk/by-id/scsi-SAIX_VDASD_00fbecf500004b0000000185a73de2a2.2' failed.\nstdout: b'Device /dev/disk/by-id/scsi-SAIX_VDASD_00fbecf500004b0000000185a73de2a2.2 not found.\n'\nstderr: b''\nadditional_info: None (0.21 s)
RESULTS    : PASS 0 | ERROR 1 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB HTML   : /home/OpTest/avocado-fvt-wrapper/results/job-2024-02-14T19.33-cf8f00c/results.html

After fix

avocado run --max-parallel-tasks=1  dlpar_vscsi.py -m dlpar_vscsi.py.data/dlpar_vscsi.yaml 
JOB ID     : a138b213274438489a577b9adaaca5319e352179
JOB LOG    : /home/OpTest/avocado-fvt-wrapper/results/job-2024-02-14T20.42-a138b21/job.log
 (1/1) dlpar_vscsi.py:DlparTest.test_dlpar;run-5a7a: STARTED
 (1/1) dlpar_vscsi.py:DlparTest.test_dlpar;run-5a7a: PASS (3.51 s)
RESULTS    : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB HTML   : /home/OpTest/avocado-fvt-wrapper/results/job-2024-02-14T20.42-a138b21/results.html
JOB TIME   : 20.55 s

@abdhaleegit abdhaleegit self-assigned this Feb 14, 2024
@@ -34,7 +35,8 @@ def setUp(self):
Gather necessary test inputs.
'''
device = self.params.get('disk', default=None)
self.disk = disk.get_absolute_disk_path(device)
dev_path = disk.get_absolute_disk_path(device)
self.disk = os.path.basename(os.path.realpath(dev_path))
Copy link
Collaborator

Choose a reason for hiding this comment

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

@abdhaleegit what are we trying to achieve here,


>>> disk.get_absolute_disk_path('/dev/sda')
'/dev/sda'
>>> 
>>> disk.get_absolute_disk_path('sda')
'/dev/sda'
>>> 
>>> os.path.basename(os.path.realpath('/dev/sda'))
'sda'
>>> 
# lsscsi 
[0:0:1:0]    disk    AIX      VDASD            0001  /dev/sda 
[2:0:1:0]    disk    AIX      VDASD            0001  /dev/sdb 

====>>> above two disks are vscsi disks

[root@sys avocado-fvt-wrapper]# lsblk -l sda
lsblk: sda: not a block device
[root@sys avocado-fvt-wrapper]# 
[root@sys avocado-fvt-wrapper]# lsblk -l /dev/sda
NAME                          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda                             8:0    0   70G  0 disk 
sda1                            8:1    0    4M  0 part 
sda2                            8:2    0    1G  0 part /boot
sda3                            8:3    0   69G  0 part 
rhel_sys-root 253:0    0 41.7G  0 lvm  /
rhel_sys-swap 253:1    0    7G  0 lvm  [SWAP]
rhel_sys-home 253:2    0 20.3G  0 lvm  /home
[root@sys avocado-fvt-wrapper]#

I feel the older way itself working fine.
can you please re-check on this

Copy link
Collaborator Author

@abdhaleegit abdhaleegit Feb 15, 2024

Choose a reason for hiding this comment

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

@Naresh-ibm my input here is /dev/disk/by-id/scsi-SAIX_VDASD_00fbecf500004b0000000185a73de2a2.2 so the test were failing

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

all our input to test are device by id for persistent device name

Copy link
Collaborator

@Naresh-ibm Naresh-ibm left a comment

Choose a reason for hiding this comment

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

LGTM

@abdhaleegit abdhaleegit merged commit 6c24b41 into avocado-framework-tests:master Feb 15, 2024
2 checks passed
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.

2 participants