plump infra data into tests

This commit is contained in:
William Banfield
2022-11-30 17:50:27 -05:00
parent 5e8028da5d
commit 46ab7a376d
4 changed files with 40 additions and 5 deletions
+6
View File
@@ -17,6 +17,7 @@ const (
// InfrastructureData contains the relevant information for a set of existing
// infrastructure that is to be used for running a testnet.
type InfrastructureData struct {
path string
// Provider is the name of infrastructure provider backing the testnet.
// For example, 'docker' if it is running locally in a docker network or
@@ -41,6 +42,10 @@ type InstanceData struct {
Port uint32 `json:"port"`
}
func (i InfrastructureData) Path() string {
return i.path
}
func NewDockerInfrastructureData(m Manifest) (InfrastructureData, error) {
netAddress := dockerIPv4CIDR
if m.IPv6 {
@@ -80,5 +85,6 @@ func InfrastructureDataFromFile(p string) (InfrastructureData, error) {
if ifd.Network == "" {
ifd.Network = globalIPv4CIDR
}
ifd.path = p
return ifd, nil
}