Commit 512d2d46 authored by Naoki Kambe's avatar Naoki Kambe
Browse files

[2298_7] Merge branch 'trac2298_7'

parents 14af6f37 3f070f48
<?xml version="1.0" encoding="UTF-8"?>
$xsd_string
<schema targetNamespace="$xsd_namespace"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:bind10="$xsd_namespace">
<annotation>
<documentation>XML schema of statistics data in BIND 10</documentation>
</annotation>
<element name="statistics">
<annotation><documentation>A set of statistics data</documentation></annotation>
<complexType>
<sequence>
<element name="item" maxOccurs="unbounded" minOccurs="1">
<complexType>
<attribute name="identifier" type="string" use="required">
<annotation>
<appinfo>Identifier</appinfo>
<documentation>Identifier of item</documentation>
</annotation>
</attribute>
<attribute name="value" type="string" use="optional">
<annotation>
<appinfo>Value</appinfo>
<documentation>Value of item</documentation>
</annotation>
</attribute>
<attribute name="owner" type="string" use="required">
<annotation>
<appinfo>Owner</appinfo>
<documentation>Owner module name</documentation>
</annotation>
</attribute>
<attribute name="uri" type="anyURI" use="required">
<annotation>
<appinfo>URI</appinfo>
<documentation>URI of item</documentation>
</annotation>
</attribute>
<attribute name="name" type="string" use="required">
<annotation>
<appinfo>Name</appinfo>
<documentation>Name of item</documentation>
</annotation>
</attribute>
<attribute name="type" use="required">
<annotation>
<appinfo>Type</appinfo>
<documentation>Type of item</documentation>
</annotation>
<simpleType>
<restriction base="token">
<enumeration value="boolean"/>
<enumeration value="integer"/>
<enumeration value="real"/>
<enumeration value="string"/>
<enumeration value="map"/>
<enumeration value="list"/>
<enumeration value="named_set"/>
<enumeration value="any"/>
</restriction>
</simpleType>
</attribute>
<attribute name="description" type="string" use="optional">
<annotation>
<appinfo>Description</appinfo>
<documentation>Description of item</documentation>
</annotation>
</attribute>
<attribute name="title" type="string" use="optional">
<annotation>
<appinfo>Title</appinfo>
<documentation>Title of item</documentation>
</annotation>
</attribute>
<attribute name="optional" type="boolean" use="optional">
<annotation>
<appinfo>Optional</appinfo>
<documentation>The item is optional or not</documentation>
</annotation>
</attribute>
<attribute name="default" type="string" use="optional">
<annotation>
<appinfo>Default</appinfo>
<documentation>Default of item</documentation>
</annotation>
</attribute>
<attribute name="format" type="string" use="optional">
<annotation>
<appinfo>Format</appinfo>
<documentation>Format of item value</documentation>
</annotation>
</attribute>
</complexType>
</element>
</sequence>
</complexType>
</element>
</schema>
......@@ -30,5 +30,27 @@ td.title {
</body>
</html>
</xsl:template>
$xsl_string
<xsl:template match="bind10:statistics">
<table>
<tr>
<th>Identifier</th><th>Value</th><th>Description</th>
</tr>
<xsl:for-each select="item">
<tr>
<td>
<xsl:element name="a">
<xsl:attribute name="href"><xsl:value-of select="@uri" /></xsl:attribute>
<xsl:value-of select="@identifier" />
</xsl:element>
</td>
<td>
<xsl:if test="@value"><xsl:value-of select="@value" /></xsl:if>
</td>
<td>
<xsl:if test="@description"><xsl:value-of select="@description" /></xsl:if>
</td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>
This diff is collapsed.
This diff is collapsed.
# Copyright (C) 2011-2012 Internet Systems Consortium.
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SYSTEMS CONSORTIUM
# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
# INTERNET SYSTEMS CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
"""
Utilities and mock modules for unittests of statistics modules
......@@ -16,6 +31,8 @@ import isc.config.cfgmgr
import stats
import stats_httpd
CONST_BASETIME = (2011, 6, 22, 8, 14, 8, 2, 173, 0)
class SignalHandler():
"""A signal handler class for deadlock in unittest"""
def __init__(self, fail_handler, timeout=20):
......@@ -222,7 +239,7 @@ class MockBoss:
}
}
"""
_BASETIME = (2011, 6, 22, 8, 14, 8, 2, 173, 0)
_BASETIME = CONST_BASETIME
def __init__(self):
self._started = threading.Event()
......@@ -457,6 +474,11 @@ class MockAuth:
return isc.config.create_answer(1, "Unknown Command")
class MyStats(stats.Stats):
stats._BASETIME = CONST_BASETIME
stats.get_timestamp = lambda: time.mktime(CONST_BASETIME)
stats.get_datetime = lambda x=None: time.strftime("%Y-%m-%dT%H:%M:%SZ", CONST_BASETIME)
def __init__(self):
self._started = threading.Event()
stats.Stats.__init__(self)
......
Supports Markdown
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