mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-05 21:14:53 +00:00
add digital ocean package
This commit is contained in:
44
test/e2e/pkg/infra/digitalocean/digitalocean.go
Normal file
44
test/e2e/pkg/infra/digitalocean/digitalocean.go
Normal file
@@ -0,0 +1,44 @@
|
||||
package digitalocean
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
e2e "github.com/tendermint/tendermint/test/e2e/pkg"
|
||||
"github.com/tendermint/tendermint/test/e2e/pkg/infra"
|
||||
e2essh "github.com/tendermint/tendermint/test/e2e/pkg/ssh"
|
||||
"golang.org/x/crypto/ssh"
|
||||
)
|
||||
|
||||
const (
|
||||
sshPort = 22
|
||||
testappName = "testappd"
|
||||
)
|
||||
|
||||
var _ infra.Provider = &Provider{}
|
||||
|
||||
// Provider implements a docker-compose backed infrastructure provider.
|
||||
type Provider struct {
|
||||
Testnet *e2e.Testnet
|
||||
InfrastructureData e2e.InfrastructureData
|
||||
SSHConfig *ssh.ClientConfig
|
||||
}
|
||||
|
||||
// Noop currently. Setup is performed externally to the e2e test tool.
|
||||
func (p *Provider) Setup() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Noop currently. Node creation is currently performed externally to the e2e test tool.
|
||||
func (p Provider) CreateNode(ctx context.Context, n *e2e.Node) error {
|
||||
return nil
|
||||
}
|
||||
func (p Provider) StartTendermint(ctx context.Context, n *e2e.Node) error {
|
||||
return e2essh.Exec(p.SSHConfig, fmt.Sprintf("%s:%d", n.IP, sshPort), fmt.Sprintf("systemctl start %s", testappName))
|
||||
}
|
||||
func (p Provider) TerminateTendermint(ctx context.Context, n *e2e.Node) error {
|
||||
return e2essh.Exec(p.SSHConfig, fmt.Sprintf("%s:%d", n.IP, sshPort), fmt.Sprintf("systemctl -s SIGTERM %s", testappName))
|
||||
}
|
||||
func (p Provider) KillTendermint(ctx context.Context, n *e2e.Node) error {
|
||||
return e2essh.Exec(p.SSHConfig, fmt.Sprintf("%s:%d", n.IP, sshPort), fmt.Sprintf("systemctl -s SIGKILL %s", testappName))
|
||||
}
|
||||
Reference in New Issue
Block a user