Add testenv.UsingSnapshotter utility

To allow skipping integration tests that don't apply to the
containerd snapshotter.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
Sebastiaan van Stijn 2023-04-13 12:16:27 +02:00 committed by Paweł Gronowski
parent 6e98a7f2c9
commit 4373547857
No known key found for this signature in database
GPG key ID: B85EFCFE26DEF92A

View file

@ -193,6 +193,13 @@ func (e *Execution) IsUserNamespaceInKernel() bool {
return true
}
// UsingSnapshotter returns whether containerd snapshotters are used for the
// tests by checking if the "TEST_INTEGRATION_USE_SNAPSHOTTER" is set to a
// non-empty value.
func (e *Execution) UsingSnapshotter() bool {
return os.Getenv("TEST_INTEGRATION_USE_SNAPSHOTTER") != ""
}
// HasExistingImage checks whether there is an image with the given reference.
// Note that this is done by filtering and then checking whether there were any
// results -- so ambiguous references might result in false-positives.