2023-02-02 17:15:17 -08:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
|
|
|
|
// SPDX-License-Identifier: BUSL-1.1
|
|
|
|
|
|
2023-06-15 11:51:14 -04:00
|
|
|
package base_test
|
2022-10-10 11:44:01 -04:00
|
|
|
|
|
|
|
|
import "github.com/kelseyhightower/envconfig"
|
|
|
|
|
|
|
|
|
|
type config struct {
|
2023-09-06 17:29:35 -04:00
|
|
|
TargetAddress string `envconfig:"E2E_TARGET_ADDRESS" required:"true"` // e.g. 192.168.0.1
|
|
|
|
|
TargetSshKeyPath string `envconfig:"E2E_SSH_KEY_PATH" required:"true"` // e.g. /Users/username/key.pem
|
|
|
|
|
TargetSshUser string `envconfig:"E2E_SSH_USER" required:"true"` // e.g. ubuntu
|
|
|
|
|
TargetPort string `envconfig:"E2E_TARGET_PORT" required:"true"`
|
2023-11-29 14:17:34 -08:00
|
|
|
MaxPageSize int `envconfig:"E2E_MAX_PAGE_SIZE" default:"1000"`
|
2022-10-10 11:44:01 -04:00
|
|
|
}
|
|
|
|
|
|
2023-05-16 13:06:11 -04:00
|
|
|
func loadTestConfig() (*config, error) {
|
2022-10-10 11:44:01 -04:00
|
|
|
var c config
|
|
|
|
|
err := envconfig.Process("", &c)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-26 16:07:19 -04:00
|
|
|
return &c, nil
|
2022-10-10 11:44:01 -04:00
|
|
|
}
|