summaryrefslogtreecommitdiff
path: root/test-common.c
AgeCommit message (Collapse)AuthorFilesLines
2012-06-01test: Add test_ioctl() function to support a mock send_ioctl()Ben Hutchings1-12/+58
test_ioctl() verifies an ethtool ioctl structure and either returns a canned response (if it was as expected) or aborts the test. Adjust the file redirection in test_cmdline() so that test_ioctl() can always print error messages. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-05-23Run tests in-processBen Hutchings1-33/+278
Wrap main(), exit(), and resource management so that ethtool commands can be tested without starting a new process and without leaking. This will allow deeper teesting that covers ioctl requests and responses. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-11-03Add test cases for command-line parsingBen Hutchings1-0/+92
Preparation for refactoring command-line parsing. All these test cases pass. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>