aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pathod/pathod.py24
-rw-r--r--pathod/pathod_cmdline.py8
-rw-r--r--test/pathod/test_pathoc.py1
-rw-r--r--test/pathod/test_pathod.py12
-rw-r--r--test/pathod/tutils.py10
5 files changed, 14 insertions, 41 deletions
diff --git a/pathod/pathod.py b/pathod/pathod.py
index add33944..ed35a92e 100644
--- a/pathod/pathod.py
+++ b/pathod/pathod.py
@@ -304,9 +304,7 @@ class Pathod(tcp.TCPServer):
staticdir=None,
anchors=(),
sizelimit=None,
- noweb=False,
nocraft=False,
- noapi=False,
nohang=False,
timeout=None,
logreq=False,
@@ -328,7 +326,6 @@ class Pathod(tcp.TCPServer):
None.
sizelimit: Limit size of served data.
nocraft: Disable response crafting.
- noapi: Disable the API.
nohang: Disable pauses.
"""
tcp.TCPServer.__init__(self, addr)
@@ -337,8 +334,8 @@ class Pathod(tcp.TCPServer):
self.staticdir = staticdir
self.craftanchor = craftanchor
self.sizelimit = sizelimit
- self.noweb, self.nocraft = noweb, nocraft
- self.noapi, self.nohang = noapi, nohang
+ self.nocraft = nocraft
+ self.nohang = nohang
self.timeout, self.logreq = timeout, logreq
self.logresp, self.hexdump = logresp, hexdump
self.http2_framedump = http2_framedump
@@ -404,14 +401,13 @@ class Pathod(tcp.TCPServer):
return
def add_log(self, d):
- if not self.noapi:
- with self.loglock:
- d["id"] = self.logid
- self.log.insert(0, d)
- if len(self.log) > self.LOGBUF:
- self.log.pop()
- self.logid += 1
- return d["id"]
+ with self.loglock:
+ d["id"] = self.logid
+ self.log.insert(0, d)
+ if len(self.log) > self.LOGBUF:
+ self.log.pop()
+ self.logid += 1
+ return d["id"]
def clear_log(self):
with self.loglock:
@@ -469,9 +465,7 @@ def main(args): # pragma: no cover
staticdir=args.staticdir,
anchors=args.anchors,
sizelimit=args.sizelimit,
- noweb=args.noweb,
nocraft=args.nocraft,
- noapi=args.noapi,
nohang=args.nohang,
timeout=args.timeout,
logreq=args.logreq,
diff --git a/pathod/pathod_cmdline.py b/pathod/pathod_cmdline.py
index a4f05faf..5ca2ca85 100644
--- a/pathod/pathod_cmdline.py
+++ b/pathod/pathod_cmdline.py
@@ -75,18 +75,10 @@ def args_pathod(argv, stdout_=sys.stdout, stderr_=sys.stderr):
type=str,
help='Size limit of served responses. Understands size suffixes, i.e. 100k.')
parser.add_argument(
- "--noapi", dest='noapi', default=False, action="store_true",
- help='Disable API.'
- )
- parser.add_argument(
"--nohang", dest='nohang', default=False, action="store_true",
help='Disable pauses during crafted response generation.'
)
parser.add_argument(
- "--noweb", dest='noweb', default=False, action="store_true",
- help='Disable both web interface and API.'
- )
- parser.add_argument(
"--nocraft",
dest='nocraft',
default=False,
diff --git a/test/pathod/test_pathoc.py b/test/pathod/test_pathoc.py
index a88cfa91..8b69a2a6 100644
--- a/test/pathod/test_pathoc.py
+++ b/test/pathod/test_pathoc.py
@@ -228,6 +228,7 @@ class TestDaemon(PathocTestDaemon):
class TestDaemonHTTP2(PathocTestDaemon):
ssl = True
+ explain = False
if tcp.HAS_ALPN:
diff --git a/test/pathod/test_pathod.py b/test/pathod/test_pathod.py
index f64b0f61..0bbad6c2 100644
--- a/test/pathod/test_pathod.py
+++ b/test/pathod/test_pathod.py
@@ -23,18 +23,10 @@ class TestPathod(object):
assert len(p.get_log()) <= p.LOGBUF
-class TestNoWeb(tutils.DaemonTests):
- noweb = True
-
- def test_noweb(self):
- assert self.get("200:da").status_code == 200
- assert self.getpath("/").status_code == 800
-
-
class TestTimeout(tutils.DaemonTests):
timeout = 0.01
- def test_noweb(self):
+ def test_timeout(self):
# FIXME: Add float values to spec language, reduce test timeout to
# increase test performance
# This is a bodge - we have some platform difference that causes
@@ -261,8 +253,6 @@ class TestDaemonSSL(CommonTests):
class TestHTTP2(tutils.DaemonTests):
ssl = True
- noweb = True
- noapi = True
nohang = True
if tcp.HAS_ALPN:
diff --git a/test/pathod/tutils.py b/test/pathod/tutils.py
index 1a883c93..56cd2002 100644
--- a/test/pathod/tutils.py
+++ b/test/pathod/tutils.py
@@ -24,14 +24,13 @@ def treader(bytes):
class DaemonTests(object):
- noweb = False
- noapi = False
nohang = False
ssl = False
timeout = None
hexdump = False
ssloptions = None
nocraft = False
+ explain = True
@classmethod
def setup_class(cls):
@@ -47,15 +46,13 @@ class DaemonTests(object):
ssl=cls.ssl,
ssloptions=so,
sizelimit=1 * 1024 * 1024,
- noweb=cls.noweb,
- noapi=cls.noapi,
nohang=cls.nohang,
timeout=cls.timeout,
hexdump=cls.hexdump,
nocraft=cls.nocraft,
logreq=True,
logresp=True,
- explain=True
+ explain=cls.explain
)
@classmethod
@@ -65,8 +62,7 @@ class DaemonTests(object):
def teardown(self):
self.d.wait_for_silence()
- if not (self.noweb or self.noapi):
- self.d.clear_log()
+ self.d.clear_log()
def _getpath(self, path, params=None):
scheme = "https" if self.ssl else "http"