Browse Source

Fix murano ci UT error

Change-Id: I24ea16ae4d853829ca34721febf8c834cc42977f
(cherry picked from commit 371e99e473)
(cherry picked from commit e7d3719025)
(cherry picked from commit 209d8b7ec3)
(cherry picked from commit 82dc0eb1e1)
changes/82/744482/1
zhurong 2 months ago
committed by Elod Illes
parent
commit
e36e91f53a
2 changed files with 5 additions and 0 deletions
  1. +2
    -0
      murano/tests/unit/dsl/test_agent.py
  2. +3
    -0
      murano/tests/unit/engine/system/test_agent.py

+ 2
- 0
murano/tests/unit/dsl/test_agent.py View File

@@ -62,6 +62,7 @@ class TestAgentListener(test_case.DslTestCase):
class TestAgent(test_case.DslTestCase):
def test_agent_enabled(self):
self.override_config('disable_murano_agent', False, 'engine')
self.override_config('signing_key', False, group='engine')
agent_cls = 'murano.engine.system.agent.Agent'
a = agent.Agent(mock.MagicMock())
self.assertTrue(a.enabled)
@@ -73,6 +74,7 @@ class TestAgent(test_case.DslTestCase):

def test_agent_disabled(self):
self.override_config('disable_murano_agent', True, 'engine')
self.override_config('signing_key', False, group='engine')
a = agent.Agent(mock.MagicMock())
self.assertFalse(a.enabled)
self.assertRaises(exc.PolicyViolationException, a.call, {}, None)


+ 3
- 0
murano/tests/unit/engine/system/test_agent.py View File

@@ -42,6 +42,7 @@ class TestAgent(base.MuranoTestCase):
self.yaml_loader = yamllib.SafeLoader

self.override_config('disable_murano_agent', False, group='engine')
self.override_config('signing_key', False, group='engine')

mock_host = mock.MagicMock()
mock_host.id = '1234'
@@ -355,6 +356,8 @@ class TestExecutionPlan(base.MuranoTestCase):
else:
self.yaml_loader = yamllib.SafeLoader

self.override_config('signing_key', False, group='engine')

self.mock_murano_class = mock.Mock(spec=murano_type.MuranoClass)
self.mock_murano_class.name = 'io.murano.system.Agent'
self.mock_murano_class.declared_parents = []


Loading…
Cancel
Save