mirror of
https://github.com/saltstack/salt.git
synced 2025-04-07 04:51:38 +00:00
Fix ssh and cmd mod tests
This commit is contained in:
parent
d3401c0c52
commit
a3b79144c1
3 changed files with 19 additions and 2 deletions
|
@ -762,4 +762,6 @@ allowed-3rd-party-modules=msgpack,
|
|||
cryptography,
|
||||
aiohttp,
|
||||
pytest_timeout,
|
||||
networkx
|
||||
networkx,
|
||||
urllib3,
|
||||
idna
|
||||
|
|
|
@ -20,12 +20,15 @@ import types
|
|||
import zipfile
|
||||
|
||||
import distro
|
||||
import idna
|
||||
import jinja2
|
||||
import looseversion
|
||||
import msgpack
|
||||
import networkx
|
||||
import packaging
|
||||
import requests
|
||||
import tornado
|
||||
import urllib3
|
||||
import yaml
|
||||
|
||||
import salt
|
||||
|
@ -282,6 +285,9 @@ def get_tops_python(py_ver, exclude=None, ext_py_ver=None):
|
|||
"tornado",
|
||||
"msgpack",
|
||||
"networkx",
|
||||
"requests",
|
||||
"idna",
|
||||
"urllib3",
|
||||
"certifi",
|
||||
"singledispatch",
|
||||
"concurrent",
|
||||
|
@ -441,6 +447,9 @@ def get_tops(extra_mods="", so_mods=""):
|
|||
backports_abc,
|
||||
looseversion,
|
||||
packaging,
|
||||
requests,
|
||||
idna,
|
||||
urllib3,
|
||||
]
|
||||
modules = find_site_modules("contextvars")
|
||||
if modules:
|
||||
|
|
|
@ -481,7 +481,13 @@ def test_runas(cmdmod, usermod, runas_usr):
|
|||
"""
|
||||
Ensure that the env is the runas user's
|
||||
"""
|
||||
out = cmdmod.run("env", runas=runas_usr).splitlines()
|
||||
# photon os sets the nobody user's home directory to /dev/null. This causes
|
||||
# runas to fail because the /dev/null is not a directory.
|
||||
cwd = None
|
||||
if os.path.expanduser(f"~{runas_usr}") == "/dev/null":
|
||||
cwd = "/"
|
||||
|
||||
out = cmdmod.run("env", runas=runas_usr, cwd=cwd).splitlines()
|
||||
assert f"USER={runas_usr}" in out
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue