-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
read_hardware_test: rewritten, with minimal stubs.
Deleted the real-world data because they are huge. Reusing probe_netcard_factory (from commit befef4d, to be merged), to have minimal stubs.
- Loading branch information
Showing
3 changed files
with
53 additions
and
508 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# A factory for the elements contained in SCR.Read(path(".probe.netcard")) | ||
# @return one item for a .probe.netcard list | ||
def probe_netcard_factory(num) | ||
num = num.to_s | ||
dev_name = "eth#{num}" | ||
|
||
{ | ||
"bus" => "Virtio", | ||
"class_id" => 2, | ||
"dev_name" => dev_name, | ||
"dev_names" => [dev_name], | ||
"device" => "Ethernet Card #{num}", | ||
"device_id" => 262145, | ||
"driver" => "virtio_net", | ||
"driver_module" => "virtio_net", | ||
"drivers" => [ | ||
{ | ||
"active" => true, | ||
"modprobe" => true, | ||
"modules" => [["virtio_net", ""]] | ||
} | ||
], | ||
"modalias" => "virtio:d00000001v00001AF4", | ||
"model" => "Virtio Ethernet Card #{num}", | ||
"resource" => { | ||
"hwaddr" => [ {"addr" => "52:54:00:5b:b2:7#{num}"} ], | ||
This comment has been minimized.
Sorry, something went wrong. |
||
"link"=> [ {"state" => true} ] | ||
}, | ||
"sub_class_id" => 0, | ||
"sysfs_bus_id" => "virtio#{num}", | ||
"sysfs_id" => "/devices/pci0000:00/0000:00:03.0/virtio#{num}", | ||
"unique_key" => "vWuh.VIRhsc57kT#{num}", | ||
"vendor" => "Virtio", | ||
"vendor_id" => 286740 | ||
} | ||
end |
Oops, something went wrong.
1 comment
on commit 5f4b758
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.
I wanted to create generic probe helper. Your approach means that when I want to use the probe helper elsewhere I'll probably need to touch the helper even fix this test. Also I currently don't see any reason (of course there can be) for stubbing Arch ... In general I prefer minimal stubbing.
num
should be converted into hex here and checked if it isnum <= 0xF