Some unit tests fail with message "no such option: AGENT"

Bug #1117240 reported by Alexej Ababilov
30
This bug affects 7 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Undecided
Alexej Ababilov

Bug Description

Some tests from test_debug_commands and test_dhcp_agent fail

test_destroy (quantum.tests.unit.test_dhcp_agent.TestDeviceManager) ... ERROR
test_get_device_id (quantum.tests.unit.test_dhcp_agent.TestDeviceManager) ... ERROR
test_get_interface_name (quantum.tests.unit.test_dhcp_agent.TestDeviceManager) ... ERROR
test_get_interface_name_no_port_provided (quantum.tests.unit.test_dhcp_agent.TestDeviceManager) ... ERROR
test_setup (quantum.tests.unit.test_dhcp_agent.TestDeviceManager) ... ERROR
test_setup_device_exists (quantum.tests.unit.test_dhcp_agent.TestDeviceManager) ... ERROR
test_setup_device_exists_reuse (quantum.tests.unit.test_dhcp_agent.TestDeviceManager) ... ERROR
test_call_driver (quantum.tests.unit.test_dhcp_agent.TestDhcpAgent) ... ERROR
test_call_driver_failure (quantum.tests.unit.test_dhcp_agent.TestDhcpAgent) ... ERROR
test_clear_probe (quantum.tests.unit.test_debug_commands.TestDebugCommands) ... ERROR
test_create_probe (quantum.tests.unit.test_debug_commands.TestDebugCommands) ... ERROR
test_create_probe_external (quantum.tests.unit.test_debug_commands.TestDebugCommands) ... ERROR
test_delete_probe (quantum.tests.unit.test_debug_commands.TestDebugCommands) ... ERROR
test_delete_probe_external (quantum.tests.unit.test_debug_commands.TestDebugCommands) ... ERROR
test_delete_probe_without_namespace (quantum.tests.unit.test_debug_commands.TestDebugCommands) ... ERROR
test_exec_command (quantum.tests.unit.test_debug_commands.TestDebugCommands) ... ERROR
test_exec_command_without_namespace (quantum.tests.unit.test_debug_commands.TestDebugCommands) ... ERROR
test_list_probe (quantum.tests.unit.test_debug_commands.TestDebugCommands) ... ERROR
test_ping_all (quantum.tests.unit.test_debug_commands.TestDebugCommands) ... ERROR
test_ping_all_v6 (quantum.tests.unit.test_debug_commands.TestDebugCommands) ... ERROR
test_ping_all_with_ensure_port (quantum.tests.unit.test_debug_commands.TestDebugCommands) ... ERROR

 with trace like:

======================================================================
ERROR: test_call_driver_failure (quantum.tests.unit.test_dhcp_agent.TestDhcpAgent)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jenkins/ababilov/quantum/quantum/tests/unit/test_dhcp_agent.py", line 152, in test_call_driver_failure
    dhcp = dhcp_agent.DhcpAgent(cfg.CONF)
  File "/home/jenkins/ababilov/quantum/quantum/agent/dhcp_agent.py", line 59, in __init__
    self.root_helper = config.get_root_helper(conf)
  File "/home/jenkins/ababilov/quantum/quantum/agent/common/config.py", line 40, in get_root_helper
    root_helper = conf.AGENT.root_helper
  File "/home/jenkins/ababilov/quantum/quantum/openstack/common/cfg.py", line 1152, in __getattr__
    return self._get(name)
  File "/home/jenkins/ababilov/quantum/quantum/openstack/common/cfg.py", line 1456, in _get
    value = self._substitute(self._do_get(name, group))
  File "/home/jenkins/ababilov/quantum/quantum/openstack/common/cfg.py", line 1472, in _do_get
    info = self._get_opt_info(name, group)
  File "/home/jenkins/ababilov/quantum/quantum/openstack/common/cfg.py", line 1572, in _get_opt_info
    raise NoSuchOptError(opt_name, group)
NoSuchOptError: no such option: AGENT

config.get_root_helper function fails because config.register_root_helper was not called.

Previously, root helper was initialized with statement

cfg.CONF.root_helper = 'sudo'

After https://github.com/openstack/quantum/commit/1b7565b83ca8ef9761cdfb1eed1e9eb9498ea340, config.register_root_helper function must be called instead.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to quantum (master)

Fix proposed to branch: master
Review: https://review.openstack.org/21297

Changed in quantum:
assignee: nobody → Alessio Ababilov (aababilov)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to quantum (master)

Reviewed: https://review.openstack.org/21297
Committed: http://github.com/openstack/quantum/commit/b2dc9e6bf996a3e607bfbcaf133968798210a54d
Submitter: Jenkins
Branch: master

commit b2dc9e6bf996a3e607bfbcaf133968798210a54d
Author: Alessio Ababilov <email address hidden>
Date: Wed Feb 6 13:22:53 2013 +0200

    Register root_helper in test_debug_commands and test_dhcp_agent

    root_helper variable currently must be introduced with a call
    to register_root_helper, not with a simple assignment.

    Change-Id: I3e72379925a994acfb6defb24820ab63eab43957
    Fixes: bug #1117240

Changed in quantum:
status: In Progress → Fix Committed
Akihiro Motoki (amotoki)
Changed in quantum:
milestone: none → grizzly-3
Thierry Carrez (ttx)
Changed in quantum:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in quantum:
milestone: grizzly-3 → 2013.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.