Commit graph

333 commits

Author SHA1 Message Date
Jiri Kucera
dee03a7820 Add back dist: xenial
Until we will be sure about system python detection in tox-travis
or we find another way of how to enforce running molecule on
system python, we must prevent the bumping system python version
when Travis team bumps default building environmet by setting the
building environment explicitly.
2019-09-16 11:30:49 +02:00
Jiri Kucera
bd3010cc75 --ignore-missing does not work as expected 2019-09-13 15:10:09 +02:00
Jiri Kucera
a13e175084 Try to use long option variant to -m 2019-09-13 15:02:55 +02:00
Jiri Kucera
b5724f045a Ignore missing packages
Ignore packages if they are missing (try to not break installation
chain early).
2019-09-13 14:33:54 +02:00
Jiri Kucera
0ae8076e55 Install extra packages allways
Do not make extra package installing dependent on TRAVIS_PYTHON_VERSION.
Instead, install them if they are available (silently ignore errors
about missing packages).
2019-09-13 14:12:44 +02:00
Jiri Kucera
1490a46f47 Add SPDX-License-Identifier: MIT 2019-09-12 11:49:01 +02:00
Jiri Kucera
392ff45c9d Cleanup [travis] section 2019-09-12 11:22:36 +02:00
Jiri Kucera
9803dfb7f2 Clean-up shell scripts 2019-09-12 10:51:49 +02:00
Jiri Kucera
7181919cc0 Add missing testenv: prefix 2019-09-12 10:51:02 +02:00
Jiri Kucera
b59078a9ab Remove LSR_USE_PYTHON
Try to keep CI configuration in a one place (this involves removing
LSR_USE_PYTHON from Travis CI Web Settings Interface and then the
loss of reason to keep it in .travis.yml)
2019-09-12 09:49:51 +02:00
Jiri Kucera
4b51f0eb47 Exclude molecule from envlist
molecule needs root privileges to run, so it is better to run
molecule explicitly
2019-09-12 09:28:51 +02:00
Jiri Kucera
047469b14d Incorporate changes from PR #120 2019-09-02 14:27:10 +02:00
Jiri Kucera
561ce8f5df Allow to dissable pylint
Introduce several environment variables:
  RUN_PYLINT_DISABLED - disable pylint execution
  RUN_PYLINT_INCLUDE - specify regex for files to be included
  RUN_PYLINT_EXCLUDE - specify regex for files to be excluded
2019-09-02 14:16:59 +02:00
Jiri Kucera
b9b3561653 Support multiple Molecule scenarios
Other changes:
- run linters before tests
- return [pylint] and [pycodestyle] back on the list (some IDE's
  rely on this)
2019-08-19 12:48:30 +02:00
Jiri Kucera
42e0a0c64d run_pylint.py: Remove duplicity 2019-08-19 12:47:46 +02:00
Jiri Kucera
149b4e3124 pylintrc: Update ignore list 2019-08-19 12:44:23 +02:00
Jiri Kucera
7af5797b7d Reuse virtual environments
Virtual environments names are now based on the version of Python
interpreter that is used. This prevents creation of redundant
environments, that is there will be only one[1] virtual environment
per Python interpreter, which saves the time by preventing the
installation of the same packages more than once.

[1] In Travis CI, this is easy to implement by using the
    TRAVIS_PYTHON_VERSION environment variable. Locally, as there
    is no information about what version of Python interpreter is
    used when creating a virtual environment in tox, there may be
    more virtual environments per interpreter (for example, env-3.6
    and env-molecule may be both based on Python 3.6).
2019-08-01 00:19:07 +02:00
Jiri Kucera
97a6ddbcc0 Return back to 'selinux'
As https://github.com/pycontribs/selinux/pull/3 was merged and
released, we can use 'selinux' dependency again.
2019-08-01 00:14:44 +02:00
Jiri Kucera
f21d01ab68 Add pylint wrapper
Add run_pylint.py that probe working directory for python source files
and pass them to pylint. This is needed because pylint expects module
or package, so passing a directory with no __init__.py in it makes
pylint angry. With this change, LSR_PYLINT_DIRS is no longer needed.

Additionally, we no longer need:
- init-hook in pylintrc
- [pylintrc] section in tox.ini, because the configuration from this
  section is now the part of pylintrc
- [pycodestyle] section in tox.ini, because pycodestyle linter is not
  used
2019-07-31 00:52:26 +02:00
Jiri Kucera
f5bc42632d Missing backslash 2019-07-19 12:49:00 +02:00
Jiri Kucera
53846c4806 Add apt-get update
Maybe this should resolve failing installs.
2019-07-19 12:36:14 +02:00
Jiri Kucera
8be4cef618 Redundant molecule and docker in pip 2019-07-19 12:26:44 +02:00
Jiri Kucera
5e2ed49044 Add trusty to make python2.6 available 2019-07-19 11:58:49 +02:00
Jiri Kucera
5d7e544134 Allow running tox also locally
- use `./.travis/runtox [ARG1 [ARG2 [...[ARGn]]]]` to run tox locally
- use LSR_USE_PYTHON to decide whether to run jobs with pylinters and
  pytesters or not
