Browse Source

If a thing is untested, mark it as so.

master
onefang 9 months ago
parent
commit
c05d4ff4d1
5 changed files with 49 additions and 7 deletions
  1. +2
    -0
      Report-web_3.html
  2. +3
    -0
      Report-web_TABLE.html
  3. +15
    -4
      apt-panopticommon.lua
  4. +15
    -1
      apt-panopticon-report-email-web.lua
  5. +14
    -2
      apt-panopticon.lua

+ 2
- 0
Report-web_3.html View File

@@ -1,6 +1,8 @@
<p><b class="TTitem" title="This is a tooltip with an explanation in it.">Tooltips</b> are things that have an explanation tooltip, hover over them.</p>
<p><font color='red'><b>FAILED</b></font> or <font color='lime'><b>OK</b></font> means the tested thing is supported for that mirror.</p>
<p><font color='darkred'><b>FAILED*</b></font> or <font color='darkgreen'><b>OK*</b></font> means the tested thing is unsupported for that mirror, but might have been tested anyway.</p>
<p><font color='grey'><b>untested</b></font> or <font color='dimgrey'><b>untested*</b></font> means that the tested thing wasn't tested. &nbsp; It might not be relevant, or might have depended on other tests passing.</p>
<p>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.</p>
<p><font color='aqua'><b>timeout</b></font> or <font color='blue'><b>timeout</b></font> means the mirror had some timeouts, and tests where not yet aborted. The darker colour means unsupported by the mirror, but tested anyway.</p>
<p><font color='aqua'><b>TIMEOUT</b></font> or <font color='blue'><b>TIMEOUT</b></font> means the mirror had too many timeouts, and tests where aborted, so there is no result for this test.</p>
<p>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.</p>


+ 3
- 0
Report-web_TABLE.html View File

@@ -125,6 +125,9 @@
<p>Also shown is the mirrors scheduled time between updates, with "m" meaning minutes and "h" meaning hours. &nbsp;
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.
</p>
<p>
pkgmaster.devuan.org is the master that the other mirrors sync to, so it's untested.
</p>
</div>
</div>
</th>


+ 15
- 4
apt-panopticommon.lua View File

@@ -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


+ 15
- 1
apt-panopticon-report-email-web.lua View File

@@ -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 = "<font color='darkgreen'><b>OK*</b></font>"
end
end
else
result = "untested"
if not s then result = result .. "*" end
if APT.html then
if s then
result = "<font color='grey'><b>untested</b></font>"
else
result = "<font color='dimgrey'><b>untested*</b></font>"
end
end
end
return result .. APT.plurals(e, w, t)
end


+ 14
- 2
apt-panopticon.lua View File

@@ -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 .. ' &nbsp; for &nbsp; ' .. 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('*&gt;* 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



Loading…
Cancel
Save