More name[casing] warnings are discovered by ansible-lint,
this may be due to the upgrade of ansible-lint.
Signed-off-by: Wen Liang <liangwen12year@gmail.com>
ansible-lint is confused by the use of `when:` with `lsr_assert_when`.
It thinks the `when` string should be evaluated as a Jinja expression
but it is really just a plain string. To make this more friendly to
ansible-lint, use `condition:` instead of `when:` with
`lsr_assert_when`.
Signed-off-by: Rich Megginson <rmeggins@redhat.com>
In some test playbooks, the `ignore_errors: true` can not be replaced
by `changed_when: false`, because `changed_when` is not a valid
attribute for a IncludeRole.
Signed-off-by: Wen Liang <liangwen12year@gmail.com>
Jinja templates should only be at the end of 'name'. This helps with
the identification of tasks inside the source code when they fail.
Signed-off-by: Wen Liang <liangwen12year@gmail.com>
ansible-lint 6.x syntax check raises `jinja[invalid]` error on the
mandatory variable 'network provider' because it is not defined. In
order to fix the problem, define the 'network_provider' variable in
the file .ansible-lint. The value of the variable is less important as
long as it is reasonable which only meets the purpose of passing the
ansible-lint 6.x syntax check.
Signed-off-by: Wen Liang <liangwen12year@gmail.com>
Update tox-lsr to 2.13.2
Update ansible-lint configuration
Add support for merge queues to github actions
This doesn't mean all system roles support merge queues,
this is just a preliminary step
See https://github.com/linux-system-roles/.github/pull/21
Signed-off-by: Rich Megginson <rmeggins@redhat.com>
When adding an approved PR to the merge queue, the required status
checks of the workflows are missing, which prevents the PR getting
merged. This commit is intended to trigger merge group checks with
Github Actions, so that the workflows will report the needed status
checks.
Signed-off-by: Wen Liang <liangwen12year@gmail.com>
Without an explicit output device, the kernel might use a different
output device than intended by the user. Therefore, use the interface
name of connections to specify it if it is available. Otherwise,
educate the user about this potential problem with a warning. This
aligns the behavior with NetworkManager which configures the output
device in routes when activating profiles on devices.
Fixes: https://bugzilla.redhat.com/2168735
Signed-off-by: Wen Liang <liangwen12year@gmail.com>
Simplify the parsing of route table IDs to avoid unnecessary exception
handling that makes the code harder to understand and triggers CodeQL
warnings. Also re-organize the unit tests and add a missing test for
table IDs higher than 0xFFFF_FFFF to achieve full test coverage.
Signed-off-by: Till Maas <opensource@till.name>
The newest ubuntu upgrade (ubuntu-22.04) in the github actions runner
image causes the CentOS 7 integration tests broken, to fix it, specify
the ubuntu-20.04 runner image for the CentOS 7 integration tests.
Signed-off-by: Wen Liang <liangwen12year@gmail.com>
Add a github action task to upload the coverage files
to codecov after the unit tests are complete.
Signed-off-by: Rich Megginson <rmeggins@redhat.com>
To allow a "non-inclusive word" in README.md, a wokeignore rule
was added as follows.
```
<!--- wokeignore:rule=word -->
"non-inclusive word" in kernel and NetworkManager.
```
When the markdown format is converged to the html format,
the comment line is treated as a blank line proceeded by `<p>`.
```
<p><!--- wokeignore:rule=word --><br />
"non-inclusive word" in kernel and NetworkManager.
```
Starting with `<p>` and being followed by`<br />`, the
wokeignore rule loses the ability to make the inclusive language
utility `woke` skip checking the non-inclusive word in the next
line.
Instead of putting the wokeignore rule comment above the non-
inclusive word, it's placed in the same line.
Signed-off-by: Noriko Hosoi <nhosoi@redhat.com>
There are now separate github actions for the various tests, instead of all of
them being done as part of the tox tests in tox.yml - ansible-lint,
ansible-test, etc.
Use the officially supported github actions e.g. for ansible-lint, ansible-test,
rather than using our own from `tox-lsr` and trying to keep up with the latest
changes. Developers will still be able to use `tox-lsr` on their local
development environments to run these tests in the same way that they are run in
github actions, so that errors found when submitting PRs can be reproduced and
corrected locally without too many github UI roundtrips.
Using separate github actions, and especially the official github actions which
generally have support for in-line comments, should help greatly with
readability and troubleshooting test results.
Python tests are removed from roles that do not use python.
Python tests are now done by python-unit-tests.yml which also does the black,
flake8, and pylint tests.
Signed-off-by: Rich Megginson <rmeggins@redhat.com>
Use `grep -E` instead of deprecated `egrep`
Ignore the "use double quotes" rule because we want the
variables to be expanded with all of the spaces.
Signed-off-by: Rich Megginson <rmeggins@redhat.com>
[1.11.1] - 2023-01-24
--------------------
- none
- none
- ansible-lint 6.x updates
- Support running the tests with ANSIBLE_GATHERING=explicit
- Clean up / Workaround non-inclusive words
- Add check for non-inclusive language
- fix the ansible-pull link, the old do not work
- tag all bond tests with expfail
Signed-off-by: Rich Megginson <rmeggins@redhat.com>
The bond tests fail regularly in our single host downstream testing,
so mark them as `expfail` (expect to fail) so that these failures
do not clutter up our test results.
We have tried to fix this in the past - several times over the past
three years, at a cost of many man weeks of effort - and the fixes just
don't seem to "take". We have reached the point where we need to cut
our losses and just skip these tests. Perhaps at some point in the
future we can revisit this issue.
Signed-off-by: Rich Megginson <rmeggins@redhat.com>
Add a check for usage of terms and language that is considered
non-inclusive. We are using the woke tool for this with a wordlist
that can be found at
https://github.com/linux-system-roles/tox-lsr/blob/main/src/tox_lsr/config_files/woke.yml
Note: this commit uses the customized woke placed locally in
.github/actions/custom-woke-action to support a new option
--count-only-error-for-failure option.
The local action custom-woke-action will be replaced with
the official woke once https://github.com/get-woke/woke/pull/252
(Add an option "--count-only-error-for-failure") is processed.
Signed-off-by: Noriko Hosoi <nhosoi@redhat.com>
Almost all the network role tests fail with fact gathering disabled.
Therefore, in order to support the tests running with
ANSIBLE_GATHERING=explicit, gather the minimum subset of facts
required.
Signed-off-by: Wen Liang <liangwen12year@gmail.com>
The only thing we need to skip currently is using FQCN for ansible
builtin modules, plugins
Add `kinds` - otherwise, Ansible thinks anything not in a traditional
role path is a plain YAML file, and we don't get the additional
checking.
Ensure all plays are named.
Fix some other minor problems.
Signed-off-by: Rich Megginson <rmeggins@redhat.com>