Commit Graph

3898 Commits

Author SHA1 Message Date
Dheeraj Gupta
08d1ee8baf Fix Python3 test errors 2018-02-28 16:44:29 +05:30
Dheeraj Gupta
aa9d709015 Pass env_vars to pip.freeze
pip.installed state calls pip.freeze to check for existing installation
and to verify installation post-install. This patch propagates the
env_vars passed to pip.installed to the pip.freeze function. It also modifies
existing pip unit tests to test new functionality and adds an integration test
that verifies the expected correct behavior

Fixes #46127
2018-02-28 16:44:20 +05:30
Erik Johnson
0eb012659c
Fix hanging tests in integration suite
A recent change to nginx appears to be causing this test to fail to
cache the test file in the temp nginx instance we've spun up. This
causes the return of cp.cache_file to be False, which in and of itself
should be enough to fail the test. But since we're not asserting on the
cp.cache_file results, flow proceeds to the next block of code, in which
we open the "file" that we cached. Some genius thought it would be a
swell idea to make io.open() successfully open a filehandle when the
path passed to it is a boolean False. When you try to read from this
filehandle, an AMAZING thing happens... It just blocks. Forever. I know,
right? Pure genius.

This commit adds an assert so that the test fails gracefully and doesn't
try to read from a bogus filehandle that SHOULDN'T EVEN EXIST.
2018-02-27 13:32:57 -06:00
Nicole Thomas
cf367dbd04
Merge pull request #45942 from terminalmage/issue45679-2017.7
Fix incorrect translation of docker port_bindings -> ports (2017.7 branch)
2018-02-13 11:10:02 -05:00
Nicole Thomas
007214f7bf
Merge pull request #45908 from DimensionDataResearch/fix/issue/45884
Fix for #45884 ("TypeError: can't serialize <NodeImage" when calling salt-cloud with the dimensiondata driver)
2018-02-12 17:05:28 -05:00
Erik Johnson
9cd47b39dd
Fix incorrect translation of docker port_bindings -> ports
The logic which ensures that we expose ports which are being bound,
even when not explicitly configured, was done incorrectly. UDP ports
were being passed to the API as '1234/udp' instead of (1234, 'udp').
This results in the port not being exposed properly.

The logic has been corrected. Additionally both the "ports" input
translation function, as well as the post-processing code (where the
port numbers configured in port_bindings were being added) both
contained code to "fix" any ports which were configured using
'portnum/tcp', as these must be passed to the API simply as integers. To
reduce code duplication, this normalization is now only performed at the
very end of the post-processing function, after ports have been
translated, and any missing ports from the port_bindings have been
added.

The unit test for the port_bindings input translation code, which was
written based upon the same incorrect reading of the API docs that
resulted in the incorrect behavior, have been updated to confirm the
(now) correct behavior. The unit test for the ports input translation
code has been updated to reflect the new normalization behavior.

Finally, an integration test has been added to ensure that we properly
expose UDP ports which are added as part of the post-processing
function.
2018-02-08 23:23:43 -06:00
Adam Friedman
1a75786b5a
Fix linter warnings.
saltstack/salt#45884
2018-02-09 05:16:59 +11:00
Adam Friedman
a2bc155c73
Use __utils__['cloud.'] instead of salt.cloud.utils.
saltstack/salt#45884
2018-02-08 08:39:33 +11:00
Adam Friedman
de26b03e2c
Fix copy/paste bug in dimensiondata provider integration test.
saltstack/salt#45884
2018-02-08 08:39:07 +11:00
Adam Friedman
6b1b6be427
Add integration tests for dimensiondata cloud provider.
saltstack/salt#45884
2018-02-08 08:38:58 +11:00
Erik Johnson
9d200efc26
Add regression test for issue 45893 2018-02-07 14:32:59 -06:00
Gareth J. Greenaway
359265869f
Adding a couple tests to ensure that duration is included in state run results even when states do not run. 2018-01-26 12:06:29 -08:00
rallytime
9f78e53d4b
Merge branch '2017.7.3' into '2017.7'
No conflicts.
2018-01-24 16:09:17 -05:00
Erik Johnson
4a6ab729dd
Fix failing pkg integration tests for releases with no '.'
Fedora releases are integers, and Arch's osrelease is simply `rolling`,
so https://github.com/saltstack/salt/pull/45636 caused these tests to
regress. This fixes them by moving the osrelease check until after the
MacOS check.

It also fixes the windows check, which would _always_ evaluate to `True`
since it was not calling the function. Therefore, the `if` would just be
a simple boolean which would resolve to `True` since it was just checking
a function reference.
2018-01-24 10:13:22 -06:00
Nicole Thomas
7934372b7b
Merge pull request #45649 from rallytime/bp-45634
Back-port #45634 to 2017.7.3
2018-01-24 09:59:42 -05:00
Nicole Thomas
e5c9cd91e8
Merge pull request #45619 from garethgreenaway/2017_7_test_mac_user_enable_auto_login
[2017.7] Fixing test_mac_user_enable_auto_login
2018-01-23 16:56:03 -05:00
Ch3LL
1c78fc23ea
Add different service name for Mac 10.13 test 2018-01-23 16:53:06 -05:00
Nicole Thomas
c290b6320b
Merge pull request #45634 from Ch3LL/mac-service
Add different service name for Mac 10.13 test
2018-01-23 16:51:56 -05:00
Nicole Thomas
0931b6417d
Merge pull request #45636 from Ch3LL/mac-tests
Fix mac service and pkg tests for 10.13
2018-01-23 13:44:55 -05:00
Ch3LL
df0ad54c9a
remove unnecessary variable for test 2018-01-23 11:47:32 -05:00
Ch3LL
acb14fd43d
fix pylint 2018-01-23 11:42:49 -05:00
Ch3LL
a9b12cd1ea
Fix mac service and pkg tests for 10.13 2018-01-23 11:39:06 -05:00
Ch3LL
31b712e27d
Add different service name for Mac 10.13 test 2018-01-23 10:07:10 -05:00
Gareth J. Greenaway
f5f03e1e6c
Fixing integration.modules.test_mac_user.MacUserModuleTest.test_mac_user_disable_auto_login 2018-01-22 14:10:23 -08:00
rallytime
a5fc3b3363
Merge branch '2017.7.3' into '2017.7'
No conflicts.
2018-01-22 11:55:54 -05:00
Erik Johnson
629e6c9674
Further fixes to for salt-ssh test under heavy load
This makes some further tweaks to make the test more stable under heavy
load. Firstly, the background job sleeps longer, and secondly, we make
up to 3 attempts run state.running instead of just the one, in case our
first attempt was too early. It also uses threading to make the job
sleep, since the method of adding a & to the command seemed to be
producing intermittent failures with returning clean JSON.
2018-01-22 07:33:42 -05:00
Daniel Wallace
f7fd35fc4a
test updating the minion blackout timeout to 10 seconds 2018-01-21 14:42:56 -07:00
Daniel Wallace
1f71f301ba
specify checking man page path
Without setting the man path, this would be checking that the installed salt
package used to bootstap has an spm man page, which is possible that it
doesn't, and also not what we want to check
2018-01-19 17:53:20 -07:00
Daniel Wallace
0ba39a7108
switch systemd-journald for sshd for arch service test
the running tests run second because of alphabetical order, and stopping sshd
does not kill off the running connection, so we know that sshd has to be on
arch for us to connect, so stop it with dead and start it back with running.

It is also not possible to stop the systemd-journald process without shutting
down the full machine.
2018-01-19 15:17:53 -07:00
rallytime
e0ffa32b49
Merge branch '2016.11' into '2017.7'
Conflicts:
  - tests/integration/modules/test_pkg.py
