Commit graph

1887 commits

Author SHA1 Message Date
MKLeb
1a5d1a0fc5 Add __init__.py 2023-09-11 21:41:05 +01:00
MKLeb
c914144f7d Add downgrade tests directory 2023-09-11 21:41:05 +01:00
MKLeb
b960cd4f2a Add back the crypt import 2023-09-11 21:41:05 +01:00
MKLeb
8a0e2ec338 Some more cleanup 2023-09-11 21:41:05 +01:00
MKLeb
3a7995634b Slim down the package test suite helpers a little, there were some unneeded pieces 2023-09-11 21:41:05 +01:00
MKLeb
9e302736e8 Don't worry about the pkg_version, that is not of concern for us 2023-09-11 21:41:05 +01:00
MKLeb
4582cdce61 Remove hash fields, they are unused 2023-09-11 21:41:05 +01:00
MKLeb
afb229431c Add downgrade option for the install salt fixture 2023-09-11 21:41:05 +01:00
MKLeb
b167d2aa2a Add back the test for the retention of pip packages 2023-09-11 21:41:05 +01:00
MKLeb
79096a5118 Fix the debian upgrade problem from 3006.0 to 3006.1 or later versions 2023-09-11 21:41:05 +01:00
MKLeb
bee29be6dd
Merge remote-tracking branch 'upstream/3006.x' into mf/master/3006.x 2023-09-08 16:25:39 -04:00
Salt Project Packaging
8505972418
Release v3006.3 2023-09-06 17:02:29 +00:00
Daniel A. Wozniak
eb493bfdd5 Add salt-dbg to package tests 2023-09-06 16:38:52 +00:00
Daniel A. Wozniak
5a58aada3c Ignore un-packaged source files for source builds 2023-09-06 16:38:52 +00:00
Daniel A. Wozniak
d8721e5cd5 Add debug debian package 2023-09-06 16:38:52 +00:00
Daniel A. Wozniak
a189dab40d Build an rpm with debug symbols 2023-09-06 16:38:52 +00:00
twangboy
2d5584a309 Get default python and relenv versions from CICD 2023-08-31 14:30:32 -07:00
twangboy
91bd8ec154 Don't remove extras dir on uninstall 2023-08-31 14:30:32 -07:00
twangboy
ff962f8077 Copy directory right 2023-08-30 19:35:30 +00:00
twangboy
d3a40fc617 Use dist_scripts instead of scripts 2023-08-30 19:35:30 +00:00
twangboy
152ced0584 Get versions from cicd 2023-08-30 19:35:30 +00:00
twangboy
f57fba5aeb Update build script so it will build 2023-08-30 19:35:30 +00:00
twangboy
fb0e7a9d42 Keep extras on upgrade in macos 2023-08-30 19:35:30 +00:00
MKLeb
0a53cf320a Fix test_pip_non_root 2023-08-16 15:53:29 -07:00
Barney Sowood
a1188e2d5f Don't change ownership of /etc/salt/minion.d
No longer changes ownership of /etc/salt/minion.d to salt user for the
salt-master. Requires #64219 to be resolved.
2023-08-16 15:53:29 -07:00
Barney Sowood
1da32ae614 Remove seperate salt-cloud path tests
Removes seperate salt-cloud path tests as they are now covered by
test_pkg_paths
2023-08-16 15:53:29 -07:00
Barney Sowood
79c808623e Revert to not hardcoding python version in cloud deploy path 2023-08-16 15:53:29 -07:00
Barney Sowood
6b922be29e Return paths without setting var 2023-08-16 15:53:29 -07:00
Barney Sowood
6bdbae00d7 Calculaate python version 2023-08-16 15:53:29 -07:00
Barney Sowood
215975bac0 Fix call to sys.stdout.flush() 2023-08-16 15:53:29 -07:00
Barney Sowood
76df410a36 Add support for fixing old pkg perms
Adds support for fixing old package (3006.0/3006.1) perms that used the
salt user too widely.
Without doing this, tests don't pass for upgrades.
2023-08-16 15:53:29 -07:00
Barney Sowood
39b464a58d Remove some perms checks in conftest.py
Remove checks for perms on /var/log/salt/master and /var/run/salt/master
in the salt_master fixture as they may not existing during an upgrade
test and it's not critical to test them in the fixture.
2023-08-16 15:53:29 -07:00
Barney Sowood
b3d2a55535 Removing check on /etc/salt/minion.d
Removes check on /etc/salt/minion.d - it's causing issues in CI
that I can't reproduce locally and we'll deal with it in #64235
anyway.
2023-08-16 15:53:29 -07:00
Barney Sowood
ae40410dee Ensure salt-api service is enabled
Ensure salt-api service is enabled now we've added a postinst script
2023-08-16 15:53:29 -07:00
Barney Sowood
cc7611e1db Handle pytest-salt-factories permission changes
Handles permission changes caused by test suite running as root and
the creation of /var/cache/salt/master/.root_key.

Running the test suite as root means that /etc/salt/pki/master subdirs
get their ownership changed to root - clean that up in conftest.py.
No longer need to fix /var/log/salt as we handle the files in there
individually.

Adds exclusion for /var/cache/salt/master/.root_key as that gets created
by salt* cli tools running as root.
2023-08-16 15:53:29 -07:00
Barney Sowood
5d3ffc9e77 Handle creation of /var/log/salt/key 2023-08-16 15:53:29 -07:00
Barney Sowood
94adcd1b2c Remove group test for files
Removes group test for ownership on files by the salt user. Files that
are created by the salt-master process can be owned by salt:root, rather
than salt:salt and that's valid
2023-08-16 15:53:29 -07:00
Barney Sowood
b6661011d2 Add tests for package directory and file ownership
Adds test that checks that files and directories created by the packages
that should be owned by salt:salt are owned by that user and that the
other files/directories created are owned by root:root.
2023-08-16 15:53:29 -07:00
Barney Sowood
194e1a4603 Create empty log for salt-api
Creates empty log for salt-api owned by salt user in same way we do for
the master and salt-cloud
2023-08-16 15:53:29 -07:00
Barney Sowood
25c5a8e8d8 Move log creation and chown to posttrans
Moves log creation for /var/log/salt/master and /var/log/salt/cloud
and setting ownership to salt:salt to the %posttrans scriplets.
Whilst using %post work fine for fresh installs, upgrading means that
the previous package %postun removes those files. Using %posttrans
ensures the logs are created at the end of the full install/upgrade
transaction.
2023-08-16 15:53:29 -07:00
Barney Sowood
1aa8276e6c Correct docstrings for salt user test_salt_user
Corrects docstrings for salt user tests - they were all the same.
2023-08-16 15:53:29 -07:00
Barney Sowood
dc2e10b855 Create /var/run/salt/master
Creates /var/run/salt/master directory - if we don't create that
specifically the postinst script will fail
2023-08-16 15:53:29 -07:00
Barney Sowood
cd93818c86 Update files to verify in pkg tests
Updates lists of files to check in package tests when starting master.
We now set the following as owned by salt:salt in master postinst

* /etc/salt/pki/master
* /etc/salt/master.d
* /var/log/salt/master
* /var/cache/salt/master
* /var/run/salt/master
2023-08-16 15:53:29 -07:00
Barney Sowood
da6cfc99ab Reduce perms for salt user on other salt dirs
Reduces the permissions granted to the salt user used to run the
salt-master:

* Under /etc/salt limit ownership to  /etc/salt/pki/master and
  /etc/salt/master.d
* Until #64219 is resolved also include /etc/salt/minion.d
* Under /var/cache/salt and /var/run/salt only give ownership on
  master directories
* Under /var/log/salt, ensure /var/log/salt/master exists and give
  ownership oof that. Also update logrotate config to create that with
  correct ownership and perms and install that on debian packages.
2023-08-16 15:53:29 -07:00
Barney Sowood
af9ee1a9c6 Update packages for python modules owned by root
Updates Debian and RPM packages so that /opt/saltstack/salt and the
python packages don't have to be owned by salt user.

It shouldn't be necessary for salt user, used to run salt-master to be
able to write/modify files in that directory hierarchy.

Add postinst scripts to call the python compileall module to create
byte-compiled python modules. This should preserve performance whilst
not requiring write access for salt user.

Also cleans up .pyc files and __pycache__ dirs on removal.
2023-08-16 15:53:29 -07:00
Clay Oster
f4efa4fb79 Fix salt user login shell path in Debian packages 2023-08-16 12:49:45 +00:00
Pedro Algarvio
22107ebd32
Merge 3006.x into master 2023-08-15 22:29:25 +01:00
Caleb Beard
9e4e36bf0b
Merge pull request #64959 from MKLeb/mf/3006.2/3006.x
[3006.x] Merge 3006.2 into 3006.x
2023-08-14 17:30:28 -04:00
MKLeb
bbeffed460 Add Breaks and Replaces statements to debian/control 2023-08-14 13:02:09 -04:00
David Murphy
f0743ec9a8 Added tests for ufw allow salt 2023-08-11 10:22:09 +01:00