Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ build-runv:
go build -tags "static_build $(HYPER_BULD_TAGS)" -o runv .
test-integration:
cd integration-test/test_data && make
cd integration-test && go test -check.v -test.timeout=120m ${TESTFLAGS} .
cd integration-test && go test -check.v -test.timeout=120m ${TESTFLAGS} . ; ret=$$? ;\
sync; sleep 20; sync; find /var/log/hyper/ -type f -exec echo -e '\n\nLog of ' {} ':' \; -exec cat {} \; ; exit $$ret
10 changes: 10 additions & 0 deletions integration-test/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"os/exec"
"path/filepath"
"syscall"
"time"

"github.com/docker/docker/integration-cli/checker"
"github.com/go-check/check"
Expand Down Expand Up @@ -39,11 +40,20 @@ func ProcessExitCode(err error) (exitCode int) {
}

func (s *RunVSuite) runvCommandWithError(args ...string) (string, int, error) {
killer := time.AfterFunc(40*time.Second, func() {
exec.Command("pkill", "-9", "runv").Run()
exec.Command("pkill", "-9", "qemu").Run()
exec.Command("pkill", "-9", "containerd-nslistener").Run()
})

cmdArgs := []string{"--kernel", s.kernelPath, "--initrd", s.initrdPath, "--debug"}
cmdArgs = append(cmdArgs, args...)
cmd := exec.Command(s.binaryPath, cmdArgs...)
out, err := cmd.CombinedOutput()
exitCode := ProcessExitCode(err)
if !killer.Stop() {
err = fmt.Errorf("test timeout error, orgin exec error: %v", err)
}
return string(out), exitCode, err
}

Expand Down