Commit Graph

3343 Commits

Author SHA1 Message Date
Daniel Wallace
d332b33c8a add extmod_blacklist to make it easier to remove modules 2017-02-15 12:47:32 -06:00
Pedro Algarvio
fc59d5e832 Python 3 Fixes (Pt. 2) (#39397)
* Typo in comment

* First convert to string if not already a string. Then to bytes under Py3.

The reason being that jids from the CLI, at least the one fed in
integration.runners.jobs.ManageTest.test_loopup_jid is loaded as an
integer, and, while the Py2 code converts JIDs to strings, under Py3, we
assume JID's are already strings.

* Mark tests which require root permissions to run

* Allow declaring that the function IS a class method.

```
Python 3.5.3 (default, Jan 21 2017, 00:29:12)
[GCC 6.3.1 20170109] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> class Foo:
...     def bar(self):
...         print('bar')
...
>>> import inspect
>>> inspect.ismethod(Foo.bar)
False
>>> inspect.ismethod(Foo().bar)
True
```

On Python 2, `inspect.ismethod` returns `True` for bound and unbound
methods while on Python 3 it only returns `True` for bound methods.
The explicit `is_class_method` is to avoid instantiating the class just
to get the function signature.

* Always decode responses to the Python version native string implementation

* Just compare the objects as matching list.

Asserting same item count doesn't make that much sense.

* Py3 compatibility

* Fix saltnado tests under Py3

* Python 3 compatibility

* Show me the full traceback

* Revert "Convert fileserver data from bytes to strings"

This reverts commit e53972f8c6.

* Revert "Under Py3, we get `bytes` when using the roots backend directly"

This reverts commit 9f73b240c1.

* Convert from bytes to str if not a binary file

* Py3 compatibility fixes.

Convert file contents from bytes to string if not a binary file
2017-02-14 16:20:56 -07:00
Mike Place
868e170b92 Merge pull request #39376 from jmickle/develop
adding librato metrics returner
2017-02-14 11:39:34 -07:00
Mike Place
471baea629 Merge pull request #39381 from cachedout/docs_fix
Docs test fix
2017-02-14 10:53:27 -07:00
Mike Place
89ed6a38f7
Typo 2017-02-13 16:46:53 -07:00
Mike Place
8fbbb781bc
Fix docs test 2017-02-13 16:45:47 -07:00
Jonathan Mickle
ec938e5f73 linter fixes 2017-02-13 15:27:07 -08:00
mephi42
6570392abd Support globbing in sources parameter of salt.modules.archive (#32356)
Add globbing support to tar, zip and rar.
Update tests to show bad return value on error.
2017-02-14 00:02:19 +01:00
Jonathan Mickle
d61865c2bc adding librato metrics returner 2017-02-13 14:18:54 -08:00
Mike Place
dcd9ff471f Merge pull request #39302 from terminalmage/loader-virtual-aliases
Add __virtual_aliases__ feature to the loader
2017-02-13 13:22:02 -07:00
Pedro Algarvio
9f73b240c1
Under Py3, we get bytes when using the roots backend directly 2017-02-13 16:44:30 +00:00
Pedro Algarvio
ff1667c6d6
We really don't need to decode the string prior to writing it to file.
Plus, this also avoids handling Py2 and Py3 differently.
2017-02-13 16:25:09 +00:00
Pedro Algarvio
005f21d3b5
Compare against the normalized mode string 2017-02-13 10:18:58 +00:00
Pedro Algarvio
c1b5606199
Handle bytes vs strings on the file state module tests 2017-02-13 10:18:57 +00:00
Pedro Algarvio
26b17fb044
Make sure the minion sync's modules/states/grains/etc when starting 2017-02-13 10:18:57 +00:00
Pedro Algarvio
7b7133ea25
This test case requires root permissions 2017-02-13 10:18:56 +00:00
Erik Johnson
6ee6874e11 Set time back 1 week instead of up to 36 years in system module tests
This prevents git_pillar certificate errors. Additionally, sometimes
/dev/rtc becomes unresponsive which leads the ``hwclock --compare``
command to spin indefinitely, ultimately causing the entire test run to
fail. This changeset uses a SIGALRM handler to abort the hwclock command
if no output is seen within 3 seconds and try a second time. If it times
out the second time as well, then an error will be logged but it will
not be fatal to the test (or hang it indefinitely).
2017-02-12 23:57:28 -06:00
Erik Johnson
4e577e697d Switch to non-legacy git_pillar syntax in test suite 2017-02-12 15:12:49 -06:00
Nicole Thomas
050b4cc824 Protect hardware clock test comparison better (#39298)
In #39060, some tests were added to check for the hardware clock
getting reset when possible. The test attempted to gate the test
when access to the hardware clock was impossible, but the check
wasn't quite right and caused problems with the resulting tests.

This change makes the `has_settable_hwclock()` function public
in order to make the test gate work correctly. This function
could also be useful at the CLI level.

When running `self.run_function('status._has_settable_hwclock()')`
from the test suite, the return is a string noting that the
function is unavailable. This change allows for the `if not` check
to evaluate the return of the function.
2017-02-10 10:15:25 -07:00
Erik Johnson
954752b5fd Add test for __virtual_aliases__ 2017-02-10 08:48:57 -06:00
Pedro Algarvio
b264114901
Restore full user permissions when failing to delete 2017-02-09 18:06:27 +00:00
Mike Place
bac99d9e72 Merge pull request #39252 from gtmanfred/extmod_whitelist
Allow specifying which modules should be used when running saltutil.sync_*
2017-02-09 10:09:43 -07:00
Erik Johnson
d35c2f810c salt.utils.gitfs: remove dulwich support, make refspecs configurable (#39210)
* Add config params for custom refspecs

* Add exceptions for errors encountered modifying git config

* Make the refspecs a configurable parameter

* Make refspecs a per-remote parameter

* Update master config template to include custom refspecs opts

* Add documentation for new config params

* Update GitFS walkthrough with a section on custom refspecs

* Remove dulwich support from salt.utils.gitfs

Dulwich still lacks important features, including (but not limited to)
the following:

- Lack of the necessary support for checking out a ref needed for
  git_pillar/winrepo support

- No support in its config objects for multivar git config items, making
  it impossible to detect when repos have multiple refspecs set for a
  given git remote

Given this information, and the fact that it trails as a distant third
to Pygit2 and GitPython, Salt will cease to support Dulwich as a git
interface moving forward.

* Excise references to dulwich from documentation

* Add mention of custom refspecs to Nitrogen release notes

* Add gitfs_refspecs to mocked opts in gitfs integration tests

Also remove dulwich from unit tests

* Add information about opts argument not being intended for CLI use
2017-02-09 09:50:45 -07:00
Daniel Wallace
e38c5d296b fix pylint 2017-02-08 18:07:13 -06:00
Daniel Wallace
57ab8dd27b add integration test 2017-02-08 16:08:50 -06:00
Mike Place
7dd7fe3269 Merge pull request #39229 from rallytime/doc-test-fix
Fixup docs that don't have a CLI Example
2017-02-07 14:45:08 -07:00
Mike Place
0f838b2b12 Merge pull request #38621 from terminalmage/pr34442
Add support for wildcard versions in pkg.installed states
2017-02-07 14:41:14 -07:00
rallytime
50b9ac6a6d Fixup docs that don't have a CLI Example
- log functions shouldn't be used at the CLI level: added to allow_failure in test
- Added example for status.proxy_reconnect
2017-02-07 13:40:01 -07:00
Erik Johnson
da7d3ecec0 Add integration test for wildcard versions 2017-02-07 08:54:26 -06:00
Mike Place
c48192beff Merge pull request #38781 from raazvvann/dev/rheghedu/nilrt_ip
Add network module for NILinuxRT: nilrt_ip.py
2017-02-06 12:30:43 -07:00
Mike Place
f8d79076f2 Merge pull request #39013 from terminalmage/zh878
Decryption of values in Pillar SLS files
2017-02-06 12:08:57 -07:00
Heghedus Razvan
8408789511 Add network module for NILinuxRT: nilrt_ip.py
Connman is the network manager used as backend.
Functionalities:
  - ip.get_interface_details()
  - ip.up(interface)
  - ip.down(interface)
  - ip.set_dhcp_linklocal_all(interface)
  - ip.set_static_all(interface, address, netmask, gateway, domains)
  - ip.build_interface(interface, interface_type, enable, **settings)
  - ip.build_network_settings(**settings)
  - ip.get_network_settings()
  - ip.apply_network_settings(**settings)

Integration test for:
  - ip.enable
  - ip.disable
  - ip.set_dhcp_linklocal_all
  - ip.set_static_all

Signed-off-by: Heghedus Razvan <razvan.heghedus@ni.com>
2017-02-03 14:25:03 +02:00
Erik Johnson
cdf045662f add debug logging for batch vars 2017-02-02 18:06:50 -06:00
Erik Johnson
316e62889a Don't fail test if data is empty
This keeps trimmed output from failing the test. We are still testing
with a specific module lower down in the test, so this doesn't reduce
our test coverage.
2017-02-02 18:06:50 -06:00
Erik Johnson
56e86a6e04 Run test_valid_docs in batches
This test fails often due to being trimmed, thanks to
salt.utils.dicttrim trimming values > max_event_size.

This commit changes this test so that it runs sys.doc twice, ensuring
that the return from sys.doc (for now) is not trimmed.
2017-02-02 18:06:50 -06:00
Erik Johnson
6221fd0573 Add tests for pillar decryption 2017-02-02 18:06:50 -06:00
rallytime
eb61788f87 Merge branch '2016.11' into 'develop'
Conflicts:
  - doc/ref/runners/all/index.rst
  - salt/modules/win_lgpo.py
  - salt/states/dockerio.py
2017-02-01 16:36:45 -07:00
rallytime
a782b00ee1 Merge branch '2016.3' into '2016.11'
Conflicts:
  - salt/cloud/clouds/openstack.py
2017-02-01 13:35:10 -07:00
Mike Place
4ed8085d27 Merge pull request #39060 from harisokanovic/dev/hokanovi/hwclock-sync
system: Update hardware clock on date/time change
2017-02-01 12:22:20 -07:00
Mike Place
cc9b69b6bc Merge pull request #39091 from terminalmage/update-test-valid-docs
Run test_valid_docs in batches
2017-02-01 12:09:04 -07:00
Erik Johnson
d76f0380d0 add debug logging for batch vars 2017-02-01 00:05:21 -06:00
Erik Johnson
b4afea2a25 Don't fail test if data is empty
This keeps trimmed output from failing the test. We are still testing
with a specific module lower down in the test, so this doesn't reduce
our test coverage.
2017-02-01 00:05:21 -06:00
Erik Johnson
909916c78e Run test_valid_docs in batches
This test fails often due to being trimmed, thanks to
salt.utils.dicttrim trimming values > max_event_size.

This commit changes this test so that it runs sys.doc twice, ensuring
that the return from sys.doc (for now) is not trimmed.
2017-02-01 00:05:05 -06:00
Haris Okanovic
c5f832b9e3 system: Update hardware clock on date/time change
Update hardware clock so that date/time changes persist
through reboot.

Add hwclock check to system integration test. Bump tolerance
of _same_times() helper to account for longer run-time of set
operations. Updating hardware rtc's can take more than 2 seconds.

Signed-off-by: Haris Okanovic <haris.okanovic@ni.com>
Reviewed-by: Sergey Kizunov <sergey.kizunov@ni.com>
Reviewed-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
Reviewed-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com>
2017-01-31 17:40:40 -06:00
Mike Place
1ccb365945 Merge pull request #39002 from rallytime/fix-38111
Pass win_* options as kwargs when calling file.manage_file
2017-01-31 13:51:39 -07:00
Erik Johnson
bcee3d1ef6 Move fileclient tests to tests/integration/fileserver/fileclient_test.py (#39081)
Being in the root of tests/integration/, these were not being run in
jenkins and would only run if executed manually using the -n flag in
runtests.py.
2017-01-31 13:44:50 -07:00
twangboy
c704eaa175 Fix geteuid stacktrace on Windows 2017-01-30 15:36:08 -07:00
rallytime
43dba1bf78 Skip new managed file state test on Windows 2017-01-30 13:40:25 -07:00
rallytime
8e17c96e02 Write failing test for Issue #38111
Test calls "file.managed" using the "check_cmd" kwarg with the
state provided as a reproducible test case for the issue.
2017-01-27 11:28:54 -07:00
Nicole Thomas
7c93bcbb2a Add one more option to "allow_failure" for doc test (#38998) 2017-01-27 09:43:04 -07:00