-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Include DEVLINKS in available diskio udev properties #5116
Changes from 9 commits
77b886a
e86bcd0
b26de49
6d45994
3df7d60
fa8913c
155dc90
12fcdc6
b2011a7
9186707
a610f1e
781b3c0
7f4c22e
9c55eb3
fec1c11
b3be174
48de766
904b650
053e194
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ import ( | |
var nullDiskInfo = []byte(` | ||
E:MY_PARAM_1=myval1 | ||
E:MY_PARAM_2=myval2 | ||
S:foo/bar/devlink foo/bar/devlink1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this be multiple lines like:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, my mistake. I will update accordingly. |
||
`) | ||
|
||
// setupNullDisk sets up fake udev info as if /dev/null were a disk. | ||
|
@@ -47,6 +48,7 @@ func TestDiskInfo(t *testing.T) { | |
require.NoError(t, err) | ||
assert.Equal(t, "myval1", di["MY_PARAM_1"]) | ||
assert.Equal(t, "myval2", di["MY_PARAM_2"]) | ||
assert.Equal(t, "foo/bar/devlink foo/bar/devlink1", di["DEVLINKS"]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Based on running udevadm we should prepend "/dev/" to the links: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point (although it really demands a change to the function itself). I may try to check docker just to see, but otherwise I will definitely do this. |
||
|
||
// test that data is cached | ||
err = clean() | ||
|
@@ -56,6 +58,7 @@ func TestDiskInfo(t *testing.T) { | |
require.NoError(t, err) | ||
assert.Equal(t, "myval1", di["MY_PARAM_1"]) | ||
assert.Equal(t, "myval2", di["MY_PARAM_2"]) | ||
assert.Equal(t, "foo/bar/devlink foo/bar/devlink1", di["DEVLINKS"]) | ||
|
||
// unfortunately we can't adjust mtime on /dev/null to test cache invalidation | ||
} | ||
|
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.
Should be able to access any of the
E:
values, so that would be at leastID*
andDM*
and probably others. Might be easier to document fields that cannot be looked up: DEVTYPE, DEVNAME, DEVPATH.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.
Makes sense.