Commit Graph

2152 Commits

Author SHA1 Message Date
Erik Johnson
c7dfb494a6 Fix mocking for grains refresh 2017-02-25 21:04:48 -06:00
Erik Johnson
ca54541abe Add missing unit test for disable func 2017-02-24 01:12:42 -06:00
Mihai Dinca
9fedb84607 Always return oscap's stderr 2017-02-20 10:36:01 +01:00
Mihai Dinca
0ecde2cd02 Include oscap returncode in response 2017-02-20 10:36:01 +01:00
Mihai Dinca
9d13422ac1 OpenSCAP module 2017-02-17 13:50:29 +01:00
Mihai Dinca
91383c5a19 Add cp.push test 2017-02-14 17:16:28 +01:00
Nicole Thomas
ef4e437bbc Fix the win_ip_test failures (#39230)
The changes made in #38793 changes the "get_all_ointerfaces" call
to be a list of DNS servers. This change adjusts the tests structure
from a string to a list and fixes the test failure.
2017-02-07 14:53:59 -07:00
Erik Johnson
646b9ea4e5 Don't abort pillar.get with merge=True if default is None (#39116)
* Don't abort pillar.get with merge=True if default is None

This prevents a SaltInvocationError from being raised if the default is
loaded from a import_yaml jinja macro and the file being loaded is empty
(which is an entirely valid use case). In these cases, the loaded
default would be None, which we don't want to cause an exception.

* Add test case for issue 39062
2017-02-01 15:07:31 -07:00
Nicole Thomas
a6c6e47842 Handle changing "is_default" value in moto package for boto test mock (#38973) 2017-01-26 12:05:30 -07:00
twangboy
d57a51f9f9 Fix tests for get_hostname 2017-01-18 11:27:50 -07:00
Ch3LL
47f8b68e0b fix unit.modules.file_test 2017-01-09 15:01:52 -07:00
Jonathan Ballet
2c8845aaa0 add test for pillar.get() + default value 2017-01-06 10:20:13 -05:00
Jonathan Ballet
c2f98d2f04 ticket 38558: add unit test, deepcopy() only if necessary 2017-01-06 10:19:57 -05:00
Daniel Wallace
048b9f6b9d add test 2016-12-29 17:08:24 -06:00
Daniel Wallace
7b7c6b3878 file.line fail with mode=delete
If the file is empty, it also fails, fix that.
2016-12-28 11:51:45 -06:00
rallytime
bdb807fc7c Skip test_cert_info tls unit test on pyOpenSSL upstream errors
The 16.0.0 version of pyOpenSSL has an upstream error in it that
causes a stacktrace in our test suite. The upstream issue has
been fixed in pyOpenSSL in 16.1.0 and upwards, but 16.0.0 is still
available.

This fix skips the test when the specific error generated by the
upstream bug is encountered during the test.
2016-12-12 14:21:41 -07:00
rallytime
3dfed6b841 Adjust linux_acl unit test argument ordering 2016-11-23 17:02:23 +00:00
Nicole Thomas
453319b50a Don't pass the vpc id to boto.vpc.create_internet_gateway func (#37556)
That function's namespace looks like this:
```
def create_internet_gateway(self, dry_run=False):
```
So when we pass in the vpc_id opbject in the test, the check later
in the function sets `dry_run=True` since the vpc_id opbject exists.

This later throws JSONResponseErrors because the `DryRun` flag is
set. This error raising functionality was added in the most recent
version of moto, which exposed this bug.

This fixes the three boto_vpc_test unit state tests. We'll see if
other tests need to be addressed in other files on a full test run.
2016-11-08 12:48:26 -07:00
Mike Place
be93710fee Merge pull request #37452 from rallytime/fix-31135
file.line with mode=replace on an empty file should return False, not stacktrace
2016-11-06 14:55:11 +13:00
Erik Johnson
a3f38e5a9f Update file.extract_hash unit tests
These tests now not only test the new functionality added for matching
on source URI and source_hash_name, but also test non-specific hash_type
lookups, specific hash_type lookups, and failed specific hash_type
lookups (i.e. requesting a hash type not present in the file).
2016-11-04 11:25:54 -05:00
rallytime
94a00c66eb Write a unit test demonstrating stack trace in #31135
Here is the stack trace that happens when running file.line with
mode=replace on a file that exists, but is empty, as described in
the bug report:

unit.modules.file_test.FileModuleTestCase.test_replace_line_in_empty_file  .................................................
   Traceback (most recent call last):
     File "/root/SaltStack/salt/tests/unit/modules/file_test.py", line 593, in test_replace_line_in_empty_file
       mode='replace'))
     File "/root/SaltStack/salt/salt/modules/file.py", line 1523, in line
       for line in body.split(os.linesep)])
   TypeError: expected a character buffer object
