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

Conversation

Projects
None yet
7 participants
@sebastiendarocha
Contributor

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

This comment has been minimized.

Contributor

ansibot commented Sep 22, 2017

@ansibot

This comment has been minimized.

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 and removed core_review labels Sep 22, 2017

@LinusU

This comment has been minimized.

Contributor

LinusU commented Sep 22, 2017

Nice! 👍

@pilou-

This comment has been minimized.

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

This comment has been minimized.

Contributor

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 ;-)

@mkrizek

This comment has been minimized.

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

This comment has been minimized.

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 and removed stale_ci labels Nov 1, 2017

@LinusU

This comment has been minimized.

Contributor

LinusU commented Nov 1, 2017

Looks very good to me!

'ship_it'

@mkrizek

This comment has been minimized.

Contributor

mkrizek commented Nov 1, 2017

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

@sebastiendarocha sebastiendarocha force-pushed the sebastiendarocha:iptables_unit_tests branch to 9ffa931 Nov 1, 2017

@sebastiendarocha

This comment has been minimized.

Contributor

sebastiendarocha commented Nov 1, 2017

@mkrizek Is it better like that ?

@mkrizek

This comment has been minimized.

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

1 check passed

Shippable Run 42697 status is SUCCESS.
Details

@ansibot ansibot added feature and removed feature_pull_request labels Mar 5, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment