forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Security Solution][Endpoint] Unskip flaky tests (document signing & …
…response console - isolate) (elastic#169539) ## Summary Split test to avoid long running times. Fixes elastic#168296 elastic#168390 **Flaky test runner** - https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3754 x 150 (3 failures for document signing: 7, 101, 141) - https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3809 x 50 (all pass for document_signing.cy.ts) - https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3835 x 50 (2 fails for document signing and 1 fail for response console release due to timeout on response delay) - https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3842 x 25 (all pass for document_singing.cy.ts and response_console_actions.cy.ts) - https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3843 x 25 (3 fails for document_signing.cy.ts related to timeout for action response) - https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3844 x 100 (all pass for release, 3 failures for document signing due to time out waiting for action response) - https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3848 x 50 ( all pass, 1 unrelated failure related to `endpoints_list_response_console.cy·ts`) - https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3849 x 50 (all pass) ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios (cherry picked from commit a3d71f2) # Conflicts: # x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_actions.cy.ts
- Loading branch information
1 parent
aaa6bd1
commit 55dc546
Showing
8 changed files
with
123 additions
and
101 deletions.
There are no files selected for viewing
84 changes: 84 additions & 0 deletions
84
...s/security_solution/public/management/cypress/e2e/response_actions/document_signing.cy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import type { PolicyData } from '../../../../../common/endpoint/types'; | ||
import type { CreateAndEnrollEndpointHostResponse } from '../../../../../scripts/endpoint/common/endpoint_host_services'; | ||
import { | ||
openResponseConsoleFromEndpointList, | ||
performCommandInputChecks, | ||
submitCommand, | ||
waitForEndpointListPageToBeLoaded, | ||
} from '../../tasks/response_console'; | ||
import type { IndexedFleetEndpointPolicyResponse } from '../../../../../common/endpoint/data_loaders/index_fleet_endpoint_policy'; | ||
import { createAgentPolicyTask, getEndpointIntegrationVersion } from '../../tasks/fleet'; | ||
import { checkEndpointListForOnlyUnIsolatedHosts } from '../../tasks/isolate'; | ||
|
||
import { login } from '../../tasks/login'; | ||
import { enableAllPolicyProtections } from '../../tasks/endpoint_policy'; | ||
import { createEndpointHost } from '../../tasks/create_endpoint_host'; | ||
import { deleteAllLoadedEndpointData } from '../../tasks/delete_all_endpoint_data'; | ||
|
||
describe('Document signing:', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { | ||
let indexedPolicy: IndexedFleetEndpointPolicyResponse; | ||
let policy: PolicyData; | ||
let createdHost: CreateAndEnrollEndpointHostResponse; | ||
|
||
before(() => { | ||
getEndpointIntegrationVersion().then((version) => | ||
createAgentPolicyTask(version).then((data) => { | ||
indexedPolicy = data; | ||
policy = indexedPolicy.integrationPolicies[0]; | ||
|
||
return enableAllPolicyProtections(policy.id).then(() => { | ||
// Create and enroll a new Endpoint host | ||
return createEndpointHost(policy.policy_id).then((host) => { | ||
createdHost = host as CreateAndEnrollEndpointHostResponse; | ||
}); | ||
}); | ||
}) | ||
); | ||
}); | ||
|
||
after(() => { | ||
if (createdHost) { | ||
cy.task('destroyEndpointHost', createdHost); | ||
} | ||
|
||
if (indexedPolicy) { | ||
cy.task('deleteIndexedFleetEndpointPolicies', indexedPolicy); | ||
} | ||
|
||
if (createdHost) { | ||
deleteAllLoadedEndpointData({ endpointAgentIds: [createdHost.agentId] }); | ||
} | ||
}); | ||
|
||
beforeEach(() => { | ||
login(); | ||
}); | ||
|
||
it('should fail if data tampered', () => { | ||
waitForEndpointListPageToBeLoaded(createdHost.hostname); | ||
checkEndpointListForOnlyUnIsolatedHosts(); | ||
openResponseConsoleFromEndpointList(); | ||
performCommandInputChecks('isolate'); | ||
|
||
// stop host so that we ensure tamper happens before endpoint processes the action | ||
cy.task('stopEndpointHost', createdHost.hostname); | ||
// get action doc before we submit command, so we know when the new action doc is indexed | ||
cy.task('getLatestActionDoc').then((previousActionDoc) => { | ||
submitCommand(); | ||
cy.task('tamperActionDoc', previousActionDoc); | ||
}); | ||
cy.task('startEndpointHost', createdHost.hostname); | ||
|
||
const actionValidationErrorMsg = | ||
'Fleet action response error: Failed to validate action signature; check Endpoint logs for details'; | ||
// wait for 3 minutes for the response to be indexed | ||
cy.contains(actionValidationErrorMsg, { timeout: 180000 }).should('exist'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 0 additions & 87 deletions
87
...ty_solution/public/management/cypress/e2e/response_actions/response_console_actions.cy.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters