File: README.md

package info (click to toggle)
pyroute2 0.8.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,700 kB
  • sloc: python: 50,245; makefile: 280; javascript: 183; ansic: 81; sh: 44; awk: 17
file content (60 lines) | stat: -rw-r--r-- 1,745 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
Test modules
============

* `test_limits` -- resource limits, fd leaks, etc
* `test_linux` -- functional tests for Linux, may require root
* `test_minimal` -- test pyroute2.minimal package
* `test_neutron` -- integration with OpenStack Neutron
* `test_repo` -- repository checks
* `test_openbsd` -- functional tests for OpenBSD
* `test_unit` -- unittests

Functional tests under `test_linux` directory require root
access to create, destroy and set up network objects --
routes, addresses, interfaces, etc. They use mainly dummy
interfaces, but the main OS setup may be affected.

Requirements
============

* nox
* python >= 3.8
* `-r requirements.dev.txt`

Run tests
=========

All the tests should be started via corresponding nox session,
see `noxfile.py`. Alternatively there is a `make` target left
for those who prefer::

    # using nox
    $ nox --list
    $ nox -e unit                     # run only unit tests
    $ nox                             # run all the tests

    # using make
    $ sudo make test                  # run the default sessions
    $ make nox session=unit           # run only unit tests
    $ make nox session=openbsd        # OpenBSD tests

It is possible to provide a session config. This example runs
only one particular test module starting debugger on failure::

    # using nox
    $ nox -e linux -- '{"pdb": true, "sub": "test_ipr/test_rule.py"}'

    # using make
    $ make nox \
        session=linux \
        noxconfig='{"pdb": true, "sub": "test_ipr/test_rule.py"}'

Get code coverage and run PDB on failures::

    # using nox
    $ nox -e linux -- '{"pdb": true, "coverage": true}'

    # using make
    $ make nox \
        session=linux \
        noxconfig='{"pdb": true, "coverage": true}'