Back to godoc.org

Package integration

v0.0.0 (8d4b571)
Latest Go to latest
Published: Jul 7, 2020 | License: Apache-2.0 | Module: github.com/chef/automate

Index

Package Files

func AppsCheckSkip

func AppsCheckSkip(testCtx diagnostics.TestContext) (bool, string, error)

func AppsCleanupData

func AppsCleanupData(testCtx diagnostics.TestContext) error

func AppsLoadData

func AppsLoadData(testCtx diagnostics.TestContext) error

func AppsVerifyData

func AppsVerifyData(verifyCtx diagnostics.VerificationTestContext)

func CompliancePurgeDiagnostic

func CompliancePurgeDiagnostic() diagnostics.Diagnostic

CompliancePurgeDiagnostic create the diagnostic for compliance purging

func CreateApplicationsDiagnostic

func CreateApplicationsDiagnostic() diagnostics.Diagnostic

func CreateCLIUpdaterDiagnostic

func CreateCLIUpdaterDiagnostic() diagnostics.Diagnostic

func CreateCfgmgmtActionsDiagnostic

func CreateCfgmgmtActionsDiagnostic() diagnostics.Diagnostic

CreateCfgmgmtActionsDiagnostic create the diagnostic struct for notification rules

func CreateCfgmgmtCCRDiagnostic

func CreateCfgmgmtCCRDiagnostic() diagnostics.Diagnostic

CreateCfgmgmtCCRDiagnostic create the diagnostic struct for ingesting and verifying CCRs

func CreateCfgmgmtJobsConfigDiagnostic

func CreateCfgmgmtJobsConfigDiagnostic() diagnostics.Diagnostic

CreateCfgmgmtJobsConfigDiagnostic creates a diagnostic the checks to make sure the ingest service job config is correctly set after calling stop It assumes people haven't stopped it already

func CreateCfgmgmtLivenessDiagnostic

func CreateCfgmgmtLivenessDiagnostic() diagnostics.Diagnostic

CreateCfgmgmtLivenessDiagnostic creates a diagnostic that sends a liveness ping and verifies they show up in node inventory

func CreateComplianceNodeDiagnostic

func CreateComplianceNodeDiagnostic() diagnostics.Diagnostic

CreateComplianceNodeDiagnostic create the diagnostic struct for compliance node

func CreateComplianceProfileDiagnostic

func CreateComplianceProfileDiagnostic() diagnostics.Diagnostic

CreateComplianceProfileDiagnostic create the diagnostic struct for compliance profile

func CreateComplianceReportDiagnostic

func CreateComplianceReportDiagnostic() diagnostics.Diagnostic

CreateComplianceReportDiagnostic create the diagnostic struct for ingesting and verifying compliance reports

func CreateComplianceReportScanNodesDiagnostic

func CreateComplianceReportScanNodesDiagnostic() diagnostics.Diagnostic

CreateComplianceReportScanNodesDiagnostic create the diagnostic struct for compliance scan job

func CreateComplianceScanJobDiagnostic

func CreateComplianceScanJobDiagnostic() diagnostics.Diagnostic

CreateComplianceScanJobDiagnostic create the diagnostic struct for compliance scan job

func CreateComplianceSecretDiagnostic

func CreateComplianceSecretDiagnostic() diagnostics.Diagnostic

CreateComplianceSecretDiagnostic create the diagnostic struct for compliance secrets

func CreateDeploymentDiagnostic

func CreateDeploymentDiagnostic() diagnostics.Diagnostic

func CreateIAMProjectsDiagnostic

func CreateIAMProjectsDiagnostic() diagnostics.Diagnostic

CreateIAMProjectsDiagnostic creates the diagnostic struct for iam projects

func CreateIAMRolesDiagnostic

func CreateIAMRolesDiagnostic() diagnostics.Diagnostic

CreateIAMRolesDiagnostic creates the diagnostic struct for iam roles

func CreateIAMTeamsDiagnostic

func CreateIAMTeamsDiagnostic() diagnostics.Diagnostic

CreateIAMTeamsDiagnostic creates a diagnostic for iam teams

func CreateIAMTokensDiagnostic

func CreateIAMTokensDiagnostic() diagnostics.Diagnostic

CreateIAMTokensDiagnostic creates the diagnostic struct for iam tokens

func CreateIAMUsersDiagnostic

func CreateIAMUsersDiagnostic() diagnostics.Diagnostic

CreateIAMUsersDiagnostic creates the diagnostic struct for iam users

func CreateIAMV1PoliciesDiagnostic

func CreateIAMV1PoliciesDiagnostic() diagnostics.Diagnostic

CreateIAMV1PoliciesDiagnostic creates the diagnostic struct for iam tokens and v1 policies.

func CreateIAMV2PoliciesDiagnostic

