Commit graph

253 commits

Author SHA1 Message Date
Pedro Algarvio
dc131a9369 Address Bandit's B602(subprocess_popen_with_shell_equals_true) on the test suite 2021-03-03 06:21:53 -05:00
Pedro Algarvio
cd004c9e8a Replace @skip_if_not_root with @pytest.mark.skip_if_not_root 2021-02-03 10:15:33 +00:00
Pedro Algarvio
967d26a7fc Replace @destructiveTest with @pytest.mark.destructive_test 2021-02-02 18:19:15 +00:00
Pedro Algarvio
6042877c41 Move test to the correct test module 2021-01-19 18:44:30 +00:00
Pedro Algarvio
be51287d41 Drop Py2 and six on tests/integration/states/test_file.py 2021-01-19 18:44:30 +00:00
Pedro Algarvio
767999f2fe Migrate state file tests which required pillar to PyTest 2020-12-03 15:38:00 +00:00
Gareth J. Greenaway
167a80dfdc Fixing the two failing tests when running on Photon OS. Python 3 installed on Photon OS does not support MD4 hashing, so don't load pdbedit module and skip the test_generate_nt_hash test. Default unmask for files and directories results in them having only user and group permissions so update the test_directory_max_depth test. 2020-12-02 14:20:32 -07:00
Pedro Algarvio
5193d09e4d Use a test class specific temp directory. Make sure to clean up after each test 2020-08-18 07:52:56 -07:00
krionbsd
9319ad52ae Fix broken test and disable another (temporary) on FreeBSD 2020-07-29 09:37:37 -07:00
cmcmarrow
686ce82947 add a test 2020-05-22 18:23:13 -07:00
Wesley Whetstone
8ae053ea54 add a file open argument check for plists as well as skip newline concatenation, include file state integration tests for plist 2020-05-19 10:16:07 -07:00
cmcmarrow
b9ba491091 add test 2020-05-08 18:48:34 -07:00
Wayne Werner
738ba7ce69
No skips for file state/module 2020-04-23 11:36:32 -05:00
Daniel Wozniak
be721e8986
Merge branch 'master' into port-to-master/50627 2020-04-21 14:59:57 -07:00
Wayne Werner
332f129e90
Skip slowest tests 2020-04-21 11:23:32 -05:00
Pedro Algarvio
4e45ed135b
Lint and formatting fixes. Update versionadded to Sodium. 2020-04-21 14:04:28 +01:00
Mattijs
f99e740638
mistook a blankline lint error for lack of blanklines between functions 2020-04-21 13:32:13 +01:00
Mattijs
362a7ff772
fixing as many PyLint errors as possible 2020-04-21 13:32:06 +01:00
Mattijs
26e55063d8
Adding a keyvalue method to the file state module
For making changes to files based on a key/value pair.
This commit also includes addition of an integration test to test
the new behaviour added.
2020-04-21 13:30:16 +01:00
Pedro Algarvio
6ba04cc7da
Add windows test whitelisting as pytest markers
Taken out from the pytest migration PR
2020-04-16 16:57:59 +01:00
Blacken Salt
0b2a5613b3
Blacken salt 2020-04-03 13:05:41 -05:00
Pedro Algarvio
35646c5ed9
Fix PyLint broad-except 2020-01-03 12:57:52 +00:00
Pedro Algarvio
6fca5e5098
Fix PyLint arguments-differ 2020-01-03 12:57:47 +00:00
Alan Somers
cb93478757 Fix the test_patch*failure tests on FreeBSD
FreeBSD's patch command has a slightly different error message than GNU
patch.  Adjust the tests' expectations to accept either error message.

Tested on FreeBSD 13 with the master branch.
2019-12-27 23:27:16 +00:00
ch3ll
26ae999bff
Fix pylint 2019-12-10 09:39:15 -05:00
ch3ll
a22b48edec
Merge remote branch 'upstream/master' into mf-master
Conflicts:
  - tests/unit/utils/test_http.py
2019-12-10 09:11:06 -05:00
Daniel Wozniak
831d22995f
Merge pull request #54929 from xeacott/contents_newline_new_fix
Address file.managed with contents_newline flag
2019-12-09 16:50:30 -07:00
ch3ll
33bc5bd840
Merge remote branch 'upstream/master' into mf-master
Conflicts:
  - tests/integration/modules/test_state.py
  - tests/integration/states/test_docker_container.py
  - tests/integration/states/test_ssh_known_hosts.py
  - tests/support/runtests.py
  - tests/unit/modules/test_win_file.py
  - tests/unit/modules/test_zcbuildout.py
  - tests/unit/states/test_zcbuildout.py
2019-12-04 15:50:25 -05:00
ch3ll
8ca43b0a0d
Merge branch 'upstream/master' into mf-master
Conflicts:
  - doc/topics/jinja/index.rst
  - requirements/static/lint.in
  - requirements/static/py2.7/lint.txt
  - requirements/static/py2.7/windows.txt
  - requirements/static/py3.5/windows.txt
  - requirements/static/py3.6/windows.txt
  - requirements/static/py3.7/windows.txt
  - tests/support/helpers.py
  - tests/support/runtests.py
2019-12-03 14:07:21 -05:00
Joe Eacott
ccbaae2e5b
Merge branch 'master' into contents_newline_new_fix 2019-12-03 09:48:56 -07:00
Pedro Algarvio
395b8fbd3a
Respect RUNTIME_VARS.TMP for tests temp files
Conflicts:
* tests/integration/states/test_file.py
2019-12-03 15:22:34 +00:00
Pedro Algarvio
ac0db895ab
Prefer RUNTIME_VARS usage 2019-12-03 15:22:34 +00:00
Pedro Algarvio
af2cb82013
Skip tests which are not supposed to pass under windows.
Previously, using `runtests.py`, we were just logging and ignoring the
fact that `file.get_mode` was returning `None`.
2019-12-02 17:23:04 +00:00
Joe Eacott
8224d617c4
Merge branch 'master' into contents_newline_new_fix 2019-11-25 10:13:32 -07:00
xeacott
c50b416860
Fix logic and add more tests 2019-11-19 14:14:00 -07:00
Megan Wilhite
135c5e38d4
Merge branch 'master' into mf-master 2019-11-19 15:45:34 -05:00
Ch3LL
355551c83b
Merge remote-tracking branch 2018.3 into master
Conflicts:
  - .ci/docs
  - .ci/kitchen-amazon2-py2
  - .ci/kitchen-amazon2-py3
  - .ci/kitchen-centos6-py2
  - .ci/kitchen-centos7-py2
  - .ci/kitchen-centos7-py3
  - .ci/kitchen-debian8-py2
  - .ci/kitchen-debian9-py2
  - .ci/kitchen-debian9-py3
  - .ci/kitchen-fedora29-py2
  - .ci/kitchen-fedora29-py3
  - .ci/kitchen-ubuntu1604-py2
  - .ci/kitchen-ubuntu1604-py3
  - .ci/kitchen-ubuntu1804-py2
  - .ci/kitchen-ubuntu1804-py3
  - .ci/kitchen-windows2016-py2
  - .ci/kitchen-windows2016-py3
  - .ci/lint
  - .gitignore
  - .pre-commit-config.yaml
  - doc/man/salt-api.1
  - doc/man/salt-call.1
  - doc/man/salt-cloud.1
  - doc/man/salt-cp.1
  - doc/man/salt-key.1
  - doc/man/salt-master.1
  - doc/man/salt-minion.1
  - doc/man/salt-proxy.1
  - doc/man/salt-run.1
  - doc/man/salt-ssh.1
  - doc/man/salt-syndic.1
  - doc/man/salt-unity.1
  - doc/man/salt.1
  - doc/man/salt.7
  - doc/man/spm.1
  - doc/topics/releases/2018.3.5.rst
  - noxfile.py
  - pkg/osx/req.txt
  - pkg/windows/req.txt
  - requirements/static/amzn-2018.03.in
  - requirements/static/arch.txt
  - requirements/static/centos-6.txt
  - requirements/static/centos-7.in
  - requirements/static/centos-7.txt
  - requirements/static/cloud.in
  - requirements/static/debian-8.txt
  - requirements/static/debian-9.txt
  - requirements/static/fedora-28.txt
  - requirements/static/fedora-29.txt
  - requirements/static/fedora-30.in
  - requirements/static/lint.in
  - requirements/static/opensuse-42.txt
  - requirements/static/opensuse-leap-15.txt
  - requirements/static/osx.in
  - requirements/static/py2.7/cloud.txt
  - requirements/static/py2.7/lint.txt
  - requirements/static/py2.7/raet-arch.txt
  - requirements/static/py2.7/raet-centos-6.txt
  - requirements/static/py2.7/raet-debian-8.txt
  - requirements/static/py2.7/raet-debian-9.txt
  - requirements/static/py2.7/raet-fedora-30.txt
  - requirements/static/py2.7/raet-opensuse-42.txt
  - requirements/static/py2.7/raet-opensuse-leap-15.txt
  - requirements/static/py2.7/raet-ubuntu-16.04.txt
  - requirements/static/py2.7/raet-ubuntu-18.04.txt
  - requirements/static/py2.7/zeromq-amzn-2018.03.txt
  - requirements/static/py2.7/zeromq-arch.txt
  - requirements/static/py2.7/zeromq-centos-6.txt
  - requirements/static/py2.7/zeromq-centos-7.txt
  - requirements/static/py2.7/zeromq-debian-8.txt
  - requirements/static/py2.7/zeromq-debian-9.txt
  - requirements/static/py2.7/zeromq-fedora-29.txt
  - requirements/static/py2.7/zeromq-fedora-30.txt
  - requirements/static/py2.7/zeromq-opensuse-leap-15.txt
  - requirements/static/py2.7/zeromq-osx.txt
  - requirements/static/py2.7/zeromq-ubuntu-16.04.txt
  - requirements/static/py2.7/zeromq-ubuntu-18.04.txt
  - requirements/static/py2.7/zeromq-windows.txt
  - requirements/static/py3.4/cloud.txt
  - requirements/static/py3.4/zeromq-arch.txt
  - requirements/static/py3.4/zeromq-centos-7.txt
  - requirements/static/py3.4/zeromq-debian-8.txt
  - requirements/static/py3.4/zeromq-debian-9.txt
  - requirements/static/py3.4/zeromq-fedora-29.txt
  - requirements/static/py3.4/zeromq-fedora-30.txt
  - requirements/static/py3.4/zeromq-opensuse-leap-15.txt
  - requirements/static/py3.4/zeromq-ubuntu-16.04.txt
  - requirements/static/py3.4/zeromq-ubuntu-18.04.txt
  - requirements/static/py3.5/cloud.txt
  - requirements/static/py3.5/zeromq-arch.txt
  - requirements/static/py3.5/zeromq-centos-7.txt
  - requirements/static/py3.5/zeromq-debian-8.txt
  - requirements/static/py3.5/zeromq-debian-9.txt
  - requirements/static/py3.5/zeromq-fedora-29.txt
  - requirements/static/py3.5/zeromq-fedora-30.txt
  - requirements/static/py3.5/zeromq-opensuse-leap-15.txt
  - requirements/static/py3.5/zeromq-osx.txt
  - requirements/static/py3.5/zeromq-ubuntu-16.04.txt
  - requirements/static/py3.5/zeromq-ubuntu-18.04.txt
  - requirements/static/py3.5/zeromq-windows.txt
  - requirements/static/py3.6/cloud.txt
  - requirements/static/py3.6/zeromq-arch.txt
  - requirements/static/py3.6/zeromq-centos-7.txt
  - requirements/static/py3.6/zeromq-debian-8.txt
  - requirements/static/py3.6/zeromq-debian-9.txt
  - requirements/static/py3.6/zeromq-fedora-29.txt
  - requirements/static/py3.6/zeromq-fedora-30.txt
  - requirements/static/py3.6/zeromq-opensuse-leap-15.txt
  - requirements/static/py3.6/zeromq-osx.txt
  - requirements/static/py3.6/zeromq-ubuntu-16.04.txt
  - requirements/static/py3.6/zeromq-ubuntu-18.04.txt
  - requirements/static/py3.6/zeromq-windows.txt
  - requirements/static/py3.7/cloud.txt
  - requirements/static/py3.7/zeromq-arch.txt
  - requirements/static/py3.7/zeromq-centos-7.txt
  - requirements/static/py3.7/zeromq-debian-8.txt
  - requirements/static/py3.7/zeromq-debian-9.txt
  - requirements/static/py3.7/zeromq-fedora-29.txt
  - requirements/static/py3.7/zeromq-fedora-30.txt
  - requirements/static/py3.7/zeromq-opensuse-leap-15.txt
  - requirements/static/py3.7/zeromq-osx.txt
  - requirements/static/py3.7/zeromq-ubuntu-16.04.txt
  - requirements/static/py3.7/zeromq-ubuntu-18.04.txt
  - requirements/static/py3.7/zeromq-windows.txt
  - requirements/static/ubuntu-14.04.txt
  - requirements/static/ubuntu-16.04.txt
  - requirements/static/windows.in
  - salt/client/mixins.py
  - salt/crypt.py
  - salt/daemons/flo/core.py
  - salt/daemons/flo/worker.py
  - salt/daemons/flo/zero.py
  - salt/engines/http_logstash.py
  - salt/engines/logstash_engine.py
  - salt/modules/beacons.py
  - salt/modules/chocolatey.py
  - salt/modules/cron.py
  - salt/modules/file.py
  - salt/modules/gpg.py
  - salt/modules/http.py
  - salt/modules/state.py
  - salt/modules/win_file.py
  - salt/modules/win_task.py
  - salt/states/file.py
  - salt/states/pip_state.py
  - salt/states/saltmod.py
  - salt/transport/ipc.py
  - salt/transport/tcp.py
  - salt/transport/zeromq.py
  - salt/utils/cloud.py
  - salt/utils/napalm.py
  - salt/utils/schedule.py
  - salt/utils/vmware.py
  - salt/utils/yamlloader.py
  - tests/integration/__init__.py
  - tests/integration/client/test_kwarg.py
  - tests/integration/cloud/clouds/test_ec2.py
  - tests/integration/cloud/clouds/test_gogrid.py
  - tests/integration/cloud/clouds/test_oneandone.py
  - tests/integration/cloud/clouds/test_vmware.py
  - tests/integration/cloud/clouds/test_vultrpy.py
  - tests/integration/files/pillar/base/top.sls
  - tests/integration/modules/test_cp.py
  - tests/integration/modules/test_pip.py
  - tests/integration/modules/test_pkg.py
  - tests/integration/modules/test_state.py
  - tests/integration/modules/test_system.py
  - tests/integration/modules/test_win_lgpo.py
  - tests/integration/shell/test_call.py
  - tests/integration/states/test_beacon.py
  - tests/integration/states/test_pip_state.py
  - tests/integration/states/test_pkg.py
  - tests/support/generate-names-file-from-failed-test-reports.py
  - tests/support/gitfs.py
  - tests/support/helpers.py
  - tests/unit/modules/test_file.py
  - tests/unit/modules/test_gpg.py
  - tests/unit/modules/test_localemod.py
  - tests/unit/modules/test_win_file.py
  - tests/unit/modules/test_win_lgpo.py
  - tests/unit/states/test_file.py
  - tests/unit/states/test_pip_state.py
  - tests/unit/test_loader.py
  - tests/unit/utils/test_pycrypto.py
  - tests/unit/utils/test_schema.py
