1
0
Fork 0

Add timeout for enough time for qemu to be runned

master
dump_stack() 4 years ago
parent 4a247b229a
commit 6d7f6c5435

@ -300,6 +300,22 @@ func exists(path string) bool {
return true
}
func kernelMask(kernel string) (km config.KernelMask, err error) {
parts := strings.Split(kernel, ":")
if len(parts) != 2 {
err = errors.New("Kernel is not 'distroType:regex'")
return
}
dt, err := config.NewDistroType(parts[0])
if err != nil {
return
}
km = config.KernelMask{DistroType: dt, ReleaseMask: parts[1]}
return
}
func pewHandler(kcfg config.KernelConfig,
workPath, ovrrdKrnl, binary, test string, guess bool,
qemuTimeout, dockerTimeout time.Duration) (err error) {
@ -314,18 +330,12 @@ func pewHandler(kcfg config.KernelConfig,
}
if ovrrdKrnl != "" {
parts := strings.Split(ovrrdKrnl, ":")
if len(parts) != 2 {
return errors.New("Kernel is not 'distroType:regex'")
}
var dt config.DistroType
dt, err = config.NewDistroType(parts[0])
var km config.KernelMask
km, err = kernelMask(ovrrdKrnl)
if err != nil {
return
}
km := config.KernelMask{DistroType: dt, ReleaseMask: parts[1]}
ka.SupportedKernels = []config.KernelMask{km}
}

@ -333,6 +333,8 @@ func TestQemuSystemDebug(t *testing.T) {
}
defer q.Stop()
time.Sleep(time.Second)
if !openedPort(port) {
t.Fatal("Qemu debug port does not opened")
}

Loading…
Cancel
Save