DejaGnu: Running tests via cron

From FVue
Jump to: navigation, search

Problem

The test suite requires a connected terminal (tty). When invoked via cron, no tty is connected and the test suite may respond with this error:

can't read "multipass_name": no such variable

Solution

To run the tests successfully via cron, connect a terminal by redirecting stdin from a tty, e.g. /dev/tty40. (In Linux, you can press alt-Fx or ctrl-alt-Fx to switch the console from /dev/tty1 to tty7. There are many more /dev/tty* which are not accessed via function keys. To be safe, use a tty greater than tty7)

runtest < /dev/tty40

If the process doesn't run as root (recommended), root will have to change the permissions of the tty:

sudo chmod o+r /dev/tty40

To make this permisson permanent - and not revert back on reboot - add the following file to /etc/udev/rules.d/10-mydejagnu.rules:

KERNEL=="tty40", MODE="0666"

You can also run this command (as root):

# udevadm trigger

to make the new udev rules effective immediately.

See also

Writing udev rules - Daniel Drake
Thorough documentation about how to write udev rules

Comments

blog comments powered by Disqus