You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by bu...@spamassassin.apache.org on 2022/06/01 15:37:24 UTC

[Bug 8003] New: t/allmodules.t fails when run on Windows in cmd.exe

https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8003

            Bug ID: 8003
           Summary: t/allmodules.t fails when run on Windows in cmd.exe
           Product: Spamassassin
           Version: SVN Trunk (Latest Devel Version)
          Hardware: PC
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Regression Tests
          Assignee: dev@spamassassin.apache.org
          Reporter: sidney@sidney.com
  Target Milestone: Undefined

In Windows 10 with Strawberry Perl in cmd.exe t/allmodules.t fails because
sarun is passed a command line that uses a pipe to grep, which a default
Windows installation does not have in the cmd command line PATH.

This is the only test that passes a command line to sarun that is platform
dependent.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 8003] Many test failures in Windows due to various platform dependent things

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8003

--- Comment #8 from Sidney Markowitz <si...@sidney.com> ---
(In reply to Loren Wilton from comment #7)
> restore to the captured value rather than some arbitrary string?

A child process creates a new copy of the environment containing whatever is
passed down to it by the parent process. Any change it makes to an environment
variable is only seen by that child process and by any children it spawns after
it has made the change. There is nothing that has to be explicitly restored
when the child process exits.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 8003] Many test failures in Windows due to various platform dependent things

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8003

--- Comment #20 from Sidney Markowitz <si...@sidney.com> ---
trunk % svn ci -m "bug 8003 - Reduce noise of warnings in Windows lock file
code to make some tests practical in Windows"
Sending        lib/Mail/SpamAssassin/Locker/Win32.pm
Sending        t/db_awl_path.t
Sending        t/db_awl_path_welcome_block.t
Transmitting file data ...done
Committing transaction...
Committed revision 1902055.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 8003] Many test failures in Windows due to various platform dependent things

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8003

--- Comment #11 from Sidney Markowitz <si...@sidney.com> ---
Some tests fail in Windows but might be fixable. Disabling them when in Windows
for now, with a comment to look at them later:

trunk % svn ci -m "bug 8003 - skip tests that fail in Windows that need further
investigation to determine if they can be fixed" t/bayesbdb.t t/db_awl_path.t
t/db_awl_path_welcome_block.t t/mass_check.t t/mkrules.t t/mkrules_else.t
t/re_base_extraction.t t/reuse.t

Committed revision 1901651.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 8003] t/allmodules.t fails when run on Windows in cmd.exe

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8003

Sidney Markowitz <si...@sidney.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sidney@sidney.com

--- Comment #1 from Sidney Markowitz <si...@sidney.com> ---
It may not just be the lack of grep on Windows, it may be all the tests that
use sarun are failing on my Windows test machine, with the test framework not
seeing any of the output stream. Here is the test setup I am using:

Windows 10 64-bit VM in VirtualBox on a macOS host, Windows fully updated to
21H2, with Visual Studio, MSYS2, and TortoiseSVN installed.

Installed Strawberry Perl into the default C:\Strawberry

Used cpanm to install all the CPAN modules listed in the cwiki page for setting
up a SpamAssassin build environment
(https://cwiki.apache.org/confluence/x/lRKhD) except IO::Socket::SSL (which is
included with Strawberry) and the following optional modules that fail to
install:
Net::LibIDN MaxMind::DB::Reader::XS Razor2 Net::PatriciaBSD::Resource
Mail::DMARC

Checked out SpamAssassin trunk into C:\SpamAssassin directory

In cmd.exe command line ran
 perl Makefile.PL < NUL
 make
 make test

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 8003] Many test failures in Windows due to various platform dependent things

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8003

--- Comment #5 from Henrik Krohns <ap...@hege.li> ---
(In reply to Henrik Krohns from comment #4)
> I'll atleast fix t/allmodules.t since it's my mess..

Committed revision 1901534.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 8003] Many test failures in Windows due to various platform dependent things

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8003

Sidney Markowitz <si...@sidney.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #24 from Sidney Markowitz <si...@sidney.com> ---
Fix the last tests that would not run under windows. Closing this issue, as all
tests now either run under Windows or are marked to be skipped under Windows.

trunk % svn ci -m "bug 8003 - fix path syntax when in Windows to let mkrule
tests work" t/mkrules*.t
Sending        t/mkrules.t
Sending        t/mkrules_else.t
Transmitting file data ..done
Committing transaction...
Committed revision 1903039.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 8003] Many test failures in Windows due to various platform dependent things

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8003

Loren Wilton <lw...@earthlink.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|lwilton@earthlink.net       |

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 8003] t/allmodules.t fails when run on Windows in cmd.exe

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8003

--- Comment #2 from Sidney Markowitz <si...@sidney.com> ---
These lines in SATest.pm are certainly not Windows-compatible.

  # Clean PATH so taint doesn't complain
  $ENV{'PATH'} = '/bin:/usr/bin:/usr/local/bin';

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 8003] Many test failures in Windows due to various platform dependent things

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8003

--- Comment #6 from Sidney Markowitz <si...@sidney.com> ---
I'm not sure what exactly to do with the untaint PATH code in SATest.pm. There
is a "minimal PATH' in Windows that corresponds to
'/bin:/usr/bin:/usr/local/bin' but that isn't quite enough for anything to work
using Strawberry Perl. Empirically, I find that require does not find a module
if the various Strawberry binary directories are removed from PATH. But worse
than making something platform specific would be to make it platform and perl
vendor specific.

Maybe the right thing to do would be to be a bit less security conscious about
running the tests under Windows and for Windows only untaint PATH by accepting
it if it contains all absolute paths with no funny characters and no \..\

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 8003] Many test failures in Windows due to various platform dependent things

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8003

Sidney Markowitz <si...@sidney.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|t/allmodules.t fails when   |Many test failures in
                   |run on Windows in cmd.exe   |Windows due to various
                   |                            |platform dependent things

--- Comment #3 from Sidney Markowitz <si...@sidney.com> ---
I'm renaming the title of this issue, because over half of all tests don't run
under Windows due to various things that are written assuming a Unix/Linux
environment. Clearly nobody has been building and running tests under Windows
for some years. Nothing I've hit so far seems hard to fix, for example
re_base_extraction.t deletes files by calling
untaint_system("rm -f $siterules/*.pre");
which I'm sure perl is capable of doing itself.

Or we can decide that SpamAssassin no longer runs on Windows.

I'll go through things an item at a time and see if we get far enough by the
time we are otherwise ready to release 4.0.0.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 8003] Many test failures in Windows due to various platform dependent things

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8003

--- Comment #21 from Sidney Markowitz <si...@sidney.com> ---
Two more tests that won't run on windows until somebody decides to get mass
check script to run on Windows. Changed the skip message to no longer say they
are under investigation:

trunk % svn ci -m "Bug 8003 - reuse.t requires masscheck which is not written
to run on Windows" t/reuse.t 
Committed revision 1902423.

trunk % svn ci -m "Bug 8003 - mass_check.t requires masscheck which is not
written to run on Windows" t/mass_check.t
Committed revision 1902424.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 8003] Many test failures in Windows due to various platform dependent things

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8003

--- Comment #22 from Sidney Markowitz <si...@sidney.com> ---
trunk % svn ci -m "bug 8003 - after changes made for other tests,
re_base_extraction.t now works on Windows" t/re_base_extraction.t
Sending        t/re_base_extraction.t
Transmitting file data .done
Committing transaction...
Committed revision 1902425.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 8003] Many test failures in Windows due to various platform dependent things

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8003

--- Comment #10 from Sidney Markowitz <si...@sidney.com> ---
trunk % svn ci -m "bug 8003 - Remove check for sudo when in Windows" t/root*.t 
Committed revision 1901649.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 8003] Many test failures in Windows due to various platform dependent things

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8003

--- Comment #23 from Sidney Markowitz <si...@sidney.com> ---
trunk % svn ci -m "bug 8003 - fix extra noise in test on Windows platform" 
t/spamd_ssl_z.t
Sending        t/spamd_ssl_z.t
Transmitting file data .done
Committing transaction...
Committed revision 1903032.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 8003] Many test failures in Windows due to various platform dependent things

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8003

Loren Wilton <lw...@earthlink.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lwilton@earthlink.net

--- Comment #7 from Loren Wilton <lw...@earthlink.net> ---
Can you capture the original path at the start of the testing sequence and
restore to the captured value rather than some arbitrary string?

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 8003] Many test failures in Windows due to various platform dependent things

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8003

