Bug 1148174 - beaker-system-scan fails when /boot is on a mapped block device
Summary: beaker-system-scan fails when /boot is on a mapped block device
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: tests
Version: 0.18
Hardware: All
OS: All
unspecified
high
Target Milestone: 19.0
Assignee: Amit Saha
QA Contact: Amit Saha
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-30 20:33 UTC by Arthur Benoit
Modified: 2018-02-06 00:41 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-10-27 22:56:42 UTC
Embargoed:


Attachments (Terms of Use)

Comment 2 Amit Saha 2014-10-07 00:19:54 UTC
The reason why it is breaking now and not before was that we were ignoring the exit code of "getdriver.sh". After a recent commit (https://git.beaker-project.org/cgit/beaker-system-scan/commit/?id=c8a349ffb19390842380404288535178592e629e), where we actually check the status code of the exited process, this becomes visible.

The real reason is:

The boot disk on this system is:

/dev/mapper/mpathap1 on /boot type ext4 (rw)

with the present code, "getdriver.sh" is called as follows:

./getdriver.sh 'mapper!mpathap1'
# [root@dell-pec6105-01 beaker-system-scan]# echo $?
1

which is a non-0 exit code and hence the traceback. 

The code has couple of issues, one of which I tried to fix here: http://gerrit.beaker-project.org/#/c/3346/3

Comment 3 Amit Saha 2014-10-07 01:44:12 UTC
(In reply to Amit Saha from comment #2)
> The reason why it is breaking now and not before was that we were ignoring
> the exit code of "getdriver.sh". After a recent commit
> (https://git.beaker-project.org/cgit/beaker-system-scan/commit/
> ?id=c8a349ffb19390842380404288535178592e629e), where we actually check the
> status code of the exited process, this becomes visible.
> 
> The real reason is:
> 
> The boot disk on this system is:
> 
> /dev/mapper/mpathap1 on /boot type ext4 (rw)
> 
> with the present code, "getdriver.sh" is called as follows:
> 
> ./getdriver.sh 'mapper!mpathap1'
> # [root@dell-pec6105-01 beaker-system-scan]# echo $?
> 1
> 
> which is a non-0 exit code and hence the traceback. 

So the right thing to do here I think is:

Find the boot disk:

# device=mount | grep "on /boot" | awk '{print $1}'

Find the dm device:

[root@dell-pec6105-01 block]# readlink /dev/mapper/mpathap1
../dm-1

Get the physical devices:

[root@dell-pec6105-01 block]# ls /sys/block/dm-1/slaves/
dm-0
[root@dell-pec6105-01 block]# ls /sys/block/dm-0/slaves/
sda  sdb  sdc  sdd
[root@dell-pec6105-01 block]# /root/beaker-system-scan/getdriver.sh sda
sd
lpfc
lpfc
[root@dell-pec6105-01 block]# /root/beaker-system-scan/getdriver.sh sdb
sd
lpfc

..
 and so on.

I believe that is the job of getdriver.sh to take care of that.

Comment 4 Dan Callaghan 2014-10-09 05:43:01 UTC
From looking at getdriver.sh it's not clear what the best way to make it give a good result is. It's also not clear in this case (multipath dm block device) what the desired answer is anyway. And we're only using it to populate the BOOTDISK key-value.

So let's just change it back to ignoring failures from getdriver.sh when handling bootdisk.

Comment 5 Amit Saha 2014-10-09 06:18:32 UTC
> 
> So let's just change it back to ignoring failures from getdriver.sh when
> handling bootdisk.


http://gerrit.beaker-project.org/#/c/3379/

Comment 6 Dan Callaghan 2014-10-16 05:39:19 UTC
Amit, can you please prepare a new build of beaker-system-scan with this fix?

Comment 9 Amit Saha 2014-10-27 09:36:24 UTC
I have requested a loan for the system as well, so I can give it a shot too. 

Arthur: please feel free to go ahead and give it a try and let us know.


Note You need to log in before you can comment on or make changes to this bug.