2019-07-19 11:45:26 +02:00
Jiri Kucera
ada1658044 Try do the trick with forgotten source and export 2019-07-17 12:44:53 +02:00
Jiri Kucera
8102fd6443 Refactor Travis CI setup
This commit introduces the refactored Travis CI setup and tox.ini
to fullfil the need to have common CI setup across all roles.

The current proposal and discussion can be found at:
https://github.com/linux-system-roles/template/issues/4
2019-07-17 11:18:50 +02:00
Till Maas
d5891d43a2
Merge pull request #115 from tyll/ethtool
Support ethtool -K|--features|--offload
2019-06-14 16:16:39 +02:00
Till Maas
70aa9875aa Add support for ethtool features 2019-06-14 15:18:11 +02:00
Till Maas
e37e9d7560
Merge pull request #119 from tyll/checkpoints
Modules/NM: Wrap changes in checkpoint
2019-06-14 15:09:44 +02:00
Till Maas
225ba70a43 Modules/NM: Wrap changes in checkpoint
Create a checkpoint before changing NetworkManager profiles and rollback
on failures (destroy it on success).
2019-06-14 12:00:15 +02:00
Till Maas
c443947150 Utils: Add helper to call sync NM methods 2019-06-14 12:00:15 +02:00
Till Maas
c90b554817
Merge pull request #117 from tyll/tox-py26
tox: Work around Python 2.6 issues with tox 3
2019-06-11 15:41:02 +02:00
Till Maas
494b4cd5ed tox: Work around Python 2.6 issues with tox 3
Fedora 30 uses tox 3 which does not work with Python 2.6 out of the box.
Setting the install and list_dependencies commands to run `pip` instead
of `python -m pip` seems to fix this for now.
2019-06-11 14:40:57 +02:00
Till Maas
cb5fb554c4
Merge pull request #116 from tyll/vlan_mtu_tests_revised
Revise VLAN MTU test
2019-06-11 11:52:48 +02:00
Till Maas
4215ef93cb tests_vlan_mtu: Properly set the network provider
Set the network_provider as fact to ensure that it is also set in the
imported playbook.
2019-06-11 11:12:15 +02:00
Till Maas
5d2eec9478 tests_vlan_mtu: Use debug task to show TEST/CLEANUP
The name for import_roles is not logged, therefore use an extra debug
task to indicate the test steps.
2019-06-11 11:12:15 +02:00
Till Maas
a00fe15943 library: Make ignore_errors a real bool
This removes warnings like:

 [WARNING]: The value False (type bool) in a string field was converted
 to u'False' (type string). If this does not look like what you expect,
 quote the entire value to ensure it does not change.
2019-06-07 22:53:11 +02:00
Till Maas
b445c04ea7
Merge pull request #114 from tyll/unittests
Cleanup/prepare unit tests for ethtool option support
2019-06-07 09:53:14 +02:00
Till Maas
ab60a47475 connections unit tests: Introduce ETHERNET_DEFAULTS 2019-06-06 22:24:34 +02:00
Till Maas
4ad865af8a Argument validator: generate Ethernet defaults 2019-06-06 22:07:40 +02:00
Till Maas
d2e7af451e connections unit tests: Fix sys.path manipulation
After moving the unit tests into a subdirectory, the path inserts need
to go to one more parent directory.
2019-06-06 21:44:36 +02:00
Till Maas
72cc26a568
Merge pull request #111 from tyll/unittests
Reorganize unit tests
2019-06-06 12:11:50 +02:00
Till Maas
9e5150b88d tests_unit.yml: Fix ansible-lint warnings 2019-06-06 09:06:16 +02:00
Till Maas
0cbf94af61 unitests: Move unit tests in separate directory 2019-06-06 09:06:16 +02:00
Till Maas
058eb4d1cd tests: Add missing roles symlink 2019-06-06 09:06:12 +02:00
Till Maas
8ec0196781 tests: Test setting the MTU of VLAN interfaces
Test setting the MTU interfaces. This needs autoconnect:false for now,
possibly because of a bug in NetworkManager.
2019-06-03 11:28:07 +02:00
Till Maas
5fa8ac9c2c
Merge pull request #109 from tyll/tests_states
tests: Test volatile state changes
2019-05-28 10:41:09 +02:00
Till Maas
1d342ef037 tests: Test volatile state changes 2019-05-26 21:19:23 +02:00
Till Maas
a4a3373e3f
Merge pull request #107 from vcrhonek/molecule-travis
Configure Molecule in Travis CI
2019-05-06 17:07:06 +02:00
Till Maas
f9fff1776d tox: Use custom selinux shim
Travis uses Ubuntu which is not yet supported by the python selinux
shim. Use a custom fork instead.
2019-05-06 11:08:44 +02:00