This repository has been archived by the owner on Sep 10, 2024. It is now read-only.
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.
[Osquery] Add Osquery cypress tests to buildkite (elastic#115902)
- Loading branch information
1 parent
f52ca15
commit 327411b
Showing
29 changed files
with
1,049 additions
and
554 deletions.
There are no files selected for viewing
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,11 @@ | ||
steps: | ||
- command: .buildkite/scripts/steps/functional/osquery_cypress.sh | ||
label: 'Osquery Cypress Tests' | ||
agents: | ||
queue: ci-group-6 | ||
depends_on: build | ||
timeout_in_minutes: 120 | ||
retry: | ||
automatic: | ||
- exit_status: '*' | ||
limit: 1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
source .buildkite/scripts/common/util.sh | ||
|
||
.buildkite/scripts/bootstrap.sh | ||
.buildkite/scripts/download_build_artifacts.sh | ||
|
||
export JOB=kibana-osquery-cypress | ||
|
||
echo "--- Osquery Cypress tests" | ||
|
||
cd "$XPACK_DIR" | ||
|
||
checks-reporter-with-killswitch "Osquery Cypress Tests" \ | ||
node scripts/functional_tests \ | ||
--debug --bail \ | ||
--kibana-install-dir "$KIBANA_BUILD_LOCATION" \ | ||
--config test/osquery_cypress/cli_config.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
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,15 @@ | ||
#!/usr/bin/env bash | ||
|
||
source test/scripts/jenkins_test_setup_xpack.sh | ||
|
||
echo " -> Running osquery cypress tests" | ||
cd "$XPACK_DIR" | ||
|
||
checks-reporter-with-killswitch "Osquery Cypress Tests" \ | ||
node scripts/functional_tests \ | ||
--debug --bail \ | ||
--kibana-install-dir "$KIBANA_INSTALL_DIR" \ | ||
--config test/osquery_cypress/cli_config.ts | ||
|
||
echo "" | ||
echo "" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"excludeAfterRemap": true, | ||
"include": ["public"] | ||
} |
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 |
---|---|---|
@@ -1,14 +1,16 @@ | ||
{ | ||
"baseUrl": "http://localhost:5620", | ||
"defaultCommandTimeout": 60000, | ||
"execTimeout": 120000, | ||
"pageLoadTimeout": 120000, | ||
"nodeVersion": "system", | ||
"defaultCommandTimeout": 6000, | ||
"execTimeout": 12000, | ||
"pageLoadTimeout": 12000, | ||
"retries": { | ||
"runMode": 2 | ||
}, | ||
"screenshotsFolder": "../../../target/kibana-osquery/cypress/screenshots", | ||
"trashAssetsBeforeRuns": false, | ||
"video": false, | ||
"videosFolder": "../../../target/kibana-osquery/cypress/videos", | ||
"viewportHeight": 900, | ||
"viewportWidth": 1440 | ||
} | ||
"viewportWidth": 1440, | ||
"experimentalStudio": true | ||
} |
60 changes: 60 additions & 0 deletions
60
x-pack/plugins/osquery/cypress/integration/integration.spec.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,60 @@ | ||
/* | ||
* 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 { FLEET_AGENT_POLICIES, navigateTo } from '../tasks/navigation'; | ||
import { addIntegration } from '../tasks/integrations'; | ||
import { checkResults, inputQuery, selectAllAgents, submitQuery } from '../tasks/live_query'; | ||
import { login } from '../tasks/login'; | ||
|
||
describe('Add Integration', () => { | ||
const integration = 'Osquery Manager'; | ||
|
||
before(() => { | ||
login(); | ||
}); | ||
|
||
it.skip('should open Osquery app', () => { | ||
cy.visit('/app/osquery/live_queries'); | ||
cy.wait(3000); | ||
cy.contains('Live queries history', { timeout: 60000 }); | ||
cy.contains('New live query').click(); | ||
cy.wait(3000); | ||
cy.contains('Saved queries').click(); | ||
cy.wait(3000); | ||
cy.contains('Saved queries', { timeout: 60000 }); | ||
cy.contains('Add saved query').click(); | ||
cy.wait(3000); | ||
cy.contains('Packs').click(); | ||
cy.wait(3000); | ||
cy.contains('Packs', { timeout: 60000 }); | ||
cy.contains('Add pack').click(); | ||
cy.wait(3000); | ||
}); | ||
|
||
it('should display Osquery integration in the Policies list once installed ', () => { | ||
addAndVerifyIntegration(); | ||
}); | ||
|
||
it.skip('should run live query', () => { | ||
navigateTo('/app/osquery/live_queries/new'); | ||
cy.wait(1000); | ||
selectAllAgents(); | ||
inputQuery(); | ||
submitQuery(); | ||
checkResults(); | ||
}); | ||
|
||
function addAndVerifyIntegration() { | ||
navigateTo(FLEET_AGENT_POLICIES); | ||
cy.contains('Default Fleet Server policy').click(); | ||
cy.contains('Add integration').click(); | ||
|
||
cy.contains(integration).click(); | ||
addIntegration(); | ||
cy.contains('osquery_manager-'); | ||
} | ||
}); |
35 changes: 0 additions & 35 deletions
35
x-pack/plugins/osquery/cypress/integration/osquery_manager.spec.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export const ADD_AGENT_BUTTON = 'addAgentButton'; | ||
|
||
export const AGENT_POLICIES_TAB = 'fleet-agent-policies-tab'; | ||
export const ENROLLMENT_TOKENS_TAB = 'fleet-enrollment-tokens-tab'; |
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
File renamed without changes.
Oops, something went wrong.