func CreateIAMV2PoliciesDiagnostic() diagnostics.Diagnostic

CreateIAMV2PoliciesDiagnostic creates the diagnostic struct for v2 policies.

func CreateLicenseDiagnostic

func CreateLicenseDiagnostic() diagnostics.Diagnostic

CreateLicenseDiagnostic returns a diagnostic test that tests the license status API endpoint. It does not add a new license but rather only verifies that the applied license hasn't changed.

func CreateNotificationRulesDiagnostic

func CreateNotificationRulesDiagnostic() diagnostics.Diagnostic

CreateNotificationRulesDiagnostic create the diagnostic struct for notification rules

func DeletePolicy

func DeletePolicy(tstCtx diagnostics.TestContext, id string) error

DeletePolicy deletes a policy with the given id

func DeleteProjectWithRule

func DeleteProjectWithRule(tstCtx diagnostics.TestContext, projectID, ruleID string) error

DeleteProjectWithRule deletes the project with the given id and its associated rule

func DeleteRole

func DeleteRole(tstCtx diagnostics.TestContext, id string) error

DeleteRole deletes the role with the given id

func DeleteTeam

func DeleteTeam(tstCtx diagnostics.TestContext, id string) error

DeleteTeam deletes the team with the given id

func DeleteToken

func DeleteToken(tstCtx diagnostics.TestContext, id string) error

DeleteToken deletes the token with the given id

func DeleteUser

func DeleteUser(tstCtx diagnostics.TestContext, username string) error

DeleteUser deletes the given user

func EventFeedPurgeDiagnostic

func EventFeedPurgeDiagnostic() diagnostics.Diagnostic

EventFeedPurgeDiagnostic create the diagnostic for event-feed purging

func GetTeamID

func GetTeamID(tstCtx diagnostics.TestContext, team generatedTeamData) (string, error)

GetTeamID determines which identifier to use when fetching the team, since the ID field is different between IAM v1 and v2

func GetUserID

func GetUserID(user generatedUserData) (string, error)

GetUserID determines which identifier to use when fetching the user, since the ID field is different between IAM v1 and v2

func IngestPurgeDiagnostic

func IngestPurgeDiagnostic() diagnostics.Diagnostic

IngestPurgeDiagnostic create the diagnostic for ingest purging

func MustJSONDecodeSuccess

func MustJSONDecodeSuccess(resp *http.Response, err error) *mustJSONDecodeSuccess

MustJSONDecodeSuccess wraps an http request response and error that must not error and must 200. You can also decode the json value with it, and it must succeed

func Password

func Password() string

Password returns a random password

func Retry

func Retry(times int, backoff time.Duration, f func() error) error

Retry calls f. If f returns an error, it will be retried again after the backoff and at most times times.

func TimestampName

func TimestampName() string

TimestampName returns a name with a timestamp

type AppsDiagnosticsRun

type AppsDiagnosticsRun struct {
	ServiceGroupSuffix string
	Events             []*habitat.HealthCheckEvent
	// For applications testing, the determination of whether to skip the test is
	// based on (more or less) the version of automate. Some Ci scenarios
	// generate data with older automate and then verify it with a newer
	// automate. The test framework does a fresh skip check for each one, which
	// can lead to the verify step being run after the generate step was skipped.
	// To handle that, we persist the skipped state
	Skipped bool
}

type HealthCheckResponse

type HealthCheckResponse struct {
	Stdout     string `json:"stdout"`
	Stderr     string `json:"stderr"`
	ExitStatus int32  `json:"exit_status"`
}

type PolicyInfo

type PolicyInfo struct {
	ID string `json:"id"`
}

PolicyInfo contains info about a created policy

func CreateV1PolicyOnToken

func CreateV1PolicyOnToken(tstCtx diagnostics.TestContext, tokenID string, action string, resource string) (*PolicyInfo, error)

CreateV1PolicyOnToken creates a v1 policy on a given tokenID

func CreateV2Policy

func CreateV2Policy(tstCtx diagnostics.TestContext, pol PolicyParameters) (*PolicyInfo, error)

CreateV2Policy creates a policy using the given policy fields

type PolicyParameters

type PolicyParameters struct {
	TokenID   string
	TeamID    string
	UserID    string
	RoleID    string
	ProjectID string
	RuleID    string
}

PolicyParameters represents policy inputs

type ProjectInfo

type ProjectInfo struct {
	Project struct {
		ID   string `json:"id"`
		Name string `json:"name"`
		Rule Rule
	}
}

ProjectInfo represents the project parameters

func CreateProjectWithRule

func CreateProjectWithRule(tstCtx diagnostics.TestContext, id string) (*ProjectInfo, error)

CreateProjectWithRule creates a project using the given id with an associated rule

func GetProject

func GetProject(tstCtx diagnostics.TestContext, id string) (*ProjectInfo, error)

