mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-09-01 14:35:29 +00:00
[1751] addition of a check of statistics data after a running auth is killed
This commit is contained in:
@@ -400,6 +400,21 @@ class TestStats(unittest.TestCase):
|
||||
self.assertEqual(self.stats.statistics_data_bypid['Auth'][9999]['queries.tcp'], 1001)
|
||||
self.assertEqual(self.stats.statistics_data_bypid,
|
||||
{'Auth': {9999: {'queries.tcp': 1001}}})
|
||||
# kill running Auth, then statistics is reset
|
||||
self.assertEqual(self.base.boss.server.pid_list[0][0], 9999)
|
||||
killed = self.base.boss.server.pid_list.pop(0)
|
||||
self.stats.update_statistics_data()
|
||||
self.assertTrue('Auth' in self.stats.statistics_data)
|
||||
self.assertTrue('queries.tcp' in self.stats.statistics_data['Auth'])
|
||||
self.assertTrue('queries.udp' in self.stats.statistics_data['Auth'])
|
||||
self.assertEqual(self.stats.statistics_data['Auth']['queries.tcp'], 0)
|
||||
self.assertEqual(self.stats.statistics_data['Auth']['queries.udp'], 0)
|
||||
self.assertFalse('Auth' in self.stats.statistics_data_bypid)
|
||||
# restore statistics data of killed auth
|
||||
self.base.boss.server.pid_list = [ killed ] + self.base.boss.server.pid_list[:]
|
||||
self.stats.update_statistics_data(owner='Auth',
|
||||
pid=9999,
|
||||
**{'queries.tcp':1001})
|
||||
# another pid of Auth
|
||||
self.stats.update_statistics_data(owner='Auth',
|
||||
pid=9998,
|
||||
|
@@ -185,6 +185,10 @@ class MockBoss:
|
||||
self.spec_file.close()
|
||||
self.cc_session = self.mccs._session
|
||||
self.got_command_name = ''
|
||||
self.pid_list = [[ 9999, "b10-auth" ],
|
||||
[ 9998, "b10-auth-2" ],
|
||||
[ 9997, "b10-auth-3" ],
|
||||
[ 9996, "b10-auth-4" ]]
|
||||
|
||||
def run(self):
|
||||
self.mccs.start()
|
||||
@@ -218,10 +222,7 @@ class MockBoss:
|
||||
elif command == 'show_processes':
|
||||
# Return dummy pids
|
||||
return isc.config.create_answer(
|
||||
0, [[ 9999, "b10-auth" ],
|
||||
[ 9998, "b10-auth-2" ],
|
||||
[ 9997, "b10-auth-3" ],
|
||||
[ 9996, "b10-auth-4" ]])
|
||||
0, self.pid_list)
|
||||
return isc.config.create_answer(1, "Unknown Command")
|
||||
|
||||
class MockAuth:
|
||||
|
Reference in New Issue
Block a user