Meego Wiki
Views

Quality/TestSuite/Watchdog Driver Test Specification

From MeeGo wiki
Jump to: navigation, search

Contents

Introduction

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.

Test Coverage

Software Coverage

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 Coverage

Hardware watchdog timers.

Limitations

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.

Future Improvements

TBD

Running the tests

Hardware setup and test environment

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:

Building packages

The build environment must have the following packages installed:

The source package includes the pack.sh script, which is used for building RPM and Debian packages and source tar packages. To build an RPM package with the script, execute this command in the top level source directory of asset:

./pack.sh -r

To get help about the packaging script, execute

./pack.sh -h

The asset can also be built manually by executing:

./autogen.sh
./configure
make

Configuration package

The watchdog test package does not require any separate configuration package.

Test asset specific instructions

The test package can be installed in the device with a command:

rpm -ivh blts-watchdog-tests_{version}.rpm

Test case arguments

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

Running test cases

Test cases must be executed with root privileges.

Test case descriptions and execution instructions:

  • Core-Watchdog presence check
    • Simple existence check for watchdog
    • blts-watchdog-tests -en "Core-Watchdog presence check"
  • Core-Open and close watchdog
    • Open watchdog device node, query information
    • blts-watchdog-tests -en "Core-Open and close watchdog"
  • Core-Send keepalive messages
    • Set keepalive timeout, send keepalive messages to watchdog for ten seconds. Note that the device should reboot after the test case finishes.
    • blts-watchdog-tests -en "Core-Send keepalive messages"

Module Design and Architecture

The test module can be compiled to a self-sufficient command line program. Debian and RPM packaging is provided.

References

Watchdog API Watchdog Driver api
blts-watchdog blts-watchdog sources

Change History

Version Date Handled By Status Comments
0.1 10-Dec-2010 Pasi Matilainen Draft Page created
Personal tools