summaryrefslogtreecommitdiffstats
path: root/README
blob: dee0e94c8030d9e7b032f3d6c6382a249204d94f (plain)
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
==============================
atf: Automated Tests Framework

Automated Tests Framework provides libraries for automating functional testcases.
==============================

Usage:-
-------
[automation]$ python atf.py --helpusage: atf [-h] --atfdir ATFDIR --testruninfo-file TESTRUNINFO_FILE
           [--summarylog-file SUMMARYLOG_FILE]
           [--summarylog-level SUMMARYLOG_LEVEL]
           [--detaillog-file DETAILLOG_FILE]
           [--detaillog-level DETAILLOG_LEVEL] [--stdout-dolog STDOUT_DOLOG]
           [--stdoutlog-level STDOUTLOG_LEVEL]

Runs GlusterFS Functional/Regression Test Suite

optional arguments:
  -h, --help            show this help message and exit
  --atfdir ATFDIR       Absolute path of directory where automation framework
                        is installed
  --testruninfo-file TESTRUNINFO_FILE
                        TestRunInfo FileName
  --summarylog-file SUMMARYLOG_FILE
                        SummaryLog Filename
  --summarylog-level SUMMARYLOG_LEVEL
                        SummaryLog LogLevel
  --detaillog-file DETAILLOG_FILE
                        DetailLog Filename
  --detaillog-level DETAILLOG_LEVEL
                        DetailLog LogLevel
  --stdout-dolog STDOUT_DOLOG
                        Log to Stdout yes|no
  --stdoutlog-level STDOUTLOG_LEVEL
                        StdoutLog LogLevel

Report Bugs to dl-qa@gluster.com

TestRunInfo File:- 
------------------
[TestUnits] : Define what testunits to run.
    The relative path from "TestUnits" directory to the testunit
    has to be specified under this section
    Ex:- unit1 = xlators/cluster/afr/self_heal
         unit2 = xlators/cluster/arf/basic_ops

[Keywords] : Type of run
    Ex:- keywords = art | sanity | bugs

[GlusterVersion] : Glusterfs Version under test
    Ex:- version = 3.2.5

Prerun:- Execute the following command from the atf directory
--------------------------------------------------------------
export PYTHONPATH=`./export.py`

Dependencies:-
--------------
1) paramiko python package

How to write testcases:-
------------------------
# Create a directory for the feature you want to automate under TestUnits.

# Under TestUnits the directory structure has to be the same as source
structure of glusterfs under

    Ex:- arf, self-heal functional testing
    TestUnits/xlators/cluster/afr/self_heal

# Every TestUnit should contain the following files:-
    1) testenv.cfg : Define the test environment
    2) testcaseslist : List of testcases for the feature
    3) testunit.py : Entry point for the TestUnit. For executing the testunit,
    the main function of this module is called
    4) testcases.py : define the testcases here.
    
# Create testunit.py (This is the entry point for the TestUnit).
Define the following functions:
    1) initialize : parse testenv.cfg, ssh_connect_allhosts
    2) setup : setup the active volume
    3) execute :parse testcaseslist to select the tests for execution, execute
                each testcase
    4) cleanup : cleanup the test environment

# testcases.py:- Define the testcase as a function. Use the framework libraries
or define new functions to automate tests

# testcaseslist:- This file should contain names of the testcases defined in
testcases.py file. The testcase is associated with the version on which it
has to be tested.

# testenv.cfg :- Define the test environment for the unit. The Servers, Clients,
Volume Info, Bricks, Exportdirs, MountPoints, MountDevice.