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
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.
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.
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.
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.
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
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.
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.
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.
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.
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.