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

fix #49754 minion zmq connecting to master configured explicitly as IPv6 address or IPv6 only master #49755

Merged
merged 47 commits into from
Jan 15, 2019

Conversation

aphor
Copy link
Contributor

@aphor aphor commented Sep 24, 2018

What does this PR do?

fixes implementation of IPv6 address handling by minion and zeromq transport to enable minions to connect to a master identified only by IPv6 address or address/port

Work:

  • depends on Bugfix/rework: IPv6 scope errors #49705 [MERGED]
  • unit tests failing [FIXED]
  • integration tests failing [FIXED]
  • parsing config master: "host:port" [FIXED]
  • missing coverage for host:port parsing [FIXED]

What issues does this PR fix or reference?

#49754, possibly #40515

Tests written?

Yes, or rather test coverage added to existing tests.

Commits signed with GPG?

Yes

@aphor aphor requested a review from a team as a code owner September 24, 2018 05:35
@ghost ghost requested review from a team September 24, 2018 05:35
@aphor aphor force-pushed the issues/49754 branch 2 times, most recently from da03dc9 to b2f5889 Compare September 24, 2018 05:47
salt/minion.py Outdated Show resolved Hide resolved
salt/transport/zeromq.py Outdated Show resolved Hide resolved
salt/utils/win_reg.py Outdated Show resolved Hide resolved
salt/utils/win_reg.py Outdated Show resolved Hide resolved
tests/integration/utils/testprogram.py Outdated Show resolved Hide resolved
salt/utils/zeromq.py Outdated Show resolved Hide resolved
salt/utils/zeromq.py Outdated Show resolved Hide resolved
@aphor aphor force-pushed the issues/49754 branch 2 times, most recently from b75b77b to e3e8172 Compare September 24, 2018 19:38
@aphor aphor changed the title fix #49754 minion zmq connecting to master configured as IPv6 address fix #49754 minion zmq connecting to master configured as IPv6 address WIP needs #49705 Sep 24, 2018
@aphor aphor force-pushed the issues/49754 branch 2 times, most recently from cc0002f to f917636 Compare September 24, 2018 21:24
salt/minion.py Outdated Show resolved Hide resolved
salt/transport/zeromq.py Outdated Show resolved Hide resolved
salt/utils/zeromq.py Outdated Show resolved Hide resolved
@rallytime
Copy link
Contributor

Hrm. The tests aren't liking this change very much. There are quite a few failing tests here.

@aphor
Copy link
Contributor Author

aphor commented Oct 4, 2018 via email

@aphor
Copy link
Contributor Author

aphor commented Oct 5, 2018

Hrm. The tests aren't liking this change very much. There are quite a few failing tests here.

I rebased against 2018.3 head last night and only got 2 unit test failures.

This one(tests/unit/transport/test_zeromq.py", line 335) needs some work, so I'll look at that.

 --------  Failed Tests  ----------------------------------------------------------------------------------------------------------------------------------------------------------------
... stuff redacted as irrelevant to this PR ...
   -> unit.transport.test_zeromq.ZMQConfigTest.test_master_uri  .........................................................................................................................
       Traceback (most recent call last):
         File "/Users/aphor/src/salt.git/tests/unit/transport/test_zeromq.py", line 335, in test_master_uri
           source_port=s_port) == 'tcp://[{0}]:{1};[{2}]:{3}'.format(s_ip, s_port, m_ip, m_port)
       AssertionError
   ......................................................................................................................................................................................
 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
=========================================================================================================================================================================================
FAILED (total=7403, skipped=2100, passed=5298, failures=2, errors=3) 
================================================================================  Overall Tests Report  =================================================================================

@isbm
Copy link
Contributor

isbm commented Oct 5, 2018

@aphor BTW, we are running all that with PyTest. 😉 JFYI.

@aphor
Copy link
Contributor Author

aphor commented Oct 5, 2018

@aphor BTW, we are running all that with PyTest. 😉 JFYI.

Trust, but verify @isbm ! :)

I think I will have some time this weekend to fix things up. I appreciate your attention!

