On Wed, 30 Aug 2023 03:15:18 GMT, Mikhailo Seledtsov <[email protected]>
wrote:
>> Container ecosystem is growing. It would be beneficial to define custom
>> command to figure out whether a specific test host or environment allows for
>> container testing. This enhancement seeks to make the command used by jtreg
>> "requires" extension configurable, specifically
>> test/jtreg-ext/requires/VMProps.java checkContainerSupport().
>
> Hi David,
>
> Thank you for taking a look at this change. To answer your questions:
> -- how is this supposed to work ?
> If user running the tests does not specify the newly introduced property
> things will work same as before. If user specifies
> -Djdk.test.container.requires.check.command then the specified command will
> be executed to check whether container testing can be performed on a given
> host/system.
>
> By default the code in VMProps.java runs "docker ps". With this change we
> could override it with any other relevant command, such as "podman version"
> or other type of container command.
>
> -- What if they are really docker specific tests?
> I think our container tests should be fairly container-generic (or container
> agnostic), but need to check this. This raises a good question. Perhaps we
> should consider removing the at-requires check entirely, and rely on
> individual checks in individual tests. This will give us more flexibility, we
> run a specific check in each test and throw a jtreg.SkippedException upon
> failure. We already do some additional checks in each test, such as podman
> version, cgroups v1 vs v2, etc.
>
> Let me know what you think.
@mseledts My concern is that given:
map.put("docker.support", this::containerSupport)
we will now have a situation where `containerSupport` may indicate `podman` but
that will enable `requires docker.support`. It seems to me that we need a range
of potential checks where the generic `requires container.support` is for a
test targeted to any container environment (though I wonder in that case what
exactly it requires that the test depends on???); and we would then potentially
need separate `docker.support`, `podman.support` if tests did things specific
to those container environments.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/15475#issuecomment-1698636023