Hello everyone

Can you help me out and send me your disk_configs (via private mail)? The more 
the better. May it be a trivial one or highly sophisticated. I'd like to build 
a nice sample collection which to test setup-storage against. [It doesn't even 
matter if the config is supposed to work, but setup-storage fails to 
parse/apply it.]

Since it's small enough I simply attached the test harness I have cobbled 
together. It is able to test a lot of different configs without rebooting the 
fai-client and analyzes setup-storage's output. It already includes some tests. 
The 'expected output' is from an unmodified 1.4 setup-storage - that's why some 
tests are expected to fail for now.

The following text is from the readme file in the archive:


# GENERAL #

you must set the class STORAGE_TEST to make use of this software package
additionally I recommend setting up a proper SSH-Login, so you can easily
copy data to/from the fai-client (especially command output)

 - boot the designated fai-client
 - login as root
 - cd /var/lib/fai/config/tests
 - ./setup-storage_wrapper

sample output for a clean run:

# ./setup-storage_wrapper
======================================================================
 empty class list
 []
======================================================================
======================================================================
 no class matches
 [undefined_class]
======================================================================
======================================================================
 empty disk config
 [01_empty]
======================================================================
[...]

# REQUIREMENTS #

 these tests require a machine with 2 harddiscs (size: at least 40GB each)
 - 52_brian_md+lvm_initial
 - 53_brian_md+lvm_preserve

# CUSTOMIZATION #

the script should be pretty easy to understand. A typical configuration
looks something like

----------------------------------------------------------------------------
test_name='simple root, swap, lvm (factory clean)'
test_class='04_root+swap+lvm'
expected_result='0'
  dd if=/dev/zero of=/dev/sda bs=1M count=10 >/dev/null 2>&1
  dd if=/dev/zero of=/dev/sdb bs=1M count=10 >/dev/null 2>&1
exec_setup-storage
  # disable lvm again
  vgchange --available n     >/dev/null
  vgremove --force vg_system >/dev/null
----------------------------------------------------------------------------

$test_name          describes the current test
$test_class         defines the relevant disc configuration
$test_class.output  contains the expected output, a missing file results in
                    skipping the check.
$expected_result    expected return code for setup-storage, this can be used
                    to feed incorrect input and check proper error detection
                    (typical values: 0, 2, 25)

The '  ' indentation has no effect except to indicate some pre- and/or
post-processing. This is mainly to (re)set the system to a 'known' state.

If a file <classname>.output is present in disk_config, then this testscript
compares the actual and the desired output against each other and notify if
something has changed. (A special case is made for uuids, since they would
always result in a difference.)

Tip: Create an empty file to make the test script show the expected output.

Attachment: fai_setup-storage-test_2012-08-28.tar.gz
Description: Binary data

Reply via email to