GetProject fetches the given project and its associated rule

type RoleInfo

type RoleInfo struct {
	Role struct {
		ID      string   `json:"id"`
		Name    string   `json:"name"`
		Actions []string `json:"actions"`
	}
}

RoleInfo represents the role parameters, including v1 and v2 fields.

func CreateRole

func CreateRole(tstCtx diagnostics.TestContext, id string, action string) (*RoleInfo, error)

CreateRole creates a role with the given id and action

func GetRole

func GetRole(tstCtx diagnostics.TestContext, id string) (*RoleInfo, error)

GetRole fetches the given role

type Rule

type Rule struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

Rule represents the rule parameters

type RuleInfo

type RuleInfo struct {
	Rule Rule
}

RuleInfo represents the nested rule response

type RulesInfo

type RulesInfo struct {
	Rules []Rule
}

RulesInfo represents the nested rules response

type ServiceResponse

type ServiceResponse struct {
	ID                string              `json:"id"`
	SupID             string              `json:"supervisor_id"`
	Release           string              `json:"release"`
	HealthCheck       string              `json:"health_check"`
	Application       string              `json:"application"`
	Environment       string              `json:"environment"`
	FQDN              string              `json:"fqdn"`
	Channel           string              `json:"channel"`
	Site              string              `json:"site"`
	HealthCheckResult HealthCheckResponse `json:"health_check_result"`
}

ServiceResponse is a struct that matches the responses returned by the HTTP/JSON API. It omits a few fields that are controlled by the server since they aren't relevant for the kind of testing we are doing here.

An individual service object in a response currently looks like this:

```
{
  "supervisor_id": "44444444-4444-4444-4444-444444444444",
  "release": "test/db/4.4.4/20200101121211",
  "group": "db.diagnostics-run-dc1b29fcc068f7478e6cfce7f63f0ac28c90cae607170fdeb1a21f01738774fd",
  "health_check": "UNKNOWN",
  "application": "test-app",
  "environment": "test-env-4",
  "fqdn": "diagnostics-4.example",
  "channel": "stable",
  "update_strategy": "AT-ONCE",
  "site": "test-site-4",
  "previous_health_check": "NONE",
  "current_health_since": "2 days 19 hours",
  "health_updated_at": "2020-01-24T22:59:22.199956Z",
  "disconnected": true,
  "last_event_occurred_at": "2020-01-25T00:13:32.629672Z",
  "last_event_since": "2 days 18 hours",
  "health_check_result": {
      "stdout": "example stdout",
      "stderr": "example stderr",
      "exit_status": 0
  },
  "id": "1304"
}
```

type ServicesResponse

type ServicesResponse struct {
	Services []ServiceResponse `json:"services"`
}

type TeamInfo

type TeamInfo struct {
	IsV2 bool
	Team struct {
		ID          string   `json:"id"`
		Name        string   `json:"name"`
		Description string   `json:"description"`
		Projects    []string `json:"projects"`
	} `json:"team"`
}

TeamInfo contains information about a team, including v1 and v2 fields. This is returned when creating a team and getting a team

func CreateTeam

func CreateTeam(tstCtx diagnostics.TestContext, id string) (*TeamInfo, error)

CreateTeam creates a team with the given identifier

func GetTeam

func GetTeam(tstCtx diagnostics.TestContext, id string) (*TeamInfo, error)

GetTeam gets the team with the given id

type TokenInfo

type TokenInfo struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Value       string `json:"value"`
	Active      bool   `json:"active"`
}

TokenInfo represents the token parameters, including v1 and v2 fields.

func CreateToken

func CreateToken(tstCtx diagnostics.TestContext, id string) (*TokenInfo, error)

CreateToken creates a token with the given id

func GetToken

func GetToken(tstCtx diagnostics.TestContext, id string) (*TokenInfo, error)

GetToken fetches the given token

type UserInfo

type UserInfo struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Username string `json:"username"`
	Password string
	IsV2     bool
}

UserInfo represents the user parameters, including v1 and v2 fields. Password will be provided only when creating, not when fetching.

func CreateUser

func CreateUser(tstCtx diagnostics.TestContext, id string) (*UserInfo, error)

CreateUser creates a user with the given id

func GetUser

func GetUser(tstCtx diagnostics.TestContext, id string) (*UserInfo, error)

GetUser fetches the given user

type V2PolicyInfo

type V2PolicyInfo struct {
	Policy PolicyInfo
}

V2PolicyInfo represents the nested response from the v2 Policy API.

type V2TokenInfo

type V2TokenInfo struct {
	Token TokenInfo
}

V2TokenInfo represents the nested response from the v2 Token API.

type V2UserInfo

type V2UserInfo struct {
	User UserInfo
}

V2UserInfo represents the nested response from the v2 User API.

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier