mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Create pip install directory for packages (except for windows, for now) and add some test coverage for the new pip install directory
This commit is contained in:
parent
405dc757b9
commit
3b49926587
4 changed files with 35 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
/var/cache/salt
|
||||
/var/log/salt
|
||||
/usr/share/fish/vendor_completions.d
|
||||
/opt/saltstack/salt/pypath
|
||||
/opt/saltstack/salt/extras-3.10
|
||||
|
|
|
@ -134,10 +134,15 @@ fi
|
|||
# Copy salt-config from Salt Repo to /opt/salt
|
||||
#-------------------------------------------------------------------------------
|
||||
SALT_DIR="$BUILD_DIR/opt/salt"
|
||||
SALT_EXTRAS_DIR="$BUILD_DIR/opt/salt/extras-3.10"
|
||||
if ! [ -d "$SALT_DIR" ]; then
|
||||
# We only need this for relenv builds
|
||||
mkdir -p "$SALT_DIR"
|
||||
fi
|
||||
if ! [ -d "$SALT_EXTRAS_DIR" ]; then
|
||||
# We only need this for relenv builds
|
||||
mkdir -p "$SALT_EXTRAS_DIR"
|
||||
fi
|
||||
if ! [ -f "$SALT_DIR/salt-config.sh" ]; then
|
||||
_msg "Staging Salt config script"
|
||||
cp "$SCRIPT_DIR/scripts/salt-config.sh" "$SALT_DIR/"
|
||||
|
|
|
@ -255,6 +255,7 @@ rm -rf %{buildroot}
|
|||
%{_bindir}/spm
|
||||
%{_bindir}/salt-pip
|
||||
/opt/saltstack/salt
|
||||
/opt/saltstack/salt/extras-3.10
|
||||
%dir %{_sysconfdir}/salt
|
||||
%dir %{_sysconfdir}/salt/pki
|
||||
|
||||
|
|
|
@ -51,6 +51,34 @@ def test_pip_install(salt_call_cli):
|
|||
assert "The github execution module cannot be loaded" in use_lib.stderr
|
||||
|
||||
|
||||
def test_pip_install(install_salt):
|
||||
"""
|
||||
Test salt-pip installs into the correct directory
|
||||
"""
|
||||
dep = "holidays"
|
||||
extras_keyword = "extras"
|
||||
try:
|
||||
install_ret = subprocess.run(
|
||||
install_salt.binary_paths["pip"] + ["install", dep],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
)
|
||||
assert not install_ret.stderr
|
||||
show_ret = subprocess.run(
|
||||
install_salt.binary_paths["pip"] + ["show", dep],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
)
|
||||
assert extras_keyword in show_ret.stderr
|
||||
finally:
|
||||
uninstall_ret = subprocess.run(
|
||||
install_salt.binary_paths["pip"] + ["uninstall", dep],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
)
|
||||
assert not uninstall_ret.stderr
|
||||
|
||||
|
||||
def demote(user_uid, user_gid):
|
||||
def result():
|
||||
os.setgid(user_gid)
|
||||
|
|
Loading…
Add table
Reference in a new issue