2019-10-16 10:17:36 -04:00
xeacott
3bcf314d9c
Allow windows to handle binary file in file.managed and add test 2019-10-08 13:44:01 -06:00
xeacott
c104f3ae3f
Address file.managed with binary file 2019-10-08 11:47:51 -06:00
Gareth J. Greenaway
362b84a945
Adding a WAR ROOM Skip for test_directory_clean_require_with_name 2019-07-23 11:33:08 -07:00
Shane Lee
571d82a128
Merge branch '2019.2.1' into bugs/test_file_recurse_set 2019-06-25 10:07:06 -06:00
Gareth J. Greenaway
1d4e228f15
Updating various skips for tests to only skip if OS is OS X and Python is Python2. 2019-06-20 07:04:21 -07:00
Gareth J. Greenaway
87888778fe
Skip integration.states.test_file.FileTest.test_issue_11003_immutable_lazy_proxy_sum and
integration.states.test_pip_state.PipStateTest.test_22359_pip_installed_unless_does_not_trigger_warnings when running on OS X.
2019-06-20 07:04:21 -07:00
Gareth J. Greenaway
1741bb053b
Adding some timeouts to see if it helps the tests pass on OS X. 2019-06-20 07:04:20 -07:00
Gareth J. Greenaway
fd0ba0aea9
Ensure the user and group used by @with_system_user_and_group are consistent. 2019-06-20 07:04:20 -07:00
twangboy
299f88f78e
Update test_managed_contents 2019-06-17 15:02:07 -06:00
twangboy
81110e55ce
Fix test_file_copy_make_dirs that was failing on Linux
I wasn't running sudo, but now it tells you that
And verifies that the user is added and the state is run successfully
before continuing with the test
2019-06-17 15:02:07 -06:00
twangboy
4a9c020787
Fix issues with win_runas
modules/file.py:     Pass the right parameters to `check_perms` on Windows
platform/win.py:     Return actual error on runas failure
platform/win.py:     Setup environment for CreateProcessWithLogonW
states/file.py:      Pass the right parameters to `file.check_perms` on
                     Windows
states/zfs.py:       Fix __virtual__ so it doesn't stacktrace in Windows
                     logs
states/zpool.py:     Fix __virtual__ so it doesn't stacktrace in Windows
                     logs
utils/win_runas.py:  Cleanup the handles a little better by using some
                     try/finally blocks.
states/test_file.py: Just use os.mkdir on Windows as the mode is ignored
2019-06-17 15:02:06 -06:00
Dmitry Kuzmenko
013e04ca6e
Recurse kwarg of state.directory state shall be a list of None 2019-05-29 14:44:02 +03:00
Wayne Werner
a1c6bcff6e
Use six.reraise for the greater good
In Python2, `raise exc` obliterates the stack trace. That's no good.

Fortunately, six has a useful syntax that works across Python versions.
It does have the downside of adding `reraise` to the stacktrace, but
otherwise, this should be better.
2019-05-21 12:27:13 -05:00