I've taken a test suite I wrote for python-ethtool within Red Hat (later
modified by Braňo Náter) and added it to the upstream git repository as:
http://git.fedorahosted.org/cgit/python-ethtool.git/commit/?id=40b4e12903...
It tries to exercise as much of the API as possible. It also runs
"ifconfig" and screenscrapes the output, to give it something to compare
the answers against.
This latter aspect of the test may be fragile, given that it depends on
ifconfig's output format. I originally developed it against the
ifconfig within net-tools-1.60-138.20120702git.fc17.x86_64; bnater then
modified it to also cope with the ifconfig within net-tools version <=
1.60-128; specifically against net-tools-1.60-110.el6_2.x86_64 on a RHEL
6 box.
If it breaks on a given box and you want to fix it, see
tests/parse_ifconfig.py
[Note to those maintaining RH's internal test suites: I took the two
python scripts from python-ethtool/Sanity/unit, specifically
92596c208fab03aac91110797d08f82af7340483]
Dave