[bug] task_test does not write to test.log

Thomas Neumann blacky+fai at fluffbunny.de
Sat Mar 2 21:17:56 CET 2013


Tested with fai 4.0.6. (I assume this is the same for all fai versions since tests/ was first implemented.)

From the documentation:

-----------------------------------------------
6.8. Automated tests

After the customization scripts are executed, FAI will execute some tests if available. Using these test, you can check for errors of the installation or of the softupdate. Test scripts are called via fai-do-scripts(1) and should append it’s messages 
to $LOGDIR/test.log. A Perl module including some useful subroutines can be found in Faitest.pm. A test can also define a new class for executing another tests during next boot via the variable $ADDCLASSES.
-----------------------------------------------
-- http://fai-project.org/fai-guide/_anchor_id_instprocess_xreflabel_instprocess_overview_of_the_installation_sequence.html


But the output is simply added to 'shell.log' (if the test is a shell script). This is a side effect of using fai-do-scripts to execute these tests, since f-d-s writes to different logfiles depending on the kind of script that is being executed. (Shell, Perl, 
Python, CFengine, ..) Now I'm wondering if we could simply switch to always writing to the same logfile. scripts/ writes to scripts.log and test writes to test.log. No more distinguishing between different script types. Does someone depend on 
split-up logfiles?

I see three strategies to fix this bug:

a) Keep the current behaviour, duplicate fai-do-scripts into fai-do-tests and make it write to multiple logfiles to keep it analogue to scripts/.

b) Keep the current behaviour, duplicate fai-do-scripts into fai-do-tests and make it write to a single logfile as documented.

c) Same as b) but keep the current behaviour for scripts/ until 4.1, then change it to use a single logfile (e.g. 'scripts.log').

I'm in favour of c), but there may be good reasons to pick a) or b).

bye
thomas

P.S.: Is 'A test can also define a new class for executing another tests during next boot via the variable $ADDCLASSES.' actually implemented? I'm busy with GPT & LVM, so I'm too lazy to test this right now. But since tests are executed with f-d-
s, then this mechanism would also be available to 'scripts/'?


More information about the linux-fai mailing list