Contents |
A Watchdog Timer (WDT) is a hardware circuit that can reset the computer system in case of a software fault. The blts-watchdog test module includes tests for watchdog devices via kernel's watchdog driver. Basically the watchdog timer is 'pinged' by an application (usually by a user space watchdog daemon), and if a 'ping' is not received within certain time, the watchdog device resets the device.
The test driver module accesses watchdog driver via /dev/watchdog device. The watchdog is controlled with ioctls;
* WDIOC_GETTIMEOUT: Get current watchdog timeout * WDIOC_SETTIMEOUT: Set current watchdog timeout * WDIOC_GETSUPPORT: Get information about the watchdog device * WDIOC_KEEPALIVE: Keep alive ping
Hardware watchdog timers.
Only one process can use the watchdog timer at a time, so the test module cannot access the watchdog device if there is some watchdog daemon, or some other process using the watchdog running.
TBD
The test device must include a watchdog device, and the driver for the watchdog device must be loaded. The test environment must have the following packages installed:
The building environment requires the following RPM packages to be installed:
The watchdog test package comes with a packaging script that can be used to build tarball out of the sources, RPM package or Debian package. To build an RPM package, execute this command in the top-level source directory of the test asset:
./pack.sh -r
To get packaging script help, execute command:
./pack.sh -h
The watchdog test package does not require any separate configuration package.
The test package can be installed in the device with a command:
rpm -ivh blts-watchdog-tests_{version}.rpm
Arguments:
| General Switch | Function |
|---|---|
| -l | Used log file |
| -e | Execute single or multiple selected tests, for example -e 1,4,5. |
| -en | Execute test by name, for example -en "My test X" |
| -s | Show list of all tests |
| -C | Used configuration file |
| -? | Help message |
| -xml, -axml | Create result XML. -axml appends results to an existing XML file. |
| -auto | Silent logging for test automation. Only the results are printed to stdout. |
| -v | Verbose logging (default) |
| -vv | Even more verbose logging |
Test cases must be executed with root privileges.
Test case descriptions and execution instructions:
blts-watchdog-tests -en "Core-Watchdog presence check"
blts-watchdog-tests -en "Core-Open and close watchdog"
blts-watchdog-tests -en "Core-Send keepalive messages"
The test module can be compiled to a self-sufficient command line program. Debian and RPM packaging is provided.
| Watchdog API | Watchdog Driver api |
| blts-watchdog | blts-watchdog sources |
| Version | Date | Handled By | Status | Comments |
|---|---|---|---|---|
| 0.1 | 10-Dec-2010 | Pasi Matilainen | Draft | Page created |