File: README

package info (click to toggle)
saunafs 5.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,820 kB
  • sloc: cpp: 109,287; sh: 18,755; python: 4,737; ansic: 4,023; makefile: 60; awk: 17
file content (115 lines) | stat: -rw-r--r-- 4,626 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
SaunaFS functional tests
*************************


How to configure testing environment?
=====================================

Functional tests configure and run testing SaunaFS installation several times.
Test installation runs all system modules on a single computer.
To prepare the testing environment safely, please use the following script:

    <SOURCE_DIRECTORY>/tests/setup_machine.sh

You will need root permissions to use it. When running it, you may want to provide
directories which will be used by chunkservers during the tests to store any
generated data as arguments for this script, eg:

    sudo setup_machine.sh setup /mnt/hdb /mnt/hdc /mnt/hdd /mnt/hde

These directories may be located on one physical disk. Long tests, however, may not work
in such configuration (they generate heavy traffic). It's OK for sanity checks.
There should be about 60 GB of disk space available for the tests.
At least three directories have to be provided in order to run some of the test cases.
Remember that user 'saunafstest' needs permissions to write files in these
directories. All the contents of these directories will be erased during tests.

If you want to know what 'setup_machine.sh' does, just run it without any command line
arguments. It will print a short description of all the changes it is going to make.

The tests need to know which binaries should be tested. The default location is
/var/lib/saunafstest/local and this means eg. that the master server will run code
from the /var/lib/saunafstest/local/sbin/sfsmaster file. You can change this
default directory by adding an entry like this to /etc/saunafs_tests.conf file:

    : ${SAUNAFS_ROOT:=/home/you/local}

Make sure that the user saunafstest is able to read files from this directory.

How to compile the tests?
=========================

To use tests, SaunaFS has to be compiled with an option ENABLE_TESTS, e.g.:

    cmake .. -DENABLE_TESTS=YES

Test installation has to be prepared. Default location for tests is
'$HOME/local' but it can be changed in tests config file, e.g.:

    : ${SAUNAFS_ROOT:="$HOME/SaunaFS"}

After that, the tests are ready to be run.

How to launch the tests?
========================

The testing framework configuration is read from one of multiple possible sources,
either:
- /etc/saunafs_tests.conf
- ${HOME}/etc/saunafs/tests.conf
- ${SAUNAFS_TESTS_CONF}

Test binary is installed together with the file system. The path leading to it
is the following:

    <INSTALL_PREFIX>/bin/saunafs-tests

Alternatively, it can be run from build directory:

    <SOURCE_DIRECTORY>/tests/saunafs-tests

This binary runs all the bash scripts using googletest framework. This makes
it easy to generate a report after all the tests are finished. Part of the source code
of 'saunafs-tests' binary (list of tests) is generated automatically when tests are added
or removed. Launched without any parameters, it executes all available tests.
By using a parameter '--gtest_filter' you can choose which tests are to be run.
The above parameter uses a pattern to select the tests, e.g.:

    ./saunafs-tests --gtest_filter='SanityChecks*'

The command above runs all tests from 'SanityChecks' suite.
A 'saunafs-tests' binary uses an interface delivered by googletest which is displayed after:

    ./saunafs-tests --help


How to make your own test?
==========================

To create a new test simply create a file:

    <SOURCE_DIRECTORY>/tests/test_suites/<SUITE>/test_<TEST_NAME>.sh

where:
    <SUITE> is a test suite that you want your test to be a part of.
        Existing test suites:
         -  SanityChecks – basic tests of SaunaFS functionality; these tests
                should last a couple of minutes,
         -  ShortSystemTests – advanced tests of SaunaFS functionality not requiring
                dedicated storage; these tests last around half an hour,
         -  LongSystemTests – advanced tests of SaunaFS functionality requiring
                dedicated storage; these tests last a few hours,
         -  ContinuousTests – tests using SaunaFS mountpoint to populate SaunaFS
                installation with data and validate them;
                these tests are desigend to be run continuously,
    <TEST_NAME> is a name of your test.

Tests which you write are run inside a kind of sandbox. They use UID
of a special user 'saunafstest', so you can safely spawn any processes
(they will be killed after the test).
Our testing framework provides numerous bash functions and structures. They are
implemented in the following directory:

    <SOURCE_DIRECTORY>/tests/tools

Merry testing!