Commit graph

146 commits

Author SHA1 Message Date
Pedro Algarvio
03ad4c6337 Update code to be Py3.7+ to reduce merge forward conflicts 2024-02-29 10:16:58 +00:00
Thomas Phipps
021c6792bf fix the runner.run to have its own full_return that defautls to False so anything currently using runner.run will work the same as before. this is what i should have done from the start. 2023-06-27 12:14:57 +01:00
Thomas Phipps
dedade07d7 fix nightlys by mimicing what cli.run does to runner.run output in run_run_plus 2023-06-23 12:39:29 -07:00
Pedro Algarvio
4d49013247 Update to isort 5.10.1
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2022-08-01 12:49:16 -06:00
Daniel Wozniak
d9343cca65
Merge forward 3004.2 (#62200)
* Check only ssh-rsa encyption for set_known_host

* Windows test fix

* Fix pre-commit

* add CentOS Stream to _OS_FAMILY_MAP, fix #59161

* added changelog and test

* fix syntax

* Use centosstream 8 for testing

* Use ? for matching spaces

Technically this isn't *quite* right as 'CentOSyStream' would also
match, but it's pretty reasonable:

- OS grains shouldn't ever be that kind of close
- This test is only swapping out spaces, and only for the os grain. That
  would mean there would have to be two OSes with grains that only
  differ by one having a space where another one has any other
  character.
- This test really isn't even about matching grains, we're just using
  compound matching and that's a reasonable one to use.

* Add centos stream when detecting package manager name

* Fix pre-commit

* Remove tests for fedora 32/33 EOL

* Remove tests for fedora 32/33 EOL

* Remove tests for fedora 33 EOL

* Use centosstream 8 for testing

* Use ? for matching spaces

Technically this isn't *quite* right as 'CentOSyStream' would also
match, but it's pretty reasonable:

- OS grains shouldn't ever be that kind of close
- This test is only swapping out spaces, and only for the os grain. That
  would mean there would have to be two OSes with grains that only
  differ by one having a space where another one has any other
  character.
- This test really isn't even about matching grains, we're just using
  compound matching and that's a reasonable one to use.

* 3002.9: Fix pre-commit

* 3003.5 Fix pre-commit

* [3002.9] Replace use of 'sl' with 'paper' for Arch tests, due to 'sl' having key issues

* Remove mojave testing

* Remove mojave and high sierra testing

* Remove mojave testing

* [3002.9] Fix cloud vultr size issue

* Update package name to aspnetcore-runtime-6.0 for redhat 8 pkg tests

* Update package name to aspnetcore-runtime-6.0 for redhat 8 pkg tests

* change amazon linux AMI

* Migrate `unit.modules.test_gpg` to PyTest

* Don't leave any `gpg-agent`'s running behind

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>

* Start a background process to generate entropy.

Some tests have failed because of not enough entropy which then makes
the test timeout.

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>

* A different approach at generating entropy

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>

* Turn entropy generation into a helper

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>

* change amazon linux AMI

* change amazon linux AMI

* [3004.2] Fix cloud vultr size issue

* Fix cloud requirements

* Skip pam tests on windows

* Update ami to try to get the tests running

* Update amis to try to get the tests running

* Fixing test_publish_to_pubserv_ipc_tcp, moving the call to socket.socket into the while loop.

* Add static requirements for 3.8 and 3.9 on Windows

* Fix requirements

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>

* The whole CI process is already slower than GH Actions, no caches.

* Pre-commit must not run with ``PIP_EXTRA_INDEX_URL`` set.

* Lint fixes

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>

* Compile cloud requirements

* Run add requirements files for 3.8 and 3.9

* Fix docs and cloud requirements

* [3003.5] Fix cloud vultr size issue

* Windows test fix

* Skip test if docker not running

* [3003.5] Fix pre-commit

* Update Markup and contextfunction imports for jinja versions >=3.1.

* update bootstrap to 2022.03.15

* update bootstrap to 2022.03.15

* skipping tests/pytests/integration/modules/test_virt.py on 3002.x and 3003.x branches.

* Windows test fix

* Skip PAM tests on Windows

Windows has no ctypes with the PAM bits, so we should go ahead and skip
on Windows.

* Skip PAM auth tests on Windows

Windows lacks the correct bits, so...

* Fix pre-commit

* Skipping tests since they're also skipped on the master branch

Fixes #403

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>

* Skip test that only runs because the patch binary is now available.

The feature though, was only added in 3004.

Fixes #404

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>

* Skip test which is only supposed to run in Linux

Fixes https://github.com/saltstack/salt-priv/issues/405

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>

* GPG tests do not work on windows yet

* Fix tests

* Fix pre-commit

* skip tests.integration.modules.test_mac_brew_pkg.BrewModuleTest.test_list_upgrades and tests.integration.modules.test_state.StateModuleTest.test_get_file_from_env_in_top_match on Mac OS.

* skip tests.integration.modules.test_mac_brew_pkg.BrewModuleTest.test_list_upgrades and tests.integration.modules.test_state.StateModuleTest.test_get_file_from_env_in_top_match on Mac OS.

* Removing skip, moving it to different PR.

* Skipping tests on 3002.9.

* test fix

* Do not run patch tests on 3003.5. Feature not added till 3004

* skipping tests/pytests/integration/modules/test_virt.py on 3002.x and 3003.x branches.

* Fix pre-commit

* [3004.2] Update freebsd ami

* Bump the git version for freebsd CI tests

* removing versions that are no longer available from the tests.pytests.scenarios.compat.test_with_versions tests.

* Skip tests on windows when NOT using static requirements

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>

* removing versions that are no longer available from the tests.pytests.scenarios.compat.test_with_versions tests.

* test_issue_36469_tcp causes a fatal python error when run on Mac OS, so skipping.

* Fix tests

* Fix pre-commit

* Do not run patch tests on 3003.5. Feature not added till 3004

* Skip archive tar tests on windows

* [3002.9] Skip archive tar tests on windows

* GPG tests do not work on windows yet

* Skip test which is only supposed to run in Linux

Fixes https://github.com/saltstack/salt-priv/issues/405

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>

* Skip test that only runs because the patch binary is now available.

The feature though, was only added in 3004.

Fixes #404

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>

* Skipping tests since they're also skipped on the master branch

Fixes #403

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>

* Fix pre-commit

* Fix pre-commit

* Fix pre-commit

* Fix pre-commit

* retry sdb.get if it returns None

None is an entirely valid return - see EtcdClient.get in
salt/utils/etcd_util.py

* drop py2/six

* fix etcd sdb.set as well

* Fix etdcd-sdb test failure

If docker container is up and running, but etcd isn't responding yet
it's possible that we get some failing tests. This should wait a
reasonable amount of time for things to come up. Or just skip the test.

* Fix etdcd-sdb test failure

If docker container is up and running, but etcd isn't responding yet
it's possible that we get some failing tests. This should wait a
reasonable amount of time for things to come up. Or just skip the test.

* Skip the tests from unit/transport/test_zero.py that are hanging on Mac.

* skip tests in tests/pytests/unit/states/test_archive.py for 3002.9

* 3002.9 Skipping  CA permissions tests on Windows, similar to 3003.5 and 3004.2

* change skipif to skip

* Rollback Windows AMIs to use Python 3.7

* Rollback AMI's to Python 3.7... fix tests

* Fix failing test_archive tests

* Build using pyenv

* Add symlinks to openssl and rpath

* Add shasum for zeromq 4.3.4

* Fix docs on scripts

* Build zeromq earlier, fix symlinks

* Bring 61446 to 3004.1 branch

* Add changelog and tests

* Fix schedule test flakiness

* Retry with new port if in use

* fixing failing tests, ensuring that the correct path is used.

* fixing failing tests, ensuring that the correct path is used.

* fixing failing tests, ensuring that the correct path is used.

* Re-enable tiamat-pip on windows

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>

* Bump duration time for windwos for test_retry_option_success

* Skip test cauing hangs

* go go pylint disable

* more pre-commit

* oh lint

* so many weird hook failures

* Add unit tests for PAM auth CVE

We could add functional tests if it's important enough, but this is the
narrowest place to test.

* Fix PAM auth CVE

Credit to @ysf

Previously we weren't checking the result of PAM_ACCT_MGMT.

* pylint disable

* rewrite hook changes

* Skip PAM auth tests on Windows

Since Windows ends out lacking the correct bits, no need to run tests
there.

* pre-commit fixes

* docs 3004.2 release

* Fix bug in tcp transport

* Fix the test_zeromq_filtering test

* skip test_npm_install_url_referenced_package on centos 7 and 8.

* Swapping CentOS Linux-8 for CentOS Stream-8

* Update build scripts to use pyenv

* Fix tests on MacOS

* Fix bug in tcp transport

* Fix test failures

* Update release notes and man pages for 3003.5

* Add 3002.9 changelog, release notes, man pages

* Update doc/topics/releases/3002.9.rst

Co-authored-by: Megan Wilhite <mwilhite@vmware.com>

* Fix requirements

* Fix imports

* Test fixup

* Fix merge warts

* fix merge wart in changelog

* Fix merge warts in tests

Co-authored-by: krionbsd <krion@FreeBSD.org>
Co-authored-by: Megan Wilhite <megan.wilhite@gmail.com>
Co-authored-by: Alexander Kriventsov <akriventsov@nic.ru>
Co-authored-by: Megan Wilhite <mwilhite@vmware.com>
Co-authored-by: Wayne Werner <wwerner@vmware.com>
Co-authored-by: Gareth J. Greenaway <gareth@saltstack.com>
Co-authored-by: David Murphy < dmurphy@saltstack.com>
Co-authored-by: Twangboy <leesh@vmware.com>
Co-authored-by: MKLeb <calebb@vmware.com>
Co-authored-by: Pedro Algarvio <pedro@algarvio.me>
Co-authored-by: Pedro Algarvio <palgarvio@vmware.com>
Co-authored-by: Thomas Phipps <tphipps@vmware.com>
Co-authored-by: Frode Gundersen <frogunder@gmail.com>
Co-authored-by: Alyssa Rock <alyssa.rock@gmail.com>
Co-authored-by: Alyssa Rock <43180546+barbaricyawps@users.noreply.github.com>
2022-06-29 10:10:06 -06:00
Pedro Algarvio
29b6fe207c Updates required for `pytest-salt-factories>=1.0.0rc16`
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2022-06-02 07:05:09 -06:00
Pedro Algarvio
76e50885b0 Fix strings 2021-08-06 13:09:47 -07:00
Pedro Algarvio
6abb43d2df Upgrade to black 21.7b0 2021-08-06 13:09:47 -07:00
Pedro Algarvio
cbdac692b6 Fix UnboundLocalError introduced in https://github.com/saltstack/salt/pull/59244 2021-02-03 20:51:36 +00:00
Pedro Algarvio
bcc54d32d2 Don't prefix the command with env vars. Address close_fds for FreeBSD. 2021-02-03 15:00:23 +00:00
Pedro Algarvio
b769fcea53 Drop Py2 support 2021-02-03 15:00:23 +00:00
Pedro Algarvio
87019146af We no longer need the distinction between running under PyTest or not 2021-01-29 13:55:52 -05:00
Pedro Algarvio
2477ebfb35 Migrate multimaster tests to PyTest 2020-12-04 20:14:37 +00:00
Pedro Algarvio
cb92560b1d Fix the salt_ssh_cli fixture 2020-12-03 15:38:00 +00:00
Pedro Algarvio
f9ac5b1cbd
Tests calling wait_for_all_jobs need to have the sub_minion running 2020-09-15 08:04:20 +01:00
Pedro Algarvio
0aba49c7d3
Bump pytest-salt-factories to 0.92.x 2020-09-14 07:55:09 +01:00
Gareth J. Greenaway
c34c22f0ab Updating reactor runner integrations tests per changes. Updating run_run_plus to be able to override opts. 2020-09-08 17:50:24 -07:00
Daniel A. Wozniak
d182bdbd76 Fix saltcheck ssh test 2020-07-15 11:38:00 -07:00
Pedro Algarvio
53cc103cf8 Run pyupgrade against file 2020-07-14 19:25:31 -07:00
Pedro Algarvio
9605aa9aa5 Drop six usage 2020-07-14 19:25:31 -07:00
Pedro Algarvio
48e75ae6bf Always pass config_dif 2020-07-14 19:25:31 -07:00
Pedro Algarvio
ffe5161d80 Pass the config directory CLI argument when calling salt-cloud
Fixes #57903
2020-07-14 19:25:31 -07:00
Pedro Algarvio
5b528fe435 Allow providing the output we want back 2020-05-15 15:06:01 -07:00
Daniel A. Wozniak
c768a315e6 Fix mine tests, passing config to salt call 2020-05-14 02:36:03 -07:00
Pedro Algarvio
f082352459 Minor fixes to the run_run_plus method 2020-05-12 14:25:15 -07:00
Dmitry Kuzmenko
400e9de43b Fixed salt key management with eauth.
Properly pass minion list to wheel command in case of using eauth with
salt-key command. Test included.
2020-05-10 11:07:08 -07:00
Pedro Algarvio
ad95cd4c47 Update to saltfactories v0.7.14 2020-05-07 16:00:11 -07:00
Daniel Wozniak
42dccb8eed
Merge pull request #56372 from jdsieci/master-x509_fixes
Fix for #41858
2020-05-07 13:28:56 -07:00
Pedro Algarvio
4ee43eb7ce Reduce code duplication(complication) 2020-05-06 13:51:43 -07:00
Jerzy Drozdz
c2846525e6 Black reformatted files 2020-04-29 16:33:52 +02:00
Jerzy Drozdz
9f8d454487 Merge remote-tracking branch 'upstream/master' into master-x509_fixes 2020-04-29 16:19:20 +02:00
Pedro Algarvio
8b7a575f69 Stop relying on the self.config_dir attribute 2020-04-28 10:30:23 -07:00
Jerzy Drozdz
d0bb4ffed5
Merge branch 'master' into master-x509_fixes 2020-04-22 16:03:52 +02:00
Pedro Algarvio
e948532a14
Improve tests setup/teardown.
Additionally, don't use a fixed path to the `vaul` binary
2020-04-21 11:20:38 +01:00
Jerzy Drozdz
7275488d9f Resolved merge conflict by incorporating both suggestions. 2020-04-21 11:59:24 +02:00
ch3ll
04af219af9
run black against changes 2020-04-09 15:40:03 -04:00
ch3ll
0c365c19a4
add --pre-flight ssh option 2020-04-09 15:40:03 -04:00
ch3ll
4fa68c9dce
Add new ssh_pre_flight roster option 2020-04-09 15:39:59 -04:00
Blacken Salt
0b2a5613b3
Blacken salt 2020-04-03 13:05:41 -05:00
Jerzy Drozdz
432626c409 Added grains.delkey and grains.delval to known_to_return_none tuple 2020-03-16 11:48:20 +01:00
ch3ll
f6348127dc
Only change mine data if using new allow_tgt feature 2020-02-14 17:37:58 -05:00
Tyler Johnson
680790a957
Refactor the mac group tests
- Simplify setup and teardown logic with user/group.present/absent
 - Added a function for asserting salt-call with no return code
 - Skip tests if required modules and states aren't available
2020-01-14 00:05:16 -07:00
Christian McHugh
15c7e0258f
Merge branch 'master' into salt-check-fullmerge 2020-01-05 07:46:08 +00:00
Christian McHugh
ea47eac3a1 Merge branch 'port-49822' of github.com:mchugh19/salt into salt-check-fullmerge 2020-01-05 07:39:04 +00:00
Pedro Algarvio
35646c5ed9
Fix PyLint broad-except 2020-01-03 12:57:52 +00:00
Pedro Algarvio
b65b9ea760
Fix PyLint assignment-from-no-return 2020-01-03 12:57:50 +00:00
Pedro Algarvio
516de267cf
Completely separate master/minion fixtures for multimaster tests 2019-12-17 18:20:42 +00:00
Pedro Algarvio
da123df58f
Enable running multimaster tests under PyTest. 2019-12-17 18:20:42 +00:00
Pedro Algarvio
9fe0be3939
Remove multimaster specific function from regular module test class 2019-12-12 16:50:14 +00:00
Daniel Wozniak
1292b6d184
Merge pull request #55527 from s0undt3ch/features/pytest-staged-21
[PyTest #21] Test related fixes/cleanup
2019-12-12 09:44:36 -07:00