@aphor aphor force-pushed the issues/49754 branch 2 times, most recently from 06b67be to 372d733 Compare October 9, 2018 22:48
@rallytime
Copy link
Contributor

@aphor Unfortunately this still isn't quite right. This is failing quite a few integration tests.

@aphor
Copy link
Contributor Author

aphor commented Oct 15, 2018

IDK what is wrong with those tests. The failure logs say that kitchen didn't make a minion, and no targets matched :(

I'm going to fix stuff @isbm recommended, re-push, and then figure out what's wrong with the test kitchen.

@cachedout
Copy link
Contributor

@aphor I am re-running the test suite and pulling in the latest upstream branch changes.

@aphor
Copy link
Contributor Author

aphor commented Oct 17, 2018

There's one unit test failure I found that I need to fix with salt.transport.zeromq._get_master_uri().

I tried running the daemon tests --docked, but there's something wrong with the test containers missing the salt test code, and I don't have time to figure out how to make that work so I'm going to just fix the master_uri bug and re-push.

@aphor
Copy link
Contributor Author

aphor commented Jan 9, 2019

@aphor great! Except please do not in a future mention GitHub usernames in the commit messages. Because now every time this commit will be referenced/pushed/touched/transferred/etc, I will get another email. 😆

Sorry about that! I will amend and force push to get rid of that.

Error Message
object of type 'NoneType' has no len()
Stacktrace
Traceback (most recent call last):
  File "/tmp/kitchen/testing/tests/unit/utils/test_network.py", line 225, in test_parse_host_port
    host, port = network.parse_host_port(host_port)
  File "/tmp/kitchen/testing/salt/utils/network.py", line 1957, in parse_host_port
    raise _e_
TypeError: object of type 'NoneType' has no len()
@aphor aphor changed the title fix #49754 minion zmq connecting to master configured as IPv6 address WIP fix #49754 minion zmq connecting to master configured as IPv6 address Jan 9, 2019
@aphor
Copy link
Contributor Author

aphor commented Jan 10, 2019

@isbm I'd be grateful if you could review these changes.

I'm not sure why the py2-windows-2016 job is having problems. It doesn't look related to this change set.

This ends up in opts['master_ip'] where it can cause problems. I found
this while testng a git+pip based minion installation on Ubuntu Bionic.
I'm not sure why it doesn't affect other targeted OS versions in the
test framework. On Bionic, if 'salt' resolves to an IPv6 address,
zmq fails to connect to the master, and complains about the bracketed
address.
TypeError
https://docs.python.org/2/library/socket.html
RTFD "Note This method has historically accepted a pair of parameters
for AF_INET addresses instead of only a tuple. This was never
intentional and is no longer available in Python 2.0 and later.
"
Bogus random test failures
forklifted from develop at 414bfe6
This reverts commit 0af7653.

I guess that was way too optimistic.
@aphor
Copy link
Contributor Author

aphor commented Jan 11, 2019

tests.integration.minion.test_blackout is failing off and on for Ubuntu and Windows tests

I tried naïvely bringing the latest changes to that file from develop, but there's too much baggage.

@gtmanfred, @s0undt3ch is there anything you would recommend to make these red lights green?

salt/utils/network.py Outdated Show resolved Hide resolved
@s0undt3ch
Copy link
Collaborator

We have fixes in develop for that test which cannot be backported into 2018.3, but perhaps the 2019.2 branch changes are small enough to get that test more stable...

aphor and others added 5 commits January 11, 2019 09:26
confession: tests failed to complete on gitub notification auth failure,
so I want to trigger another test.
This reverts commit a07f356.

It wasn't necessary, and I want to trigger another round of tests on a Friday night.
@aphor aphor changed the title fix #49754 minion zmq connecting to master configured as IPv6 address fix #49754 minion zmq connecting to master configured explicitly as IPv6 address or IPv6 only master Jan 12, 2019
@aphor
Copy link
Contributor Author

aphor commented Jan 15, 2019

@rallytime I think this is ready for review.

@thatch45
Copy link
Contributor

@s0undt3ch @DmitryKuzmenko can either of you review and sign off here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants