syz-ci: allow manager http address auto-assignment

Manually assigning http addresses is tedious and error-prone.
This commit is contained in:
Dmitry Vyukov 2018-09-06 11:15:56 +02:00
parent 596466b38c
commit 5509d25c1d
2 changed files with 8 additions and 2 deletions

View File

@ -103,6 +103,10 @@ func createManager(cfg *Config, mgrcfg *ManagerConfig, stop chan struct{}) *Mana
}
managercfg.Name = cfg.Name + "-" + mgrcfg.Name
managercfg.Syzkaller = filepath.FromSlash("syzkaller/current")
if managercfg.HTTP == "" && cfg.ManagerPort != 0 {
managercfg.HTTP = fmt.Sprintf(":%v", cfg.ManagerPort)
cfg.ManagerPort++
}
kernelDir := filepath.Join(dir, "kernel")
repo, err := vcs.NewRepo(managercfg.TargetOS, managercfg.Type, kernelDir)

View File

@ -68,8 +68,10 @@ import (
var flagConfig = flag.String("config", "", "config file")
type Config struct {
Name string `json:"name"`
HTTP string `json:"http"`
Name string `json:"name"`
HTTP string `json:"http"`
// If manager http address is not specified, give it an address starting from this port. Optional.
ManagerPort int `json:"manager_port_start"`
DashboardAddr string `json:"dashboard_addr"` // Optional.
DashboardClient string `json:"dashboard_client"` // Optional.
DashboardKey string `json:"dashboard_key"` // Optional.