Merge "Fix TestNecAgentMain not to call sys.exit()"

This commit is contained in:
Jenkins 2013-06-19 14:25:33 +00:00 committed by Gerrit Code Review
commit 248375ed0b
2 changed files with 4 additions and 7 deletions

View File

@ -23,7 +23,6 @@
# @author: Akihiro MOTOKI
import socket
import sys
import time
import eventlet
@ -242,8 +241,6 @@ def main():
# Start everything.
agent.daemon_loop()
sys.exit(0)
if __name__ == "__main__":
main()

View File

@ -290,12 +290,12 @@ class TestNecAgentMain(base.BaseTestCase):
with contextlib.nested(
mock.patch.object(nec_quantum_agent, 'NECQuantumAgent'),
mock.patch('eventlet.monkey_patch'),
mock.patch('quantum.common.config'),
mock.patch.object(nec_quantum_agent, 'logging_config'),
mock.patch.object(nec_quantum_agent, 'config')
) as (agent, eventlet, logging_config, cfg):
cfg.CONF.ovs.integration_bridge = 'br-int-x'
cfg.CONF.AGENT.root_helper = 'dummy-helper'
cfg.CONF.AGENT.polling_interval = 10
cfg.OVS.integration_bridge = 'br-int-x'
cfg.AGENT.root_helper = 'dummy-helper'
cfg.AGENT.polling_interval = 10
nec_quantum_agent.main()