Skip to content

Commit 3be7ff0

Browse files
committed
fix: Update blkio test to be compatible with finch CI
Signed-off-by: Arjun Raja Yogidas <[email protected]>
1 parent 070f70b commit 3be7ff0

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

e2e/tests/container_create.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"fmt"
1010
"net/http"
1111
"os"
12-
"os/exec"
1312
"path/filepath"
1413
"strconv"
1514
"strings"
@@ -803,15 +802,15 @@ func ContainerCreate(opt *option.Option, pOpt util.NewOpt) {
803802
dummyDev2 := "/dev/dummy-zero2"
804803

805804
// Create dummy devices (major number 1 for char devices)
806-
err := exec.Command("mknod", dummyDev1, "c", "1", "5").Run()
807-
Expect(err).Should(BeNil())
808-
err = exec.Command("mknod", dummyDev2, "c", "1", "6").Run()
809-
Expect(err).Should(BeNil())
805+
mknodOpt1, _ := pOpt([]string{"mknod", dummyDev1, "c", "1", "5"})
806+
command.Run(mknodOpt1)
807+
mknodOpt2, _ := pOpt([]string{"mknod", dummyDev2, "c", "1", "6"})
808+
command.Run(mknodOpt2)
810809

811810
// Cleanup dummy devices after test
812811
defer func() {
813-
exec.Command("rm", "-f", dummyDev1).Run()
814-
exec.Command("rm", "-f", dummyDev2).Run()
812+
rmOpt, _ := pOpt([]string{"rm", "-f", dummyDev1, dummyDev2})
813+
command.Run(rmOpt)
815814
}()
816815

817816
// define options
@@ -877,7 +876,7 @@ func ContainerCreate(opt *option.Option, pOpt util.NewOpt) {
877876
// inspect container
878877
resp := command.Stdout(opt, "inspect", testContainerName)
879878
var inspect []*dockercompat.Container
880-
err = json.Unmarshal(resp, &inspect)
879+
err := json.Unmarshal(resp, &inspect)
881880
Expect(err).Should(BeNil())
882881
Expect(inspect).Should(HaveLen(1))
883882

0 commit comments

Comments
 (0)