Bug 986157 - Test suite development for lshw and making lshw ready for it
Test suite development for lshw and making lshw ready for it
Status: CLOSED NOTABUG
Product: Beaker
Classification: Community
Component: inventory (Show other bugs)
develop
Unspecified Unspecified
unspecified Severity unspecified (vote)
: ---
: ---
Assigned To: beaker-dev-list
tools-bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-19 01:47 EDT by Amit Saha
Modified: 2018-02-05 19:41 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-08-08 06:06:46 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Amit Saha 2013-07-19 01:47:02 EDT
Description of problem:

We now have a fork of 'lshw' at [1]. There are absolutely no tests in 'lshw' of any kind. As we start making 'lshw' ready for our inventory task, it makes sense to have a test suite which tests its functionality on different hardware.

[1] http://git.beaker-project.org/cgit/lshw/


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

One direction (also considering how we use 'lshw') is to present a particular hardware configuration to 'lshw' and match it's XML output to what is expected - thus helping prevent regressions, for one thing. 

Now, coming to the problem of how to provide this hardware configuration as input to 'lshw': 

A majority of lshw's functionality is implemented by directly reading information from procfs and sysfs. (However, functionalities such as those dealing with storage devices involve ioctl() calls). For at least the functionalities which read their info from the procfs and sysfs file systems, we can adopt an approach similar to utilities such as those part of the 'util-linux' package [2]. One of them, 'lscpu' (for example) has a switch '-s' to read a system snapshot instead of reading directly from the "live" system. 

A problem here is that the various files being read all hard coded in lshw. So, we would first need to make lshw ready for reading snapshots - adding a switch and perhaps have some conditionals using macros around all the places where it attempts to read from the system..or something like that which results in the minimum changes to the existing code.

[2] https://www.kernel.org/pub/linux/utils/util-linux/
Comment 2 Dan Callaghan 2013-08-08 06:06:46 EDT
This isn't a Beaker bug, we will track this effort elsewhere...

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