Various fixes for MacOS X (#36085)

* Change "unknown" user to "some_unknown_user_xyz" since "unknown"
  *is* a valid user

* Add timeout to proxy test_exit_status_no_proxyid() since a known
  failure case is to infinitely loop with an error.

* Always force the source code tree under test to be the first entry
  in PYTHONPATH (excluding verbatim_env)
This commit is contained in:
plastikos 2016-09-06 16:30:08 -06:00 committed by Nicole Thomas
parent 017a3df12b
commit dde85e1144
5 changed files with 10 additions and 6 deletions

View file

@ -87,7 +87,7 @@ class MasterTest(integration.ShellCase, testprogram.TestProgramCase, integration
master = testprogram.TestDaemonSaltMaster(
name='unknown_user',
configs={'master': {'map': {'user': 'unknown'}}},
configs={'master': {'map': {'user': 'some_unknown_user_xyz'}}},
parent_dir=self._test_dir,
)
# Call setup here to ensure config and script exist

View file

@ -283,7 +283,7 @@ class MinionTest(integration.ShellCase, testprogram.TestProgramCase, integration
minion = testprogram.TestDaemonSaltMinion(
name='unknown_user',
configs={'minion': {'map': {'user': 'unknown'}}},
configs={'minion': {'map': {'user': 'some_unknown_user_xyz'}}},
parent_dir=self._test_dir,
)
# Call setup here to ensure config and script exist

View file

@ -46,6 +46,9 @@ class ProxyTest(testprogram.TestProgramCase):
verbatim_args=True, # prevents --proxyid from being added automatically
catch_stderr=True,
with_retcode=True,
# The proxy minion had a bug where it would loop forever
# without daemonizing - protect that with a timeout.
timeout=60,
)
self.assert_exit_status(
status, 'EX_USAGE',
@ -62,7 +65,7 @@ class ProxyTest(testprogram.TestProgramCase):
proxy = testprogram.TestDaemonSaltProxy(
name='proxy-unknown_user',
config_base={'user': 'unknown'},
config_base={'user': 'some_unknown_user_xyz'},
parent_dir=self._test_dir,
)
# Call setup here to ensure config and script exist

View file

@ -94,7 +94,7 @@ class SyndicTest(integration.ShellCase, testprogram.TestProgramCase, integration
syndic = testprogram.TestDaemonSaltSyndic(
name='unknown_user',
config_base={'user': 'unknown'},
config_base={'user': 'some_unknown_user_xyz'},
parent_dir=self._test_dir,
)
# Call setup here to ensure config and script exist

View file

@ -384,8 +384,9 @@ class TestProgram(six.with_metaclass(TestProgramMeta, object)):
for path in sys.path:
if path not in env_pypath:
env_pypath.append(path)
if integration.CODE_DIR not in env_pypath:
env_pypath.append(integration.CODE_DIR)
# Always ensure that the test tree is searched first for python modules
if integration.CODE_DIR != env_pypath[0]:
env_pypath.insert(0, integration.CODE_DIR)
env_delta['PYTHONPATH'] = ':'.join(env_pypath)
cmd_env = dict(os.environ)