2018-01-19 10:09:36 -05:00
Daniel Wallace
f4b6367cf9
fix fedora pkg test
yum is no longer installed by default on fedora.  apparently it has been
removed from the base installs, and only dnf is available.  Stop depending on
the pkg manager, and just use bash.
2018-01-18 14:54:54 -07:00
Daniel Wallace
5455d2dee6
fix centos 6 pip test
flake8 is having problems installing on python2.6, switching to different
module that still works easily on python 2.6
2018-01-17 22:41:06 -07:00
Daniel Wallace
40255194b0
fix fedora pkg test
yum is no longer installed by default on fedora.  apparently it has been
removed from the base installs, and only dnf is available.  Stop depending on
the pkg manager, and just use bash.
2018-01-17 21:35:41 -07:00
rallytime
de6d85959a
Lint fix 2018-01-17 12:42:38 -05:00
rallytime
9f547a31f0
Merge branch '2016.11' into '2017.7' 2018-01-16 17:19:08 -05:00
Nicole Thomas
5f58a87e84
Merge pull request #45365 from meaksh/2017.7-issue-45345
Return an error when "gid_from_name" is set but group does not exist
2018-01-16 13:31:49 -05:00
Nicole Thomas
de080983e3
Merge pull request #44822 from frogunder/pkg_latestversion
add pkg_latest_version test
2018-01-16 09:16:53 -05:00
rallytime
590a6db626
Lint: use support TMP path instead of integration TMP path 2018-01-16 09:13:27 -05:00
Erik Johnson
919e92c911
Fix git.latest failure when rev is not the default branch 2018-01-14 08:25:30 -05:00
Erik Johnson
c081b2c62c
Fix git.latest failure when rev is not the default branch 2018-01-14 08:23:38 -05:00
Pablo Suárez Hernández
52f9c06908
Fix integration tests for 'user.present' state. 2018-01-12 12:47:29 +00:00
Erik Johnson
0cbc6767bf
Fix git.latest failure when rev is not the default branch 2018-01-11 15:26:35 -06:00
twangboy
0356b3d56f
Backport changes from #45308 2018-01-11 15:36:38 -05:00
Nicole Thomas
2340f0b487
Merge pull request #45380 from twangboy/backport_45308
Backport changes from #45308
2018-01-11 14:45:20 -05:00
Frode Gundersen
08644e02a0
skip if mac 2018-01-11 19:12:31 +00:00
Nicole Thomas
22c3efda06
Merge pull request #45371 from rallytime/bp-45158
Back-port #45158 to 2017.7
2018-01-11 12:51:37 -05:00
Erik Johnson
ff3039db6c
Skip flaky test on 2017.7 branch
The behavior of the set union used to combine ext_nodes and top file
matches is not consistent on Python 3 (well, 3.5 at least), and this
produces flaky test results.

Since we do not change things like the state compiler in point
releases, the method used to combine the ext_nodes and top file matches
has been changed for Oxygen and is now fully deterministic. This test
will therefore be skipped for the remainder of the 2017.7 release cycle
on Python 3.

Fixes https://github.com/saltstack/salt-jenkins/issues/686.
2018-01-10 16:02:32 -06:00
twangboy
419be8a9b5
Backport changes from #45308 2018-01-10 11:16:59 -07:00
Erik Johnson
3565bc2bf2
Don't use include-test SLS in orch tests
This was the _actual_ cause of the failing test in the state module
integration tests.
2018-01-10 10:29:15 -05:00
Erik Johnson
8bc17e0d7a
Fix integration.modules.test_state.StateModuleTest.test_exclude
test_exclude shares file paths with test_include, and while I can't
reproduce the failures, it is likely that improperly cleaned-up files
from test_include are causing the failures in test_exclude. This is
backed up by the fact that the state.sls return data from the
salt-runtests.log shows no trace of the "to-include-test" file
(suggesting it was excluded as expected), yet os.path.isfile() returns
True for this path, causing the test to fail.

This commit uses a distinct base dir for both tests, which should keep
this sort of failure from happening.
2018-01-10 10:29:15 -05:00