Documentation ¶
Overview ¶
Package framework provides a testing framework for MarbleRun integration testing.
Index ¶
- func MakeEnv(key, value string) string
- type CoordinatorConfig
- type IntegrationTest
- func (i IntegrationTest) GetMarbleCmd(cfg MarbleConfig) *exec.Cmd
- func (i IntegrationTest) GetStatus() (string, error)
- func (i IntegrationTest) SetManifest(manifest manifest.Manifest) ([]byte, error)
- func (i IntegrationTest) SetRecover(recoveryKey []byte) error
- func (i IntegrationTest) SetUpdateManifest(manifest manifest.Manifest, certPEM []byte, key *rsa.PrivateKey) ([]byte, error)
- func (i IntegrationTest) StartCommand(cmd *exec.Cmd) chan string
- func (i IntegrationTest) StartCoordinator(cfg CoordinatorConfig) *os.Process
- func (i IntegrationTest) StartMarbleClient(cfg MarbleConfig) bool
- func (i IntegrationTest) StartMarbleServer(cfg MarbleConfig) *os.Process
- func (i IntegrationTest) TriggerRecovery(coordinatorCfg CoordinatorConfig, coordinatorProc *os.Process) (*os.Process, string)
- func (i IntegrationTest) UpdateManifest()
- func (i IntegrationTest) VerifyCertAfterRecovery(cert string, coordinatorProc *os.Process, cfg CoordinatorConfig) *os.Process
- func (i IntegrationTest) VerifyResetAfterRecovery(coordinatorProc *os.Process, cfg CoordinatorConfig) *os.Process
- type MarbleConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CoordinatorConfig ¶
type CoordinatorConfig struct {
// contains filtered or unexported fields
}
CoordinatorConfig contains the configuration for the Coordinator.
func NewCoordinatorConfig ¶
func NewCoordinatorConfig(extraEnv ...string) CoordinatorConfig
NewCoordinatorConfig creates a new CoordinatorConfig.
func (CoordinatorConfig) Cleanup ¶
func (c CoordinatorConfig) Cleanup()
Cleanup removes the seal directory.
type IntegrationTest ¶
type IntegrationTest struct { TestManifest manifest.Manifest UpdatedManifest manifest.Manifest BuildDir string SimulationFlag string NoEnclave bool MeshServerAddr string ClientServerAddr string MarbleTestAddr string // contains filtered or unexported fields }
IntegrationTest is a testing framework for MarbleRun tests.
func New ¶
func New(t *testing.T, buildDir, simulation string, noenclave bool, marbleTestAddr, meshServerAddr, clientServerAddr, testManifest, updatedManifest string, ) *IntegrationTest
New creates a new IntegrationTest.
func (IntegrationTest) GetMarbleCmd ¶
func (i IntegrationTest) GetMarbleCmd(cfg MarbleConfig) *exec.Cmd
GetMarbleCmd returns the command to start a Marble.
func (IntegrationTest) GetStatus ¶
func (i IntegrationTest) GetStatus() (string, error)
GetStatus returns the status of the Coordinator.
func (IntegrationTest) SetManifest ¶
func (i IntegrationTest) SetManifest(manifest manifest.Manifest) ([]byte, error)
SetManifest sets the manifest of the Coordinator.
func (IntegrationTest) SetRecover ¶
func (i IntegrationTest) SetRecover(recoveryKey []byte) error
SetRecover sets the recovery key of the Coordinator.
func (IntegrationTest) SetUpdateManifest ¶
func (i IntegrationTest) SetUpdateManifest(manifest manifest.Manifest, certPEM []byte, key *rsa.PrivateKey) ([]byte, error)
SetUpdateManifest sets performs a manifest update for the Coordinator.
func (IntegrationTest) StartCommand ¶
func (i IntegrationTest) StartCommand(cmd *exec.Cmd) chan string
StartCommand starts the given command and returns a channel that contains the output.
func (IntegrationTest) StartCoordinator ¶
func (i IntegrationTest) StartCoordinator(cfg CoordinatorConfig) *os.Process
StartCoordinator starts the Coordinator defined by the given config.
func (IntegrationTest) StartMarbleClient ¶
func (i IntegrationTest) StartMarbleClient(cfg MarbleConfig) bool
StartMarbleClient starts a Client Marble.
func (IntegrationTest) StartMarbleServer ¶
func (i IntegrationTest) StartMarbleServer(cfg MarbleConfig) *os.Process
StartMarbleServer starts a Server Marble.
func (IntegrationTest) TriggerRecovery ¶
func (i IntegrationTest) TriggerRecovery(coordinatorCfg CoordinatorConfig, coordinatorProc *os.Process) (*os.Process, string)
TriggerRecovery triggers a recovery.
func (IntegrationTest) UpdateManifest ¶
func (i IntegrationTest) UpdateManifest()
UpdateManifest updates the manifest with the uniqueID, signerID, productID and securityVersion of the testing marble.
func (IntegrationTest) VerifyCertAfterRecovery ¶
func (i IntegrationTest) VerifyCertAfterRecovery(cert string, coordinatorProc *os.Process, cfg CoordinatorConfig) *os.Process
VerifyCertAfterRecovery verifies the certificate after a recovery.
func (IntegrationTest) VerifyResetAfterRecovery ¶
func (i IntegrationTest) VerifyResetAfterRecovery(coordinatorProc *os.Process, cfg CoordinatorConfig) *os.Process
VerifyResetAfterRecovery verifies the Coordinator after a recovery as been reset by setting a new manifest.
type MarbleConfig ¶
type MarbleConfig struct {
// contains filtered or unexported fields
}
MarbleConfig contains the configuration for a Marble.
func NewMarbleConfig ¶
func NewMarbleConfig(coordinatorAddr, marbleType, dnsNames string) MarbleConfig
NewMarbleConfig creates a new MarbleConfig.
func (MarbleConfig) Cleanup ¶
func (c MarbleConfig) Cleanup()
Cleanup removes the data directory of the Marble.