Commit Graph

437 Commits

Author SHA1 Message Date
Mike Place
41d3c09857 Merge pull request #35433 from terminalmage/issue34790
git.latest: Add a hint for possible rev changes resulting in non-fast-forward failures
2016-09-21 16:02:18 +09:00
Thomas S Hatch
5625827ee2 Merge pull request #36378 from terminalmage/issue36321
git.latest Treat an up-to-date checkout with local changes as up-to-date
2016-09-19 12:43:29 -06:00
Erik Johnson
bb4d69f58a git.latest: fail gracefully for misconfigured remote repo (#36391)
* git.latest: fail gracefully for misconfigured remote repo

When the remote repo's HEAD refers to a nonexistent ref, this was
causing a traceback when we tried to check if the upstream tracking
branch needed to be changed after cloning the repo. This commit fixes
this traceback by gracefully failing the state when the remote HEAD is
not present in the ``git ls-remote`` output, but the desired remote
revision doesn't exist.

Additionally, a similar graceful failure now happens if the state is run
again after we gracefully fail the first time, and we need to set the
tracking branch. Trying to set the tracking branch when there is no
local branch would fail with an ambiguous error like "fatal: branch
'master' does not exist", so before we even attempt to set the tracking
branch, the state is failed with a more descriptive comment.

* Add integration test for #36242
2016-09-19 09:33:00 -06:00
Erik Johnson
71b51f49ba Add integration tests for PR #35433 2016-09-17 22:55:47 -05:00
Erik Johnson
7b1f621206 Fix git.latest test with local changes to reflect changes in state 2016-09-17 21:56:31 -05:00
Pablo Suárez Hernández
ed2d2bd331 Integration tests fixes for 2015.8 (#36262)
* Fixing integration tests if azure is not present

* Fixing integration tests failures if 'git' command is missing

Skip git state integration tests if 'git' does not exists
Prevent OSError if 'git' command not found during _git_version()
2016-09-13 15:24:06 -06:00
Mike Place
6cf56843d4 Revert "service state integration tests" 2016-09-02 21:38:15 +09:00
rallytime
30f42d5352 Write test for multiple unless commands where 1st cmd passes and 2nd fails
This is a regression integration test for #35384, which was fixed by #35545,
and back-ported to the 2015.8 branch in #35566.
2016-08-18 11:04:08 -06:00
Erik Johnson
a375dd7e1f Clean up open filehandles (#35359)
* salt/crypt.py: clean up open filehandles

* salt/fileclient.py: clean up open filehandles

* salt/grains/core.py: clean up open filehandles

* salt/modules/cp.py: clean up open filehandles

* salt/modules/data.py: clean up open filehandles

* salt/modules/dnsutil.py: clean up open filehandles

* salt/modules/dockerng.py: clean up open filehandles

* salt/modules/inspectlib/collector.py: clean up open filehandles

* salt/modules/file.py: clean up open filehandles

* salt/modules/hosts.py: clean up open filehandles

* salt/modules/incron.py: clean up open filehandles

* salt/modules/dpkg.py: clean up open filehandles

* salt/modules/linux_sysctl.py: clean up open filehandles

* salt/modules/netbsd_sysctl.py: clean up open filehandles

* salt/modules/network.py: clean up open filehandles

* salt/modules/nftables.py: clean up open filehandles

* salt/modules/openbsd_sysctl.py: clean up open filehandles

* salt/modules/rh_ip.py: clean up open filehandles

* salt/modules/portage_config.py: clean up open filehandles

* salt/modules/status.py: clean up open filehandles

* salt/modules/tls.py: clean up open filehandles

* salt/modules/xapi.py: clean up open filehandles

* salt/modules/x509.py: clean up open filehandles

* salt/modules/virt.py: clean up open filehandles

* salt/modules/zcbuildout.py: clean up open filehandles

* salt/returners/local_cache.py: clean up open filehandles

* salt/utils/cloud.py: clean up open filehandles

* salt/states/pkgrepo.py: clean up open filehandles

* salt/states/x509.py: clean up open filehandles

* salt/transport/mixins/auth.py: clean up open filehandles

* salt/utils/__init__.py: clean up open filehandles

* salt/states/pkg.py: clean up open filehandles

* salt/utils/minion.py: clean up open filehandles

* salt/utils/openstack/nova.py: clean up open filehandles

* salt/utils/openstack/swift.py: clean up open filehandles

* salt/utils/process.py: clean up open filehandles

* salt/utils/templates.py: clean up open filehandles

* salt/utils/virt.py: clean up open filehandles

* tests/integration/__init__.py: clean up open filehandles

* tests/integration/cli/grains.py: clean up open filehandles

* tests/integration/client/standard.py: clean up open filehandles

* tests/integration/modules/hosts.py: clean up open filehandles

* tests/unit/utils/vt_test.py: clean up open filehandles

* tests/integration/shell/enabled.py: clean up open filehandles

* tests/integration/states/cmd.py: clean up open filehandles

* tests/integration/states/file.py: clean up open filehandles

* tests/integration/states/match.py: clean up open filehandles

* tests/unit/config_test.py: clean up open filehandles

* tests/unit/templates/jinja_test.py: clean up open filehandles

* tests/unit/utils/find_test.py: clean up open filehandles

* tests/integration/modules/state.py: clean up open filehandles

* Update dnsutil_test to reflect changes in fopen usage
2016-08-11 10:45:24 -06:00
Erik Johnson
243909f39d file.recurse: Do not convert octal mode string to int (#35309)
* Add integration test for #34945

* file.recurse: Do not convert octal mode string to int

When we run file.makedirs_perms to create the dest directory, we pass
through the mode to file.check_perms. However, file.check_perms expects
an octal string, not an int. This causes the initial directory to be
chmod'ed to the wrong mode. When there are files in the source
directory, file.recurse will invoke the file.directory state to manage
files/dirs in that directory, and this ends up correcting the mode as we
simply pass the dir_mode to it. However, when there are only directories
in the source directory, this never happens and the incorrect mode
remains on the destination directory.

Fixes #34945.
2016-08-09 13:02:26 -06:00
Erik Johnson
e2e8bbbfde Add integration test for #35214 2016-08-05 20:47:24 -05:00
Erik Johnson
1ca1367289 Fail git.latest states with uncommitted changes when force_reset=False (#34869)
* Add git.diff function

* Fail git.latest states with uncommitted changes when force_reset=False

Also, discard these changes when running the state if force_reset=True.

* Add integration test for case where there are uncommitted changes
2016-07-22 09:04:05 -06:00
Justin Anderson
9abb6f91bb Skip mysql state test if mysqladmin is not available 2016-07-20 09:24:24 -06:00
Mike Place
3e612c3794 Merge pull request #34618 from jtand/network_integration_fix
Network state integration test test=True
2016-07-13 10:30:15 -06:00
rallytime
3026df346f Merge branch '2015.5' into '2015.8'
No conflicts.
2016-07-12 13:27:16 -06:00
Justin Anderson
57df38e685 Update github IP for ssh state integration tests (#34592) 2016-07-12 15:17:41 -04:00
Justin Anderson
34bcf9ccfc Changed network state test to use test=True 2016-07-12 12:40:40 -06:00
Justin Anderson
b2616833b0 Some small changes 2016-07-11 14:35:25 -06:00
Mike Place
685df80929 Merge pull request #34518 from terminalmage/fix-pkg.latest-test
Fix pkg.latest integration test for non-LTS ubuntu
2016-07-07 13:29:13 -06:00
Justin Anderson
ed59113e94 Change network state integration test to use test=True 2016-07-07 12:27:18 -06:00
Erik Johnson
4aef44ecdf Fix pkg.latest integration test for non-LTS ubuntu
This test uses ``pkg.list_upgrades`` to find a package which it assumes is
installed, to test ``pkg.installed`` with ``only_upgrade=True``. The
problem with that approach is that ``pkg.list_upgrades`` uses a dry-run
of an ``apt-get dist-upgrade`` to find the upgrades. On non-LTS Ubuntu
releases, a ``dist-upgrade`` results in upgrading to an entirely new
Ubuntu release, and new packages which would be installed by the
dist-upgrade (but are not currently installed) will be included in the
return data. This causes the test to fail when we attempt to run
``pkg.latest`` with ``only_upgrade=True`` on a package which is not
already installed.

This commit fixes the test by ensuring that our target package is
already installed, and continuing to iterate through the return data
from ``pkg.list_upgrades`` until a currently-installed package is found.
2016-07-07 12:51:01 -05:00
Justin Anderson
75299456be Use skipTest for network state integration test (#34489)
* Updated skipTest to check for debian or redhat

* Removed skipIf import
2016-07-06 13:43:09 -04:00
Mike Place
45b8fb10d7 Merge pull request #34373 from jtand/network_state_integration_test
Network state integration test
2016-06-30 08:05:44 -07:00
Erik Johnson
d6af1de0b7 Optimize pkg integration tests and add a couple new tests (#34377)
* Remove redundant usage of destructiveTest decorator

* Remove unnecessary SLS file

This simple state can be run using run_state

* Explicitly order tests

* Use run_state instead of invoking state.sls

* Ensure only one refresh_db done during pkg integration tests

* Add pkg.latest test for package without an epoch

* Optimize pkg.latest_version usage in pkg integration tests

* Clarify outcome when only_upgrade is used

* Add pkg.latest test with only_upgrade=True
2016-06-30 10:48:22 -04:00
Justin Anderson
84a36369fa Added network state integration test 2016-06-29 14:28:36 -06:00
Erik Johnson
b793426c23 Remove unnecessarily-disabled sanity check (#34325)
This was commented out for reasons having nothing to do with anything
else going on in 0c069dd. Uncommenting this sanity check so that we are
notified if we need to update our targets in the future.
2016-06-28 11:12:55 -04:00
Mike Place
1db559afe9 Merge pull request #33805 from jfindlay/pkg_tests
states.pkg int tests: skip if pkg mgr unavailable
2016-06-07 07:40:46 -07:00
Justin Findlay
f13f914755 states.service: add integration tests 2016-06-06 23:11:49 -06:00
Justin Findlay
0c069ddc95 states.pkg int tests: skip if pkg mgr unavailable 2016-06-06 17:44:43 -06:00
Nicole Thomas
730bec1eef [2015.8] Merge forward from 2015.5 to 2015.8 (#33207)
* Fix file.managed for Windows (#33181)

* Revert back to import string_types

For some reason, there is a problem with the following
code when run from the file.py module:
```
from salt.ext import six
comment = 'This is a string'
isinstance(comment, six.string_types)
```
When run from within the python shell it works fine.

* Add six import

* Fix some lint

* Use correct six import

* Changed it back to explicit import

* Additional comments specific to 2015.5

* Fix file.managed for real

* Move comment to clarify purpose

* update 2015.5.11 release notes (#33197)

* Add pip installed and removed test (#33178)

* Resolve issue with pkg module on Mint Linux (#33205)

Closes #32198
2016-05-12 13:54:47 -07:00
Justin Anderson
a09e1b6335 Add pip installed and removed test (#33178) 2016-05-12 08:31:41 -07:00
Megan Wilhite
2c6326f14a fix tests for file.blockplace to remove newline (#33082) 2016-05-06 08:44:20 -06:00
Nicole Thomas
111701c8bb [2015.8] Merge forward from 2015.5 to 2015.8 (#33054)
* Add run_on_start docs to schedule.rst (#32958)

Fixes #22580

* Backport #33021 manually to 2015.5 (#33044)

* Saltfile with pillar tests (#33045)

* add file.managed with pillar data tests

* do not require git for other tests

* Whitespace...
2016-05-05 07:05:55 -07:00
Justin Anderson
1066063a19 File and User test fixes for 2015.8 on Fedora23 (#33056)
* Fix failing user present test

* Fix file_test.test_symlink failure on 2015.8
2016-05-05 07:05:10 -07:00
Justin Anderson
6d3e4e8935 File and User test fixes for 2015.5 on Fedora23 (#33055)
* Fix file_test.test_symlink on 2015.5

* Fix failing user present test
2016-05-05 07:00:59 -07:00
Megan Wilhite
f8757631b2 Saltfile with pillar tests (#33045)
* add file.managed with pillar data tests

* do not require git for other tests
2016-05-04 14:37:57 -06:00
rallytime
6559ea15b0 Merge branch '2015.5' into '2015.8'
Conflicts:
  - doc/glossary.rst
  - salt/config.py
  - tests/unit/modules/gpg_test.py
2016-03-06 10:59:46 -07:00
Erik Johnson
da954d7b92 Add integration test for packages with epoch in version
This starts with cent7, but later I can add cent6 as well.
2016-03-03 15:40:22 -06:00
Ch3LL
29a53f4353 rename methods in pkg states test 2016-02-26 06:54:01 +09:00
Ch3LL
a387d175d8 integartion test- ensure decorator only runs on one method and not entire class 2016-02-25 01:55:35 +09:00
Mike Place
c5e5af827c Merge pull request #31171 from Ch3LL/megan-20158
added logic to check for installed package
2016-02-12 15:10:21 -07:00
Ch3LL
9204e3f562 add integration test for issue 30934w 2016-02-12 12:21:50 -07:00
Ch3LL
a12e2f566b fix lint error 2016-02-12 11:38:29 -07:00
Ch3LL
a123efd4ef added logic to check for installed package 2016-02-12 11:01:35 -07:00
Mike Place
b831e0a865 Merge pull request #31131 from Ch3LL/megan-20158
integration test for issue #31014
2016-02-11 10:33:23 -07:00
Ch3LL
af82b1233a integration test for issue #31014 2016-02-10 21:46:22 -07:00
justinta89
a5eac47b25 Changed npm integration test to install request.
Later versions of npm were having trouble installing pm2 with the git link.
2016-02-10 14:31:16 -07:00
Colton Myers
117fb205de Merge remote-tracking branch 'upstream/2015.5' into merge-forward-2015.8
Conflicts:
    tests/unit/modules/boto_vpc_test.py
2016-01-21 14:37:32 -07:00
Justin Findlay
66f06f2bd3 disable pkgrepo test for ubuntu 15.10+ 2016-01-21 10:55:37 -07:00
Jonathan Ballet
6d95cbc998 Fix lint errors 2015-10-07 17:49:07 +02:00