Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: add support to test cross-compiled via Windows Subsystem for Linux (WIP) #3899

Merged
merged 3 commits into from Dec 10, 2019

Conversation

@mback2k
Copy link
Member

@mback2k mback2k commented May 18, 2019

This enables the use of Windows Subsystem for Linux to run the
testsuite against Windows binaries while using Linux servers.

This PR introduces the following environment variables:

  • CURL_TEST_EXE_EXT: set the executable extension for all components
  • CURL_TEST_EXE_EXT_TOOL: set it for the curl tool only
  • CURL_TEST_EXE_EXT_SSH: set it for the SSH tools only
  • CURL_TEST_EXE_EXT_SRV: set it for the test servers only

Later testcurl.pl could be adjusted to make use of those variables.

Example usage:

CURL_TEST_EXE_EXT_TOOL=.exe CURL_TEST_EXE_EXT_SRV=.exe ./runtests.pl -a

This will use .exe variants for the curl tool and the test servers, but not for OpenSSH commands and therefore enables testing Windows curl against known good Linux OpenSSH (instead of a Windows port).

This PR requires #3290 and therefore currently carries b9f8937 with it until #3290 is merged.

@mback2k mback2k self-assigned this May 19, 2019
@mback2k mback2k requested a review from bagder May 19, 2019
@mback2k
Copy link
Member Author

@mback2k mback2k commented May 19, 2019

@bagder Any thoughts about the structure of this? I am still thinking about a better approach to specify the executable extension for different parts of the testsuite, e.g. via additional runtests.pl and testcurl.pl parameters.

Finally I would also like to achieve the possibility of compiling the test servers for Linux while the rest is still cross-compiled so that the Windows build of curl could be tested against test servers that do not include crazy Windows workarounds. A solution which I haven't tested yet, could be to run ./configure twice, once for Linux and once for Windows and then only making the servers for Linux.

@mback2k mback2k force-pushed the mback2k:tests-with-wsl branch from 0a384ac to 7c547d9 May 22, 2019
@mback2k
Copy link
Member Author

@mback2k mback2k commented May 22, 2019

Rebased to current master and updated logmsg to only force \r\n on Windows Subsystem for Linux.

@mback2k mback2k force-pushed the mback2k:tests-with-wsl branch from 7c547d9 to c1d6c4f May 28, 2019
@mback2k
Copy link
Member Author

@mback2k mback2k commented May 28, 2019

Rebased to current master and removed weird special character from runtests.pl that caused:
Unrecognized character \xC2; marked by <-- HERE after ($is_wsl)<-- HERE near column 21 at /tests/runtests.pl line 330.

@stale
Copy link

@stale stale bot commented Nov 24, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 24, 2019
@mback2k
Copy link
Member Author

@mback2k mback2k commented Nov 24, 2019

@bagder Would you mind taking a look at this idea?

@stale stale bot removed the stale label Nov 24, 2019
@bagder
Copy link
Member

@bagder bagder commented Nov 26, 2019

I think the idea is fine. It is possibly a bit icky for users to have to set multiple long environment variables to get it going, but it also seems like a rather edge use case so I doubt we will see wide adoption and use of this.

I don't run/use Windows myself. I can't comment on the specifics as I haven't tested this.

@bagder
bagder approved these changes Nov 26, 2019
Copy link
Member

@bagder bagder left a comment

Looks fine to me, but I have not tested it!

@jay jay added the tests label Dec 7, 2019
@jay
Copy link
Member

@jay jay commented Dec 7, 2019

Can we get someone who uses WSL to review this, @MarcelRaad don't mean to single you out but I know you've used it...

@mback2k mback2k marked this pull request as ready for review Dec 9, 2019
@mback2k
Copy link
Member Author

@mback2k mback2k commented Dec 9, 2019

@MarcelRaad @bagder @jay Thanks for the feedback, I guess this can be merged in it's current state and additional improvements done in a separate PR.

mback2k added 3 commits May 18, 2019
Bash in Windows Subsystem for Linux (WSL) requires it for some reason.

(This is one of several commits to support use of WSL for the tests.)

Ref: #3899
Keys created on Windows Subsystem for Linux (WSL) require it for some
reason.

(This is one of several commits to support use of WSL for the tests.)

Ref: #3899
This enables the use of Windows Subsystem for Linux (WSL) to run the
testsuite against Windows binaries while using Linux servers.

This commit introduces the following environment variables:
- CURL_TEST_EXE_EXT: set the executable extension for all components
- CURL_TEST_EXE_EXT_TOOL: set it for the curl tool only
- CURL_TEST_EXE_EXT_SSH: set it for the SSH tools only

Later testcurl.pl could be adjusted to make use of those variables.
- CURL_TEST_EXE_EXT_SRV: set it for the test servers only

(This is one of several commits to support use of WSL for the tests.)

Closes #3899
@jay jay force-pushed the mback2k:tests-with-wsl branch from c1d6c4f to 9819984 Dec 10, 2019
@jay
Copy link
Member

@jay jay commented Dec 10, 2019

Travis CI wasn't listed in the check for some reason. I've prepared the commits and rebased on master and force pushed to your branch, hopefully the travis ci will run now.

@bagder
Copy link
Member

@bagder bagder commented Dec 10, 2019

Very green!

@jay jay closed this in 9819984 Dec 10, 2019
@jay jay merged commit 9819984 into curl:master Dec 10, 2019
23 of 25 checks passed
23 of 25 checks passed
build
Details
continuous-integration/appveyor/branch Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/push The Travis CI build is in progress
Details
LGTM analysis: C/C++ No code changes detected
Details
LGTM analysis: Python No code changes detected
Details
Codacy/PR Quality Review Up to standards. A positive pull request.
Details
FreeBSD FreeBSD:freebsd-10-4 Task Summary
Details
FreeBSD FreeBSD:freebsd-11-3-snap Task Summary
Details
FreeBSD FreeBSD:freebsd-12-0 Task Summary
Details
FreeBSD FreeBSD:freebsd-13-0-snap Task Summary
Details
buildbot/curl_winssl_cross_x64 Build done.
Details
buildbot/curl_winssl_cross_x64_dbg Build done.
Details
buildbot/curl_winssl_cross_x86 Build done.
Details
buildbot/curl_winssl_cross_x86_dbg Build done.
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage decreased (-2.7%) to 72.575%
Details
curl.curl Build #20191210.5 succeeded
Details
curl.curl #20191210.2 succeeded
Details
curl.curl (macos default) macos default succeeded
Details
curl.curl (ubuntu HTTP only) ubuntu HTTP only succeeded
Details
curl.curl (ubuntu sync resolver) ubuntu sync resolver succeeded
Details
curl.curl (ubuntu w/o HTTP/SMTP/IMAP) ubuntu w/o HTTP/SMTP/IMAP succeeded
Details
curl.curl (ubuntu w/o IPv6) ubuntu w/o IPv6 succeeded
Details
curl.curl (unbuntu default) unbuntu default succeeded
Details
@lock lock bot locked as resolved and limited conversation to collaborators Mar 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.