Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iptables unit tests #30762

Merged
merged 8 commits into from Nov 1, 2017
Merged

Conversation

sebastiendarocha
Copy link
Contributor

@sebastiendarocha sebastiendarocha commented Sep 22, 2017

SUMMARY

Made some tests fot the iptables modules.

Discovered a small bug when removing a chain

ISSUE TYPE
  • Feature Pull Request
  • Bugfix Pull Request
COMPONENT NAME

system/iptables

ANSIBLE VERSION
ansible 2.5.0 (iptables_unit_tests 5312e98afc) last updated 2017/09/22 17:01:20 (GMT +200)
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/sebastien/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/sebastien/Source/ansible/lib/ansible
  executable location = /home/sebastien/Source/ansible/bin/ansible
  python version = 3.5.2 (default, Aug 18 2017, 17:48:00) [GCC 5.4.0 20160609]
ADDITIONAL INFORMATION

As a maintainer is needed, I propose myself to be a maintainer

test/units/modules/system$ pytest -r a  --color yes test_iptables.py::TestIptables
========================================================================================================================== test session starts ==========================================================================================================================
platform linux -- Python 3.5.2, pytest-3.2.2, py-1.4.34, pluggy-0.4.0
rootdir: /home/sebastien/Source/ansible, inifile:
plugins: xdist-1.20.0, mock-1.6.3, forked-0.2, f5-sdk-3.0.1
collected 12 items                                                                                                                                                                                                                                                       

test_iptables.py ............

======================================================================================================================= 12 passed in 0.03 seconds =======================================================================================================================

@ansibot
Copy link
Contributor

ansibot commented Sep 22, 2017

cc @LinusU
click here for bot help

@ansibot ansibot added affects_2.5 This issue/PR affects Ansible v2.5 core_review In order to be merged, this PR must follow the core review workflow. feature_pull_request module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. python3 support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Sep 22, 2017
@s-hertel s-hertel removed needs_triage Needs a first human triage before being processed. python3 labels Sep 22, 2017
@ansibot
Copy link
Contributor

ansibot commented Sep 22, 2017

The test ansible-test sanity --test ansible-doc --python 2.6 [?] failed with the following error:

Command "ansible-doc iptables" returned exit status 1.
>>> Standard Error
ERROR! module iptables missing documentation (or could not parse documentation): Parsing produced an empty object.

The test ansible-test sanity --test ansible-doc --python 2.7 [?] failed with the following error:

Command "ansible-doc iptables" returned exit status 1.
>>> Standard Error
ERROR! module iptables missing documentation (or could not parse documentation): Parsing produced an empty object.

The test ansible-test sanity --test ansible-doc --python 3.5 [?] failed with the following error:

Command "ansible-doc iptables" returned exit status 1.
>>> Standard Error
ERROR! module iptables missing documentation (or could not parse documentation): Parsing produced an empty object.

The test ansible-test sanity --test ansible-doc --python 3.6 [?] failed with the following error:

Command "ansible-doc iptables" returned exit status 1.
>>> Standard Error
ERROR! module iptables missing documentation (or could not parse documentation): Parsing produced an empty object.

The test ansible-test sanity --test pep8 [?] failed with the following error:

test/sanity/pep8/legacy-files.txt:421:1: A201 Remove "lib/ansible/modules/system/iptables.py" since it passes the current rule set

The test ansible-test sanity --test validate-modules [?] failed with the following error:

lib/ansible/modules/system/iptables.py:241:14: E302 DOCUMENTATION is not valid YAML

click here for bot help

@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed core_review In order to be merged, this PR must follow the core review workflow. labels Sep 22, 2017
@LinusU
Copy link
Contributor

LinusU commented Sep 22, 2017

Nice! 👍

@mattclay mattclay added the ci_verified Changes made in this PR are causing tests to fail. label Sep 22, 2017
@pilou-
Copy link
Contributor

pilou- commented Sep 24, 2017

@sebastiendarocha: there are two minor problems:

  1. lib/ansible/modules/system/iptables.py:241:14: E302 DOCUMENTATION is not valid YAML

    a plain style YAML string can not contains : (see). Adding single-quotes around the string will fix this error:

    - 'Specifies the error packet type to return while rejecting. It implies
      "jump: REJECT"'
    
  2. test/sanity/pep8/legacy-files.txt:421:1: A201 Remove "lib/ansible/modules/system/iptables.py" since it passes the current rule set

    Because PEP8 errors have been fixed (in this pull request), you need to remove lib/ansible/modules/system/iptables.py from test/sanity/pep8/legacy-files.txt.

@sebastiendarocha
Copy link
Contributor Author

sebastiendarocha commented Sep 25, 2017

Ok, thanks @pilou-, I'll give it a try tonight

I was close to find the solution for the doc, but not for the PEP8 ;-)

@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. and removed ci_verified Changes made in this PR are causing tests to fail. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Sep 25, 2017
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Oct 3, 2017
@ansibot ansibot added new_contributor This PR is the first contribution by a new community member. test This PR relates to tests. labels Oct 18, 2017
@mkrizek
Copy link
Contributor

mkrizek commented Nov 1, 2017

@sebastiendarocha can you please resolve the conflict?

@sebastiendarocha @LinusU Otherwise it looks good to me, anything else on this one before I merge? Thanks!

@ansibot ansibot added needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed core_review In order to be merged, this PR must follow the core review workflow. labels Nov 1, 2017
@ansibot
Copy link
Contributor

ansibot commented Nov 1, 2017

@sebastiendarocha this PR contains the following merge commits:

Please rebase your branch to remove these commits.

click here for bot help

@ansibot ansibot added merge_commit This PR contains at least one merge commit. Please resolve! and removed stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels Nov 1, 2017
@LinusU
Copy link
Contributor

LinusU commented Nov 1, 2017

Looks very good to me!

'ship_it'

@mkrizek
Copy link
Contributor

mkrizek commented Nov 1, 2017

@sebastiendarocha can you please do git rebase instead of merge? Let me know if you need help.

@ansibot ansibot removed merge_commit This PR contains at least one merge commit. Please resolve! needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html labels Nov 1, 2017
@sebastiendarocha
Copy link
Contributor Author

sebastiendarocha commented Nov 1, 2017

@mkrizek Is it better like that ?

@mkrizek
Copy link
Contributor

mkrizek commented Nov 1, 2017

@sebastiendarocha Yes :) I'll merge after the CI passes. Thanks for the PR!

@mkrizek mkrizek merged commit bc4ba6b into ansible:devel Nov 1, 2017
@ansibot ansibot added feature This issue/PR relates to a feature request. and removed feature_pull_request labels Mar 5, 2018
@ansible ansible locked and limited conversation to collaborators Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.5 This issue/PR affects Ansible v2.5 feature This issue/PR relates to a feature request. module This issue/PR relates to a module. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. new_contributor This PR is the first contribution by a new community member. support:core This issue/PR relates to code supported by the Ansible Engineering Team. test This PR relates to tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants