Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
6ff2610c
Commit
6ff2610c
authored
Oct 22, 2013
by
Kean Johnston
Browse files
[433] Improve test and make status variable local in scope
parent
9cb427b4
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/bin/msgq/msgq.py.in
View file @
6ff2610c
...
@@ -275,18 +275,18 @@ class MsgQ:
...
@@ -275,18 +275,18 @@ class MsgQ:
# connect to the existing socket to see if there is an existing
# connect to the existing socket to see if there is an existing
# msgq running. Only if that fails do we remove the file and
# msgq running. Only if that fails do we remove the file and
# attempt to create a new socket.
# attempt to create a new socket.
self._
existing = True
existing
_msgq
= True
try:
try:
self._session = isc.cc.Session(self.socket_file)
self._session = isc.cc.Session(self.socket_file)
except isc.cc.session.SessionError:
except isc.cc.session.SessionError:
self._
existing = False
existing
_msgq
= False
self._session.close()
self._session.close()
self._session = None
self._session = None
if
self._
existing:
if existing
_msgq
:
logger.fatal(MSGQ_ALREADY_RUNNING)
logger.fatal(MSGQ_ALREADY_RUNNING)
raise MsgQRunningError("
Message Queue daemon
already running")
raise MsgQRunningError("
b10-msgq
already running")
os.remove(self.socket_file)
os.remove(self.socket_file)
...
...
src/bin/msgq/msgq_messages.mes
View file @
6ff2610c
...
@@ -19,9 +19,9 @@
...
@@ -19,9 +19,9 @@
# <topsrcdir>/tools/reorder_message_file.py to make sure the
# <topsrcdir>/tools/reorder_message_file.py to make sure the
# messages are in the correct order.
# messages are in the correct order.
% MSGQ_ALREADY_RUNNING Another copy of
the message queue daemon
is already running.
% MSGQ_ALREADY_RUNNING Another copy of
b10-msgq
is already running.
Only a single instance of
the message queue daemon
should ever be run at one
Only a single instance of
b10-msgq
should ever be run at one
time.
time.
This instance will now terminate.
This instance will now terminate.
% MSGQ_CFGMGR_SUBSCRIBED The config manager subscribed to message queue
% MSGQ_CFGMGR_SUBSCRIBED The config manager subscribed to message queue
This is a debug message. The message queue has little bit of special handling
This is a debug message. The message queue has little bit of special handling
...
...
src/bin/msgq/tests/msgq_run_test.py
View file @
6ff2610c
...
@@ -333,9 +333,14 @@ class MsgqRunTest(unittest.TestCase):
...
@@ -333,9 +333,14 @@ class MsgqRunTest(unittest.TestCase):
Check to make sure that an attempt to start a second copy of the MsgQ
Check to make sure that an attempt to start a second copy of the MsgQ
daemon fails.
daemon fails.
"""
"""
self
.
assertTrue
(
os
.
path
.
exists
(
SOCKET_PATH
))
self
.
__retcode
=
subprocess
.
call
([
MSGQ_PATH
,
'-s'
,
SOCKET_PATH
])
self
.
__retcode
=
subprocess
.
call
([
MSGQ_PATH
,
'-s'
,
SOCKET_PATH
])
self
.
assertNotEqual
(
self
.
__retcode
,
0
)
self
.
assertNotEqual
(
self
.
__retcode
,
0
)
# Verify that the socket still exists
self
.
assertTrue
(
os
.
path
.
exists
(
SOCKET_PATH
))
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
isc
.
log
.
init
(
"msgq-tests"
)
isc
.
log
.
init
(
"msgq-tests"
)
isc
.
log
.
resetUnitTestRootLogger
()
isc
.
log
.
resetUnitTestRootLogger
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment