diff options
author | onefang | 2020-07-20 22:34:32 +1000 |
---|---|---|
committer | onefang | 2020-07-20 22:34:32 +1000 |
commit | c05d4ff4d1c5f5eb61b92fb7fff8f667aa0c9b40 (patch) | |
tree | 2c849638eceb1271106f17967c62a28d5e8edd63 /apt-panopticommon.lua | |
parent | Work around a problem with the STATUS files. (diff) | |
download | apt-panopticon-c05d4ff4d1c5f5eb61b92fb7fff8f667aa0c9b40.zip apt-panopticon-c05d4ff4d1c5f5eb61b92fb7fff8f667aa0c9b40.tar.gz apt-panopticon-c05d4ff4d1c5f5eb61b92fb7fff8f667aa0c9b40.tar.bz2 apt-panopticon-c05d4ff4d1c5f5eb61b92fb7fff8f667aa0c9b40.tar.xz |
If a thing is untested, mark it as so.
Diffstat (limited to 'apt-panopticommon.lua')
-rw-r--r-- | apt-panopticommon.lua | 19 |
1 files changed, 15 insertions, 4 deletions
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) | |||
435 | t = t .. "(" .. x .. ")" | 435 | t = t .. "(" .. x .. ")" |
436 | if "" ~= prot then | 436 | if "" ~= prot then |
437 | if "" == test then | 437 | if "" == test then |
438 | if nil == APT.results[prot] then APT.results[prot] = {errors = 0; warnings = 0; timeouts = 0} end | 438 | if nil == APT.results[prot] then APT.results[prot] = {tested = 0; errors = 0; warnings = 0; timeouts = 0} end |
439 | if v == 0 then APT.results[prot].errors = APT.results[prot].errors + 1 end | 439 | if v == 0 then APT.results[prot].errors = APT.results[prot].errors + 1 end |
440 | if v == 1 then APT.results[prot].warnings = APT.results[prot].warnings + 1 end | 440 | if v == 1 then APT.results[prot].warnings = APT.results[prot].warnings + 1 end |
441 | if v == 2 then APT.results[prot].timeouts = APT.results[prot].timeouts + 1 end | 441 | if v == 2 then APT.results[prot].timeouts = APT.results[prot].timeouts + 1 end |
442 | else | 442 | else |
443 | if nil == APT.results[prot] then APT.results[prot] = {errors = 0; warnings = 0; timeouts = 0} end | 443 | if nil == APT.results[prot] then APT.results[prot] = {tested = 0; errors = 0; warnings = 0; timeouts = 0} end |
444 | if nil == APT.results[prot][test] then APT.results[prot][test] = {errors = 0; warnings = 0; timeouts = 0} end | 444 | if nil == APT.results[prot][test] then APT.results[prot][test] = {tested = 0; errors = 0; warnings = 0; timeouts = 0} end |
445 | if v == 0 then APT.results[prot][test].errors = APT.results[prot][test].errors + 1 end | 445 | if v == 0 then APT.results[prot][test].errors = APT.results[prot][test].errors + 1 end |
446 | if v == 1 then APT.results[prot][test].warnings = APT.results[prot][test].warnings + 1 end | 446 | if v == 1 then APT.results[prot][test].warnings = APT.results[prot][test].warnings + 1 end |
447 | if v == 2 then APT.results[prot][test].timeouts = APT.results[prot][test].timeouts + 1 end | 447 | 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) | |||
496 | return false | 496 | return false |
497 | end | 497 | end |
498 | 498 | ||
499 | APT.tested = function(prot, test, host) | ||
500 | if "" == test then | ||
501 | if nil == APT.results[prot] then APT.results[prot] = {tested = 0; errors = 0; warnings = 0; timeouts = 0} end | ||
502 | APT.results[prot].tested = APT.results[prot].tested + 1; | ||
503 | else | ||
504 | if nil == APT.results[prot] then APT.results[prot] = {tested = 0; errors = 0; warnings = 0; timeouts = 0} end | ||
505 | if nil == APT.results[prot][test] then APT.results[prot][test] = {tested = 0; errors = 0; warnings = 0; timeouts = 0} end | ||
506 | APT.results[prot][test].tested = APT.results[prot][test].tested + 1; | ||
507 | end | ||
508 | end | ||
509 | |||
499 | APT.exe = function(c) | 510 | APT.exe = function(c) |
500 | local exe = {status = 0, result = '', log = true, cmd = c .. ' '} | 511 | local exe = {status = 0, result = '', log = true, cmd = c .. ' '} |
501 | 512 | ||
@@ -607,7 +618,7 @@ APT.plurals = function(e, w, t) | |||
607 | return result | 618 | return result |
608 | end | 619 | end |
609 | 620 | ||
610 | local typs = {'errors', 'warnings', 'timeouts'} | 621 | local typs = {'tested', 'errors', 'warnings', 'timeouts'} |
611 | APT.padResults = function(results) | 622 | APT.padResults = function(results) |
612 | local c = 0 | 623 | local c = 0 |
613 | if nil == results then results = {}; c = 999 end | 624 | if nil == results then results = {}; c = 999 end |