Skip to content

Commit 9b60c15

Browse files
committed
WIP
Signed-off-by: apostasie <[email protected]>
1 parent 91d3db5 commit 9b60c15

File tree

23 files changed

+297
-208
lines changed

23 files changed

+297
-208
lines changed

cmd/nerdctl/container/container_inspect_linux_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import (
3030

3131
"github.com/containerd/nerdctl/mod/tigron/expect"
3232
"github.com/containerd/nerdctl/mod/tigron/test"
33+
3334
"github.com/containerd/nerdctl/v2/pkg/infoutil"
3435
"github.com/containerd/nerdctl/v2/pkg/inspecttypes/dockercompat"
3536
"github.com/containerd/nerdctl/v2/pkg/labels"

cmd/nerdctl/container/container_run_linux_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ func TestRunSigProxy(t *testing.T) {
379379
},
380380

381381
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
382+
// FIXME: os.Interrupt will likely not work on Windows
382383
cmd := nerdtest.RunSigProxyContainer(os.Interrupt, true, nil, data, helpers)
383384
err := cmd.Signal(os.Interrupt)
384385
assert.NilError(helpers.T(), err)
@@ -417,7 +418,7 @@ func TestRunSigProxy(t *testing.T) {
417418
return cmd
418419
},
419420

420-
Expected: test.Expects(127, nil, expect.DoesNotContain(nerdtest.SignalCaught)),
421+
Expected: test.Expects(expect.ExitCodeSignaled, nil, expect.DoesNotContain(nerdtest.SignalCaught)),
421422
},
422423
}
423424

