Bug 1396629

Summary: Refactor retrace-server so it is easier to test and modify kernel version detection code
Product: [Fedora] Fedora EPEL Reporter: Dave Wysochanski <dwysocha>
Component: retrace-serverAssignee: Dave Wysochanski <dwysocha>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: low    
Version: epel7CC: abrt-devel-list, jberan, michal.toman, mmarusak
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-05 18:43:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
python test program to rework get_kernel_version none

Description Dave Wysochanski 2016-11-18 18:40:38 UTC
Description of problem:
Today the only way to test kernel version detection is by submitting a file to retrace-server.  It would be good to factor this piece of code out so we can more easily test and modify it.


Version-Release number of selected component (if applicable):
retrace-server-1.16-1.el6.noarch

Additional info:

Comment 1 Matej Marušák 2017-01-19 13:39:39 UTC
If I understood you correctly, you are talking about this function https://github.com/abrt/retrace-server/blob/master/src/retrace/retrace.py#L481. Am I right? 
How do yo imagine this detection would work? Could you give us some ideas?

Comment 2 Dave Wysochanski 2017-01-24 21:53:20 UTC
(In reply to Matej Marušák from comment #1)
> If I understood you correctly, you are talking about this function
> https://github.com/abrt/retrace-server/blob/master/src/retrace/retrace.
> py#L481. Am I right? 

Yes that is the main function.

> How do yo imagine this detection would work? Could you give us some ideas?

It could be the case that we could re-do one of the commandline tools to add this functionality, or possibly add a new one that does not necessarily have to be user visible in a non-test environment.  It may be ok if there was some way to just run this over a number of vmcore files without a command tool (for example, if we ran python manually, etc).  Goal is mainly to be able to test it with a number of vmcores.

Offhand I don't recall a need to modify the detection code so I'm marking this as a "low" priority for now.  Once the testing infrastructure is there (bug 129078) it may be nice to try to attempt this but I'm not sure how invasive it will be.

Comment 3 Dave Wysochanski 2018-02-05 18:43:28 UTC
I don't think this is too important anymore.  For now when reworking get_kernel_version I just pulled this code out into a separate python test program and ran it against a ton of vmcores.  I compared the existing 'kernelver' file with the new code and then I could see any differences.

There is another bit of code for the arch if we ever rework that but hopefully a similar thing can be done.

Comment 4 Dave Wysochanski 2018-02-05 18:45:02 UTC
Created attachment 1391686 [details]
python test program to rework get_kernel_version