Commit graph

63 commits

Author SHA1 Message Date
Megan Wilhite
66cf74140b
Merge Freeze into Master (#60074)
* Merge 3002.6 bugfix changes (#59822)

* Pass `CI_RUN` as an environment variable to the test run.

This allows us to know if we're running the test suite under a CI
environment or not and adapt/adjust if needed

* Migrate `unit.setup` to PyTest

* Backport ae36b15 just for test_install.py

* Only skip tests on CI runs

* Always store git sha in _version.py during installation

* Fix PEP440 compliance.

The wheel metadata version 1.2 states that the package version MUST be
PEP440 compliant.

This means that instead of `3002.2-511-g033c53eccb`, the salt version
string should look like `3002.2+511.g033c53eccb`, a post release of
`3002.2` ahead by 511 commits with the git sha `033c53eccb`

* Fix and migrate `tests/unit/test_version.py` to PyTest

* Skip test if `easy_install` is not available

* We also need to be PEP440 compliant when there's no git history

* Allow extra_filerefs as sanitized kwargs for SSH client

* Fix regression on cmd.run when passing tuples as cmd

Co-authored-by: Alexander Graul <agraul@suse.com>

* Add unit tests to ensure cmd.run accepts tuples

* Add unit test to check for extra_filerefs on SSH opts

* Add changelog file

* Fix comment for test case

* Fix unit test to avoid failing on Windows

* Skip failing test on windows

* Fix test to work on Windows

* Add all ssh kwargs to sanitize_kwargs method

* Run pre-commit

* Fix pylint

* Fix cmdmod loglevel and module_names tests

* Fix pre-commit

* Skip ssh tests if binary does not exist

* Use setup_loader for cmdmod test

* Prevent argument injection in restartcheck

* Add changelog for restartcheck fix

* docs_3002.6

* Add back tests removed in merge

Co-authored-by: Pedro Algarvio <pedro@algarvio.me>
Co-authored-by: Megan Wilhite <megan.wilhite@gmail.com>
Co-authored-by: Bryce Larson <brycel@vmware.com>
Co-authored-by: Pablo Suárez Hernández <psuarezhernandez@suse.com>
Co-authored-by: Alexander Graul <agraul@suse.com>
Co-authored-by: Frode Gundersen <fgundersen@saltstack.com>

* Remove glance state module in favor of glance_image

* update wording in changelog

* bump deprecation warning to Silicon.

* Updating warnutil version to Phosphorous.

* Update salt/modules/keystone.py

Co-authored-by: Megan Wilhite <megan.wilhite@gmail.com>

* Check $HOMEBREW_PREFIX when linking against libcrypto

When loading `libcrypto`, Salt checks for a Homebrew installation of `openssl`
at Homebrew's default prefix of `/usr/local`. However, on Apple Silicon Macs,
Homebrew's default installation prefix is `/opt/homebrew`. On all platforms,
the prefix is configurable.  If Salt doesn't find one of those `libcrypto`s,
it will fall back on the un-versioned `/usr/lib/libcrypto.dylib`, which will
cause the following crash:

    Application Specific Information:
    /usr/lib/libcrypto.dylib
    abort() called
    Invalid dylib load. Clients should not load the unversioned libcrypto dylib as it does not have a stable ABI.

This commit checks $HOMEBREW_PREFIX instead of hard-coding `/usr/local`.

* Add test case

* Add changelog for 59808

* Add changelog entry

* Make _find_libcrypto fail on Big Sur if it can't find a library

Right now, if `_find_libcrypto` can't find any externally-managed versions of
libcrypto, it will fall back on the pre-Catalina un-versioned system libcrypto.
This does not exist on Big Sur and it would be better to raise an exception
here rather than crashing later when trying to open it.

* Update _find_libcrypto tests

This commit simplifies the unit tests for _find_libcrypto by mocking out the
host's filesystem and testing the common libcrypto installations (brew, ports,
etc.) on Big Sur. It simplifies the tests for falling back on system versions
of libcrypto on previous versions of macOS.

* Fix description of test_find_libcrypto_with_system_before_catalina

* Patch sys.platform for test_rsax931 tests

* modules/match: add missing "minion_id" in Pillar example

The documented Pillar example for `match.filter_by` lacks the `minion_id` parameter. Without it, the assignment won't work as expected.
- fix documentation
- add tests:
  - to prove the misbehavior of the documented example
  - to prove the proper behaviour when supplying `minion_id`
  - to ensure some misbehaviour observed with compound matchers doesn't occur

* Fix for issue #59773

- When instantiating the loader grab values of grains and pillars if
  they are NamedLoaderContext instances.
- The loader uses a copy of opts.
- Impliment deepcopy on NamedLoaderContext instances.

* Add changelog for #59773

* _get_initial_pillar function returns pillar

* Fix linter issues

* Clean up test

* Bump deprecation release for neutron

* Uncomment Sulfur release name

* Removing the _ext_nodes deprecation warning and alias.

* Adding changelog.

* Renaming changelog file.

* Update 59804.removed

* Initial pass at fips_mode config option

* Fix pre-commit

* Fix tests and add changelog

* update docs 3003

* update docs 3003 - newline

* Fix warts in changelog

* update releasenotes 3003

* add ubuntu-2004-amd64 m2crypto pycryptodome and tcp tests

* add distro_arch

* changing the cloud platforms file missed in 1a9b7be0e2

* Update __utils__ calls to import utils in azure

* Add changelog for 59744

* Fix azure unit tests and move to pytest

* Use contextvars from site-packages for thin

If a contextvars package exists one of the site-packages locations use
it for the generated thin tarball. This overrides python's builtin
contextvars and allows salt-ssh to work with python <=3.6 even when the
master's python is >3.6 (Fixes #59942)

* Add regression test for #59942

* Add changelog for #59942

* Update filemap to include test_py_versions

* Fix broken thin tests

* Always install the `contextvars` backport, even on Py3.7+

Without this change, salt-ssh cannot target systems with Python <= 3.6

* Use salt-factories to handle the container. Don't override default roster

* Fix thin tests on windows

* No need to use warn log level here

* Fix getsitepackages for old virtualenv versions

* Add explicit pyobjc reqs

* Add back the passthrough stuff

* Remove a line so pre-commit will run

* Bugfix release docs

* Bugfix release docs

* Removing pip-compile log files

* Fix failing test tests.unit.grains.test_core.CoreGrainsTestCase.test_xen_virtual

* Fix pre-commit for docs.txt reqs

Co-authored-by: Daniel Wozniak <dwozniak@saltstack.com>
Co-authored-by: Pedro Algarvio <pedro@algarvio.me>
Co-authored-by: Bryce Larson <brycel@vmware.com>
Co-authored-by: Pablo Suárez Hernández <psuarezhernandez@suse.com>
Co-authored-by: Alexander Graul <agraul@suse.com>
Co-authored-by: Frode Gundersen <fgundersen@saltstack.com>
Co-authored-by: Gareth J. Greenaway <gareth@saltstack.com>
Co-authored-by: Gareth J. Greenaway <gareth@wiked.org>
Co-authored-by: Hoa-Long Tam <hoalong@apple.com>
Co-authored-by: krionbsd <krion@freebsd.org>
Co-authored-by: Elias Probst <e.probst@ssc-services.de>
Co-authored-by: Daniel A. Wozniak <dwozniak@vmware.com>
Co-authored-by: Frode Gundersen <frogunder@gmail.com>
Co-authored-by: twangboy <slee@saltstack.com>
Co-authored-by: twangboy <leesh@vmware.com>
Co-authored-by: ScriptAutomate <derek@icanteven.io>
2021-04-27 11:47:47 -04:00
krionbsd
3c55ce4fe2 Move apache, zabbix, postgresql and rabbitmq state tests into own
directories.
2021-03-22 14:00:06 -04:00
krionbsd
6eb5064053 Rename tests 2021-03-19 08:44:16 +00:00
krionbsd
dd604458c5 Pack MySQL related tests into own directory.
Use pytest.importorskip
2021-03-19 08:44:16 +00:00
krionbsd
e353df7ae1 Move MySQL state tests to pytest 2021-03-19 08:44:16 +00:00
krionbsd
6c3c55f567 Move remaining PostgreSQL state tests to pytest.
Get rid of duplicate tests in PostgreSQL extensions and schemas.
2021-03-17 10:38:25 +00:00
krionbsd
59f4268894 Move user state tests to pytest 2021-03-16 15:15:28 -04:00
krionbsd
b3090d7055 Move multiple tests to pytest 2021-03-16 15:14:56 -04:00
Gareth J. Greenaway
4bb4edde40 Moving service state tests to pytest. 2021-03-05 10:03:56 -05:00
Pedro Algarvio
48cf93055e Define which tests must run when matchers change 2021-03-05 07:53:51 -05:00
krionbsd
2d40084abc Move openvswitch state tests to pytest 2021-03-02 13:22:14 +00:00
James Howe
1e219c9074
Add SCRAM-SHA-256 support to postgres states (#59034)
* Tests for existing postgres_user states. Basic usage and password-related.

* Fix minor failing tests in postgres_user.present

* Make postgres_group consistent with postgres_user

Related: #59028

* Add support for SCRAM-SHA-256 for PostgreSQL.

Fixes: #51217

* Some additional old postgres tests that are now redundant.

* Add postgres changelog entries.

* Update documentation for 3003 release

* Convert DB_ARGS constant to fixture

* Simplify six auto-removal

Co-authored-by: Pedro Algarvio <pedro@algarvio.me>

* filename_map.yml should still list pytests

* Another six removal simplification

Co-authored-by: Pedro Algarvio <pedro@algarvio.me>

Co-authored-by: Sage the Rage <36676171+sagetherage@users.noreply.github.com>
Co-authored-by: Gareth J. Greenaway <gareth@wiked.org>
Co-authored-by: Pedro Algarvio <pedro@algarvio.me>
2021-03-01 13:39:48 -07:00
krionbsd
8086103307 Move docker state tests to pytest 2021-03-01 04:06:01 +00:00
krionbsd
18c24f57b8 Move apache state tests to pytest 2021-02-26 07:23:12 +00:00
krionbsd
c90fc2fdac Move ssh state tests to pytest 2021-02-24 14:46:23 +00:00
krionbsd
028cc11fb8 Fix filename_map 2021-02-24 10:08:03 +00:00
krionbsd
672e97830a Move rabbitmq states tests to pytest 2021-02-21 20:37:19 +00:00
krionbsd
908c68a095 Move pkg state test to pytest 2021-02-20 07:45:25 +00:00
Pedro Algarvio
9247ece7a5 Migrate tests/integration/states/test_docker_container.py to PyTest 2021-02-18 14:29:19 +00:00
Pedro Algarvio
d8facfa16b Migrate integration.shell.test_cloud to PyTest 2021-01-08 21:24:36 +00:00
Pedro Algarvio
a3ddbadb53 Migrate integration.ssh.test_grains and integration.cli.test_grains to PyTest 2021-01-04 19:39:20 +00:00
Pedro Algarvio
84fdfca253 Migrate unit.serializers to PyTest 2021-01-04 11:27:50 +00:00
Pedro Algarvio
ce1d52ee33 Migrate integration.reactor.test_reactor to PyTest 2021-01-02 10:14:06 +00:00
Pedro Algarvio
d9c163f9b0 Migrate unit.setup to PyTest 2020-12-28 08:34:58 +00:00
Pedro Algarvio
a521ff1785 Migrate tests/integration/states/test_cron.py to PyTest 2020-12-05 10:16:47 +00:00
Pedro Algarvio
ed4b34525a Fix the filemap checks 2020-12-04 07:44:52 +00:00
Pedro Algarvio
19c72464df Migrate integration.minion.test_pillar to PyTest 2020-12-04 07:44:52 +00:00
Pedro Algarvio
2d3d26a6cd Migrate the minion blackout integration tests to PyTest 2020-12-03 09:32:12 +00:00
Pedro Algarvio
d753386493
Fix the tests file mapping 2020-09-14 15:29:13 +01:00
Pedro Algarvio
af85e37583
Migrate the test valid docs integration test to pytest 2020-09-14 09:04:31 +01:00
Pedro Algarvio
1b4d6bde59
This test module does not target linux service alone 2020-08-26 15:16:08 +01:00
Pedro Algarvio
8e4b94d847 Fix warn_until calls for the Sodium release 2020-05-23 12:55:03 -07:00
Pedro Algarvio
a5d6d14e51 Update/fix tests/filename_map.yml 2020-05-19 10:18:24 -07:00
Dmitry Kuzmenko
e5057287a7 Correct path to test_doc in filename_map.yml 2020-04-30 10:09:55 -07:00
Dmitry Kuzmenko
f9646c8e9d Remove salt/utils/vt.py duplication from filename map. 2020-04-30 10:09:55 -07:00
Pedro Algarvio
10a33a9eeb
These are not integration tests.
Additionally, created a base class which takes care of setup and cleanup
2020-04-24 09:55:50 +01:00
Daniel Wozniak
0b3e05077d
Merge pull request #56767 from s0undt3ch/port-to-master/50230
Port #50230 to master
2020-04-21 17:20:22 -07:00
rallytime
34808629ab
Add various ssh tests to the filemap for salt/utils/vt.py changes
Some of the salt-ssh tests use the salt/utils/vt.py functions. A recent
change in that file caused about 90 tests to start failing on the branch.

We need to make sure these tests run when changes to the vt.py util are
made in PRs.
2020-04-21 12:48:13 +01:00
Erik Johnson
4b3db2c7ae
Add the saltcli tests to the filename map salt/client/*
This updates the filename map added in #47337 to ensure that the salt
CLI tests are run when anything in salt.client files are updated.
2020-04-21 09:49:30 +01:00
Christian McHugh
e615b6a4a4 update tests to reflect service -> linux_service 2020-04-04 17:59:12 +01:00
Daniel A. Wozniak
0ea007de6f
Parse chattr version and fix test case
- Parse the system's chattr version from the chattr man page
- Fix integration.states.test_cron on centos 6
2019-04-21 22:19:45 +00:00
Daniel A. Wozniak
b0af11f3d3
Run include tests when pillar source changes 2019-04-10 22:41:47 +00:00
Gareth J. Greenaway
e37fc20e7c
Merge branch '2018.3' into merge-2018.3
Conflicts:
  - doc/ref/modules/all/index.rst
  - salt/states/file.py
  - tests/unit/modules/test_yumpkg.py
  - tests/unit/modules/test_zypperpkg.py
  - tests/unit/states/test_file.py
2019-02-22 16:38:15 -08:00
Daniel Wallace
d59952fce6
Merge branch '2018.3' into virtualnames 2019-02-19 16:59:42 -06:00
Daniel Wallace
33bb5bfe69
fix use of virtualname
Make sure that the virtualname is included in the actual filename of
core modules.  This will help speed up loading of modules that need to
use the virtualname, so that we hit @depends decorators less.
2019-02-19 13:16:06 -06:00
Ch3LL
ffa2f5fa50
Merge branch '2018.3' into '2019.2'
Conflicts:
  - pkg/windows/build_env_2.ps1
  - pkg/windows/build_env_3.ps1
  - pkg/windows/req.txt
  - pkg/windows/req_win.txt
  - salt/grains/core.py
2019-02-15 15:09:36 -05:00
Gareth J. Greenaway
0760133336
adding integration.scheduler.test_helpers to various files to by pass the test_module_name_source_match check. 2019-02-13 09:27:55 -08:00
Gareth J. Greenaway
0f15796484
Merge branch '2018.3' into merge-2018.3
Conflicts:
	salt/utils/schedule.py
2018-11-26 11:43:51 -08:00
Gareth J. Greenaway
45e160d8fe
Adding integration.scheduler.test_maxrunning to filename_map.yml 2018-11-23 17:07:16 -08:00
rallytime
a02564c7c0
Merge branch '2018.3' into 'fluorine'
Conflicts:
  - salt/utils/win_dacl.py
2018-11-05 14:06:42 -05:00