Skip to content

Commit 4fa13e2

Browse files
committed
Fixes for TestImageConvertNydusVerify
Signed-off-by: apostasie <[email protected]>
1 parent 599aa39 commit 4fa13e2

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

cmd/nerdctl/image/image_convert_linux_test.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package image
1919
import (
2020
"fmt"
2121
"testing"
22+
"time"
2223

2324
"github.com/containerd/nerdctl/mod/tigron/require"
2425
"github.com/containerd/nerdctl/mod/tigron/test"
@@ -102,6 +103,10 @@ func TestImageConvertNydusVerify(t *testing.T) {
102103

103104
var reg *registry.Server
104105

106+
// It is unclear what is problematic here, but we use the kernel version to discriminate against EL
107+
// See: https://github.com/containerd/nerdctl/issues/4332
108+
testutil.RequireKernelVersion(t, ">= 6.0.0-0")
109+
105110
testCase := &test.Case{
106111
Require: require.All(
107112
require.Linux,
@@ -116,6 +121,7 @@ func TestImageConvertNydusVerify(t *testing.T) {
116121
helpers.Ensure("pull", "--quiet", testutil.CommonImage)
117122
reg = nerdtest.RegistryWithNoAuth(data, helpers, 0, false)
118123
reg.Setup(data, helpers)
124+
119125
data.Labels().Set(remoteImageKey, fmt.Sprintf("%s:%d/nydusd-image:test", "localhost", reg.Port))
120126
helpers.Ensure("image", "convert", "--nydus", "--oci", testutil.CommonImage, data.Identifier("converted-image"))
121127
helpers.Ensure("tag", data.Identifier("converted-image"), data.Labels().Get(remoteImageKey))
@@ -129,15 +135,19 @@ func TestImageConvertNydusVerify(t *testing.T) {
129135
}
130136
},
131137
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
132-
return helpers.Custom("nydusify",
138+
cmd := helpers.Custom("nydusify",
133139
"check",
140+
"--work-dir",
141+
data.Temp().Dir("nydusify-temp"),
134142
"--source",
135143
testutil.CommonImage,
136144
"--target",
137145
data.Labels().Get(remoteImageKey),
138146
"--source-insecure",
139147
"--target-insecure",
140148
)
149+
cmd.WithTimeout(30 * time.Second)
150+
return cmd
141151
},
142152
Expected: test.Expects(0, nil, nil),
143153
}

0 commit comments

Comments
 (0)