Commit Graph

3460 Commits

Author SHA1 Message Date
Erik Johnson
5ad476936d Overhaul Docker support
This does the following:

- Splits states for container/volume/image/network management into four
  separate state modules.

- Preserves backward compatibility by making ``docker.image_present``
  invoke ``docker_image.present``, etc.

- Changes how Salt detects that a container needs to be replaced.
  Instead of comparing each passed argument to the named container's
  configuration, it creates a temporary container, and compares that
  container to the named container. If the two differ, then the older
  container is removed, and the new one is renamed and started, becoming
  the named container.

- Removes the unit tests for container management and replaces them with
  integration tests.

- Adds unit tests for the new salt.utils.docker
2017-03-21 16:53:19 -05:00
rallytime
a6a7538fe4 Pylint fix 2017-03-21 13:39:34 -06:00
rallytime
2222e1cae9 Merge branch '2016.11' into 'develop'
Conflicts:
  - salt/modules/napalm_network.py
  - tests/integration/states/test_archive.py
  - tests/integration/states/test_file.py
  - tests/unit/modules/test_docker.py
2017-03-21 10:19:52 -06:00
rallytime
dd193cc740 Make sure the tornado web server is stopped at the end of the test class
The tornado web aplication that was set up in the archive tests, and then
duplicated in the remote file integration tests, starts the web server,
but never stops it. This creates a stacktrace that hangs the other test
file that attempts to start the web server.

The Application class has a `listen()` function, but not a `stop()` function.
The change uses the `HTTPServer` class to set up the listening server, but
also has the necessary `stop()` function. (The `listen()` function from the
`Application` class just calls out to the `HTTPServer`'s `listen()` function,
so this works nicely here.)

We can then call the `stop()` function in the `tearDownClass` class method.

I also removed some duplicate STATE_DIR definitions.
2017-03-20 13:08:17 -06:00
Nicole Thomas
201846ff01 Merge pull request #40129 from terminalmage/py3-tests
Python 3 compatibility fixes
2017-03-17 17:49:26 -06:00
Erik Johnson
8676f7d14a Add pip3 to list of commands in which_bin test 2017-03-16 22:07:52 -05:00
Nicole Thomas
d64dee46bd Merge pull request #40061 from rallytime/merge-develop
[develop] Merge forward from 2016.11 to develop
2017-03-16 11:16:52 -06:00
Erik Johnson
3923305141 Sort list of minions in batch to make tests consistent 2017-03-16 12:00:38 -05:00
Erik Johnson
5b71db29d5 Use user.present/absent states to manage user in virtualenv test 2017-03-15 17:18:25 -05:00
Erik Johnson
eb09901f36 Simplify the user state integration tests
Put the skipIf and the destructiveTest decorators on the class instead
of each function. Also added a user.absent to the tearDown to reduce
code duplication.
2017-03-15 17:16:34 -05:00
Erik Johnson
66596c6d75 Fail test if sudo is missing 2017-03-15 17:15:56 -05:00
Erik Johnson
9b3890b5f2 Fix network test for cases where no network settings are configured
This allows the test to pass inside a docker container where the
networking is managed by docker and not by the OS' network mangagment
daemon.
2017-03-15 17:14:29 -05:00
rallytime
148df32604 Merge branch '2016.11' into 'develop'
No conflicts.
2017-03-15 14:52:07 -06:00
Mike Place
5734e2b0a8 Merge pull request #40027 from terminalmage/py3-tests
Update git state integration tests for PY3 compatibility
2017-03-15 13:40:55 -06:00
Erik Johnson
ef110baa99 Update git state integration tests for PY3 compatibility
Python 3 didn't like some of the stuff that we were doing with
``subprocess.check_call()`` in these tests, so to fix this I have redone
that stuff with calls to functions in the git execution module. In order
to avoid problems with running tests with no global gitconfig, I needed
to add an argument called ``git_opts`` to most of the funcs in the git
execution module (well I didn't *need* to do it to most of the funcs, it
just seemed like we shouldn't only be supporting this argument in a
single function).

This new ``git_opts`` argument is specifically for passing arguments to
the git command itself (not the subcommand). For example, ``git -c
user.name="Foo Bar" commit .....`` is different than running ``git
commit -c user.name="Foo Bar" .....``, because the ``commit`` subcommand
for git also accepts ``-c``.
2017-03-14 18:07:06 -05:00
rallytime
fe4a208569 Add flaky decorator to flaky rest_tornado test 2017-03-14 16:30:54 -06:00
rallytime
029f28bbd5 Merge branch '2016.3' into '2016.11'
Conflicts:
  - salt/modules/cmdmod.py
2017-03-14 15:44:38 -06:00
Nicole Thomas
0ec81a4cde Fixup a syntax error 2017-03-14 11:15:02 -06:00
Nicole Thomas
2714676a13 Merge pull request #39746 from terminalmage/pathutils
Add salt.utils.path
2017-03-14 11:00:34 -06:00
Erik Johnson
5d84b40bfd Attempt to fix failing grains tests in 2016.3
The tearDown appears to only be removing the grain if it matches a
specific value. This may be leading to the grain value not being blank
at the time the next test is run.

Instead of only deleting the grain if it matches a specific value,
instead delete all items from that grain to ensure that it is empty for
the next test.
2017-03-14 11:25:15 -05:00
Pedro Algarvio
410b583a63
The port attribute definition must come first 2017-03-12 18:05:30 +00:00
Pedro Algarvio
992a8c7294
Don't hardcode the webserver port number 2017-03-11 16:00:28 +00:00
Erik Johnson
d2206d1a94 Changes to imports to comport with test suite changes in develop 2017-03-10 11:05:02 -06:00
Erik Johnson
db5208b65a Set up special file_roots for windows symlink test 2017-03-10 11:05:02 -06:00
Erik Johnson
22d5689eb0 Clarify reason for skipping test 2017-03-10 11:05:02 -06:00
twangboy
05cca8b72d Add filerserver test to whitelist, skip symlink test 2017-03-10 11:05:02 -06:00
Mike Place
bbf4eacbba Merge pull request #39930 from s0undt3ch/features/py3
Moar Py3 and a fix for #38121
2017-03-09 17:25:01 -07:00
rallytime
4a52cca926 Pylint fixes 2017-03-09 14:55:33 -07:00
Pedro Algarvio
4627c4ea6d Code cleanup and make sure the beacons config file is deleted after testing
Conflicts:
  - tests/integration/modules/beacons.py
2017-03-09 13:35:16 -07:00
rallytime
e7fa367548 [develop] Fix pylint error 2017-03-09 13:04:51 -07:00
Pedro Algarvio
50e51b5b9d The beacons configuration is now a list. Handle it! 2017-03-09 13:00:41 -07:00
Pedro Algarvio
680bbec79f
The beacons configuration is now a list. Handle it! 2017-03-09 19:31:13 +00:00
Pedro Algarvio
dd53f055b9
Code cleanup and make sure the beacons config file is deleted after testing 2017-03-09 19:29:16 +00:00
Pedro Algarvio
42065350f1
Catch and handle tornado.iostream.StreamClosedError exceptions 2017-03-09 19:29:16 +00:00
Nicole Thomas
2f0f7cd224 Merge pull request #39897 from rallytime/merge-develop
[develop] Merge forward from 2016.11 to develop
2017-03-09 09:03:46 -07:00
rallytime
c6cfac7678 Pylint fix 2017-03-08 16:24:03 -07:00
Pedro Algarvio
51c5558b32
This should no longer hang 2017-03-08 20:43:36 +00:00
Pedro Algarvio
0b41b92d7d
Use salt.utils.versions instead of distutils.version 2017-03-08 19:22:33 +00:00
Pedro Algarvio
06c063a609
Test assertion cannot be done in the callback context 2017-03-08 18:34:34 +00:00
Pedro Algarvio
b58241648a
Use the tests support paths module 2017-03-08 18:34:34 +00:00
Pedro Algarvio
7fffd93b50
Don't pollute the repo tests state tree 2017-03-08 18:34:33 +00:00
Pedro Algarvio
b391a4eb5b
Supervisord does not work under Python 3 2017-03-08 18:34:33 +00:00
Pedro Algarvio
e2e303e724
Minor changes to paths 2017-03-08 18:34:32 +00:00
Pedro Algarvio
712b81e0c1
supervisor does not run against py3. Use pep8 for the tests. 2017-03-08 18:34:32 +00:00
Pedro Algarvio
07d0a5ed20
Cleanup after ourselves 2017-03-08 18:34:32 +00:00
Pedro Algarvio
c436d9f2f6
This no longer applies. 2017-03-08 18:34:31 +00:00
rallytime
4fc9b5484b Merge branch '2016.11' into 'develop'
Conflicts:
  - salt/client/ssh/__init__.py
  - salt/pillar/makostack.py
  - tests/integration/client/test_runner.py
  - tests/integration/states/test_file.py
2017-03-08 09:04:26 -07:00
Pedro Algarvio
7dc6b64689
No need to call .keys() when iterating a dictionary 2017-03-06 14:42:31 +00:00
Pedro Algarvio
ffec7dc299
Lint fixes 2017-03-06 14:35:16 +00:00
Mike Place
3341e4e202 Merge pull request #39492 from whiteinge/full_return-arg
Add full_return arg to LocalClient and RunnerClient
2017-03-04 09:14:17 -07:00