Commit 516417bc authored by Naoki Kambe's avatar Naoki Kambe
Browse files

[2883] add a test specfile for using a counters object in TestNotifyOut class

parent 695d7c75
......@@ -5,7 +5,7 @@ EXTRA_DIST += testdata/test.sqlite3 testdata/brokentest.sqlite3
# The rest of the files are actually not necessary, but added for reference
EXTRA_DIST += testdata/example.com testdata/example.net
EXTRA_DIST += testdata/nons.example testdata/nosoa.example
EXTRA_DIST += testdata/multisoa.example
EXTRA_DIST += testdata/multisoa.example testdata/test_spec1.spec
# If necessary (rare cases), explicitly specify paths to dynamic libraries
# required by loadable python modules.
......
......@@ -22,8 +22,10 @@ import socket
from isc.notify import notify_out, SOCK_DATA
import isc.log
from isc.dns import *
from isc.statistics.dns import Counters
TESTDATA_SRCDIR = os.getenv("TESTDATASRCDIR")
SPECFILE_LOCATION = TESTDATA_SRCDIR + os.sep + 'test_spec1.spec'
def get_notify_msgdata(zone_name, qid=0):
"""A helper function to generate a notify response in wire format.
......@@ -128,7 +130,7 @@ class TestZoneNotifyInfo(unittest.TestCase):
class TestNotifyOut(unittest.TestCase):
def setUp(self):
self._db_file = TESTDATA_SRCDIR + '/test.sqlite3'
self._notify = notify_out.NotifyOut(self._db_file)
self._notify = notify_out.NotifyOut(self._db_file, counters=Counters(SPECFILE_LOCATION))
self._notify._notify_infos[('example.com.', 'IN')] = MockZoneNotifyInfo('example.com.', 'IN')
self._notify._notify_infos[('example.com.', 'CH')] = MockZoneNotifyInfo('example.com.', 'CH')
self._notify._notify_infos[('example.net.', 'IN')] = MockZoneNotifyInfo('example.net.', 'IN')
......
{
"module_spec": {
"module_name": "NotifyOutLike",
"module_description": "XFR in daemon",
"config_data": [],
"commands": [],
"statistics": [
{
"item_name": "zones",
"item_type": "named_set",
"item_optional": false,
"item_default": {
"_SERVER_" : {
"notifyoutv4" : 0,
"notifyoutv6" : 0
}
},
"item_title": "Zone names",
"item_description": "Zone names",
"named_set_item_spec": {
"item_name": "classname",
"item_type": "named_set",
"item_optional": false,
"item_default": {},
"item_title": "RR class name",
"item_description": "RR class name",
"named_set_item_spec": {
"item_name": "zonename",
"item_type": "map",
"item_optional": false,
"item_default": {},
"item_title": "Zone name",
"item_description": "Zone name",
"map_item_spec": [
{
"item_name": "notifyoutv4",
"item_type": "integer",
"item_optional": false,
"item_default": 0,
"item_title": "IPv4 notifies",
"item_description": "Number of IPv4 notifies per zone name sent out"
},
{
"item_name": "notifyoutv6",
"item_type": "integer",
"item_optional": false,
"item_default": 0,
"item_title": "IPv6 notifies",
"item_description": "Number of IPv6 notifies per zone name sent out"
}
]
}
}
}
]
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment