Skip to content

[o365] add agent replacement script test#19457

Open
kcreddy wants to merge 3 commits into
elastic:mainfrom
kcreddy:o365-cursor-script-test
Open

[o365] add agent replacement script test#19457
kcreddy wants to merge 3 commits into
elastic:mainfrom
kcreddy:o365-cursor-script-test

Conversation

@kcreddy

@kcreddy kcreddy commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Proposed commit message

[o365] add agent replacement script test

Verify that destroying and re-enrolling the agent does not lose
events. The new agent has no cursor state and re-collects from
initial_interval; fingerprint dedup on o365audit.Id prevents
duplicates. New blobs that appeared during the outage are picked up.

Note

Test only - no changelog needed.

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.
  • I have verified that any added dashboard complies with Kibana's Dashboard good practices

How to test this PR locally

New script test runs successfully.

--- Test results for package: o365 - START ---
╭─────────┬─────────────┬───────────┬───────────────────┬────────┬─────────────────╮
│ PACKAGE │ DATA STREAM │ TEST TYPE │ TEST NAME         │ RESULT │    TIME ELAPSED │
├─────────┼─────────────┼───────────┼───────────────────┼────────┼─────────────────┤
│ o365    │ audit       │ script    │ agent_replacement │ PASS   │ 2m13.009634417s │
│ o365    │ audit       │ script    │ env               │ PASS   │     68.517167ms │
╰─────────┴─────────────┴───────────┴───────────────────┴────────┴─────────────────╯
--- Test results for package: o365 - END   ---
Done

kcreddy added 3 commits June 5, 2026 09:34
Verify that destroying and re-enrolling the agent does not lose
events. The new agent has no cursor state and re-collects from
initial_interval; fingerprint dedup on o365audit.Id prevents
duplicates. New blobs that appeared during the outage are picked up.
@andrewkroh andrewkroh added the Integration:o365 Microsoft Office 365 label Jun 9, 2026
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

@elasticmachine

Copy link
Copy Markdown

💚 Build Succeeded

@kcreddy kcreddy self-assigned this Jun 16, 2026
@kcreddy kcreddy added the Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] label Jun 16, 2026
@kcreddy kcreddy marked this pull request as ready for review June 16, 2026 10:18
@kcreddy kcreddy requested review from a team as code owners June 16, 2026 10:18
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

Pinging @elastic/security-service-integrations (Team:Security-Service Integrations)

Comment on lines +1 to +2
# Test that replacing the agent (full re-enrollment, no cursor carried over)
# does not lose events.

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.

I don't think this test does this; specifically, it is incapable of detecting whether the four events from the first phase were not lost.

In order to do this I'd suggest having six events in the first phase, and then six events in the second phase (four of them shared with the first), and then confirming that the final state has eight events.

Phase 1: {sp,gen}-event-{001,002,003}: 6 events
Phase 2: {sp,gen}-event-{002,003,004}: 6 events (001 gone, 004 new)
Expected total: 8 distinct events

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Integration:o365 Microsoft Office 365 Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants