diff options
author | Markus Hosch <markus.hosch@bmw.de> | 2018-11-21 14:33:14 +0100 |
---|---|---|
committer | Markus Hosch <markus.hosch@bmw.de> | 2018-11-22 18:32:15 +0100 |
commit | cbb0082451511206dec82c3ef8e10e87f41f5a75 (patch) | |
tree | 27c185460b6b755521cfa142410a93e8d0fa275f /tests/unit/test_inventory.py | |
parent | 33699fa31689b2b40cff5b103a55f7cbd80fc096 (diff) | |
download | zuul-cbb0082451511206dec82c3ef8e10e87f41f5a75.tar.gz |
Add config parameters for WinRM timeouts
Both the operation and the read timeout can now be configured in the
zuul-executor main configuration file. If the network is flaky,
increasing these numbers from their defaults might help to lower the
rate of aborted Windows builds.
Change-Id: I4c25ca6027fc4150ec1c9c49ed286e7b4f20d4dd
Diffstat (limited to 'tests/unit/test_inventory.py')
-rw-r--r-- | tests/unit/test_inventory.py | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/tests/unit/test_inventory.py b/tests/unit/test_inventory.py index 8f1ff8c4b..cc19cbafc 100644 --- a/tests/unit/test_inventory.py +++ b/tests/unit/test_inventory.py @@ -19,12 +19,12 @@ import yaml from tests.base import ZuulTestCase -class TestInventory(ZuulTestCase): +class TestInventoryBase(ZuulTestCase): tenant_config_file = 'config/inventory/main.yaml' def setUp(self): - super(TestInventory, self).setUp() + super(TestInventoryBase, self).setUp() self.executor_server.hold_jobs_in_build = True A = self.fake_gerrit.addFakeChange('org/project', 'master', 'A') self.fake_gerrit.addEvent(A.getPatchsetCreatedEvent(1)) @@ -41,6 +41,9 @@ class TestInventory(ZuulTestCase): 'setup-inventory.yaml') return yaml.safe_load(open(setup_inv_path, 'r')) + +class TestInventory(TestInventoryBase): + def test_single_inventory(self): inventory = self._get_build_inventory('single-inventory') @@ -157,3 +160,21 @@ class TestInventory(ZuulTestCase): self.executor_server.release() self.waitUntilSettled() + + +class TestWindowsInventory(TestInventoryBase): + config_file = 'zuul-winrm.conf' + + def test_windows_inventory(self): + inventory = self._get_build_inventory('hostvars-inventory') + windows_host = inventory['all']['hosts']['windows'] + self.assertEqual(windows_host['ansible_connection'], 'winrm') + self.assertEqual( + windows_host['ansible_winrm_operation_timeout_sec'], + '120') + self.assertEqual( + windows_host['ansible_winrm_read_timeout_sec'], + '180') + + self.executor_server.release() + self.waitUntilSettled() |