From c05d4ff4d1c5f5eb61b92fb7fff8f667aa0c9b40 Mon Sep 17 00:00:00 2001 From: onefang Date: Mon, 20 Jul 2020 22:34:32 +1000 Subject: If a thing is untested, mark it as so. --- Report-web_3.html | 2 ++ Report-web_TABLE.html | 3 +++ apt-panopticommon.lua | 19 +++++++++++++++---- apt-panopticon-report-email-web.lua | 16 +++++++++++++++- apt-panopticon.lua | 16 ++++++++++++++-- 5 files changed, 49 insertions(+), 7 deletions(-) diff --git a/Report-web_3.html b/Report-web_3.html index 915bd56..632e6f4 100644 --- a/Report-web_3.html +++ b/Report-web_3.html @@ -1,6 +1,8 @@
Tooltips are things that have an explanation tooltip, hover over them.
FAILED or OK means the tested thing is supported for that mirror.
FAILED* or OK* means the tested thing is unsupported for that mirror, but might have been tested anyway.
+untested or untested* means that the tested thing wasn't tested. It might not be relevant, or might have depended on other tests passing.
+NOTE: Any mirror that doesn't redirect to a Debian mirror coz it is a Debian mirror itself, doesn't have the Protocol and Redirect tests run.
timeout or timeout means the mirror had some timeouts, and tests where not yet aborted. The darker colour means unsupported by the mirror, but tested anyway.
TIMEOUT or TIMEOUT means the mirror had too many timeouts, and tests where aborted, so there is no result for this test.
NOTE: timeouts may be due to a problem on the testing computer, it might be busy with other things, or be having it's own network problems.
diff --git a/Report-web_TABLE.html b/Report-web_TABLE.html index f3fd5d5..6ee14f4 100644 --- a/Report-web_TABLE.html +++ b/Report-web_TABLE.html @@ -125,6 +125,9 @@Also shown is the mirrors scheduled time between updates, with "m" meaning minutes and "h" meaning hours. If this is showing a WARNING, it's likely that the mirror hasn't updated yet, but is due to update after this test was run.
++ pkgmaster.devuan.org is the master that the other mirrors sync to, so it's untested. +
diff --git a/apt-panopticommon.lua b/apt-panopticommon.lua index 52159dd..593fa32 100644 --- a/apt-panopticommon.lua +++ b/apt-panopticommon.lua @@ -435,13 +435,13 @@ local log = function(v, t, s, prot, test, host) t = t .. "(" .. x .. ")" if "" ~= prot then if "" == test then - if nil == APT.results[prot] then APT.results[prot] = {errors = 0; warnings = 0; timeouts = 0} end + if nil == APT.results[prot] then APT.results[prot] = {tested = 0; errors = 0; warnings = 0; timeouts = 0} end if v == 0 then APT.results[prot].errors = APT.results[prot].errors + 1 end if v == 1 then APT.results[prot].warnings = APT.results[prot].warnings + 1 end if v == 2 then APT.results[prot].timeouts = APT.results[prot].timeouts + 1 end else - if nil == APT.results[prot] then APT.results[prot] = {errors = 0; warnings = 0; timeouts = 0} end - if nil == APT.results[prot][test] then APT.results[prot][test] = {errors = 0; warnings = 0; timeouts = 0} end + if nil == APT.results[prot] then APT.results[prot] = {tested = 0; errors = 0; warnings = 0; timeouts = 0} end + if nil == APT.results[prot][test] then APT.results[prot][test] = {tested = 0; errors = 0; warnings = 0; timeouts = 0} end if v == 0 then APT.results[prot][test].errors = APT.results[prot][test].errors + 1 end if v == 1 then APT.results[prot][test].warnings = APT.results[prot][test].warnings + 1 end if v == 2 then APT.results[prot][test].timeouts = APT.results[prot][test].timeouts + 1 end @@ -496,6 +496,17 @@ APT.testing = function(t, host) return false end +APT.tested = function(prot, test, host) + if "" == test then + if nil == APT.results[prot] then APT.results[prot] = {tested = 0; errors = 0; warnings = 0; timeouts = 0} end + APT.results[prot].tested = APT.results[prot].tested + 1; + else + if nil == APT.results[prot] then APT.results[prot] = {tested = 0; errors = 0; warnings = 0; timeouts = 0} end + if nil == APT.results[prot][test] then APT.results[prot][test] = {tested = 0; errors = 0; warnings = 0; timeouts = 0} end + APT.results[prot][test].tested = APT.results[prot][test].tested + 1; + end +end + APT.exe = function(c) local exe = {status = 0, result = '', log = true, cmd = c .. ' '} @@ -607,7 +618,7 @@ APT.plurals = function(e, w, t) return result end -local typs = {'errors', 'warnings', 'timeouts'} +local typs = {'tested', 'errors', 'warnings', 'timeouts'} APT.padResults = function(results) local c = 0 if nil == results then results = {}; c = 999 end diff --git a/apt-panopticon-report-email-web.lua b/apt-panopticon-report-email-web.lua index a9852c1..b21ba8a 100755 --- a/apt-panopticon-report-email-web.lua +++ b/apt-panopticon-report-email-web.lua @@ -51,15 +51,18 @@ local status = function(hosts, host, results, typ) local e = 0 local w = 0 local t = 0 + local d = 0 local s = nil ~= hosts[host].Protocols[typ] local to = results.timeout if not APT.search(APT.protocols, typ) then s = true end if nil ~= results[typ] then + d = results[typ].tested e = results[typ].errors w = results[typ].warnings t = results[typ].timeouts for k, v in pairs(results[typ]) do if ("table" == type(v)) and ('redirects' ~= k) then + if 0 <= v.tested then d = d + v.tested else to = true end if 0 <= v.errors then e = e + v.errors else to = true end if 0 <= v.warnings then w = w + v.warnings else to = true end if 0 <= v.timeouts then t = t + v.timeouts else to = true end @@ -71,6 +74,7 @@ local status = function(hosts, host, results, typ) for i, u in pairs(v) do if "table" == type(u) then if typ == i then + if 0 <= u.tested then d = d + u.tested end if 0 <= u.errors then e = e + u.errors end if 0 <= u.warnings then w = w + u.warnings end if 0 <= u.timeouts then t = t + u.timeouts end @@ -111,7 +115,7 @@ local status = function(hosts, host, results, typ) else faulty = faulty .. host .. " (" .. typ .. ")\n" end - else + elseif 0 < d then result = "OK" if not s then result = result .. "*" end if APT.html then @@ -121,6 +125,16 @@ local status = function(hosts, host, results, typ) result = "OK*" end end + else + result = "untested" + if not s then result = result .. "*" end + if APT.html then + if s then + result = "untested" + else + result = "untested*" + end + end end return result .. APT.plurals(e, w, t) end diff --git a/apt-panopticon.lua b/apt-panopticon.lua index f166819..d8ee95b 100755 --- a/apt-panopticon.lua +++ b/apt-panopticon.lua @@ -290,6 +290,11 @@ checkHEAD = function (host, URL, r, retry, sanity) IP .. ' ' .. '-o /dev/null -D results/"HEADERS_' .. fname .. '" ' .. hdr .. ' -w "#%{http_code} %{ssl_verify_result} %{url_effective}\\n" ' .. PU.scheme .. '://' .. host .. PU.path .. ' >>results/"STATUS_' .. fname .. '"' ):Nice():log():Do().status + if 0 < r then + APT.tested(PU.scheme, 'Redirects', host) + else + APT.tested(PU.scheme, '', host) + end local code = "???" local cstr = "" local location = nil @@ -359,14 +364,15 @@ checkHEAD = function (host, URL, r, retry, sanity) if (pu.host == APT.options.roundRobin.value) and (nil ~= PU.path:find('merged/pool/DEVUAN/')) then E('DEVUAN packages must not be redirected to ' .. APT.options.roundRobin.value .. ' - ' .. APT.lnk(URL) .. arw .. APT.lnk(location), PU.scheme, 'Redirects', host) end - if ('http' == location:sub(1, 4)) and (pu.scheme ~= PU.scheme) then -- Sometimes a location sans scheme is returned, this is not a protocol change. - if APT.testing("Protocol") then + if APT.testing("Protocol") then + if ('http' == location:sub(1, 4)) and (pu.scheme ~= PU.scheme) then -- Sometimes a location sans scheme is returned, this is not a protocol change. if APT.options.roundRobin.value == host then -- Coz HTTPS shouldn't happen via the round robin. E(spcd .. spcd .. "Protocol changed during redirect! " .. check .. " " .. APT.lnk(URL) .. arw .. APT.lnk(location), PU.scheme, "Protocol", host) end W(spcd .. spcd .. "Protocol changed during redirect! " .. check .. " " .. APT.lnk(URL) .. arw .. APT.lnk(location), PU.scheme, "Protocol", host) else end + APT.tested(PU.scheme, 'Protocol', host) end if location == URL then @@ -402,6 +408,7 @@ checkHEAD = function (host, URL, r, retry, sanity) I(spcd .. spcd .. "Now checking redirected host " .. u .. ' for ' .. APT.lnk(URL) .. arw .. APT.lnk(location), host) APT.exe(downloadLock .. "REDIR-" .. check .. ".log.txt" .. " ./apt-panopticon.lua " .. extraArgs .. ' ' .. pu.host .. "/" .. path .. " " .. file):Nice():log():fork() D(spcd .. 'logging to ' .. APT.logName(pu.host, nil, file)[2]) + APT.tested(PU.scheme, 'Redirects', host) end end elseif nil ~= PU.path:find('merged/pool/DEBIAN-SECURITY/') then @@ -417,6 +424,7 @@ local checkTimeouts = function(host, scheme, URL) URL = URL:gsub("/", "///") URL = URL:gsub("///", "/", 1) checkHEAD(host, scheme .. "://" .. URL, 0, 0, true) + APT.tested(scheme, 'URLSanity', host) end if nil ~= cor then D('*>* About to resume coroutine after checkHEAD(' .. host .. ' , ' .. scheme .. ' :// ' .. URL .. ')') @@ -700,11 +708,13 @@ local parseDebs = function(host) if sha ~= fsha:sub(2, -2) then E('Package SHA256 sum mismatch - results/' .. host .. "/merged/" .. p, 'http', 'Integrity', host) end -- TODO - maybe check the PGP key, though packages are mostly not signed. end + APT.tested('http', 'Integrity', host) end if APT.testing("Updated") then if sz ~= fsz:sub(2, -2) then E('Package size mismatch for ' .. host .. "/merged/" .. p, 'http', 'Updated', host) end + APT.tested('http', 'Updated', host) end os.execute('rm -f results/' .. host .. "/merged/" .. p) else @@ -839,6 +849,7 @@ local parseRelease = function(host) " results/" .. host .. "/merged/dists/" .. n .. '/' .. o:sub(1, -5)):Nice():noErr():log():Do().status if 0 ~= status then E("GPG check failed for " .. host .. "/merged/dists/" .. n .. '/' .. o, "http", "Integrity", host) end -- TODO - should check the PGP sig of InRelease as well. + APT.tested('http', 'Integrity', host) end os.execute('rm results/' .. host .. '/merged/dists/' .. n .. '/' .. o) end @@ -885,6 +896,7 @@ local parseRelease = function(host) else updated = true end + APT.tested('http', 'Updated', host) end end -- cgit v1.1