Commit 3516ab55 authored by Naoki Kambe's avatar Naoki Kambe
Browse files

[trac930] remove tailing whitespaces.

parent 9f8ddd6e
......@@ -132,7 +132,7 @@
<refsect1>
<title>CONFIGURATION AND COMMANDS</title>
<para>
The configurable setting in
The configurable setting in
<filename>stats-httpd.spec</filename> is:
</para>
<variablelist>
......
......@@ -415,7 +415,7 @@ class StatsHttpd:
annotation.append(documentation)
element.append(annotation)
alltag.append(element)
complextype = xml.etree.ElementTree.Element("complexType")
complextype.append(alltag)
mod_element = xml.etree.ElementTree.Element("element", { "name" : mod })
......
......@@ -13,7 +13,7 @@ endif
# test using command-line arguments, so use check-local target instead of TESTS
check-local:
if ENABLE_PYTHON_COVERAGE
touch $(abs_top_srcdir)/.coverage
touch $(abs_top_srcdir)/.coverage
rm -f .coverage
${LN_S} $(abs_top_srcdir)/.coverage .coverage
endif
......
......@@ -30,7 +30,7 @@ import stats_httpd
import stats
from test_utils import BaseModules, ThreadingServerManager, MyStats, MyStatsHttpd, TIMEOUT_SEC
# set test name for logger
# set test name for logger
isc.log.init("b10-stats-httpd_test")
DUMMY_DATA = {
......@@ -364,7 +364,7 @@ class TestStatsHttpd(unittest.TestCase):
for ht in self.stats_httpd.httpd:
self.assertTrue(isinstance(ht.socket, socket.socket))
self.stats_httpd.close_httpd()
# dual stack (address is ipv4)
if self.ipv6_enabled:
self.stats_httpd.http_addrs = [ ('127.0.0.1', 8000) ]
......@@ -380,20 +380,20 @@ class TestStatsHttpd(unittest.TestCase):
for ht in self.stats_httpd.httpd:
self.assertTrue(isinstance(ht.socket, socket.socket))
self.stats_httpd.close_httpd()
# only-ipv4 single stack (force set ipv6 )
if not self.ipv6_enabled:
self.stats_httpd.http_addrs = [ ('::1', 8000) ]
self.assertRaises(stats_httpd.HttpServerError,
self.stats_httpd.open_httpd)
# hostname
self.stats_httpd.http_addrs = [ ('localhost', 8000) ]
self.stats_httpd.open_httpd()
for ht in self.stats_httpd.httpd:
self.assertTrue(isinstance(ht.socket, socket.socket))
self.stats_httpd.close_httpd()
self.stats_httpd.http_addrs = [ ('my.host.domain', 8000) ]
self.assertRaises(stats_httpd.HttpServerError, self.stats_httpd.open_httpd)
self.assertEqual(type(self.stats_httpd.httpd), list)
......
......@@ -24,7 +24,7 @@ import stats
import isc.cc.session
from test_utils import BaseModules, ThreadingServerManager, MyStats, send_command, TIMEOUT_SEC
# set test name for logger
# set test name for logger
isc.log.init("b10-stats_test")
class TestUtilties(unittest.TestCase):
......@@ -205,19 +205,19 @@ class TestStats(unittest.TestCase):
self.base.boss.server._started.wait()
self.assertEqual(
send_command(
'show', 'Stats',
'show', 'Stats',
params={ 'owner' : 'Boss',
'name' : 'boot_time' }),
(0, '2011-06-22T08:14:08Z'))
self.assertEqual(
send_command(
'set', 'Stats',
'set', 'Stats',
params={ 'owner' : 'Boss',
'data' : { 'boot_time' : '2012-06-22T18:24:08Z' } }),
(0, None))
self.assertEqual(
send_command(
'show', 'Stats',
'show', 'Stats',
params={ 'owner' : 'Boss',
'name' : 'boot_time' }),
(0, '2012-06-22T18:24:08Z'))
......@@ -267,7 +267,7 @@ class TestStats(unittest.TestCase):
self.assertTrue('item_description' in item)
if len(item) == 7:
self.assertTrue('item_format' in item)
self.assertEqual(
send_command('__UNKNOWN__', 'Stats'),
(1, "Unknown command: '__UNKNOWN__'"))
......@@ -340,13 +340,13 @@ class TestStats(unittest.TestCase):
self.assertEqual(self.stats.command_status(),
isc.config.create_answer(
0, "Stats is up. (PID " + str(os.getpid()) + ")"))
def test_command_shutdown(self):
self.stats.running = True
self.assertEqual(self.stats.command_shutdown(),
isc.config.create_answer(0))
self.assertFalse(self.stats.running)
def test_command_show(self):
self.assertEqual(self.stats.command_show(owner='Foo', name=None),
isc.config.create_answer(
......@@ -380,7 +380,7 @@ class TestStats(unittest.TestCase):
"statistics": [] } )
self.assertRaises(
stats.StatsError, self.stats.command_show, owner='Foo', name='bar')
def test_command_showchema(self):
(rcode, value) = isc.config.ccsession.parse_answer(
self.stats.command_showschema())
......
......@@ -10,7 +10,7 @@ import threading
import tempfile
import msgq
import isc.config.cfgmgr
import isc.config.cfgmgr
import stats
import stats_httpd
......@@ -49,7 +49,7 @@ class ThreadingServerManager:
self.server._thread = threading.Thread(
name=self.server_class_name, target=self.server.run)
self.server._thread.daemon = True
def run(self):
self.server._thread.start()
self.server._started.wait()
......@@ -94,7 +94,7 @@ class MockCfgmgr:
def shutdown(self):
self.cfgmgr.running = False
class MockBoss:
spec_str = """\
{
......@@ -157,7 +157,7 @@ class MockBoss:
params = { "owner": "Boss",
"data": {
'boot_time': time.strftime('%Y-%m-%dT%H:%M:%SZ', self._BASETIME)
}
}
}
return send_command("set", "Stats", params=params, session=self.cc_session)
return isc.config.create_answer(1, "Unknown Command")
......
......@@ -14,7 +14,7 @@ endif
# test using command-line arguments, so use check-local target instead of TESTS
check-local:
if ENABLE_PYTHON_COVERAGE
touch $(abs_top_srcdir)/.coverage
touch $(abs_top_srcdir)/.coverage
rm -f .coverage
${LN_S} $(abs_top_srcdir)/.coverage .coverage
endif
......
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