2016-11-03 14:57:10 -06:00
Pablo Suárez Hernández
ffc596f215 Including resolver params for Zypper debug-solver
Now '--no-allow-vendor-change' and '--from' parameters are included
into the zypper --debug-solver call before performing a dry-run dist-upgrade.
2016-11-03 08:34:26 +00:00
rallytime
e082ff538b Fix failing test now that we're raising a CommandExecutionError
Also adds a test to check that the CommandExecutionError is raised
when the filename is not present.
2016-11-01 15:51:09 -06:00
rallytime
fd380c79b9 Add test case to reproduce dnsmasq.set_config failure in #34263 2016-11-01 14:31:14 -06:00
Mike Place
c5d81a8ade Merge pull request #37158 from jfindlay/mac_skip_uptime
add mock for `status.uptime` unit test
2016-10-24 12:13:53 +09:00
rallytime
8fff95b3b4 Merge branch '2015.8' into '2016.3'
Conflicts:
  - salt/modules/gpg.py
  - salt/modules/zypper.py
2016-10-21 16:09:17 -06:00
Justin Findlay
094eac06eb modules.status.uptime unit test: mock on linux 2016-10-21 15:50:42 -06:00
Pablo Suárez Hernández
01b0a6917c Minor pylint fixes 2016-10-20 11:33:11 +01:00
Pablo Suárez Hernández
7dbb0bd252 Unit tests fixes 2016-10-20 10:59:48 +01:00
Pablo Suárez Hernández
a092a974da Refactor: Cleanup and pylint fixes 2016-10-19 14:57:03 +01:00
Pablo Suárez Hernández
1331ae5c72 Unit tests for zypper upgrade and dist-upgrade 2016-10-19 13:21:55 +01:00
twangboy
b3b688e298 Fix tests 2016-10-17 13:31:55 -06:00
Thomas S Hatch
6b782c15e1 Merge pull request #36755 from terminalmage/issue36671
systemd.py: check retcode for service availability in systemd >= 231
2016-10-13 13:41:50 -06:00
rallytime
c09b9d6e6a Merge branch '2015.8' into '2016.3'
No conflicts.
2016-10-10 10:21:04 -06:00
Erik Johnson
7c78d6f419 Add unit tests for systemd scope usage 2016-10-07 17:35:09 -05:00
Mike Place
1284de27fc Merge pull request #36789 from maximeguillet/fix-psqlrc-pg9.6
Fix behavior of psql -c option with postgresql 9.6
2016-10-06 20:24:51 +09:00
Maxime Guillet
b59c23bef1 Fix one remaining postgresql tests linked to #36787. 2016-10-05 17:05:10 +02:00
Maxime Guillet
8b92ae2061 Fix postgresql tests using position in the argument list of psql.
Some tests use position number in the argument list of psql command
to check their results. As #36787 add one element, next position
in the list must be used.
2016-10-05 16:08:42 +02:00
Maxime Guillet
21f2a17a07 Fix postgresql tests by adding --no-psqlrc option introduced by #36787. 2016-10-05 14:43:02 +02:00
Erik Johnson
d916c2b49c Handle cases where retcode/output feature is backported
This will handle the case of RHEL 7.3, which maintains an older version
of systemd with the retcode/output changes from "systemctl status" in
systemd 231 backported.
2016-10-04 09:55:56 -05:00
Erik Johnson
b3364646ad Update systemd module unit tests
The _systemctl_status() function has changed its return data, this
commit updates the affected tests to reflect this.
2016-10-03 22:51:43 -05:00
rallytime
24b8bba145 Merge branch '2015.8' into '2016.3'
No conflicts.
2016-09-30 16:13:08 -06:00
Denys Havrysh
bba9d0d105 alternatives.install state: detect alternatives command failed 2016-09-29 18:09:16 +03:00
Mike Place
ccd92d22d2 Merge pull request #36621 from terminalmage/fix-shadowed-builtins
Fix shadowed builtins
2016-09-29 11:25:54 +09:00
Erik Johnson
62729eff8d Update tests to include fix for renamed function 2016-09-28 11:00:33 -05:00
Erik Johnson
283aca8f2a Update test to reflect new function signature 2016-09-27 23:13:19 -05:00
rallytime
a828bdd0b8 Update test mocks for cmd.run_all dicts 2016-09-27 20:55:39 -06:00
Michael Stella
8b877f014d 'All' grants for PostgreSQL.
This update allows granting privileges on ALL tables or ALL sequences
in a given schema.  Such as:

GRANT SELECT ON ALL TABLES IN SCHEMA public TO 'monkey';
2016-09-15 17:22:08 -04:00
Michael Stella
fbbe9ec571 Quote postgres privilege target names (#36249)
* Quote postgres privilege target names

Postgres lets you put characters in table/database names which you then must
quote.  So we should always quote.

* Updating unit tests

* Also quote role names.

Role names can also have dashes (or others) in them, so we must also quote
them.
2016-09-15 15:12:41 -06:00
Nicole Thomas
a4bbd5e3d7 Add resize2fs unit test from blockdev_test to disk_test (#36346)
The blockdev module is being slowly deprecated and its functions moved to
to the disk module instead. There is a test for resize2fs in the blockdev_test
file in the 2015.8 branch (which matches the resize2fs function in the blockdev
module), but this function was moved to the disk file in 2016.3. The test was
never moved over.

I discovered this during a merge forward in #36344. This PR adds the
test from 2015.8 blockdev_test to the 2016.3 disk_test.py, and is adjusted
to work with the disk module accordingly.
2016-09-15 14:37:53 -06:00