mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-11 07:20:19 +00:00
add the infrastructure types
This commit is contained in:
20
test/e2e/pkg/infrastructure.go
Normal file
20
test/e2e/pkg/infrastructure.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package e2e
|
||||
|
||||
import "net"
|
||||
|
||||
// InfrastructureData contains the relevant information for a set of existing
|
||||
// infrastructure that is to be used for running a testnet.
|
||||
type InfrastructureData struct {
|
||||
|
||||
// Instances is a map of all of the machine instances on which to run
|
||||
// processes for a testnet.
|
||||
// The key of the map is the name of the instance, which each must correspond
|
||||
// to the names of one of the testnet nodes defined in the testnet manifest.
|
||||
Instances map[string]InstanceData `json:"instances"`
|
||||
}
|
||||
|
||||
// InstanceData contains the relevant information for a machine instance backing
|
||||
// one of the nodes in the testnet.
|
||||
type InstanceData struct {
|
||||
IPAddress net.IP `json:"ip_address"`
|
||||
}
|
||||
@@ -53,7 +53,7 @@ func NewCLI() *CLI {
|
||||
if err := Cleanup(cli.testnet); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Setup(cli.testnet); err != nil {
|
||||
if err := Setup(cli.testnet, e2e.InfrastructureData{}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ func NewCLI() *CLI {
|
||||
Use: "setup",
|
||||
Short: "Generates the testnet directory and configuration",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
return Setup(cli.testnet)
|
||||
return Setup(cli.testnet, e2e.InfrastructureData{})
|
||||
},
|
||||
})
|
||||
|
||||
@@ -135,7 +135,7 @@ func NewCLI() *CLI {
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
_, err := os.Stat(cli.testnet.Dir)
|
||||
if os.IsNotExist(err) {
|
||||
err = Setup(cli.testnet)
|
||||
err = Setup(cli.testnet, e2e.InfrastructureData{})
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -258,7 +258,7 @@ Does not run any perbutations.
|
||||
if err := Cleanup(cli.testnet); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Setup(cli.testnet); err != nil {
|
||||
if err := Setup(cli.testnet, e2e.InfrastructureData{}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ const (
|
||||
)
|
||||
|
||||
// Setup sets up the testnet configuration.
|
||||
func Setup(testnet *e2e.Testnet) error {
|
||||
func Setup(testnet *e2e.Testnet, ifd e2e.InfrastructureData) error {
|
||||
logger.Info("setup", "msg", log.NewLazySprintf("Generating testnet files in %q", testnet.Dir))
|
||||
|
||||
err := os.MkdirAll(testnet.Dir, os.ModePerm)
|
||||
|
||||
Reference in New Issue
Block a user