[PATCH] Enable jtreg tests to run on WSL (Windows Subsystem for Linux)

Jonathan Gibbons jonathan.gibbons at oracle.com
Tue Jan 8 23:15:37 UTC 2019


Well, the issue is about how to run shell tests when running on Windows, 
because the shell tests are written to be run with bash, which means 
that on Windows you need either WSL or Cygwin, right?

But, you write:  "it depends on whether you called ./configure in 
OpenJDK to build a Linux JDK on WSL or a Windows JDK on WSL."  Would it 
not be reasonable to expect that you can query the JVM to know if it is 
a "Linux JDK on WSL" or a "Windows JDK on WSL"   For example, is there 
any information in the output of `java -version` or `java -fullversion` 
or a system property that identifies which of these variants the JDK is?

-- Jon


On 01/08/2019 02:22 PM, Andrew Luo wrote:
>
> Jon,
>
> I’m not sure what exactly you mean that the “test effectively require 
> either Cygwin or WSL”?  I believe it would be possible (ideal 
> actually) to write the tests such that they can run on all platforms 
> (Linux, Cygwin, WSL Windows target) – most tests today run on multiple 
> platforms already, right?
>
> The option needs to be provided only when you use WSL to target 
> Windows.  If you use WSL to target Linux then the option should not be 
> set; the behavior will be the same as Linux. I don’t think it’s 
> possible for jtreg or the test itself to infer this information, 
> because it depends on whether you called ./configure in OpenJDK to 
> build a Linux JDK on WSL or a Windows JDK on WSL.
>
> Perhaps I’m misunderstanding what you’re saying though…
>
> Thanks,
>
> -Andrew
>
> *From:*Jonathan Gibbons <jonathan.gibbons at oracle.com>
> *Sent:* Tuesday, January 8, 2019 11:25 AM
> *To:* Andrew Luo <andrewluotechnologies at outlook.com>; 
> code-tools-dev at openjdk.java.net
> *Subject:* Re: [PATCH] Enable jtreg tests to run on WSL (Windows 
> Subsystem for Linux)
>
> Andrew,
>
> One final question ...
>
> You introduce a new jtreg option to sepcify the use of WSL. Given that 
> the test effectively require either Cygwin or WSL, would it be 
> reasonable to try and infer which subsystem is required, perhaps 
> leaving the new option to be used only in the case of 
> uncertainty/ambiguity?
>
> Not everyone runs jtreg tests through the Makefiles, and for those 
> that don't, requiring the new option will mean that they need to 
> specify the new option to use WSL. It would be nice if they didn't 
> have to.
>
> -- Jon
>



More information about the code-tools-dev mailing list