Skip to content

Commit

Permalink
test: fix inspect and ls
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <[email protected]>
  • Loading branch information
crazy-max committed Jun 19, 2023
1 parent 73c0630 commit 967e46c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion tests/inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ func testInspect(t *testing.T, sb integration.Sandbox) {
out, err := inspectCmd(sb)
require.NoError(t, err, string(out))

sbDriver := sb.Name()
if sbDriver == "docker-containerd" {
sbDriver = "docker"
}

var name string
var driver string
for _, line := range strings.Split(out, "\n") {
Expand All @@ -34,5 +39,5 @@ func testInspect(t *testing.T, sb integration.Sandbox) {
}
}
require.Equal(t, sb.Address(), name)
require.Equal(t, sb.Name(), driver)
require.Equal(t, sbDriver, driver)
}
7 changes: 6 additions & 1 deletion tests/ls.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,14 @@ func testLs(t *testing.T, sb integration.Sandbox) {
out, err := lsCmd(sb)
require.NoError(t, err, string(out))

sbDriver := sb.Name()
if sbDriver == "docker-containerd" {
sbDriver = "docker"
}

for _, line := range strings.Split(out, "\n") {
if strings.Contains(line, sb.Address()) {
require.Contains(t, line, sb.Name())
require.Contains(t, line, sbDriver)
return
}
}
Expand Down

0 comments on commit 967e46c

Please sign in to comment.