Commit graph

178 commits

Author SHA1 Message Date
Till Maas
70d3e9e96c
Merge pull request #58 from smasc/fix_autoconnect
Fix handling of autoconnect parameter
2018-06-11 15:36:15 +02:00
Shannon Mascarenhas
70e69226c1 Add test for disabling autoconnect 2018-05-30 08:25:25 -05:00
Shannon Mascarenhas
5b45f9bc46 Fix handling of autoconnect parameter
This fixes a bug in the `network_connections` module when using the
`initscripts` provider and encountering a connection with `autoconnect`
set to false. It fails to write any `ONBOOT=` line to the interface's
`ifcfg-*` file, which RHEL treats as equivalent to `ONBOOT=yes`.

This explicitly sets `ONBOOT` for all interfaces defined, instead of
relying on what RHEL considers its default value.
2018-05-29 12:52:02 -05:00
Till Maas
fd110a4deb
Merge pull request #51 from tyll/type_keyerror
Detect and fix keyerror
2018-05-25 20:36:02 +02:00
Till Maas
dd24f020a9 Handle undefined type attribute
This fixes this exception (issue #40):

 [WARNING]: exception: Traceback (most recent call last):   File
"/tmp/ansible_FfjjGk/ansible_module_network_connections.py", line 2812, in <module>     cmd.run()   File
"/tmp/ansible_FfjjGk/ansible_module_network_connections.py", line 2398, in run     self.run_prepare()   File
"/tmp/ansible_FfjjGk/ansible_module_network_connections.py", line 2653, in run_prepare     if connection['type'] in [
'macvlan' ]: KeyError: 'type'
2018-05-25 19:52:10 +02:00
Till Maas
0fc1b5bbb5 Add test to remove Ethernet profile 2018-05-25 19:52:10 +02:00
Till Maas
598e487971 Only run tests with python2 or python3 binary
Also fail, when the tests did not run with at least one of them.
2018-05-25 19:51:09 +02:00
Till Maas
47c7b638f0 Test whether python commands can be executed
This changes the test to rely on whether the binaries are available
regardless of how they were installed or from which package.
2018-05-25 19:50:07 +02:00
Till Maas
baae5ab9f9
Merge pull request #50 from tyll/more_integration_tests
More integration tests
2018-05-25 13:17:09 +02:00
Till Maas
05ae9bbc1e Remove .image-cache from .gitignore
It was used by an old version of the test harness
2018-05-24 15:15:38 +02:00
Till Maas
75784ea5ed Install python{,3}-gobject-base if required 2018-05-24 15:14:04 +02:00
Till Maas
b01ab7fd50 Add integration test for Ethernet device 2018-05-24 15:14:04 +02:00
Till Maas
910f399665 Add helper scripts to get coverage data 2018-05-24 15:14:04 +02:00
Till Maas
640e11001e Add examples to remove or take down a profile 2018-05-23 18:55:21 +02:00
Till Maas
ff2f35cb8a Add helper tasks for integration tests 2018-05-23 18:55:21 +02:00
Till Maas
14e65ec6c5
Merge pull request #54 from tyll/sysutils
Fix exception on Python3 in _link_read_permaddress() and for sorting network connections
2018-05-23 18:54:19 +02:00
Till Maas
2185df2a81 Always run commands in C locale 2018-05-23 18:31:54 +02:00
Till Maas
791d271d0b Use "is succeeded" instead of | succeeded
This removes this deprecation warning:
[DEPRECATION WARNING]: Using tests as filters is deprecated. Instead of
using `result|succeeded` instead use `result is succeeded`. This feature
will be removed in version 2.9. Deprecation warnings can be disabled by
setting deprecation_warnings=False in ansible.cfg.
2018-05-23 18:29:31 +02:00
Till Maas
0bb66af883 Add basic test for Utils.check_output() 2018-05-23 18:29:31 +02:00
Till Maas
83f2521d5e Fix python3 missing "cmp" keyword for list.sort()
This fixes this exception on Python3:
TypeError: 'cmp' is an invalid keyword argument for this function
2018-05-23 18:29:31 +02:00
Till Maas
8157a89456 Install pygobject and NetworkManager-libnm if possible
This avoids skipping tests that require pygobject/libnm
2018-05-23 18:29:31 +02:00
Till Maas
fa13ea2388 Fix exception on Python3 in _link_read_permaddress
Bytestrings need to be decoded. Just use UTF-8 here, since everyone
should be using it. Also add a test case to catch this. The exception
was:
TypeError: cannot use a string pattern on a bytes-like object
2018-05-23 18:29:31 +02:00
Till Maas
b3341f50c0
Merge pull request #49 from tyll/py26-37
Run tests for python 2.6 and 3.7, too
2018-05-17 12:42:43 +02:00
Till Maas
7c51a71cf4 Run tests for python 2.6 and 3.7, too 2018-05-17 12:23:31 +02:00
pcahyna
9f00e45818
Merge pull request #46 from tyll/coveralls
Travis-CI + Coveralls + move of tests and restructuring of the roles subdirectory
2018-05-17 11:29:47 +02:00
Till Maas
8d014e7a1d Update gitignore 2018-05-17 11:15:28 +02:00
Till Maas
3ad7589913 Add status badges 2018-05-17 11:15:28 +02:00
Till Maas
fb76fba61d Add initial travis and coveralls support via tox
Do not run coveralls by default and do not run flake8 and pylint in
travis. They make it always fail at the moment.
2018-05-17 11:15:14 +02:00
Till Maas
8e6f1bf96b Move unit tests to tests dir 2018-05-16 20:18:05 +02:00
Till Maas
3e6e536248 Avoid symlink loop and nonstandard top level roles directory - move to tests 2018-05-16 20:03:05 +02:00
Till Maas
4ead3cfea8 Move tests to /tests directory and rename to new naming scheme
Ansible Galaxy and
https://fedoraproject.org/wiki/CI/Standard_Test_Interface suggest to use
a /tests directory and a names matching test*.yml.
2018-05-16 19:48:23 +02:00
Till Maas
57a67a3785 Fix role symlink 2018-05-14 17:06:24 +02:00
Till Maas
af34b18b0f Use common roles directory to detect loops
This helps pytest to detect a loop.
2018-05-14 16:53:39 +02:00
Till Maas
b3163cdf20 Test more boolean values 2018-05-14 16:53:39 +02:00
Till Maas
9528ab4cba Use linux-system-roles.network as role name 2018-05-14 16:53:39 +02:00
Pavel Cahyna
08187ae624 Unset the executable bit on Ansible module.
Per the policy defined in https://docs.ansible.com/ansible/latest/dev_guide/testing/sanity/shebang.html.
(Some RPM checks
f7e8f73ead/f/brp-mangle-shebangs
do not like an executable script to have a #!/usr/bin/python shebang.)
2018-05-10 18:28:13 +02:00
Till Maas
b5143f8b44
Merge pull request #37 from tyll/dns_simpletest
Add unittest for single IPv4 DNS server
2018-04-12 21:31:26 +02:00
Till Maas
2c3fd58458
Merge pull request #36 from pcahyna/add0.4docs
Improved documentation, especially of the new options added in 0.4, and DNS.
2018-03-14 08:34:42 +01:00
Pavel Cahyna
5106cb67e8 doc: corrections from @tyll: among others, use yes/no for bools 2018-03-14 01:39:18 +01:00
Till Maas
168bd43629 Add unittest for single IPv4 DNS server 2018-03-13 16:15:35 +01:00
Till Maas
f0d0e0637b Add SPDX-License-Identifier headers 2018-03-13 10:06:30 +01:00
Till Maas
ab73cbc864 Rename license file to match linux system role template 2018-03-13 10:06:29 +01:00
Till Maas
5cd3d680fd Update license header 2018-03-13 10:06:29 +01:00
Pavel Cahyna
0204786c8a doc: infiniband is a valid connection type as well. 2018-03-09 15:36:46 +01:00
Pavel Cahyna
06eb0ff5d3 doc: document the ethernet specific options. 2018-03-09 15:36:34 +01:00
Pavel Cahyna
7e1b2f0117 doc: document the static routing related options. 2018-03-09 15:36:27 +01:00
Pavel Cahyna
0a7df307d4 doc: add a brief description of the dns and dns_search options
requested in bz1550128.
2018-03-09 15:32:00 +01:00
Pavel Cahyna
0921678f1b correct typo in documentation 2018-03-09 11:28:57 +01:00
Thomas Haller
84e4d3ac95 library: merge branch 'macvlan-pr27'
https://github.com/linux-system-roles/network/pull/27
2018-02-13 08:25:18 +01:00
Thomas Haller
2dbc68b7d9 library: fix tests for macvlan with initscripts 2018-02-13 08:23:59 +01:00