14ef6d2b51
- splitting out the susemanager integration plugins into their own subpackages. ATM this only contains the zypp plugin to tell susemanager about manually installed packages. - Unit and integration tests fixes for 2016.3.2 Add: * 0018-Unit-tests-fixes-for-2016.3.2.patch * 0019-Fix-snapper_test-for-python26.patch * 0020-Integration-tests-fixes-for-2016.3.2.patch - Prevent pkg.install failure for expired keys (bsc#996455) Add: * 0017-Check-for-single-quote-before-splitting-on-single-qu.patch - Required D-Bus and generating machine ID where it is missing - Fix sphinx crashes when documentation is being generated Add script for documentation update. Add: * 0016-Improve-Mock-to-be-flexible-and-able-to-mock-methods.patch * update-documentation.sh - Fix pkg.installed refresh repo failure (bsc#993549) Fix salt.states.pkgrepo.management no change failure (bsc#990440) Add: * 0014-Add-ignore_repo_failure-option-to-suppress-zypper-s-.patch * 0015-Remove-zypper-s-raise-exception-if-mod_repo-has-no-a.patch - Deprecate status.uptime one version later Add: OBS-URL: https://build.opensuse.org/request/show/430691 OBS-URL: https://build.opensuse.org/package/show/systemsmanagement:saltstack/salt?expand=0&rev=77
108 lines
3.9 KiB
Diff
108 lines
3.9 KiB
Diff
From 65dba3e9ab088087943f67367dc27fce00e4cd92 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?=
|
|
<psuarezhernandez@suse.com>
|
|
Date: Tue, 13 Sep 2016 11:05:35 +0100
|
|
Subject: [PATCH 20/20] Integration tests fixes for 2016.3.2
|
|
|
|
* Fix PillarModuleTest::test_pillar_items: 'info' does not exist in pillar
|
|
* 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()
|
|
---
|
|
tests/integration/cloud/providers/msazure.py | 17 +++++++++--------
|
|
tests/integration/modules/git.py | 15 +++++++++------
|
|
tests/integration/modules/pillar.py | 1 -
|
|
tests/integration/states/git.py | 2 +-
|
|
4 files changed, 19 insertions(+), 16 deletions(-)
|
|
|
|
diff --git a/tests/integration/cloud/providers/msazure.py b/tests/integration/cloud/providers/msazure.py
|
|
index c4934e4..4e53add 100644
|
|
--- a/tests/integration/cloud/providers/msazure.py
|
|
+++ b/tests/integration/cloud/providers/msazure.py
|
|
@@ -53,14 +53,15 @@ def __has_required_azure():
|
|
'''
|
|
Returns True/False if the required version of the Azure SDK is installed.
|
|
'''
|
|
- if hasattr(azure, '__version__'):
|
|
- version = LooseVersion(azure.__version__)
|
|
- else:
|
|
- version = LooseVersion(azure.common.__version__)
|
|
- if HAS_AZURE is True and REQUIRED_AZURE <= version:
|
|
- return True
|
|
- else:
|
|
- return False
|
|
+ if HAS_AZURE:
|
|
+ if hasattr(azure, '__version__'):
|
|
+ version = LooseVersion(azure.__version__)
|
|
+ else:
|
|
+ version = LooseVersion(azure.common.__version__)
|
|
+
|
|
+ if REQUIRED_AZURE <= version:
|
|
+ return True
|
|
+ return False
|
|
|
|
|
|
@skipIf(HAS_AZURE is False, 'These tests require the Azure Python SDK to be installed.')
|
|
diff --git a/tests/integration/modules/git.py b/tests/integration/modules/git.py
|
|
index 7c40664..f5c15f3 100644
|
|
--- a/tests/integration/modules/git.py
|
|
+++ b/tests/integration/modules/git.py
|
|
@@ -36,12 +36,15 @@ log = logging.getLogger(__name__)
|
|
|
|
|
|
def _git_version():
|
|
- git_version = subprocess.Popen(
|
|
- ['git', '--version'],
|
|
- shell=False,
|
|
- close_fds=True,
|
|
- stdout=subprocess.PIPE,
|
|
- stderr=subprocess.PIPE).communicate()[0]
|
|
+ try:
|
|
+ git_version = subprocess.Popen(
|
|
+ ['git', '--version'],
|
|
+ shell=False,
|
|
+ close_fds=True,
|
|
+ stdout=subprocess.PIPE,
|
|
+ stderr=subprocess.PIPE).communicate()[0]
|
|
+ except OSError:
|
|
+ return False
|
|
if not git_version:
|
|
log.debug('Git not installed')
|
|
return False
|
|
diff --git a/tests/integration/modules/pillar.py b/tests/integration/modules/pillar.py
|
|
index b081f76..3d55b4c 100644
|
|
--- a/tests/integration/modules/pillar.py
|
|
+++ b/tests/integration/modules/pillar.py
|
|
@@ -119,7 +119,6 @@ class PillarModuleTest(integration.ModuleCase):
|
|
from pillar.items
|
|
'''
|
|
get_items = self.run_function('pillar.items')
|
|
- self.assertDictContainsSubset({'info': 'bar'}, get_items)
|
|
self.assertDictContainsSubset({'monty': 'python'}, get_items)
|
|
self.assertDictContainsSubset(
|
|
{'knights': ['Lancelot', 'Galahad', 'Bedevere', 'Robin']},
|
|
diff --git a/tests/integration/states/git.py b/tests/integration/states/git.py
|
|
index a78b271..87681ba 100644
|
|
--- a/tests/integration/states/git.py
|
|
+++ b/tests/integration/states/git.py
|
|
@@ -20,6 +20,7 @@ import integration
|
|
import salt.utils
|
|
|
|
|
|
+@skip_if_binaries_missing('git')
|
|
class GitTest(integration.ModuleCase, integration.SaltReturnAssertsMixIn):
|
|
'''
|
|
Validate the git state
|
|
@@ -254,7 +255,6 @@ class GitTest(integration.ModuleCase, integration.SaltReturnAssertsMixIn):
|
|
finally:
|
|
shutil.rmtree(name, ignore_errors=True)
|
|
|
|
- @skip_if_binaries_missing('git')
|
|
def test_config_set_value_with_space_character(self):
|
|
'''
|
|
git.config
|
|
--
|
|
2.8.2
|
|
|