Add timeout for enough time for qemu to be runned
This commit is contained in:
parent
4a247b229a
commit
6d7f6c5435
26
pew.go
26
pew.go
@ -300,6 +300,22 @@ func exists(path string) bool {
|
|||||||
return true
|
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,
|
func pewHandler(kcfg config.KernelConfig,
|
||||||
workPath, ovrrdKrnl, binary, test string, guess bool,
|
workPath, ovrrdKrnl, binary, test string, guess bool,
|
||||||
qemuTimeout, dockerTimeout time.Duration) (err error) {
|
qemuTimeout, dockerTimeout time.Duration) (err error) {
|
||||||
@ -314,18 +330,12 @@ func pewHandler(kcfg config.KernelConfig,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ovrrdKrnl != "" {
|
if ovrrdKrnl != "" {
|
||||||
parts := strings.Split(ovrrdKrnl, ":")
|
var km config.KernelMask
|
||||||
if len(parts) != 2 {
|
km, err = kernelMask(ovrrdKrnl)
|
||||||
return errors.New("Kernel is not 'distroType:regex'")
|
|
||||||
}
|
|
||||||
|
|
||||||
var dt config.DistroType
|
|
||||||
dt, err = config.NewDistroType(parts[0])
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
km := config.KernelMask{DistroType: dt, ReleaseMask: parts[1]}
|
|
||||||
ka.SupportedKernels = []config.KernelMask{km}
|
ka.SupportedKernels = []config.KernelMask{km}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -333,6 +333,8 @@ func TestQemuSystemDebug(t *testing.T) {
|
|||||||
}
|
}
|
||||||
defer q.Stop()
|
defer q.Stop()
|
||||||
|
|
||||||
|
time.Sleep(time.Second)
|
||||||
|
|
||||||
if !openedPort(port) {
|
if !openedPort(port) {
|
||||||
t.Fatal("Qemu debug port does not opened")
|
t.Fatal("Qemu debug port does not opened")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user