-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #76 from sapcc/load_default_config
Register DEFAULT group on agent start and [Caracal] Update github workflow & Fix unit tests
- Loading branch information
Showing
10 changed files
with
100 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
networking_aci/tests/unit/plugins/ml2/drivers/mech_aci/test_db_plugin.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from neutron.tests.unit.plugins.ml2 import test_plugin | ||
from neutron_lib import context | ||
from neutron_lib.db import api as db_api | ||
from oslotest import base | ||
|
||
from networking_aci.db.models import HostgroupModeModel | ||
from networking_aci.plugins.ml2.drivers.mech_aci.common import DBPlugin | ||
|
||
|
||
class NetworkingDBPluginTests(test_plugin.Ml2PluginV2TestCase, base.BaseTestCase): | ||
|
||
def _create_hostgroup_mode(self, hostgroup, mode): | ||
ctx = context.get_admin_context() | ||
with db_api.CONTEXT_WRITER.using(ctx): | ||
self._hg_mode = HostgroupModeModel(hostgroup=hostgroup, mode=mode) | ||
ctx.session.add(self._hg_mode) | ||
|
||
def test_set_hostgroup_mode(self): | ||
new_hg_mode = 'something-different' | ||
|
||
self._create_hostgroup_mode(hostgroup="hg-1", mode="infra") | ||
plugin = DBPlugin() | ||
ctx = context.get_admin_context() | ||
plugin.set_hostgroup_mode(ctx, "hg-1", new_hg_mode) | ||
|
||
hg_mode = plugin.get_hostgroup_mode(ctx, "hg-1") | ||
self.assertEqual(new_hg_mode, hg_mode, f"Hostgroup Mode should match {new_hg_mode} but got {hg_mode}") |
Oops, something went wrong.