diff --git a/neutron/cmd/sanity_check.py b/neutron/cmd/sanity_check.py index 5d26af2d19c..540c66826dd 100644 --- a/neutron/cmd/sanity_check.py +++ b/neutron/cmd/sanity_check.py @@ -23,9 +23,12 @@ from neutron.agent import dhcp_agent from neutron.cmd.sanity import checks from neutron.common import config from neutron.conf.agent import securitygroups_rpc +from neutron.conf import common as common_config from neutron.conf.db import l3_hamode_db from neutron.conf.plugins.ml2 import config as ml2_conf from neutron.conf.plugins.ml2.drivers import linuxbridge as lb_conf +from neutron.conf.plugins.ml2.drivers.mech_sriov import agent_common as \ + sriov_conf from neutron.conf.plugins.ml2.drivers import ovs_conf @@ -35,10 +38,12 @@ LOG = logging.getLogger(__name__) def setup_conf(): ovs_conf.register_ovs_agent_opts(cfg.CONF) lb_conf.register_linuxbridge_opts(cfg.CONF) + sriov_conf.register_agent_sriov_nic_opts(cfg.CONF) ml2_conf.register_ml2_plugin_opts(cfg.CONF) securitygroups_rpc.register_securitygroups_opts(cfg.CONF) dhcp_agent.register_options(cfg.CONF) l3_hamode_db.register_db_l3_hamode_opts(cfg.CONF) + common_config.register_core_common_config_opts(cfg.CONF) class BoolOptCallback(cfg.BoolOpt): diff --git a/neutron/tests/unit/cmd/test_sanity_check.py b/neutron/tests/unit/cmd/test_sanity_check.py index 08f7bbbaa5f..83c431eae39 100644 --- a/neutron/tests/unit/cmd/test_sanity_check.py +++ b/neutron/tests/unit/cmd/test_sanity_check.py @@ -22,8 +22,11 @@ from neutron.tests import base class TestSanityCheck(base.BaseTestCase): - def test_setup_conf(self): - # verify that configuration can be successfully imported - with mock.patch.object(sanity_check.cfg, 'CONF', - return_value=cfg.ConfigOpts()): + def test_setup_conf_and_enable_test_from_config(self): + # Verify that configuration can be successfully imported and tests are + # correctly loaded, based on the registered configuration parameters. + with mock.patch.object(sanity_check, 'cfg') as mock_cfg: + mock_cfg.CONF = cfg.ConfigOpts() + sanity_check.cfg.CONF.register_cli_opts(sanity_check.OPTS) sanity_check.setup_conf() + sanity_check.enable_tests_from_config()