Commit Graph

3081 Commits

Author SHA1 Message Date
Bo Maryniuk
5c1259834f Add UT for None type verification if version has been not passed 2017-05-25 12:55:46 -06:00
Bo Maryniuk
0dd27380b1 Add UT for wildcard finder usage 2017-05-25 12:55:46 -06:00
Bo Maryniuk
5e836a2543 Test the exact methods for matcher 2017-05-25 12:55:46 -06:00
Bo Maryniuk
2af4160a1a Add UT for exact match of the pattern at the beginning 2017-05-25 12:55:46 -06:00
Bo Maryniuk
5a2248d254 Add UT for exact match of the pattern at the end 2017-05-25 12:55:46 -06:00
Bo Maryniuk
334c634826 Add UT to match multiple asterisks 2017-05-25 12:55:46 -06:00
Bo Maryniuk
f73b39fd3c Add UT for matching all versions 2017-05-25 12:55:46 -06:00
Bo Maryniuk
a9c3c8bf03 Fix a docstring 2017-05-25 12:55:46 -06:00
Bo Maryniuk
344295666b Rename UT to a proper name 2017-05-25 12:55:46 -06:00
Bo Maryniuk
369b4bf127 Add unit test scaffold for wildcard support 2017-05-25 12:55:46 -06:00
rallytime
ff0def408b Whitespace fix 2017-05-25 10:26:06 -06:00
Dmitry Kuzmenko
7a9b4a92af Fixed syslog-ng test: it passes command as list, not as a string. 2017-05-25 14:33:43 +03:00
Dmitry Kuzmenko
6b0921e5ba Py3 tests fixes: don't mock non-callable objects with return_value.
mock = MagicMock(return_value='') works for functions: here mock() will
return the value (empty string). But mock returns the MagicMock object.
Not sure why but it worked in Py2, but in Py3 os.path.join(mock,
'something'), for instance, returns an error.

Fixed the issues by avoiding of using mocks where we can use simple
strings.
2017-05-25 12:33:43 +03:00
rallytime
9ff2694155 Merge branch '2016.11' into 'nitrogen'
Conflicts:
  - pkg/salt-minion.service
  - salt/modules/junos.py
  - salt/modules/localemod.py
  - salt/modules/win_system.py
  - salt/states/junos.py
  - tests/unit/modules/test_localemod.py
  - tests/unit/modules/test_win_powercfg.py
  - tests/unit/states/dockerng_test.py
2017-05-24 16:32:59 -06:00
Nicole Thomas
a924806d6e Merge pull request #41411 from rallytime/fix-haproxyconn-tests
Fix haproxyconn unit test failures
2017-05-24 13:01:29 -06:00
Mike Place
88fd3c0ed9 Merge pull request #41336 from mcalmer/fix-locale-on-SUSE
fix setting and getting locale on SUSE systems
2017-05-24 12:46:07 -05:00
Mike Place
49f93cb091 Merge pull request #41405 from isbm/isbm-zypper-wildcards-dev
Wildcards for Zypper
2017-05-24 11:57:42 -05:00
rallytime
68c277e5f7 Fix haproxyconn unit test failures
Too many arguments were being passed into the test function

This change removes the extra "mock" arg and the tests pass.

This issue was introduced in PR #40713

Fixes https://github.com/saltstack/salt-jenkins/issues/357
2017-05-24 10:41:38 -06:00
Bo Maryniuk
22732504a3 Add UT for unsupported operators 2017-05-24 16:29:59 +02:00
Bo Maryniuk
a579ffc166 Lintfixes 2017-05-24 15:19:39 +02:00
Bo Maryniuk
3d40688cd9 Add UT for operator conditions 2017-05-24 13:55:49 +02:00
Bo Maryniuk
0bf0950158 Add UT for typecheck on the output data 2017-05-24 13:55:49 +02:00
Bo Maryniuk
20ff494b93 Add UT for None type verification if version has been not passed 2017-05-24 13:55:49 +02:00
Bo Maryniuk
c806128d51 Add UT for wildcard finder usage 2017-05-24 13:55:49 +02:00
Bo Maryniuk
552b3265d0 Test the exact methods for matcher 2017-05-24 13:55:49 +02:00
Bo Maryniuk
561ae0b8c8 Add UT for exact match of the pattern at the beginning 2017-05-24 13:55:49 +02:00
Bo Maryniuk
b1ddcccda0 Add UT for exact match of the pattern at the end 2017-05-24 13:55:49 +02:00
Bo Maryniuk
4c9dd39118 Add UT to match multiple asterisks 2017-05-24 13:55:49 +02:00
Bo Maryniuk
8839f7219b Add UT for matching all versions 2017-05-24 13:55:49 +02:00
Bo Maryniuk
5988e3b5d3 Fix a docstring 2017-05-24 13:55:49 +02:00
Bo Maryniuk
508c439b2b Rename UT to a proper name 2017-05-24 13:55:49 +02:00
Bo Maryniuk
3b44018f58 Add unit test scaffold for wildcard support 2017-05-24 13:55:49 +02:00
Benjamin Drung
33a7f8b2ec Fix typos
lintian found several spelling errors.

Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
2017-05-24 12:50:29 +02:00
rallytime
718b0adc70 Merge branch 'nitrogen' into 'develop'
Conflicts:
  - salt/modules/zypper.py
  - tests/unit/utils/test_network.py
2017-05-23 09:05:13 -06:00
Mike Place
b43b89c5fa Merge pull request #40713 from pgstenberg/feature-haproxyconnaddfunc
Additional functionality to the haproxy module
2017-05-22 12:11:32 -05:00
rallytime
c6c1d30c48 Merge branch '2016.11' into 'nitrogen'
Conflicts:
  - salt/modules/yumpkg.py
  - salt/spm/__init__.py
  - tests/unit/modules/test_zypper.py
  - tests/unit/utils/test_network.py
2017-05-20 17:07:34 -06:00
Mike Place
ebd8376ef4 Merge pull request #41328 from jpautler/dev/jpautler/hwclock_nilinuxrt_support
Update timezone get/set_hwclock for NILinuxRT systems
2017-05-19 13:04:21 -05:00
Michael Calmer
f30f5c8a25 fix unit tests 2017-05-19 13:28:52 +02:00
Mike Place
9f359d841f Merge pull request #41208 from pkazmierczak/pkazmierczak-zypper-multiple-ver-pkgs
Fix: zypper handling of multiple version packages
2017-05-18 10:44:26 -05:00
Jeffrey Pautler
6254b8f326 Update set_hwclock to only accept UTC on NILinuxRT
NILinuxRT systems do not support non-UTC timezones for hwclock, so
enforce that in set_hwclock.
2017-05-17 16:44:44 -05:00
Mike Place
9d9bf1c7f6 Merge pull request #41247 from mcdermj/develop
JunOS: Change os_install to use get_file instead of get_template
2017-05-17 13:46:15 -05:00
Mike Place
fe38c7cf5e Merge pull request #41282 from mcdermj/bp-41247
JunOS: Change os_install to use get_file instead of get_template
2017-05-17 13:25:26 -05:00
Piotr Kaźmierczak
d411a91676 Reverted back to cascading with statements for python 2.6 compat 2017-05-17 11:52:56 +02:00
rallytime
9668480fc5 Merge branch 'nitrogen' into 'develop'
No conflicts.
2017-05-16 19:58:21 -06:00
rallytime
76714d116b Mock calls to salt.utils.pkg.clear_rtag call in aptpkg unit tests 2017-05-16 16:00:37 -06:00
Piotr Kaźmierczak
7204013653 Compacted with statements in the unit test. 2017-05-16 22:48:09 +02:00
Piotr Kaźmierczak
6c4c08042c Added unit tests and copied the behavior to
.upgrade method, too.
2017-05-16 20:47:04 +02:00
Jeremy McDermond
3e481cb764 JunOS: Fix whitespace for PEP compliance 2017-05-16 10:00:58 -07:00
Jeremy McDermond
f1751d135a JunOS: Fix Unit Test
When adding the cp.get_file function, we need to add it into the list of
mock functions in the unit test along with get_template or the unit
tests will fail.
2017-05-16 10:00:50 -07:00
Jeremy McDermond
40eef0c0e3 JunOS: Fix whitespace for PEP compliance 2017-05-16 08:21:16 -07:00
Jeremy McDermond
7cdf7b3546 JunOS: Fix Unit Test
When adding the cp.get_file function, we need to add it into the list of
mock functions in the unit test along with get_template or the unit
tests will fail.
2017-05-15 16:12:19 -07:00
rallytime
d23010a114 Merge branch '2016.11' into 'nitrogen'
Conflicts:
  - salt/modules/aptpkg.py
  - salt/states/libcloud_dns.py
  - salt/states/pkg.py
  - tests/integration/modules/test_pkg.py
  - tests/unit/modules/test_mac_brew.py
  - tests/unit/modules/test_pkgutil.py
  - tests/unit/modules/test_zypper.py
  - tests/unit/states/libcloud_dns_test.py
2017-05-15 16:41:59 -06:00
rallytime
bde9d6cdc0 Merge branch 'nitrogen' into 'develop'
No conflicts.
2017-05-15 16:29:13 -06:00
Mike Place
50d8fde123 Merge pull request #41101 from terminalmage/issue40940
Fix "latest" keyword for version specification when used with aggregation
2017-05-15 11:52:35 -05:00
Dmitry Kuzmenko
b10730d8a1 Py3: Fixed timezone test. 2017-05-15 19:40:57 +03:00
Adam Mendlik
bec23de76f Add function kernelpkg.upgrade_available to kernelpkg module
This function return a True/False value if a newer kernel
is available in the package repositories.
2017-05-11 18:09:14 -06:00
rallytime
4100e2b6a6 Merge branch 'nitrogen' into 'develop'
No conflicts.
2017-05-10 15:32:33 -06:00
rallytime
9014033726 Use LoaderModuleMockMixin for setting up default grains/salt dunders 2017-05-10 13:49:43 -06:00
rallytime
c282533612 Use with patch.dict for timezone.__grains__ dictionaries 2017-05-10 10:32:24 -06:00
rallytime
baa8e3f5a6 Move new timezone_test.py tests over to test_timezone.py tests 2017-05-09 16:33:18 -06:00
rallytime
ef0df4a954 Merge branch '2016.11' into 'nitrogen'
Conflicts:
  - salt/modules/win_network.py
  - salt/modules/win_pkg.py
  - salt/utils/gitfs.py
  - tests/unit/modules/test_win_network.py
  - tests/unit/states/test_file.py
2017-05-09 14:32:49 -06:00
Mike Place
a2f359fa13 Merge pull request #40852 from isbm/isbm-fix-coregrains-constants-bsc#1032931
Isbm fix coregrains constants bsc#1032931
2017-05-09 12:35:45 -06:00
Loren Gordon
06c46b48f3 Adds a function to list all users from shadow file 2017-05-09 12:58:12 -04:00
Bo Maryniuk
f3b12a3f5b Do not use multiple variables in "with" statement as of lint issues 2017-05-09 10:17:49 +02:00
Bo Maryniuk
35a8d99934 Disable the test for a while 2017-05-08 13:49:54 +02:00
Bo Maryniuk
76cb1b7150 Rewrite test case for using no patch decorators 2017-05-08 10:41:50 +02:00
Erik Johnson
dcb0d63883 Update test to reflect additional calls to os.path.isfile() 2017-05-06 01:51:11 -05:00
Erik Johnson
772167306c Merge pull request #41015 from gtmanfred/docker
Allow docker.call to run as non-root user
2017-05-06 01:21:05 -05:00
Erik Johnson
2af89beb53 Merge pull request #41103 from lorengordon/win.get_route
Adds a get_route() function to win_network.py
2017-05-06 01:19:41 -05:00
Erik Johnson
92011dbe5f Fix "latest" keyword for version specification when used with aggregation
The "latest" keyword was only implemented when both "name" and "version"
were used, and not for "pkgs". But mod_aggregate puts all packages into
a single low chunk, within "pkgs". This means that using aggregation in
conjuntion with the "latest" keyword no longer resolves the latest
version and thus breaks these states.

