Merge pull request #50917 from dwoz/test_fixes

Cherry pick test fixes from fluorine
This commit is contained in:
Daniel Wozniak 2018-12-19 10:56:18 -07:00 committed by GitHub
commit b08b7e1fd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 13 deletions

View File

@ -590,8 +590,8 @@ class GitProvider(object):
# According to stackoverflow (http://goo.gl/l74GC8), we are setting LANGUAGE as well # According to stackoverflow (http://goo.gl/l74GC8), we are setting LANGUAGE as well
# just to be sure. # just to be sure.
env = os.environ.copy() env = os.environ.copy()
env["LANGUAGE"] = "C" env[b"LANGUAGE"] = b"C"
env["LC_ALL"] = "C" env[b"LC_ALL"] = b"C"
cmd = subprocess.Popen( cmd = subprocess.Popen(
shlex.split(cmd_str), shlex.split(cmd_str),

View File

@ -483,6 +483,7 @@ class ShellCase(ShellTestCase, AdaptedConfigurationTestCaseMixin, ScriptPathMixi
_code_dir_ = CODE_DIR _code_dir_ = CODE_DIR
_script_dir_ = SCRIPT_DIR _script_dir_ = SCRIPT_DIR
_python_executable_ = PYEXEC _python_executable_ = PYEXEC
RUN_TIMEOUT = 500
def chdir(self, dirname): def chdir(self, dirname):
try: try:
@ -490,7 +491,8 @@ class ShellCase(ShellTestCase, AdaptedConfigurationTestCaseMixin, ScriptPathMixi
except OSError: except OSError:
os.chdir(INTEGRATION_TEST_DIR) os.chdir(INTEGRATION_TEST_DIR)
def run_salt(self, arg_str, with_retcode=False, catch_stderr=False, timeout=60, popen_kwargs=None): # pylint: disable=W0221 def run_salt(self, arg_str, with_retcode=False, catch_stderr=False, # pylint: disable=W0221
timeout=RUN_TIMEOUT, popen_kwargs=None):
''' '''
Execute salt Execute salt
''' '''
@ -504,7 +506,7 @@ class ShellCase(ShellTestCase, AdaptedConfigurationTestCaseMixin, ScriptPathMixi
log.debug('Result of run_salt for command \'%s\': %s', arg_str, ret) log.debug('Result of run_salt for command \'%s\': %s', arg_str, ret)
return ret return ret
def run_spm(self, arg_str, with_retcode=False, catch_stderr=False, timeout=60): # pylint: disable=W0221 def run_spm(self, arg_str, with_retcode=False, catch_stderr=False, timeout=RUN_TIMEOUT): # pylint: disable=W0221
''' '''
Execute spm Execute spm
''' '''
@ -517,7 +519,7 @@ class ShellCase(ShellTestCase, AdaptedConfigurationTestCaseMixin, ScriptPathMixi
return ret return ret
def run_ssh(self, arg_str, with_retcode=False, catch_stderr=False, # pylint: disable=W0221 def run_ssh(self, arg_str, with_retcode=False, catch_stderr=False, # pylint: disable=W0221
timeout=60, wipe=True, raw=False): timeout=RUN_TIMEOUT, wipe=True, raw=False):
''' '''
Execute salt-ssh Execute salt-ssh
''' '''
@ -538,7 +540,7 @@ class ShellCase(ShellTestCase, AdaptedConfigurationTestCaseMixin, ScriptPathMixi
return ret return ret
def run_run(self, arg_str, with_retcode=False, catch_stderr=False, def run_run(self, arg_str, with_retcode=False, catch_stderr=False,
asynchronous=False, timeout=180, config_dir=None, **kwargs): asynchronous=False, timeout=RUN_TIMEOUT, config_dir=None, **kwargs):
''' '''
Execute salt-run Execute salt-run
''' '''
@ -595,7 +597,8 @@ class ShellCase(ShellTestCase, AdaptedConfigurationTestCaseMixin, ScriptPathMixi
fun, opts_arg, ret) fun, opts_arg, ret)
return ret return ret
def run_key(self, arg_str, catch_stderr=False, with_retcode=False): def run_key(self, arg_str, catch_stderr=False, with_retcode=False, # pylint: disable=W0221
timeout=RUN_TIMEOUT):
''' '''
Execute salt-key Execute salt-key
''' '''
@ -604,11 +607,12 @@ class ShellCase(ShellTestCase, AdaptedConfigurationTestCaseMixin, ScriptPathMixi
arg_str, arg_str,
catch_stderr=catch_stderr, catch_stderr=catch_stderr,
with_retcode=with_retcode, with_retcode=with_retcode,
timeout=60) timeout=timeout)
log.debug('Result of run_key for command \'%s\': %s', arg_str, ret) log.debug('Result of run_key for command \'%s\': %s', arg_str, ret)
return ret return ret
def run_cp(self, arg_str, with_retcode=False, catch_stderr=False): def run_cp(self, arg_str, with_retcode=False, catch_stderr=False, # pylint: disable=W0221
timeout=RUN_TIMEOUT):
''' '''
Execute salt-cp Execute salt-cp
''' '''
@ -619,9 +623,10 @@ class ShellCase(ShellTestCase, AdaptedConfigurationTestCaseMixin, ScriptPathMixi
arg_str, arg_str,
with_retcode=with_retcode, with_retcode=with_retcode,
catch_stderr=catch_stderr, catch_stderr=catch_stderr,
timeout=60) timeout=timeout)
def run_call(self, arg_str, with_retcode=False, catch_stderr=False, local=False): def run_call(self, arg_str, with_retcode=False, catch_stderr=False, # pylint: disable=W0221
local=False, timeout=RUN_TIMEOUT):
''' '''
Execute salt-call. Execute salt-call.
''' '''
@ -631,11 +636,11 @@ class ShellCase(ShellTestCase, AdaptedConfigurationTestCaseMixin, ScriptPathMixi
arg_str, arg_str,
with_retcode=with_retcode, with_retcode=with_retcode,
catch_stderr=catch_stderr, catch_stderr=catch_stderr,
timeout=60) timeout=timeout)
log.debug('Result of run_call for command \'%s\': %s', arg_str, ret) log.debug('Result of run_call for command \'%s\': %s', arg_str, ret)
return ret return ret
def run_cloud(self, arg_str, catch_stderr=False, timeout=30): def run_cloud(self, arg_str, catch_stderr=False, timeout=RUN_TIMEOUT):
''' '''
Execute salt-cloud Execute salt-cloud
''' '''