Skip to content
This repository was archived by the owner on Sep 17, 2024. It is now read-only.
Merged
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions e2e/_suites/ingest-manager/features/ingest-manager.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
@ingest
Comment thread
mdelapenya marked this conversation as resolved.
Outdated
Feature: Enable Fleet and Deploy Agent

@enroll
Scenario: Deploying an agent
Given the "Fleet" Kibana setup has been executed
When an agent is deployed to Fleet
Then the agent is listed in Fleet as online
And system package dashboards are listed in Fleet
And new documents are inserted into Elasticsearch

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

there is a final step we should ideally do here, we should attempt to re-enroll the Agent with the exact same string as before, but it should fail this time with an error message on the host cli as seen in this usage:

edavis-mbp:elastic-agent-7.8.0-darwin-x86_64-BC5 edavis$ ./elastic-agent enroll https://fc0fe63733904e31ac7aec80b3dbf246.us-central1.gcp.foundit.no:443 R2JSX2dISUJtNzhySTBVS0JXMGM6aEJ6NlZyb0dUUWE3anhBNWRmLU9qQQ==
The Elastic Agent is currently in Experimental and should not be used in production
This will replace your current settings. Do you want to continue? [Y/n]:y
2020-06-04T17:08:33-04:00 DEBUG client.go:178 Request method: POST, path: /api/ingest_manager/fleet/agents/enroll

fail to enroll: fail to execute request to Kibana: Status code: 401, Kibana returned an error: Unauthorized, message: [security_exception] missing authentication credentials for REST request [/_security/_authenticate], with { header={ WWW-Authenticate={ 0="Bearer realm="security"" & 1="ApiKey" & 2="Basic realm="security" charset="UTF-8"" } } }
edavis-mbp:elastic-agent-7.8.0-darwin-x86_64-BC5 edavis$

I suggest if we can, we parse this message for the keywords 'fail' 'unauthorized' (lowercased).

@start-agent
Scenario: Starting the agent starts backend processes
When an agent is deployed to Fleet
Then filebeat is started
And metricbeat is started
Comment thread
mdelapenya marked this conversation as resolved.
Outdated

@stop-agent
Scenario: Stopping the agent stops backend processes
Given an agent is deployed to Fleet
When the agent is stopped on the host
Then filebeat is stopped

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we would need probably more like Then there are '2' metricbeat processes as we will need to check monitoring and ingesting beats

And metricbeat is stopped

@unenroll
Scenario: Un-enrolling an agent
Given an agent is deployed to Fleet
When the agent is un-enrolled
Then the agent is not listed as online in Fleet

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hey @EricDavisX, could we reuse here the step the agent is listed in Fleet as "online"?

Therefore we would have:

the agent is listed in Fleet as "online"
the agent is listed in Fleet as "offline"

which would be one single step. wdyt?

And no new documents are inserted into Elasticsearch

@reenroll
Scenario: Re-enrolling an agent
Given an agent is enrolled
And the agent is un-enrolled
And the Agent is stopped on the host

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Is this one automatically inferred from un-enrolling the agent, or must be done as a separate action?

If the later, I would keep it as is (although from user's perspective it seems more -unproductive?- work)

When the agent is re-enrolled on the host
And the agent is run on the host
Then the agent is listed in Fleet as online
And new documents are inserted into Elasticsearch

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'd like to abstract this step to a more product-related level, as I see it very technical.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what about something like

index `xxx` is created 
And index `xxx` has more than 123 documents

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I like it! What if the number of documents is not there after an amount of time (minutes)?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yes exactly this should fail then


@revoke-token
Scenario: Revoking the enrollment token for an agent
Given an agent is enrolled
When the enrollment token is revoked
And new documents are inserted into Elasticsearch
Then the agent is un-enrolled
And the agent is stopped on the host

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

And the agent cannot be re-enrolled with the same command