BIND 10 trac2922, updated. 15810521bfeea89e77334df66512863911a4d03c [2922] Cleaner way to extract lname from msgq
BIND 10 source code commits
bind10-changes at lists.isc.org
Tue Jun 11 09:41:38 UTC 2013
The branch, trac2922 has been updated
via 15810521bfeea89e77334df66512863911a4d03c (commit)
via af91bbf6f4104b9731264270e2f1356b0ec74981 (commit)
from 779d5913cc017664e72d4e6008b1e7dced1a6ae4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 15810521bfeea89e77334df66512863911a4d03c
Author: Michal 'vorner' Vaner <vorner at vorner.cz>
Date: Tue Jun 11 11:40:32 2013 +0200
[2922] Cleaner way to extract lname from msgq
commit af91bbf6f4104b9731264270e2f1356b0ec74981
Author: Michal 'vorner' Vaner <vorner at vorner.cz>
Date: Tue Jun 11 11:39:03 2013 +0200
[2922] Minor: Consistency in group names and quotes
-----------------------------------------------------------------------
Summary of changes:
src/bin/msgq/tests/msgq_run_test.py | 4 ++--
src/bin/msgq/tests/msgq_test.py | 32 ++++++++++++++++----------------
2 files changed, 18 insertions(+), 18 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/msgq/tests/msgq_run_test.py b/src/bin/msgq/tests/msgq_run_test.py
index ca01192..9cf6da6 100644
--- a/src/bin/msgq/tests/msgq_run_test.py
+++ b/src/bin/msgq/tests/msgq_run_test.py
@@ -289,7 +289,7 @@ class MsgqRunTest(unittest.TestCase):
"""
conn = self.__get_connection()
# Activate the session, pretend to be the config manager.
- conn.group_subscribe("ConfigManager")
+ conn.group_subscribe('ConfigManager')
# Answer request for logging config
(msg, env) = conn.group_recvmsg(nonblock=False)
self.assertEqual({'command': ['get_config',
@@ -321,7 +321,7 @@ class MsgqRunTest(unittest.TestCase):
attempts -= 1
self.assertTrue(synchronised)
# The actual test
- conn.group_subscribe("notifications/cc_members")
+ conn.group_subscribe('notifications/cc_members')
(msg, env) = conn.group_recvmsg(nonblock=False)
self.assertEqual({'notification': ['subscribed', {
'client': conn.lname,
diff --git a/src/bin/msgq/tests/msgq_test.py b/src/bin/msgq/tests/msgq_test.py
index 2be47d0..1b569cb 100644
--- a/src/bin/msgq/tests/msgq_test.py
+++ b/src/bin/msgq/tests/msgq_test.py
@@ -199,19 +199,19 @@ class MsgQTest(unittest.TestCase):
class Sock:
def __init__(self, fileno):
self.fileno = lambda: fileno
- self.__msgq.lnames["first"] = Sock(1)
- self.__msgq.lnames["second"] = Sock(2)
- self.__msgq.fd_to_lname[1] = "first"
- self.__msgq.fd_to_lname[2] = "second"
+ self.__msgq.lnames['first'] = Sock(1)
+ self.__msgq.lnames['second'] = Sock(2)
+ self.__msgq.fd_to_lname[1] = 'first'
+ self.__msgq.fd_to_lname[2] = 'second'
# Subscribe them to some groups
- self.__msgq.process_command_subscribe(self.__msgq.lnames["first"],
- {'group': "G1", 'instance': "*"},
+ self.__msgq.process_command_subscribe(self.__msgq.lnames['first'],
+ {'group': 'G1', 'instance': '*'},
None)
- self.__msgq.process_command_subscribe(self.__msgq.lnames["second"],
- {'group': "G1", 'instance': "*"},
+ self.__msgq.process_command_subscribe(self.__msgq.lnames['second'],
+ {'group': 'G1', 'instance': '*'},
None)
- self.__msgq.process_command_subscribe(self.__msgq.lnames["second"],
- {'group': "G2", 'instance': "*"},
+ self.__msgq.process_command_subscribe(self.__msgq.lnames['second'],
+ {'group': 'G2', 'instance': '*'},
None)
# Now query content of some groups through the command handler.
self.__msgq.running = True # Enable the command handler
@@ -228,16 +228,16 @@ class MsgQTest(unittest.TestCase):
# on them)
json.dumps(result)
# Members of the G1 and G2
- self.assertEqual({'result': [0, ["second"]]},
+ self.assertEqual({'result': [0, ['second']]},
self.__msgq.command_handler('members',
- {'group': "G2"}))
+ {'group': 'G2'}))
check_both(self.__msgq.command_handler('members', {'group': 'G1'}))
# We pretend that all the possible groups exist, just that most
- # of them are empty. So requesting for G3 is request for an empty
+ # of them are empty. So requesting for Empty is request for an empty
# group and should not fail.
self.assertEqual({'result': [0, []]},
self.__msgq.command_handler('members',
- {'group': "Empty"}))
+ {'group': 'Empty'}))
# Without the name of the group, we just get all the clients.
check_both(self.__msgq.command_handler('members', {}))
# Omitting the parameters completely in such case is OK
@@ -280,7 +280,7 @@ class MsgQTest(unittest.TestCase):
# We should notify about new cliend when we register it
self.__msgq.register_socket(sock)
- lname = list(self.__msgq.lnames.keys())[0] # Steal the lname
+ lname = self.__msgq.fd_to_lname[1] # Steal the lname
self.assertEqual([('connected', {'client': lname})], notifications)
notifications.clear()
@@ -313,7 +313,7 @@ class MsgQTest(unittest.TestCase):
# Register and subscribe. Notifications for these are in above test.
self.__msgq.register_socket(sock)
- lname = list(self.__msgq.lnames.keys())[0] # Steal the lname
+ lname = self.__msgq.fd_to_lname[1] # Steal the lname
self.__msgq.process_command_subscribe(sock, {'group': 'G',
'instance': '*'},
None)
More information about the bind10-changes
mailing list