condortest

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package condortest provides a reusable in-process HTCondor test harness.

It stands up a real, ephemeral HTCondor pool (master, collector, shared port, and schedd) via condor_master so that integration tests in any package can exercise CEDAR against a live pool. Tests that use this package are skipped automatically when condor_master is not available in PATH.

Although this is a regular (non _test.go) source file, it intentionally imports the testing package: this is the idiomatic way to share a test harness across multiple Go packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Harness

type Harness struct {
	// contains filtered or unexported fields
}

Harness manages a mini HTCondor instance for integration testing.

func New

func New(t *testing.T) *Harness

New creates and starts a mini HTCondor instance via condor_master.

func NewWithConfig

func NewWithConfig(t *testing.T, extraConfig string) *Harness

NewWithConfig allows injecting extra HTCondor config lines (e.g., extra daemons).

func (*Harness) CACertFile

func (h *Harness) CACertFile() string

CACertFile returns the path to the generated CA certificate.

func (*Harness) ConfigDir

func (h *Harness) ConfigDir() string

ConfigDir returns the directory containing the generated condor_config.

func (*Harness) GetCollectorAddr

func (h *Harness) GetCollectorAddr() string

GetCollectorAddr returns the collector address.

func (*Harness) GetCollectorAlias

func (h *Harness) GetCollectorAlias() string

GetCollectorAlias extracts the alias from the collector sinful string. Sinful string format: <127.0.0.1:52504?addrs=127.0.0.1-52504&alias=f4hp7ql65f-2.local>

func (*Harness) GetCollectorHost

func (h *Harness) GetCollectorHost() string

GetCollectorHost returns the collector host.

func (*Harness) GetCollectorPort

func (h *Harness) GetCollectorPort() int

GetCollectorPort returns the collector port.

func (*Harness) HostCertFile

func (h *Harness) HostCertFile() string

HostCertFile returns the path to the generated host certificate.

func (*Harness) HostKeyFile

func (h *Harness) HostKeyFile() string

HostKeyFile returns the path to the generated host private key.

func (*Harness) PasswordDir

func (h *Harness) PasswordDir() string

PasswordDir returns the directory containing the pool signing key(s).

func (*Harness) PrintAllLogs

func (h *Harness) PrintAllLogs()

PrintAllLogs prints all HTCondor logs for debugging.

func (*Harness) QuerySchedAds

func (h *Harness) QuerySchedAds(t *testing.T) (int, string, error)

QuerySchedAds queries the collector for schedd ads and returns the count and any found address.

func (*Harness) Shutdown

func (h *Harness) Shutdown(t *testing.T)

Shutdown stops the HTCondor master instance.

func (*Harness) SocketDir

func (h *Harness) SocketDir() string

SocketDir returns the pool's DAEMON_SOCKET_DIR, the directory the condor_shared_port daemon watches for endpoint sockets.

func (*Harness) SupportsAuthMethod

func (h *Harness) SupportsAuthMethod(method string) bool

SupportsAuthMethod checks if HTCondor supports a specific authentication method by querying the collector's capabilities.

func (*Harness) TmpDir

func (h *Harness) TmpDir() string

TmpDir returns the harness temporary directory. Tests can place generated tokens and other scratch files here.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL