[tools] winetest: Detect and report tests blocked by anti-virus tools.

Francois Gouget fgouget at codeweavers.com
Mon Jul 5 11:18:27 CDT 2021


Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
This happened to httpapi:httpapi:
https://test.winehq.org/data/patterns.html#httpapi:httpapi

WineTest also sometimes fails to run this test (error -2) but does 
not report the GetLastError(). I suspect these are cases where the test 
executable was quarantined by the anti-virus.

It used to be possible to disable Microsoft Defender through the 
registry but then that stopped working and WineTest.exe started getting 
blocked by the anti-virus.
Since disabling Microsoft Defender is no longer possible I told it to 
ignore the directory where WineTest.exe is downloaded and that helped.
But WineTest.exe does not extract the tests in that directory which 
lead to the current round of issues.
So I will have to update some configuration snapshots and/or the 
TestBot. Again :-(
---
 winetest/build-patterns |  1 +
 winetest/dissect        |  5 +++++
 winetest/gather         | 10 ++++++++--
 winetest/report.css     |  3 +++
 4 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/winetest/build-patterns b/winetest/build-patterns
index 0b33512a7..d530ad2f8 100755
--- a/winetest/build-patterns
+++ b/winetest/build-patterns
@@ -929,6 +929,7 @@ my %status2html = (
     "missingsxs"        => ["v", "v", "missing side-by-side dll version", "version", ""],
     "stub"              => ["u", "u", "stub Windows dll", "version", ""],
     "native"            => ["N", "N", "native Windows dll", "version", ""],
+    "loaderror225"      => ["V", "V", "blocked by the anti-virus", "version", ""],
     "loaderror258"      => ["I", "I", "timed out while getting the test list", "version", ""],
     # Other status values
     "skipped"           => ["-", "s", "skipped by user request", "", ""],
diff --git a/winetest/dissect b/winetest/dissect
index 3f89e1064..55d0a7299 100755
--- a/winetest/dissect
+++ b/winetest/dissect
@@ -937,6 +937,11 @@ foreach my $dll (sort keys %dllinfo)
         $box->{data} .= sprintf "<td>%s</td><td class=\"failed\">timed out getting the test list</td></tr>\n",
                                    escapeHTML($dll);
     }
+    elsif ($dllinfo{$dll}->{version} eq "load error 225")
+    {
+        $box->{data} .= sprintf "<td>%s</td><td class=\"failed\">test blocked by the anti-virus</td></tr>\n",
+                                   escapeHTML($dll);
+    }
     elsif ($dllinfo{$dll}->{version} =~ /^load error (\d+)$/)
     {
         # Flag unknown errors
diff --git a/winetest/gather b/winetest/gather
index e6d5a9a30..5aabe4e48 100755
--- a/winetest/gather
+++ b/winetest/gather
@@ -663,8 +663,10 @@ sub get_result_title($$)
     if ($result->{status} =~ /^loaderror(.*)$/)
     {
         my $code = $1;
-        return "Not run because getting the test list ".
-                ($code eq "258" ? "timed out" : "failed with error $code");
+        return $code eq "225" ?
+            "Not run because the test was blocked by the anti-virus" :
+            ("Not run because getting the test list ".
+             ($code eq "258" ? "timed out" : "failed with error $code"));
     }
     if ($result->{status} eq "native") { return "Not run because $dll is a native Windows dll (not allowed for Wine tests)"; }
     if ($result->{status} eq "stub") { return "Not run because $dll is a stub Windows dll"; }
@@ -716,6 +718,10 @@ sub singletest($$$) {
              !$result->{errors}->[1] ? $result->{todos}->[1] :
              "$result->{errors}->[1]+$result->{todos}->[1]";
     }
+    elsif ($status eq "loaderror225")
+    {
+        $msg = "virus";
+    }
     elsif ($status =~ /^loaderror/)
     {
         $msg = "no list";
diff --git a/winetest/report.css b/winetest/report.css
index bd8b73fec..4594c5d49 100644
--- a/winetest/report.css
+++ b/winetest/report.css
@@ -116,6 +116,9 @@ div.pattern :hover   { color: black; text-decoration: underline; }
 .patL { /* error while getting the test list */
     background-color: #80aaff;
 }
+.patV { /* test blocked by the anti-virus */
+    background-color: #99e6ff;
+}
 
 .commitR {
     color: #cc0000;
-- 
2.20.1



More information about the wine-devel mailing list