summaryrefslogtreecommitdiffstats
path: root/docs/userguide/intro.rst
blob: 276d06fae0fc8e7b9362f03cacde4561ea7fe343 (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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
Glusto Tests
------------

The **glusto-tests** repo contains automated testcases for testing gluster software.
It provides the Libraries/Modules necessary for automating tests for gluster under the Glusto framework.

The Libraries/Modules/Tests in glusto-tests are written using the 'glusto'
framework. TestCases in glusto-tests can we written/run using standard
PyUnit, PyTest or Nose methodologies as supported by 'glusto' framework.

Refer to 'http://glusto.readthedocs.io/en/latest/' for info on 'glusto'
framework.

Prereqs
=======

To automate/run glusto-tests we need to install the following packages:

-   glusto

-   glustolibs-gluster

-   glustolibs-io

Installing Glusto
=================

-   pip install

::

        # pip install --upgrade git+git://github.com/loadtheaccumulator/glusto.git

... or ...

-   git clone

::

        # git clone https://github.com/loadtheaccumulator/glusto.git
        # cd glusto
        # python setup.py

Refer to: http://glusto.readthedocs.io/en/latest/userguide/install.html

Installing Glustolibs
=====================

To install the glustolibs-gluster and glustolibs-io libraries...

::

    # git clone http://review.gluster.org/glusto-tests
    # cd glusto-tests/glustolibs-gluster
    # python setup.py install
    # cd glusto-tests/glustolibs-io
    # python setup.py install

How to run the test case
------------------------
-   Create config file containing info about the servers, clients, volumes,
    mounts. Please refer to example config file under tests directory in
    glusto-tests repo. The example config file is in yaml format and
    defines sections which provides info about the gluster cluster.
    We can use any 'glusto' framework supported formats for writing the
    config files.
    Refer : http://glusto.readthedocs.io/en/latest/userguide/configurable.html

-   glusto-tests are run using the 'glusto' command available after installing
    the glusto framework. The various options to run tests as provided by
    glusto framework:

To run PyUnit tests

::

        # glusto -c 'config.yml' -d 'tests'
        # glusto -c 'config.yml unittest_list.yml' -u

To run PyTest tests:
::

        # glusto -c 'config.yml' --pytest='-v -x tests -m bvt'

To run Nose tests:
::

        # glusto -c 'config.yml' --nosetests='-v -w tests'

    Refer: http://glusto.readthedocs.io/en/latest/userguide/glusto.html#options-for-running-unit-tests

Writing tests in glusto-tests:
------------------------------
The `tests` directory in glusto-tests contains testcases. One might want to create
a dir with feature name as the name of test directory under `tests` to add
new testcases.

TestCases in glusto-tests can we written using standard PyUnit, PyTest or Nose
methodologies as supported by 'glusto' framework.

For more information on PyUnit tests, see http://glusto.readthedocs.io/en/latest/userguide/unittest.html

For more information on PyTest tests, see http://glusto.readthedocs.io/en/latest/userguide/pytest.html

For more informaiton on Nose tests, see http://glusto.readthedocs.io/en/latest/userguide/nosetests.html

Logging
--------

The Log file name and Log level can be passed as argument to glusto command while
running the glusto-tests. For example:

::

    # glusto -c 'config.yml' -l /tmp/glustotests_bvt.log --log-level DEBUG --pytest='-v -x tests -m bvt'

One can configure log files, log levels in the testcases as well. For details
on how to use glusto framework for configuring logs in tests Refer to:
http://glusto.readthedocs.io/en/latest/userguide/loggable.html

Default log location is '/tmp/glustomain.log'.

Note: When using 'glusto' via the Python Interactive Interpreter,
the default log location is '/tmp/glusto.log'.