installer

package
v0.64.2 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package installer contains code for the E2E tests for the Datadog installer on Windows

Package installer contains code for the E2E tests for the Datadog installer on Windows

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseSuite added in v0.64.0

type BaseSuite struct {
	e2e.BaseSuite[environments.WindowsHost]
	// contains filtered or unexported fields
}

BaseSuite the base suite for all installer tests on Windows (install script, MSI, exe etc...). To run the test suites locally, pick a pipeline and define the following environment variables: E2E_PIPELINE_ID: the ID of the pipeline CURRENT_AGENT_VERSION: pull it from one of the jobs that builds the Agent STABLE_INSTALLER_VERSION_PACKAGE: use `crane ls public.ecr.aws/datadog/installer-package | sort | tail -n 2 | head -n 1` STABLE_AGENT_VERSION_PACKAGE: use `crane ls public.ecr.aws/datadog/agent-package | sort | tail -n 2 | head -n 1` or pick any other version from that registry.

For example:

CI_COMMIT_SHA=ac2acaffab7b039f8c2524df8ae82f9f5fd04d5d;
E2E_PIPELINE_ID=40537701;
CURRENT_AGENT_VERSION=7.57.0-devel+git.370.d429ae3;
STABLE_INSTALLER_VERSION_PACKAGE=7.56.0-installer-0.4.6-1-1
STABLE_AGENT_VERSION_PACKAGE=7.55.2-1

func (*BaseSuite) BeforeTest added in v0.64.0

func (s *BaseSuite) BeforeTest(suiteName, testName string)

BeforeTest creates a new Datadog Installer and sets the output logs directory for each tests

func (*BaseSuite) CurrentAgentVersion added in v0.64.0

func (s *BaseSuite) CurrentAgentVersion() *agentVersion.Version

CurrentAgentVersion the version of the Agent in the current pipeline

func (*BaseSuite) InstallScript added in v0.64.0

func (s *BaseSuite) InstallScript() *DatadogInstallScript

InstallScript The Datadog Install script for testing.

func (*BaseSuite) Installer added in v0.64.0

func (s *BaseSuite) Installer() *DatadogInstaller

Installer The Datadog Installer for testing.

func (*BaseSuite) Require added in v0.64.0

func (s *BaseSuite) Require() *suiteasserts.SuiteAssertions

Require instantiates a suiteAssertions for the current suite. This allows writing assertions in a "natural" way, i.e.:

suite.Require().HasAService(...).WithUserSid(...)

Ideally this suite assertion would exist at a higher level of abstraction so that it could be shared by multiple suites, but for now it exists only on the Windows Datadog installer `BaseSuite` object.

func (*BaseSuite) SetupSuite added in v0.64.0

func (s *BaseSuite) SetupSuite()

SetupSuite checks that the environment variables are correctly setup for the test

func (*BaseSuite) StableAgentVersion added in v0.64.0

func (s *BaseSuite) StableAgentVersion() PackageVersion

StableAgentVersion the version of the last published stable agent

func (*BaseSuite) StableInstallerVersion added in v0.64.0

func (s *BaseSuite) StableInstallerVersion() PackageVersion

StableInstallerVersion the version of the last published stable installer

type DatadogInstallScript added in v0.64.0

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

DatadogInstallScript represents an interface to the Datadog Install script on the remote host.

func NewDatadogInstallScript added in v0.64.0

func NewDatadogInstallScript(env *environments.WindowsHost) *DatadogInstallScript

NewDatadogInstallScript instantiates a new instance of the Datadog Install Script running on a remote Windows host.

func (*DatadogInstallScript) Run added in v0.64.0

func (d *DatadogInstallScript) Run(opts ...Option) (string, error)

Run runs the Datadog Installer install script on the remote host.

type DatadogInstaller

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

DatadogInstaller represents an interface to the Datadog Installer on the remote host.

func NewDatadogInstaller

func NewDatadogInstaller(env *environments.WindowsHost, outputDir string) *DatadogInstaller

NewDatadogInstaller instantiates a new instance of the Datadog Installer running on a remote Windows host.

func (*DatadogInstaller) Install

func (d *DatadogInstaller) Install(opts ...MsiOption) error

Install will attempt to install the Datadog Installer on the remote host. By default, it will use the installer from the current pipeline.

func (*DatadogInstaller) InstallExperiment

func (d *DatadogInstaller) InstallExperiment(packageName string, opts ...installer.PackageOption) (string, error)

InstallExperiment will attempt to use the Datadog Installer to start an experiment for the package given in parameter.

func (*DatadogInstaller) InstallPackage

func (d *DatadogInstaller) InstallPackage(packageName string, opts ...installer.PackageOption) (string, error)

InstallPackage will attempt to use the Datadog Installer to install the package given in parameter. version: A function that returns the version of the package to install. By default, it will install the package matching the current pipeline. This is a function so that it can be combined with Note that this command is a direct command and won't go through the Daemon.

func (*DatadogInstaller) Purge added in v0.61.0

func (d *DatadogInstaller) Purge() (string, error)

Purge runs the purge command, removing all packages

func (*DatadogInstaller) RemoveExperiment

func (d *DatadogInstaller) RemoveExperiment(packageName string) (string, error)

RemoveExperiment requests that the Datadog Installer removes a package on the remote host.

func (*DatadogInstaller) RemovePackage

func (d *DatadogInstaller) RemovePackage(packageName string) (string, error)

RemovePackage requests that the Datadog Installer removes a package on the remote host.

func (*DatadogInstaller) Status added in v0.60.0

func (d *DatadogInstaller) Status() (string, error)

Status returns the status provided by the running daemon

func (*DatadogInstaller) Uninstall

func (d *DatadogInstaller) Uninstall(opts ...MsiOption) error

Uninstall will attempt to uninstall the Datadog Installer on the remote host.

func (*DatadogInstaller) Version

func (d *DatadogInstaller) Version() (string, error)

Version returns the version of the Datadog Installer on the host.

type MsiOption added in v0.64.0

type MsiOption func(*MsiParams) error

MsiOption is an optional function parameter type for the Datadog Installer Install command

func CreateInstallerFolders added in v0.64.0

func CreateInstallerFolders(create bool) MsiOption

CreateInstallerFolders Specifies whether to create some folders that are necessary for the Datadog Installer. Those folders are normally created when using the install script / bootstrapper, but are not when installing the Datadog Installer MSI directly.

func WithMSIArg

func WithMSIArg(arg string) MsiOption

WithMSIArg uses a specific URL for the Datadog Installer Install command instead of using the pipeline URL.

func WithMSILogFile added in v0.58.0

func WithMSILogFile(filename string) MsiOption

WithMSILogFile sets the filename for the MSI log file, to be stored in the output directory.

func WithOption added in v0.64.0

func WithOption(opt Option) MsiOption

WithOption converts an Option to an MsiOption (downcast) allowing to use the base Option methods on with a func that accepts MsiOptions

type MsiParams added in v0.64.0

type MsiParams struct {
	Params
	// contains filtered or unexported fields
}

MsiParams contains the optional parameters for the Datadog Installer Install command

type Option

type Option func(*Params) error

Option is an optional function parameter type for the Params

func WithExtraEnvVars added in v0.64.0

func WithExtraEnvVars(envVars map[string]string) Option

WithExtraEnvVars specifies additional environment variables.

func WithInstallerURL

func WithInstallerURL(installerURL string) Option

WithInstallerURL uses a specific URL for the Datadog Installer Install command instead of using the pipeline URL.

func WithInstallerURLFromInstallersJSON

func WithInstallerURLFromInstallersJSON(jsonURL, version string) Option

WithInstallerURLFromInstallersJSON uses a specific URL for the Datadog Installer from an installers_v2.json file. jsonURL: The URL of the installers_v2.json file, i.e. pipeline.StableURL version: The artifact version to retrieve, i.e. "7.56.0-installer-0.4.5-1"

Example: WithInstallerURLFromInstallersJSON(pipeline.StableURL, "7.56.0-installer-0.4.5-1") will look into "https://s3.amazonaws.com/ddagent-windows-stable/stable/installers_v2.json" for the Datadog Installer version "7.56.0-installer-0.4.5-1"

type PackageVersion

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

PackageVersion is a helper type to store both the version and the package version of a binary. The package version has the "-1" suffix, whereas the binary's "version" command does not contain the "-1" suffix.

func (PackageVersion) PackageVersion

func (v PackageVersion) PackageVersion() string

PackageVersion the version with the package suffix

func (PackageVersion) Version

func (v PackageVersion) Version() string

Version the version without the package suffix

type Params

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

Params contains the optional parameters for the Datadog Install Script command

Directories

Path Synopsis
Package consts list the common packages paths used in the Datadog Installer tests.
Package consts list the common packages paths used in the Datadog Installer tests.
Package assertions provide custom assertions for Windows tests
Package assertions provide custom assertions for Windows tests
Package suiteasserts extends require.Assertions with custom assertions
Package suiteasserts extends require.Assertions with custom assertions
suites

Jump to

Keyboard shortcuts

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