2020-06-24 10:52:23 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"github.com/testground/sdk-go/run"
|
|
|
|
"github.com/testground/sdk-go/runtime"
|
|
|
|
)
|
|
|
|
|
|
|
|
var testplans = map[string]interface{}{
|
|
|
|
"lotus-baseline": doRun(baselineRoles),
|
|
|
|
}
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
run.InvokeMap(testplans)
|
|
|
|
}
|
|
|
|
|
|
|
|
func doRun(roles map[string]func(*TestEnvironment) error) run.InitializedTestCaseFn {
|
|
|
|
return func(runenv *runtime.RunEnv, initCtx *run.InitContext) error {
|
|
|
|
role := runenv.StringParam("role")
|
2020-06-24 11:02:20 +00:00
|
|
|
proc, ok := roles[role]
|
2020-06-24 10:52:23 +00:00
|
|
|
if ok {
|
|
|
|
return proc(&TestEnvironment{RunEnv: runenv, InitContext: initCtx})
|
|
|
|
}
|
|
|
|
return fmt.Errorf("Unknown role: %s", role)
|
|
|
|
}
|
|
|
|
}
|