2013-12-26 16:40:24 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
'''
|
|
|
|
:codauthor: :email:`Mike Place <mp@saltstack.com>`
|
|
|
|
'''
|
|
|
|
|
|
|
|
# Import Salt Testing libs
|
2013-12-31 13:53:37 +00:00
|
|
|
from salttesting import TestCase, skipIf
|
2013-12-26 16:40:24 +00:00
|
|
|
from salttesting.helpers import ensure_in_syspath
|
2013-12-31 13:53:37 +00:00
|
|
|
from salttesting.mock import NO_MOCK, NO_MOCK_REASON, patch
|
2013-12-26 16:40:24 +00:00
|
|
|
|
|
|
|
from salt import minion
|
|
|
|
from salt.exceptions import SaltSystemExit
|
|
|
|
|
|
|
|
|
|
|
|
ensure_in_syspath('../')
|
|
|
|
|
|
|
|
__opts__ = {}
|
|
|
|
|
|
|
|
|
2013-12-31 13:53:37 +00:00
|
|
|
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
2013-12-26 16:40:24 +00:00
|
|
|
class MinionTestCase(TestCase):
|
|
|
|
def test_invalid_master_address(self):
|
|
|
|
with patch.dict(__opts__, {'ipv6': False, 'master': float('127.0'), 'master_port': '4555', 'retry_dns': False}):
|
2013-12-26 18:51:30 +00:00
|
|
|
self.assertRaises(SaltSystemExit, minion.resolve_dns, __opts__)
|