--- Comment #18 from Sidney Markowitz <si...@sidney.com> ---
trunk % svn ci -m "bug 8003 - Remove debugging flag accidentally left in last
commit" t/basic_meta_net.t 
Sending        t/basic_meta_net.t
Transmitting file data .done
Committing transaction...
Committed revision 1901958.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 8003] Many test failures in Windows due to various platform dependent things

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8003

--- Comment #14 from Sidney Markowitz <si...@sidney.com> ---
t/timeout.t fixed in bug 8005

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 8003] Many test failures in Windows due to various platform dependent things

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8003

--- Comment #19 from Sidney Markowitz <si...@sidney.com> ---
trunk % svn ci -m "bug 8003 - Fix bayesbdb.t not closing db files during test,
now works on Windows" t/bayesbdb.t 
Sending        t/bayesbdb.t
Transmitting file data .done
Committing transaction...
Committed revision 1902053.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 8003] Many test failures in Windows due to various platform dependent things

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8003

--- Comment #9 from Sidney Markowitz <si...@sidney.com> ---
trunk % svn ci -m "bug 8003 - Untaint PATH in Windows"
Sending        t/SATest.pm
Transmitting file data .done
Committing transaction...
Committed revision 1901573.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 8003] Many test failures in Windows due to various platform dependent things

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8003

Henrik Krohns <ap...@hege.li> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |apache@hege.li

--- Comment #4 from Henrik Krohns <ap...@hege.li> ---
Committed some semi-related fixes just now for find_executable_in_env_path.

I'll atleast fix t/allmodules.t since it's my mess..

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 8003] Many test failures in Windows due to various platform dependent things

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8003

--- Comment #16 from Sidney Markowitz <si...@sidney.com> ---
bug 8010 and bug 8011 committed

trunk % svn ci -m "bug 8003 - Change ip address used in test from one that
Windows is too strict with" t/basic_meta_net.t 
Sending        t/basic_meta_net.t
Transmitting file data .done
Committing transaction...
Committed revision 1901953.

trunk % svn ci -m "bug 8003 - Skip tests or portions that cannot run in
Windows, change other non-portable things in tests to portable equivalents"
t/basic_lint.t t/extracttext.t t/make_install.t t/sa_awl.t
t/sa_awl_welcome_block.t t/sa_compile.t t/uri_list.t t/strip2.t 
Sending        t/basic_lint.t
Sending        t/extracttext.t
Sending        t/make_install.t
Sending        t/sa_awl.t
Sending        t/sa_awl_welcome_block.t
Sending        t/sa_compile.t
Sending        t/strip2.t
Sending        t/uri_list.t
Transmitting file data ........done
Committing transaction...
Committed revision 1901954.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 8003] Many test failures in Windows due to various platform dependent things

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8003

--- Comment #17 from Sidney Markowitz <si...@sidney.com> ---
No tests now fail when run on windows, but the following tests now skip running
with the message:
  Bug 8003 - Investigate if can be made to work on windows

t/bayesbdb.t
t/db_awl_path.t
t/db_awl_path_welcome_block.t
t/mass_check.t
t/mkrules.t
t/mkrules_else.t
t/re_base_extraction.t
t/reuse.t

Each of those should be either made to run under Windows or changed to be
simply skipped.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 8003] Many test failures in Windows due to various platform dependent things

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8003

--- Comment #12 from Henrik Krohns <ap...@hege.li> ---
It broke re_base_extraction.t, I don't think rmtree supports file wildcards..

Committed revision 1901657.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 8003] Many test failures in Windows due to various platform dependent things

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8003

--- Comment #13 from Sidney Markowitz <si...@sidney.com> ---
Most of the t/spamc*.t tests failed in Windows becauae it used a non-portable
test for the spamc executable. Also t/tainted_msg.t had an obsolete line of
code.

trunk % svn ci -m "Bug 8003 - Fix determining when to skip spamc/spamd tests in
Windows" t/tainted_msg.t t/SATest.pm 
Sending        t/SATest.pm
Sending        t/tainted_msg.t
Transmitting file data ..done
Committing transaction...
Committed revision 1901667.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 8003] Many test failures in Windows due to various platform dependent things

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8003

--- Comment #15 from Sidney Markowitz <si...@sidney.com> ---
trunk % svn ci -m "Bug 8003 - Fix compile time error in Windows in test that is
supposed to be skipped on Windows" t/dcc.t

Committed revision 1901764.

-- 
You are receiving this mail because:
You are the assignee for the bug.