feat: parameters to specify kernel/distro for test
This commit is contained in:
parent
ad5254ded3
commit
80037a48d9
42
cmd/pew.go
42
cmd/pew.go
@ -64,7 +64,6 @@ func successRate(state runstate) float64 {
|
|||||||
type PewCmd struct {
|
type PewCmd struct {
|
||||||
Max int64 `help:"test no more than X kernels" default:"100500"`
|
Max int64 `help:"test no more than X kernels" default:"100500"`
|
||||||
Runs int64 `help:"runs per each kernel" default:"1"`
|
Runs int64 `help:"runs per each kernel" default:"1"`
|
||||||
Kernel string `help:"override kernel regex"`
|
|
||||||
RootFS string `help:"override rootfs image" type:"existingfile"`
|
RootFS string `help:"override rootfs image" type:"existingfile"`
|
||||||
Guess bool `help:"try all defined kernels"`
|
Guess bool `help:"try all defined kernels"`
|
||||||
Shuffle bool `help:"randomize kernels test order"`
|
Shuffle bool `help:"randomize kernels test order"`
|
||||||
@ -75,6 +74,10 @@ type PewCmd struct {
|
|||||||
Tag string `help:"log tagging"`
|
Tag string `help:"log tagging"`
|
||||||
Timeout time.Duration `help:"timeout after tool will not spawn new tests"`
|
Timeout time.Duration `help:"timeout after tool will not spawn new tests"`
|
||||||
|
|
||||||
|
KernelRegex string `help:"set kernel regex"`
|
||||||
|
DistroID string `help:"set distribution"`
|
||||||
|
DistroRelease string `help:"set distribution release"`
|
||||||
|
|
||||||
ArtifactConfig string `help:"path to artifact config" type:"path"`
|
ArtifactConfig string `help:"path to artifact config" type:"path"`
|
||||||
|
|
||||||
QemuTimeout time.Duration `help:"timeout for qemu"`
|
QemuTimeout time.Duration `help:"timeout for qemu"`
|
||||||
@ -220,14 +223,47 @@ func (cmd *PewCmd) Run(g *Globals) (err error) {
|
|||||||
ka.SourcePath = g.WorkDir
|
ka.SourcePath = g.WorkDir
|
||||||
}
|
}
|
||||||
|
|
||||||
if cmd.Kernel != "" {
|
if cmd.KernelRegex != "" {
|
||||||
var km artifact.Target
|
var km artifact.Target
|
||||||
km, err = kernelMask(cmd.Kernel)
|
km.Kernel.Regex = cmd.KernelRegex
|
||||||
|
|
||||||
|
if cmd.DistroID == "" {
|
||||||
|
err = errors.New("--distro-id is required")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var dt distro.ID
|
||||||
|
dt, err = distro.NewID(cmd.DistroID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
km.Distro.ID = dt
|
||||||
|
|
||||||
|
if cmd.DistroRelease != "" {
|
||||||
|
km.Distro.Release = cmd.DistroRelease
|
||||||
|
}
|
||||||
|
|
||||||
ka.Targets = []artifact.Target{km}
|
ka.Targets = []artifact.Target{km}
|
||||||
|
} else if cmd.DistroID != "" {
|
||||||
|
var km artifact.Target
|
||||||
|
|
||||||
|
var dt distro.ID
|
||||||
|
dt, err = distro.NewID(cmd.DistroID)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
km.Distro.ID = dt
|
||||||
|
|
||||||
|
if cmd.DistroRelease != "" {
|
||||||
|
km.Distro.Release = cmd.DistroRelease
|
||||||
|
}
|
||||||
|
|
||||||
|
ka.Targets = []artifact.Target{km}
|
||||||
|
} else if cmd.DistroRelease != "" {
|
||||||
|
err = errors.New("--distro-release has no use on its own")
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if ka.Qemu.Timeout.Duration == 0 {
|
if ka.Qemu.Timeout.Duration == 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user