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

Commit

Permalink
Merge branch '7.11.x' into backport/7.11.x/pr-866
Browse files Browse the repository at this point in the history
  • Loading branch information
mdelapenya authored Mar 12, 2021
2 parents cad6581 + 3816a99 commit 0473d47
Show file tree
Hide file tree
Showing 7 changed files with 245 additions and 40 deletions.
5 changes: 5 additions & 0 deletions .ci/.e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@ SUITES:
- "ubuntu-18.04"
scenarios:
- name: "Fleet"
pullRequestFilter: " && ~debian"
tags: "fleet_mode_agent"
- name: "Endpoint Integration"
pullRequestFilter: " && ~debian"
tags: "agent_endpoint_integration"
- name: "Stand-alone"
pullRequestFilter: " && ~ubi8"
tags: "stand_alone_agent"
- name: "Backend Processes"
pullRequestFilter: " && ~debian"
tags: "backend_processes"
- suite: "metricbeat"
platforms:
Expand All @@ -45,6 +49,7 @@ SUITES:
- name: "Metricbeat"
tags: "metricbeat"
- name: "MySQL"
pullRequestFilter: " && ~old_versions"
tags: "integrations && mysql"
- name: "Oracle"
tags: "integrations && oracle"
Expand Down
8 changes: 7 additions & 1 deletion .ci/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,13 @@ def checkTestSuite(Map parallelTasks = [:], Map item = [:]) {
def suite = item.suite
def platforms = item.platforms
item.scenarios.each { scenario ->
def pullRequestFilter = scenario.containsKey('pullRequestFilter') ? scenario.pullRequestFilter : ''
def tags = scenario.tags
def regexps = [ "^e2e/_suites/${suite}/.*", "^.ci/.*", "^cli/.*", "^e2e/.*\\.go" ]
if ("${FORCE_SKIP_GIT_CHECKS}" == "true" || isGitRegionMatch(patterns: regexps, shouldMatchAll: false)) {
platforms.each { platform ->
log(level: 'INFO', text: "Adding ${platform}:${suite}:${tags} test suite to the build execution")
parallelTasks["${platform}_${suite}_${tags}"] = generateFunctionalTestStep(platform: "${platform}", suite: "${suite}", tags: "${tags}")
parallelTasks["${platform}_${suite}_${tags}"] = generateFunctionalTestStep(platform: "${platform}", suite: "${suite}", tags: "${tags}", pullRequestFilter: "${pullRequestFilter}")
}
} else {
log(level: 'WARN', text: "The ${suite}:${tags} test suite won't be executed because there are no modified files")
Expand Down Expand Up @@ -307,6 +308,7 @@ def generateFunctionalTestStep(Map args = [:]){
def platform = args.get('platform')
def suite = args.get('suite')
def tags = args.get('tags')
def pullRequestFilter = args.get('pullRequestFilter')?.trim() ? args.get('pullRequestFilter') : ''

// We will decide whether to include the nightly tests in the execution at CI time, only.
// On the other hand, the developers can use the TAGS environment variable locally.
Expand All @@ -317,6 +319,10 @@ def generateFunctionalTestStep(Map args = [:]){
}
tags += excludeNightlyTag

if (isPR() || isUpstreamTrigger(filter: 'PR-')) {
tags += pullRequestFilter
}

return {
node("${platform} && immutable && docker") {
try {
Expand Down
72 changes: 60 additions & 12 deletions e2e/_suites/fleet/features/agent_endpoint_integration.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,84 @@ Feature: Agent Endpoint Integration
Scenarios for Agent to deploy Endpoint and sending data to Fleet and Elasticsearch.

@deploy-endpoint-with-agent
Scenario: Adding the Endpoint Integration to an Agent makes the host to show in Security App
Given a "centos" agent is deployed to Fleet with "tar" installer
Scenario Outline: Adding the Endpoint Integration to an Agent makes the host to show in Security App
Given a "<os>" agent is deployed to Fleet with "tar" installer
And the agent is listed in Fleet as "online"
When the "Endpoint Security" integration is "added" in the policy
Then the "Endpoint Security" datasource is shown in the policy as added
And the host name is shown in the Administration view in the Security App as "online"

@centos
Examples: Centos
| os |
| centos |

@debian
Examples: Debian
| os |
| debian |

@endpoint-policy-check
Scenario: Deploying an Endpoint makes policies to appear in the Security App
When an Endpoint is successfully deployed with a "centos" Agent using "tar" installer
Scenario Outline: Deploying an Endpoint makes policies to appear in the Security App
When an Endpoint is successfully deployed with a "<os>" Agent using "tar" installer
Then the policy response will be shown in the Security App

@centos
Examples: Centos
| os |
| centos |

@debian
Examples: Debian
| os |
| debian |

@set-policy-and-check-changes
Scenario: Changing an Agent policy is reflected in the Security App
Given an Endpoint is successfully deployed with a "centos" Agent using "tar" installer
Scenario Outline: Changing an Agent policy is reflected in the Security App
Given an Endpoint is successfully deployed with a "<os>" Agent using "tar" installer
When the policy is updated to have "malware" in "detect" mode
Then the policy will reflect the change in the Security App

@centos
Examples: Centos
| os |
| centos |

@debian
Examples: Debian
| os |
| debian |

@deploy-endpoint-then-unenroll-agent
Scenario: Un-enrolling Elastic Agent stops Elastic Endpoint
Given an Endpoint is successfully deployed with a "centos" Agent using "tar" installer
Scenario Outline: Un-enrolling Elastic Agent stops Elastic Endpoint
Given an Endpoint is successfully deployed with a "<os>" Agent using "tar" installer
When the agent is un-enrolled
Then the agent is listed in Fleet as "inactive"
And the host name is not shown in the Administration view in the Security App
And the "elastic-endpoint" process is in the "stopped" state on the host

@centos
Examples: Centos
| os |
| centos |

@debian
Examples: Debian
| os |
| debian |

@deploy-endpoint-then-remove-it-from-policy
Scenario: Removing Endpoint from Agent policy stops the connected Endpoint
Given an Endpoint is successfully deployed with a "centos" Agent using "tar" installer
Scenario Outline: Removing Endpoint from Agent policy stops the connected Endpoint
Given an Endpoint is successfully deployed with a "<os>" Agent using "tar" installer
When the "Endpoint Security" integration is "removed" in the policy
Then the agent is listed in Fleet as "online"
But the host name is not shown in the Administration view in the Security App
And the "elastic-endpoint" process is in the "stopped" state on the host

@centos
Examples: Centos
| os |
| centos |

@debian
Examples: Debian
| os |
| debian |
96 changes: 88 additions & 8 deletions e2e/_suites/fleet/features/backend_processes.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,15 @@ Scenario Outline: Deploying the <os> agent
When the "elastic-agent" process is in the "started" state on the host
Then the "filebeat" process is in the "started" state on the host
And the "metricbeat" process is in the "started" state on the host
Examples:

@centos
Examples: Centos
| os |
| centos |

@debian
Examples: Debian
| os |
| debian |

@enroll
Expand All @@ -19,9 +25,15 @@ Scenario Outline: Deploying the <os> agent with enroll and then run on rpm and d
When the "elastic-agent" process is in the "started" state on the host
Then the "filebeat" process is in the "started" state on the host
And the "metricbeat" process is in the "started" state on the host
Examples:

@centos
Examples: Centos
| os |
| centos |

@debian
Examples: Debian
| os |
| debian |

@stop-agent
Expand All @@ -30,9 +42,15 @@ Scenario Outline: Stopping the <os> agent stops backend processes
When the "elastic-agent" process is "stopped" on the host
Then the "filebeat" process is in the "stopped" state on the host
And the "metricbeat" process is in the "stopped" state on the host
Examples:

@centos
Examples: Centos
| os |
| centos |

@debian
Examples: Debian
| os |
| debian |

@restart-agent
Expand All @@ -41,9 +59,15 @@ Scenario Outline: Restarting the installed <os> agent
When the "elastic-agent" process is "restarted" on the host
Then the "filebeat" process is in the "started" state on the host
And the "metricbeat" process is in the "started" state on the host
Examples:

@centos
Examples: Centos
| os |
| centos |

@debian
Examples: Debian
| os |
| debian |

@restart-host
Expand All @@ -53,9 +77,15 @@ Scenario Outline: Restarting the <os> host with persistent agent restarts backen
Then the "elastic-agent" process is in the "started" state on the host
And the "filebeat" process is in the "started" state on the host
And the "metricbeat" process is in the "started" state on the host
Examples:

@centos
Examples: Centos
| os |
| centos |

@debian
Examples: Debian
| os |
| debian |

@unenroll
Expand All @@ -65,9 +95,15 @@ Scenario Outline: Un-enrolling the <os> agent stops backend processes
Then the "elastic-agent" process is in the "started" state on the host
And the "filebeat" process is in the "stopped" state on the host
And the "metricbeat" process is in the "stopped" state on the host
Examples:

@centos
Examples: Centos
| os |
| centos |

@debian
Examples: Debian
| os |
| debian |

@reenroll
Expand All @@ -77,9 +113,15 @@ Scenario Outline: Re-enrolling the <os> agent starts the elastic-agent process
And the "elastic-agent" process is "stopped" on the host
When the agent is re-enrolled on the host
Then the "elastic-agent" process is "started" on the host
Examples:

@centos
Examples: Centos
| os |
| centos |

@debian
Examples: Debian
| os |
| debian |

@uninstall-host
Expand All @@ -89,7 +131,45 @@ Scenario Outline: Un-installing the installed <os> agent
Then the "elastic-agent" process is in the "stopped" state on the host
And the "filebeat" process is in the "stopped" state on the host
And the "metricbeat" process is in the "stopped" state on the host
Examples:

@centos
Examples: Centos
| os |
| centos |

@debian
Examples: Debian
| os |
| debian |

@deploy-endpoint-then-unenroll-agent
Scenario Outline: Un-enrolling Elastic Agent stops Elastic Endpoint
Given an Endpoint is successfully deployed with a "<os>" Agent using "tar" installer
When the agent is un-enrolled
Then the "elastic-endpoint" process is in the "stopped" state on the host

@centos
Examples: Centos
| os |
| centos |

@debian
Examples: Debian
| os |
| debian |

@deploy-endpoint-then-remove-it-from-policy
Scenario Outline: Removing Endpoint from Agent policy stops the connected Endpoint
Given an Endpoint is successfully deployed with a "<os>" Agent using "tar" installer
When the "Endpoint Security" integration is "removed" in the policy
Then the "elastic-endpoint" process is in the "stopped" state on the host

@centos
Examples: Centos
| os |
| centos |

@debian
Examples: Debian
| os |
| debian |
Loading

0 comments on commit 0473d47

Please sign in to comment.