-
Notifications
You must be signed in to change notification settings - Fork 92
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
changed command for redhat family to modprobe to properly evaluate test #10
changed command for redhat family to modprobe to properly evaluate test #10
Conversation
@crashdummymch Thank you very much, once you've rebased, this should turn green. |
Is this fixing #4? |
…into linux_command_modprobe
this fixes #4 |
libraries/linux_module.rb
Outdated
@@ -59,7 +59,7 @@ def version | |||
|
|||
def command | |||
modinfo_cmd = if inspec.os.redhat? || inspec.os.name == 'fedora' | |||
"/sbin/modinfo -n -v #{@module}" | |||
"/sbin/modprobe -n -v #{@module} | awk '{$1=$1;print}'" | |||
else | |||
"modinfo -n -v #{@module}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that we need to use modprobe here too, even on ubuntu the -v flag is not available:
root@9d282e26d262:/# modinfo -h
Usage:
modinfo [options] filename [args]
Options:
-a, --author Print only 'author'
-d, --description Print only 'description'
-l, --license Print only 'license'
-p, --parameters Print only 'parm'
-n, --filename Print only 'filename'
-0, --null Use \0 instead of \n
-F, --field=FIELD Print only provided FIELD
-k, --set-version=VERSION Use VERSION instead of `uname -r`
-b, --basedir=DIR Use DIR as filesystem root for /lib/modules
-V, --version Show version
-h, --help Show this help
In addition, /sbin/modprobe
works on ubuntu too, therefore I do not think we need to distinguish between redhat and other linux platforms here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed condition logic so that all linux systems utilize modprobe for detecting module status
…into linux_command_modprobe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed linux distribution specific command and replaced with modprobe
libraries/linux_module.rb
Outdated
@@ -59,7 +59,7 @@ def version | |||
|
|||
def command | |||
modinfo_cmd = if inspec.os.redhat? || inspec.os.name == 'fedora' | |||
"/sbin/modinfo -n -v #{@module}" | |||
"/sbin/modprobe -n -v #{@module} | awk '{$1=$1;print}'" | |||
else | |||
"modinfo -n -v #{@module}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed condition logic so that all linux systems utilize modprobe for detecting module status
modinfo does not produce the correct output for the test and should use modprobe. Test currently always fails when using modinfo due to output not matching.