mirror of
https://github.com/openglow-org/forgefirm.git
synced 2026-09-27 16:51:12 -07:00
IPv6 on, forgetest dual-stack, the release rootfs sheds 22 MB
The distro keeps its ipv6 feature (busybox networking and ifupdown inet6, openssh, ntp and rsyslog follow); forgetest binds "::" by default, one dual-stack socket that still serves IPv4. The release image drops nano (with it file and the libmagic database, 8.7 MB; the dev image keeps nano), the udev hardware database (7.7 MB of USB and PCI identities for buses the board lacks, via BAD_RECOMMENDATIONS) and urllib3's pyOpenSSL/cryptography recommendation (6 MB; nothing imports them, TLS goes through the standard library). BRINGUP item 21 records the round and the bench checks it owes; item 16 gets its re-measure plan on the UP kernel with the performance governor. Coverage: image.* covers the rootfs composition and the distro conf (platform); forgetest's own suite covers the server.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"""forgetest daemon entry point.
|
||||
|
||||
python3 -m forgetest [--port 8090] [--host 0.0.0.0] [--manifest PATH]
|
||||
python3 -m forgetest [--port 8090] [--host ::] [--manifest PATH]
|
||||
|
||||
Environment: FORGETEST_DATA (state directory, default /data/forgetest),
|
||||
FORGETEST_MANIFEST, FORGETEST_BENCH_DIR, FORGETEST_MARKER, and the hw.py
|
||||
@@ -24,7 +24,7 @@ from .runner import Runner, configure_journal
|
||||
def main(argv=None):
|
||||
ap = argparse.ArgumentParser(prog="forgetest")
|
||||
ap.add_argument("--port", type=int, default=int(os.environ.get("FORGETEST_PORT") or 8090))
|
||||
ap.add_argument("--host", default=os.environ.get("FORGETEST_HOST") or "0.0.0.0")
|
||||
ap.add_argument("--host", default=os.environ.get("FORGETEST_HOST") or "::")
|
||||
ap.add_argument("--manifest", default=None)
|
||||
ap.add_argument("--version", action="version", version="forgetest %s" % VERSION)
|
||||
args = ap.parse_args(argv)
|
||||
|
||||
@@ -38,6 +38,7 @@ import re
|
||||
import secrets
|
||||
import sys
|
||||
import urllib.parse
|
||||
import socket
|
||||
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
|
||||
|
||||
from . import artifact as _artifact
|
||||
@@ -327,9 +328,15 @@ class Handler(BaseHTTPRequestHandler):
|
||||
self._deny(500, "%s: %s" % (type(e).__name__, e))
|
||||
|
||||
|
||||
def make_server(app, host="0.0.0.0", port=8090):
|
||||
def make_server(app, host="::", port=8090):
|
||||
handler = type("ForgetestHandler", (Handler,), {"app": app})
|
||||
ThreadingHTTPServer.allow_reuse_address = True
|
||||
srv = ThreadingHTTPServer((host, port), handler)
|
||||
# An IPv6 bind address (the default "::") gives one dual-stack socket
|
||||
# that serves IPv4 clients too; a dotted address keeps the IPv4 family.
|
||||
server_cls = ThreadingHTTPServer
|
||||
if ":" in host:
|
||||
server_cls = type("ForgetestServer6", (ThreadingHTTPServer,),
|
||||
{"address_family": socket.AF_INET6})
|
||||
srv = server_cls((host, port), handler)
|
||||
srv.daemon_threads = True
|
||||
return srv
|
||||
|
||||
Reference in New Issue
Block a user