Documentation ¶
Index ¶
- func CreateMultinodeSampleCluster(baseDir string) *greenplum.Cluster
- func CreateMultinodeSampleClusterPair(baseDir string) (*greenplum.Cluster, *greenplum.Cluster)
- func CreateTablespaces() greenplum.Tablespaces
- func FinishMock(mock sqlmock.Sqlmock, t *testing.T)
- func GetTempDir(t *testing.T, prefix string) string
- func MockCluster() *greenplum.Cluster
- func MockSegmentConfiguration() *sqlmock.Rows
- func MustAddTablespace(t *testing.T, cluster greenplum.Cluster, tablespaceDir string)
- func MustApplySQLFile(t *testing.T, gphome string, port string, path string)
- func MustClearEnv(t *testing.T, envar string) func()
- func MustConvertStringToInt(t *testing.T, input string) int
- func MustCreateDataDirs(t *testing.T) (string, string, func(*testing.T))
- func MustCreateDir(t *testing.T, path string)
- func MustCreateDirRemotely(t *testing.T, host string, path string)
- func MustCreateFilespaceAndTablespace(t *testing.T, cluster greenplum.Cluster, tablespaceDir string)
- func MustCreateTablespace(t *testing.T, cluster greenplum.Cluster, tablespaceDir string)
- func MustDeleteTablespaces(t *testing.T, source greenplum.Cluster, target greenplum.Cluster)
- func MustExecuteSQL(t *testing.T, connection string, query string) int
- func MustGetEnv(key string) string
- func MustGetExecutablePath(t *testing.T) string
- func MustGetLog(t *testing.T, process string) string
- func MustGetPort(t *testing.T) int
- func MustListenOnPort(t *testing.T, port int) func()
- func MustMakeTablespaceDir(t *testing.T, tablespaceOid int) (string, string, string)
- func MustMoveRemoteFile(t *testing.T, host string, source string, destination string)
- func MustQuery(t *testing.T, connection string, query string) interface{}
- func MustQueryRow(t *testing.T, connection string, query string) int
- func MustReadFile(t *testing.T, path string) string
- func MustRemoveAll(t *testing.T, dir string)
- func MustRemoveAllRemotely(t *testing.T, host string, path string)
- func MustRename(t *testing.T, oldPath string, newPath string)
- func MustTruncateTablespaces(t *testing.T, cluster greenplum.Cluster)
- func MustWriteToFile(t *testing.T, path string, contents string)
- func MustWriteToRemoteFile(t *testing.T, host string, path string, contents string)
- func PathMustExist(t *testing.T, path string)
- func PathMustNotExist(t *testing.T, path string)
- func RemotePathMustExist(t *testing.T, host string, path string)
- func RemotePathMustNotExist(t *testing.T, host string, path string)
- func RemoteProcessMustBeRunning(t *testing.T, host string, process string)
- func RemoteProcessMustNotBeRunning(t *testing.T, host string, process string)
- func SetEnv(t *testing.T, envar, value string) func()
- func SetStdin(t *testing.T, input string) func()
- func VerifyClusterIsRunning(t *testing.T, cluster greenplum.Cluster)
- func VerifyClusterIsStopped(t *testing.T, cluster greenplum.Cluster)
- func VerifyRename(t *testing.T, source, target string)
- func VerifyTablespaceData(t *testing.T, cluster greenplum.Cluster)
- type DevNullSpy
- type FailingStreams
- type FailingWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateMultinodeSampleCluster ¶
TODO remove in favor of MustCreateCluster
func CreateMultinodeSampleClusterPair ¶
TODO remove in favor of MustCreateCluster
func CreateTablespaces ¶
func CreateTablespaces() greenplum.Tablespaces
func FinishMock ¶
finishMock is a defer function to make the sqlmock API a little bit more like gomock. Use it like this:
db, mock, err := sqlmock.New() if err != nil { t.Fatalf("couldn't create sqlmock: %v", err) } defer finishMock(mock, t)
func MockCluster ¶
MockCluster returns the Cluster equivalent of MockSegmentConfiguration().
When changing this implementation, make sure you change MockSegmentConfiguration() to match!
func MockSegmentConfiguration ¶
MockSegmentConfiguration returns a set of sqlmock.Rows that contains the expected response to a gp_segment_configuration query.
When changing this implementation, make sure you change MockCluster() to match!
func MustAddTablespace ¶
func MustApplySQLFile ¶
func MustClearEnv ¶
MustClearEnv makes sure envar is cleared, and returns a function to be used in a defer that resets the state to what it was prior to this function being called.
func MustCreateDataDirs ¶
MustCreateDataDirs returns a temporary source and target data directory that looks like a postgres directory. The last argument returned is a cleanup function that can be used in a defer.
func MustCreateDir ¶
func MustCreateTablespace ¶
func MustDeleteTablespaces ¶
MustDeleteTablespaces deletes tablespaces from the target cluster. However, since we do not yet support upgrading tablespaces from version GPDB 6+ we do not need to delete them as they do not exist.
func MustGetEnv ¶
func MustGetExecutablePath ¶
func MustGetPort ¶
func MustListenOnPort ¶
MustListenOnPort listens on the specified port and returns a cleanup function that can be used in a defer clause.
func MustMakeTablespaceDir ¶
MustMakeTablespaceDir returns a temporary tablespace directory, its parent dbID directory, and its grandparent tablespace location. The location should be removed for cleanup.
func MustMoveRemoteFile ¶
func MustRemoveAll ¶
func MustTruncateTablespaces ¶
func MustWriteToRemoteFile ¶
MustWriteToRemoteFile writes a local file in a temp directory and rsync's it to the remote host. It does this since writing remotely is difficult and error prone.
func PathMustExist ¶
func PathMustNotExist ¶
func VerifyRename ¶
VerifyRename ensures the source and archive data directories exist, and the target directory does not exist.
Types ¶
type DevNullSpy ¶
DevNullWithClose implements step.OutStreams
func (DevNullSpy) Stderr ¶
func (s DevNullSpy) Stderr() io.Writer
func (DevNullSpy) Stdout ¶
func (s DevNullSpy) Stdout() io.Writer
type FailingStreams ¶
type FailingStreams struct {
Err error
}
FailingStreams is an implementation of OutStreams for which every call to a stream's Write() method will fail with the given error.
func (FailingStreams) Stderr ¶
func (f FailingStreams) Stderr() io.Writer
func (FailingStreams) Stdout ¶
func (f FailingStreams) Stdout() io.Writer
type FailingWriter ¶
type FailingWriter struct {
Err error
}
FailingWriter is an io.Writer for which all calls to Write() return an error.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package exectest provides helpers for test code that wants to mock out pieces of the os/exec package, namely exec.Command().
|
Package exectest provides helpers for test code that wants to mock out pieces of the os/exec package, namely exec.Command(). |