2020-06-24 10:52:23 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2020-06-24 15:39:37 +00:00
|
|
|
"os"
|
2020-06-24 10:52:23 +00:00
|
|
|
|
2020-06-24 14:46:12 +00:00
|
|
|
"github.com/filecoin-project/lotus/build"
|
|
|
|
"github.com/filecoin-project/specs-actors/actors/abi"
|
|
|
|
"github.com/filecoin-project/specs-actors/actors/abi/big"
|
|
|
|
"github.com/filecoin-project/specs-actors/actors/builtin/power"
|
|
|
|
"github.com/filecoin-project/specs-actors/actors/builtin/verifreg"
|
2020-06-24 10:52:23 +00:00
|
|
|
"github.com/testground/sdk-go/run"
|
|
|
|
"github.com/testground/sdk-go/runtime"
|
2020-06-24 14:46:12 +00:00
|
|
|
|
|
|
|
saminer "github.com/filecoin-project/specs-actors/actors/builtin/miner"
|
|
|
|
logging "github.com/ipfs/go-log/v2"
|
2020-06-24 10:52:23 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
var testplans = map[string]interface{}{
|
|
|
|
"lotus-baseline": doRun(baselineRoles),
|
|
|
|
}
|
|
|
|
|
2020-06-24 14:46:12 +00:00
|
|
|
func init() {
|
2020-06-25 10:00:56 +00:00
|
|
|
logging.SetLogLevel("*", "ERROR")
|
2020-06-24 14:46:12 +00:00
|
|
|
|
|
|
|
build.DisableBuiltinAssets = true
|
|
|
|
|
|
|
|
// Note: I don't understand the significance of this, but the node test does it.
|
|
|
|
power.ConsensusMinerMinPower = big.NewInt(2048)
|
|
|
|
saminer.SupportedProofTypes = map[abi.RegisteredSealProof]struct{}{
|
|
|
|
abi.RegisteredSealProof_StackedDrg2KiBV1: {},
|
|
|
|
}
|
|
|
|
verifreg.MinVerifiedDealSize = big.NewInt(256)
|
2020-06-24 15:39:37 +00:00
|
|
|
|
|
|
|
build.InsecurePoStValidation = true
|
|
|
|
os.Setenv("BELLMAN_NO_GPU", "1")
|
2020-06-24 14:46:12 +00:00
|
|
|
}
|
|
|
|
|
2020-06-24 10:52:23 +00:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|