This fixes the problem by moving the logic for resolving the "latest"
keyword into _find_install_targets(). It also makes some improvements to
the logic we use to ensure only one package DB refresh is performed per
Salt run, by making the pkg.refresh_db functions handle removing the
rtag file, instead of requiring a call to a helper function everywhere
in the pkg state where we might be calling a function that refreshes the
package DB.
2017-05-06 00:46:06 -05:00
Loren Gordon
93ce5644ea Adds test for win_network.get_route 2017-05-05 17:32:50 -04:00
Mike Place
330e717150 Merge pull request #40977 from amendlik/kernelpkg
kernelpkg module
2017-05-05 10:21:12 -06:00
Adam Mendlik
2bc930acb3 Fix linter errors 2017-05-05 06:27:37 -06:00
Adam Mendlik
9f13ce9ee2 Fix kernelpkg.latest_available when no upgrades are available 2017-05-05 05:51:11 -06:00
Adam Mendlik
741fd9d1ee Rename kernelpkg.current to kernelpkg.active for clarity 2017-05-04 19:15:04 -06:00
rallytime
b93e35dd06 Merge branch 'nitrogen' into 'develop'
Conflicts:
  - salt/engines/docker_events.py
2017-05-03 10:00:24 -06:00
Daniel Wallace
97e67e262f fix unit tests for dockermod 2017-05-02 18:50:03 -06:00
Mike Place
044e0b2063 Merge pull request #40860 from twangboy/change_broadcast
Remove dependency on win32gui
2017-05-02 10:45:51 -06:00
Adam Mendlik
74c7899f2a Rename kernelpkg module files to kernelpkg_linux_<pkgmanager>
This groups them together lexicographically and makes it clear which
package manager each one supports.
2017-05-01 18:22:34 -06:00
Erik Johnson
26d2f4a52a Do not automatically unmask services to start/restart/etc. them 2017-05-01 16:01:35 -05:00
Mike Place
9d12a614b7
Fix failing test 2017-05-01 11:50:39 -06:00
Anthony Shaw
77cdd3c2dc
backward compatibility with older versions of libcloud where snapshots don't have a name field 2017-05-01 21:05:33 +10:00
Anthony Shaw
e85f1a4314
snapshot name seems to be a recent addition 2017-05-01 14:28:54 +10:00
Adam Mendlik
e2524656c4 Add execution modules to manage Linux kernel packages 2017-04-30 12:53:48 -06:00
Anthony Shaw
7ec1d6ba83
lint fixes 2017-04-30 21:49:54 +10:00
Anthony Shaw
1c4a03c538
key pair management methods and tests, linting 2017-04-30 20:28:20 +10:00
Anthony Shaw
06e94dcb58
add image management methods and tests 2017-04-30 19:49:54 +10:00
Anthony Shaw
277933e8d8
add volume, list_images, snapshot methods and tests 2017-04-30 15:04:50 +10:00
Anthony Shaw
3f8827f6b4
add list_volumes 2017-04-29 15:54:59 +10:00
Anthony Shaw
ec95304153
destroy and reboot node 2017-04-29 15:45:07 +10:00
Anthony Shaw
cc40734255
implement list_locations 2017-04-29 15:33:20 +10:00
Anthony Shaw
3c6f13699b
unit tests for list_nodes and list_sizes with implementation 2017-04-29 15:24:15 +10:00
rallytime
f875ee3309 Merge branch 'nitrogen' into 'develop'
Conflicts:
  - tests/integration/runners/test_runner_returns.py
2017-04-28 09:26:26 -06:00
Pedro Algarvio
e6ee82e7be
The expected error message is different on py2 and py3 2017-04-28 13:36:45 +01:00
Pedro Algarvio
abe608d739
Drop @patch usage 2017-04-28 13:36:42 +01:00
Pedro Algarvio
4b59c351e4
This branch no longer targets py 2.6 2017-04-28 13:33:37 +01:00
Pedro Algarvio
9ffc79ca67
Use tornado HTTPClient directly. 2017-04-28 13:33:35 +01:00
Pedro Algarvio
7480a8e5fb
Check status on setUp not on the module level @skipIf decorator 2017-04-28 13:33:34 +01:00
Mike Place
78011f8740 Merge pull request #40761 from meaksh/develop-pkg-minor-fixes
Minor fixes on new pkg.list_downloaded
2017-04-28 06:32:48 -06:00
twangboy
e8d440b543 Mock win32api instead of win32gui 2017-04-26 12:41:13 -06:00
Pablo Suárez Hernández
9b241b7338 Adapting Zypper test to new list_downloaded output 2017-04-26 12:35:27 +01:00
Pablo Suarez Hernandez
ddf98e3fe3 Enhances pkg.list_downloaded information of a package 2017-04-26 12:34:13 +01:00
twangboy
fa8f9b55d8 Fix unit test, still mocking SendMessageTimout 2017-04-25 10:13:55 -06:00
Anthony Shaw
5dee8b12de
add support for custom algorithms and complementary test 2017-04-25 21:47:38 +10:00
Anthony Shaw
867e6c1ce5
tests for load balancer and lint for other modules, fixes for load balancer 2017-04-25 21:07:27 +10:00
Anthony Shaw
5f03b7a506
tests for load balancer and fixed issue with destroy balancer 2017-04-25 20:44:36 +10:00
Anthony Shaw
bb4ec6c4db
tests for the storage module 2017-04-25 20:27:52 +10:00
Bo Maryniuk
f71af0b625 Fix lint issues 2017-04-24 18:46:27 +02:00
Bo Maryniuk
0e6abb3e37 Add UT on set_hw_clock on Gentoo 2017-04-24 16:08:22 +02:00
Bo Maryniuk
a2b1d4638c Add UT for set_hwclock on Debian 2017-04-24 16:08:22 +02:00
Bo Maryniuk
88e8184702 Add UT set_hwclock on SUSE 2017-04-24 16:08:22 +02:00
Bo Maryniuk
0cd590f927 Fix UT names 2017-04-24 16:08:22 +02:00
Bo Maryniuk
bee94ade63 Add UT for set_hwclock on RedHat 2017-04-24 16:08:22 +02:00
Bo Maryniuk
dfe2610d05 Add UT for set_hwclock on Arch 2017-04-24 16:08:22 +02:00
Bo Maryniuk
d000a8a6f5 Add UT for set_hwclock on solaris 2017-04-24 16:08:22 +02:00
Bo Maryniuk
d2614aedaa Fix docstrings 2017-04-24 16:08:22 +02:00
Bo Maryniuk
6d782191dc Add UT for set_hwclock on AIX 2017-04-24 16:08:22 +02:00
Bo Maryniuk
d303e0dd8a Add UT for AIX on get_hwclock 2017-04-24 16:08:22 +02:00
Bo Maryniuk
86f2d83781 Add UT on Solaris 2017-04-24 16:08:22 +02:00
Bo Maryniuk
c3cafed6d5 Add UT for Debian on get_hwclock 2017-04-24 16:08:22 +02:00
Bo Maryniuk
d337c09357 Add UT for RedHat/SUSE platforms on get_hwclock 2017-04-24 16:08:22 +02:00
Bo Maryniuk
f25dc5c56c Add UT for get_hwclock on SUSE platform 2017-04-24 16:08:22 +02:00
Bo Maryniuk
08e00c865c Remove dead code 2017-04-24 16:08:22 +02:00
Bo Maryniuk
1216a0bf12 Add UT for get_hwclock on UTC/localtime 2017-04-24 16:08:22 +02:00
Bo Maryniuk
58676c568d Add UT for Debian on set_zone 2017-04-24 16:08:22 +02:00
Bo Maryniuk
1b9ce37b1b Add UT for gentoo on set_zone 2017-04-24 16:08:22 +02:00
Bo Maryniuk
6ed9be985e Adjust UT to use correct grain for SUSE series 2017-04-24 16:08:22 +02:00
Bo Maryniuk
ce4c836a60 Add UT for set_zone on SUSE series 2017-04-24 16:08:22 +02:00
Bo Maryniuk
155a498b49 Doc fix 2017-04-24 16:08:22 +02:00
Bo Maryniuk
a40876cdac Remove unnecessary mock patch 2017-04-24 16:08:22 +02:00
Bo Maryniuk
ffab2db213 Fix doc for RH UT 2017-04-24 16:08:22 +02:00
Bo Maryniuk
72388f7ae2 Add UT for RedHat's set_zone 2017-04-24 16:08:22 +02:00
Bo Maryniuk
11595d3a42 Refactor with setup/teardown 2017-04-24 16:08:22 +02:00
Bo Maryniuk
28072c9e41 Adjust the test so it is using the right grain for SUSE systems 2017-04-24 16:08:22 +02:00
Bo Maryniuk
7a0e4be4f8 Add unit test for get_zone and various platforms 2017-04-24 16:08:22 +02:00
Anthony Shaw
2b4d84ef3f
add a unit test to check the module starts correctly 2017-04-24 16:35:16 +10:00
Mike Place
6da806d1cc Merge pull request #39850 from epcim/pr_fix_keystone_endpoints_multiregion
Fix endpoint handling per region
2017-04-23 04:00:00 -06:00
rallytime
a7eb8f717e Merge branch 'nitrogen' into 'develop'
No conflicts.
2017-04-21 09:50:25 -06:00
Petr Michalec
ab1dd446e7
Endpoint handling per region, fixes #35874
- extend tests for multiple regions
- region arg by default set to None
- print verbose changes to be exec.
2017-04-21 15:48:52 +02:00
Andrey Arapov
4c29c5f6ab
dockerng: avoid network duplication and add driver_opts 2017-04-21 08:52:55 +02:00
rallytime
d5b1241972 Skip tsl unit test when we hit an error due to OpenSSL and junos-eznc packaging conflict
he pip junos-eznc package, when installed with PyOpenSSL version 0.14 causes
this test failure. If you either remove junos-eznc, or upgrade PyOpenSSL
(current is 0.17) the test is happy. So, we need to handle this case in the test.
2017-04-20 17:02:33 -06:00
Pablo Suárez Hernández
bd1f170a05 Fixes Zypper unit test 2017-04-19 10:18:46 +01:00
rallytime
885419b3e7 Merge branch 'nitrogen' into 'develop'
No conflicts.
2017-04-17 13:27:58 -06:00
Mike Place
f7b062acd7 Merge pull request #40266 from meaksh/develop-pkg-improvements
[develop] Adding "pkg.downloaded" state and support for installing patches/erratas
2017-04-17 11:34:42 -06:00
Per-Gustaf Stenberg
a0d6f9d883 Fixed lint errors in haproxy module and unit-tests 2017-04-17 19:13:17 +02:00
Per-Gustaf Stenberg
bcd88b0fb2 Added wait_state function in haproxy module 2017-04-17 19:13:17 +02:00
Per-Gustaf Stenberg
0120e32cfb added list_backends and get_backend function in haproxy module 2017-04-17 19:13:17 +02:00
Per-Gustaf Stenberg
438092126b Added list_frontends in haproxy module with returned mock data 2017-04-17 19:13:17 +02:00
Per-Gustaf Stenberg
14b492b5b4 Fixed unit test comments for haproxy module 2017-04-17 19:13:17 +02:00
Pablo Suárez Hernández
fa9e7f01f7 Pylint fix 2017-04-17 14:18:09 +01:00