cmd/nerdctl/issues/main_linux_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func TestIssue108(t *testing.T) {
3939
{
4040
Description: "-it --net=host",
4141
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
42-
cmd := helpers.Command("run", "-it", "--rm", "--net=host", testutil.CommonImage, "echo", "this was always working")
42+
cmd := helpers.Command("run", "--quiet", "-it", "--rm", "--net=host", testutil.CommonImage, "echo", "this was always working")
4343
cmd.WithPseudoTTY()
4444
return cmd
4545
},
@@ -48,7 +48,7 @@ func TestIssue108(t *testing.T) {
4848
{
4949
Description: "--net=host -it",
5050
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
51-
cmd := helpers.Command("run", "--rm", "--net=host", "-it", testutil.CommonImage, "echo", "this was not working due to issue #108")
51+
cmd := helpers.Command("run", "--quiet", "--rm", "--net=host", "-it", testutil.CommonImage, "echo", "this was not working due to issue #108")
5252
cmd.WithPseudoTTY()
5353
return cmd
5454
},

cmd/nerdctl/system/system_events_linux_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ import (
3030

3131
func testEventFilterExecutor(data test.Data, helpers test.Helpers) test.TestableCommand {
3232
cmd := helpers.Command("events", "--filter", data.Get("filter"), "--format", "json")
33-
cmd.WithTimeout(3 * time.Second)
33+
// 3 seconds is too short on slow rig (EL8)
34+
cmd.WithTimeout(10 * time.Second)
3435
cmd.Background()
3536
helpers.Ensure("run", "--rm", testutil.CommonImage)
3637
return cmd

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ require (
117117
github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect
118118
github.com/philhofer/fwd v1.1.3-0.20240612014219-fbbf4953d986 // indirect
119119
github.com/pkg/errors v0.9.1 // indirect
120-
github.com/rs/zerolog v1.34.0 // indirect
121120
github.com/sasha-s/go-deadlock v0.3.5 // indirect
122121
github.com/sirupsen/logrus v1.9.3 // indirect
123122
github.com/smallstep/pkcs7 v0.1.1 // indirect

go.sum

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
180180
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
181181
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
182182
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
183-
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
184183
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
185184
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
186185
github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk=
@@ -263,9 +262,6 @@ github.com/rootless-containers/bypass4netns v0.4.2 h1:JUZcpX7VLRfDkLxBPC6fyNalJG
263262
github.com/rootless-containers/bypass4netns v0.4.2/go.mod h1:iOY28IeFVqFHnK0qkBCQ3eKzKQgSW5DtlXFQJyJMAQk=
264263
github.com/rootless-containers/rootlesskit/v2 v2.3.4 h1:EHiqqiq+ntTfdnQtIgDR3etiuqKkRCPr1qpoizJxW/E=
265264
github.com/rootless-containers/rootlesskit/v2 v2.3.4/go.mod h1:AJNM4jS0jFIF8GvBfnm4I0498zosnHGCIMRhUoEUmFg=
266-
github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0=
267-
github.com/rs/zerolog v1.34.0 h1:k43nTLIwcTVQAncfCw4KZ2VY6ukYoZaBPNOE8txlOeY=
268-
github.com/rs/zerolog v1.34.0/go.mod h1:bJsvje4Z08ROH4Nhs5iH600c3IkWhwp44iRc54W6wYQ=
269265
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
270266
github.com/sasha-s/go-deadlock v0.3.5 h1:tNCOEEDG6tBqrNDOX35j/7hL5FcFViG6awUGROb2NsU=
271267
github.com/sasha-s/go-deadlock v0.3.5/go.mod h1:bugP6EGbdGYObIlx7pUZtWqlvo8k9H6vCBBsiChJQ5U=

mod/tigron/.golangci.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ linters:
3030
- github.com/creack/pty
3131
- golang.org/x/sync
3232
- golang.org/x/term
33-
- gotest.tools/v3
34-
- github.com/rs/zerolog
35-
- github.com/rs/zerolog/log
3633
- go.uber.org/goleak
3734
staticcheck:
3835
checks:

mod/tigron/expect/comparators.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package expect
1818

1919
import (
20+
"encoding/hex"
2021
"fmt"
2122
"regexp"
2223
"strings"
@@ -45,7 +46,8 @@ func Contains(compare string) test.Comparator {
4546
return func(stdout, info string, t *testing.T) {
4647
t.Helper()
4748
assertive.Check(t, strings.Contains(stdout, compare),
48-
fmt.Sprintf("Output does not contain: %q", compare)+info)
49+
fmt.Sprintf("Output does not contain: %q", compare),
50+
info)
4951
}
5052
}
5153

@@ -56,7 +58,7 @@ func DoesNotContain(compare string) test.Comparator {
5658
return func(stdout, info string, t *testing.T) {
5759
t.Helper()
5860
assertive.Check(t, !strings.Contains(stdout, compare),
59-
fmt.Sprintf("Output should not contain: %q", compare)+info)
61+
fmt.Sprintf("Output should not contain: %q", compare), info)
6062
}
6163
}
6264

@@ -65,10 +67,14 @@ func Equals(compare string) test.Comparator {
6567
//nolint:thelper
6668
return func(stdout, info string, t *testing.T) {
6769
t.Helper()
70+
71+
hexdump := hex.Dump([]byte(stdout))
6872
assertive.Check(
6973
t,
7074
compare == stdout,
71-
fmt.Sprintf("Output is not equal to: %q", compare)+info,
75+
fmt.Sprintf("Output is not equal to: %q", compare),
76+
"\n"+hexdump,
77+
info,
7278
)
7379
}
7480
}

mod/tigron/go.mod

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,9 @@ go 1.23.0
44

55
require (
66
github.com/creack/pty v1.1.24
7-
github.com/rs/zerolog v1.34.0
87
go.uber.org/goleak v1.3.0
98
golang.org/x/sync v0.11.0
109
golang.org/x/term v0.29.0
1110
)
1211

13-
require (
14-
github.com/mattn/go-colorable v0.1.13 // indirect
15-
github.com/mattn/go-isatty v0.0.19 // indirect
16-
golang.org/x/sys v0.31.0 // indirect
17-
)
12+
require golang.org/x/sys v0.31.0 // indirect

mod/tigron/go.sum

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,15 @@
1-
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
21
github.com/creack/pty v1.1.24 h1:bJrF4RRfyJnbTJqzRLHzcGaZK1NeM5kTC9jGgovnR1s=
32
github.com/creack/pty v1.1.24/go.mod h1:08sCNb52WyoAwi2QDyzUCTgcvVFhUzewun7wtTfvcwE=
43
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
54
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
6-
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
7-
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
8-
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
9-
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
10-
github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA=
11-
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
12-
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
135
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
146
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
15-
github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0=
16-
github.com/rs/zerolog v1.34.0 h1:k43nTLIwcTVQAncfCw4KZ2VY6ukYoZaBPNOE8txlOeY=
17-
github.com/rs/zerolog v1.34.0/go.mod h1:bJsvje4Z08ROH4Nhs5iH600c3IkWhwp44iRc54W6wYQ=
187
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
198
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
209
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
2110
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
2211
golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w=
2312
golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
24-
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
25-
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
26-
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
2713
golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
2814
golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
2915
golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU=

0 commit comments

Comments
 (0)