Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

Test preconfigured agent policies and output #1680

Merged
merged 10 commits into from
Oct 21, 2021
Merged

Conversation

nchaulet
Copy link
Member

@nchaulet nchaulet commented Oct 19, 2021

Description

Related to elastic/kibana#114285

I changed the preconfigured policies test this test:

  • define a preconfigured policy and a preconfigured output
  • enroll an agent to that preconfigured policy
  • verify the agent is running the policy

I made some change to the test runner:

  • I added a step to select an enrollment token
  • I changed the behavior of the kibana profile step to have the kibana profile use during the whole scenario.

@nchaulet nchaulet self-assigned this Oct 19, 2021
@elasticmachine
Copy link
Contributor

elasticmachine commented Oct 19, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2021-10-21T11:34:33.802+0000

  • Duration: 42 min 39 sec

  • Commit: 938da65

Test stats 🧪

Test Results
Failed 0
Passed 242
Skipped 0
Total 242

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@mdelapenya
Copy link
Contributor

This is a great PR @nchaulet!! Thanks for taking the time in contributing the tests 👏 As soon you mark it as ready for review, I'll accept it, as it LGTM. Please see my previous comments, but they are non-functional related.

@nchaulet nchaulet marked this pull request as ready for review October 19, 2021 17:05
@nchaulet
Copy link
Member Author

/test

Examples: Centos
| os |
| centos |
And the agent run the "Test preconfigured policy" policy
Copy link
Contributor

@mdelapenya mdelapenya Oct 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wdyt about renaming the step to:

    And the agent uses the "Test preconfigured policy" policy

Using run seems very low-level, and we must be close to the business when defining steps. Unless running a policy is part of the vocabulary, of course

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see, we are using the agent uses "A" policy for setting the policy, and the agent runs the "A" policy for checking it indeed was produced, right?

If this is business-correct, then I'm OK too 😃

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can probably change the use step by the agent uses enrollment token from "A" and run step by something like the agent is enrolled into "A" policy it's probably less confusion

@nchaulet
Copy link
Member Author

I do not think we should target 7.15 version as the preconfigured output only appear in 7.16

@nchaulet nchaulet removed the v7.15.0 label Oct 20, 2021
And a "<os>" agent is deployed to Fleet with "tar" installer
When the "elastic-agent" process is in the "started" state on the host
Then the agent is listed in Fleet as "online"
And the agent run the "Test preconfigured policy" policy
And the agent is enrolled into "Test preconfigured policy" policy
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love this step name! 😄

Copy link
Contributor

@mdelapenya mdelapenya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can merge it once the end-of-file issue in the feature file is fixed (pre-commit run end-of-file-fixer --files ./...).

The other 4 errors appeared today and seems related to heartbeat

@nchaulet
Copy link
Member Author

/test

@mdelapenya
Copy link
Contributor

Closes #1680

@nchaulet nchaulet merged commit 56ce765 into master Oct 21, 2021
@nchaulet nchaulet deleted the feature-test-preconfigure branch October 21, 2021 12:29
mergify bot pushed a commit that referenced this pull request Oct 21, 2021
mdelapenya added a commit that referenced this pull request Oct 26, 2021
(cherry picked from commit 56ce765)

Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Manuel de la Peña <mdelapenya@gmail.com>
mdelapenya added a commit that referenced this pull request Dec 3, 2021
The backport added a reference to code implemented in:

   Test preconfigured agent policies and output  (#1680)

But this PR was not backported to 7.15 because there is no support to
preconfigured policies.
mdelapenya added a commit that referenced this pull request Dec 15, 2021
* Support running tests in full VM's (#1740)

* Support running e2e in VM's

Signed-off-by: Adam Stokes <51892+adam-stokes@users.noreply.github.com>
Co-authored-by: Manuel de la Peña <mdelapenya@gmail.com>
(cherry picked from commit 8a94011)

# Conflicts:
#	.ci/.e2e-tests.yaml
#	.ci/Jenkinsfile
#	.gitignore
#	e2e/_suites/fleet/features/fleet_mode_agent.feature
#	e2e/_suites/fleet/features/preconfigured_policies.feature
#	e2e/_suites/fleet/fleet.go
#	go.sum

* Fix conflicts

Signed-off-by: Adam Stokes <51892+adam-stokes@users.noreply.github.com>

* fix: remove not implemented function call

The backport added a reference to code implemented in:

   Test preconfigured agent policies and output  (#1680)

But this PR was not backported to 7.15 because there is no support to
preconfigured policies.

Co-authored-by: Adam Stokes <51892+adam-stokes@users.noreply.github.com>
Co-authored-by: Manuel de la Peña <mdelapenya@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants