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).
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.
* 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
Version 2.6.0 changed the wording of one of the exceptions tested,
causing tests to fail when jsonschema 2.6.0 is installed. This commit
updates the tests to change the assert for 2.6.0 and later.
* Fix for #38697
* Lint fixes
* Added missing source_hash_name argument in get_managed function
Additional fix to #33187
Customer was still seeing errors, this should now work.
Tested with 2015.8.13 and 2016.11.2
* [2016.3] Pylint fix (#39202)
* Ignore empty dicts in highstate outputter
Closes#37174
* Sort the return list from the fileserver.envs runner
* 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.
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.
* Apply fix from #38705 to 2016.3 branch
This is a better fix and covers more use cases than the sudo_user one.
* Remove saltenv param from internal state func call
This was probably redundant in the first place, but since state.sls,
state.highstate, etc. accept a saltenv param and the actual state
functions do not, this results in multiple values passed for the saltenv
param.
Remove this argument and let file.get_managed reference __env__
internally.
* Update archive tests to match 2016.11 branch
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.
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.
Stabilizes these tests by avoiding errors when cheese, crackers
order changes in the comment and gives errors like:
- 'comment': 'Kernel modules crackers, cheese are already present',
? --------
+ 'comment': 'Kernel modules cheese, crackers are already present',
? ++++++++
* 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
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.
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.
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>
If all the devices submitted to pvcreate() are already initialized as
LVM physical volumes, pvcreate() should return True and no futher
actions should be made.
pvdisplay() would be called by pvcreate() twice: firstly to check
whether a device is already initialized for use by LVM and then to
ensure that the pvcreate executable did its job correctly. The test
replaces pvdisplay() with a mock that always returns True and thus
pvcreate() would think that a specified device is already initialized
and exit. In the other words, instead of testing physical volume
initialization the test simulates a case with all the submitted
devices already initialized.
Fix it by replacing pvdisplay with a mock that returns False on the
first call (thus pvcreate thinks that a device is not a PV yet) and True
on the second call (after the pvcreate executable is called).
'lvm version' produces multiline output whereas test_version and
test_fullversion use mocks with single-line output. Use real-life
'lvm version' output in those mocks instead.
* openvswitch: add a basic unit test for openvswitch
* openvswitch: enclose comments_* variables into a map
* openvswitch: only prepare error messages if type parameter is present
* openvswitch: add test case: create a GRE port
* openvswitch: remove trailing whitespace
* openvswitch: add missing "comments" variable
* openvswitch: pep8 compliance
* openvswitch: mock dig.check_ip
* openvswitch: rename "type" argument into "tunnel_type"
* openvswitch: reference bridge_exists before assignment
* openvswitch: reference port_list before assignment
* openvswitch: add upgrade note about "type" option renaming
These unit tests exposed a bunch of python 3 incompatibilities in the
filebuffer util as well as the find util. The filebuffer changes should
be reviewed carefully.
Once this happens, we need to re-enable the test. The move over
should also allow us to upgrade the version of salt-testing that
is applied to the test VMs. Once this is complete, we can apply
the `@flaky` decorator to this test. (salt-testing must be a
version newer than the September release.)