e2e: Skip tests with platform-specific digests on other platforms
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
Родитель
591320db4a
Коммит
41b6ec07ce
|
@ -18,6 +18,10 @@ const registryPrefix = "registry:5000"
|
|||
func TestRunAttachedFromRemoteImageAndRemove(t *testing.T) {
|
||||
skip.If(t, environment.RemoteDaemon())
|
||||
|
||||
// Digests in golden file are linux/amd64 specific.
|
||||
// TODO: Fix this test and make it work on all platforms.
|
||||
environment.SkipIfNotPlatform(t, "linux/amd64")
|
||||
|
||||
image := createRemoteImage(t)
|
||||
|
||||
result := icmd.RunCommand("docker", "run", "--rm", image,
|
||||
|
|
|
@ -17,6 +17,10 @@ const registryPrefix = "registry:5000"
|
|||
func TestPullWithContentTrust(t *testing.T) {
|
||||
skip.If(t, environment.RemoteDaemon())
|
||||
|
||||
// Digests in golden files are linux/amd64 specific.
|
||||
// TODO: Fix this test and make it work on all platforms.
|
||||
environment.SkipIfNotPlatform(t, "linux/amd64")
|
||||
|
||||
dir := fixtures.SetupConfigFile(t)
|
||||
defer dir.Remove()
|
||||
image := fixtures.CreateMaskedTrustedRemoteImage(t, registryPrefix, "trust-pull", "latest")
|
||||
|
|
|
@ -33,6 +33,10 @@ const (
|
|||
func TestPushAllTags(t *testing.T) {
|
||||
skip.If(t, environment.RemoteDaemon())
|
||||
|
||||
// Compared digests are linux/amd64 specific.
|
||||
// TODO: Fix this test and make it work on all platforms.
|
||||
environment.SkipIfNotPlatform(t, "linux/amd64")
|
||||
|
||||
_ = createImage(t, "push-all-tags", "latest", "v1", "v1.0", "v1.0.1")
|
||||
result := icmd.RunCmd(icmd.Command("docker", "push", "--all-tags", registryPrefix+"/push-all-tags"))
|
||||
|
||||
|
@ -51,6 +55,10 @@ func TestPushAllTags(t *testing.T) {
|
|||
func TestPushWithContentTrust(t *testing.T) {
|
||||
skip.If(t, environment.RemoteDaemon())
|
||||
|
||||
// Compared digests are linux/amd64 specific.
|
||||
// TODO: Fix this test and make it work on all platforms.
|
||||
environment.SkipIfNotPlatform(t, "linux/amd64")
|
||||
|
||||
dir := fixtures.SetupConfigFile(t)
|
||||
defer dir.Remove()
|
||||
image := createImage(t, "trust-push", "latest")
|
||||
|
|
|
@ -20,6 +20,9 @@ const (
|
|||
|
||||
func TestSignLocalImage(t *testing.T) {
|
||||
skip.If(t, environment.RemoteDaemon())
|
||||
// Digests in golden files are linux/amd64 specific.
|
||||
// TODO: Fix this test and make it work on all platforms.
|
||||
environment.SkipIfNotPlatform(t, "linux/amd64")
|
||||
|
||||
dir := fixtures.SetupConfigFile(t)
|
||||
defer dir.Remove()
|
||||
|
@ -35,6 +38,9 @@ func TestSignLocalImage(t *testing.T) {
|
|||
|
||||
func TestSignWithLocalFlag(t *testing.T) {
|
||||
skip.If(t, environment.RemoteDaemon())
|
||||
// Digests in golden files are linux/amd64 specific.
|
||||
// TODO: Fix this test and make it work on all platforms.
|
||||
environment.SkipIfNotPlatform(t, "linux/amd64")
|
||||
|
||||
dir := fixtures.SetupConfigFile(t)
|
||||
defer dir.Remove()
|
||||
|
|
|
@ -98,3 +98,13 @@ func SkipIfCgroupNamespacesNotSupported(t *testing.T) {
|
|||
|
||||
skip.If(t, !cgroupNsFound, fmt.Sprintf("running against a daemon that doesn't support cgroup namespaces (security options: %s)", result.Stdout()))
|
||||
}
|
||||
|
||||
// SkipIfNotPlatform skips the test if the running docker daemon is not running on a specific platform.
|
||||
// platform should be in format os/arch (for example linux/arm64).
|
||||
func SkipIfNotPlatform(t *testing.T, platform string) {
|
||||
t.Helper()
|
||||
result := icmd.RunCmd(icmd.Command("docker", "version", "--format", "{{.Server.Os}}/{{.Server.Arch}}"))
|
||||
result.Assert(t, icmd.Expected{Err: icmd.None})
|
||||
daemonPlatform := strings.TrimSpace(result.Stdout())
|
||||
skip.If(t, daemonPlatform != platform, "running against a non %s daemon", platform)
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче