Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
PCI: Add KUnit tests for __pci_read_base()
It is usually hard to debug issues in the resource assignment code due
to long reporduction cycles between the developer trying to fix the code
and the user testing it.
This adds KUnit tests for __pci_read_base() which is only dependent
on software structures, so no hardware is needed to run these.
This lays the foundation for test fixtures we can use to reproduce the
resource assignment code path of PCI.
Sample output from KUnit Test run:
Subtest: __pci_read_base()
1..2
# test_pci_read_base_type_0_hdr_approach_1: initializing __pci_read_base() tests
(null): reg 0x18: [mem 0x4f400000-0x4f400fff]
ok 1 - test_pci_read_base_type_0_hdr_approach_1
# test_pci_read_base_type_0_hdr_approach_2: initializing __pci_read_base() tests
(null): reg 0x18: [mem 0x4f400000-0x4f400fff]
ok 2 - test_pci_read_base_type_0_hdr_approach_2
# __pci_read_base(): pass:2 fail:0 skip:0 total:2
# Totals: pass:2 fail:0 skip:0 total:2
ok 2 - __pci_read_base()
Suggested-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Naveen Naidu <naveennaidu479@gmail.com>- Loading branch information