[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: my progress



>>>>> On Sun, 6 Nov 2016 11:38:33 -0800, Noah Meyerhans <noahm@debian.org> said:

    > 3. Mount generated image locally and perform filesystem-level tests.
Hi Noah,

this can be done inside FAI itself. You can put some scripts into the
tests/ subdirectory and name them after a class, see fai-do-scripts(1)
for details. Then they will be executed. The scripts can access the
still mounted target directory which is available in the variable
$target. For example a test may look like this (not tested at all):

#! /bin/bash

error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code

if [ ! -f $target/boot/grub/grub.cfg ]; then
   echo "TEST FAILED. No grub.cfg available"
   task_error 812
fi

exit $error


The function task_error will set a special variable which is checked
against $STOP_ON_ERROR, which is default to 700. All error codes
greater this value should stop the FAI installation. It also displays
a red icon on the fai-monitor-gui, if it's running.


-- 
regards Thomas


Reply to: