Skip to content

Commit

Permalink
[Security Solution] Fix metadata tests with updated timestamps (#115591)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinlog authored Oct 21, 2021
1 parent e578bf1 commit c53004f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"id": "3KVN2G8BYQH1gtPUuYk7",
"index": "metrics-endpoint.metadata-default",
"source": {
"@timestamp": 1626897841950,
"@timestamp": 1634656952181,
"agent": {
"id": "963b081e-60d1-482c-befd-a5815fa8290f",
"version": "6.6.1",
Expand All @@ -26,7 +26,7 @@
}
},
"event": {
"created": 1626897841950,
"created": 1634656952181,
"id": "32f5fda2-48e4-4fae-b89e-a18038294d14",
"kind": "metric",
"category": [
Expand Down Expand Up @@ -74,7 +74,7 @@
"id": "3aVN2G8BYQH1gtPUuYk7",
"index": "metrics-endpoint.metadata-default",
"source": {
"@timestamp": 1626897841950,
"@timestamp": 1634656952181,
"agent": {
"id": "b3412d6f-b022-4448-8fee-21cc936ea86b",
"version": "6.0.0",
Expand All @@ -96,7 +96,7 @@
}
},
"event": {
"created": 1626897841950,
"created": 1634656952181,
"id": "32f5fda2-48e4-4fae-b89e-a18038294d15",
"kind": "metric",
"category": [
Expand Down Expand Up @@ -143,7 +143,7 @@
"id": "3qVN2G8BYQH1gtPUuYk7",
"index": "metrics-endpoint.metadata-default",
"source": {
"@timestamp": 1626897841950,
"@timestamp": 1634656952181,
"agent": {
"id": "3838df35-a095-4af4-8fce-0b6d78793f2e",
"version": "6.8.0",
Expand All @@ -165,7 +165,7 @@
}
},
"event": {
"created": 1626897841950,
"created": 1634656952181,
"id": "32f5fda2-48e4-4fae-b89e-a18038294d16",
"kind": "metric",
"category": [
Expand Down Expand Up @@ -210,7 +210,7 @@
"id": "36VN2G8BYQH1gtPUuYk7",
"index": "metrics-endpoint.metadata-default",
"source": {
"@timestamp": 1626897841950,
"@timestamp": 1634656952181,
"agent": {
"id": "963b081e-60d1-482c-befd-a5815fa8290f",
"version": "6.6.1",
Expand All @@ -232,7 +232,7 @@
}
},
"event": {
"created": 1626897841950,
"created": 1634656952181,
"id": "32f5fda2-48e4-4fae-b89e-a18038294d18",
"kind": "metric",
"category": [
Expand Down Expand Up @@ -280,7 +280,7 @@
"id": "4KVN2G8BYQH1gtPUuYk7",
"index": "metrics-endpoint.metadata-default",
"source": {
"@timestamp": 1626897841950,
"@timestamp": 1634656952181,
"agent": {
"id": "b3412d6f-b022-4448-8fee-21cc936ea86b",
"version": "6.0.0",
Expand All @@ -302,7 +302,7 @@
}
},
"event": {
"created": 1626897841950,
"created": 1634656952181,
"id": "32f5fda2-48e4-4fae-b89e-a18038294d19",
"kind": "metric",
"category": [
Expand Down Expand Up @@ -348,7 +348,7 @@
"id": "4aVN2G8BYQH1gtPUuYk7",
"index": "metrics-endpoint.metadata-default",
"source": {
"@timestamp": 1626897841950,
"@timestamp": 1634656952181,
"agent": {
"id": "3838df35-a095-4af4-8fce-0b6d78793f2e",
"version": "6.8.0",
Expand All @@ -370,7 +370,7 @@
}
},
"event": {
"created": 1626897841950,
"created": 1634656952181,
"id": "32f5fda2-48e4-4fae-b89e-a18038294d39",
"kind": "metric",
"category": [
Expand Down Expand Up @@ -416,7 +416,7 @@
"id": "4qVN2G8BYQH1gtPUuYk7",
"index": "metrics-endpoint.metadata-default",
"source": {
"@timestamp": 1626897841950,
"@timestamp": 1634656952181,
"agent": {
"id": "963b081e-60d1-482c-befd-a5815fa8290f",
"version": "6.6.1",
Expand All @@ -438,7 +438,7 @@
}
},
"event": {
"created": 1626897841950,
"created": 1634656952181,
"id": "32f5fda2-48e4-4fae-b89e-a18038294d31",
"kind": "metric",
"category": [
Expand Down Expand Up @@ -485,7 +485,7 @@
"id": "46VN2G8BYQH1gtPUuYk7",
"index": "metrics-endpoint.metadata-default",
"source": {
"@timestamp": 1626897841950,
"@timestamp": 1634656952181,
"agent": {
"id": "b3412d6f-b022-4448-8fee-21cc936ea86b",
"version": "6.0.0",
Expand All @@ -507,7 +507,7 @@
}
},
"event": {
"created": 1626897841950,
"created": 1634656952181,
"id": "32f5fda2-48e4-4fae-b89e-a18038294d23",
"kind": "metric",
"category": [
Expand Down Expand Up @@ -553,7 +553,7 @@
"id": "5KVN2G8BYQH1gtPUuYk7",
"index": "metrics-endpoint.metadata-default",
"source": {
"@timestamp": 1626897841950,
"@timestamp": 1634656952181,
"agent": {
"id": "3838df35-a095-4af4-8fce-0b6d78793f2e",
"version": "6.8.0",
Expand All @@ -575,7 +575,7 @@
}
},
"event": {
"created": 1626897841950,
"created": 1634656952181,
"id": "32f5fda2-48e4-4fae-b89e-a18038294d35",
"kind": "metric",
"category": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ export default function ({ getService }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
const supertest = getService('supertest');

// Failing: See https://github.com/elastic/kibana/issues/115488
describe.skip('test metadata api', () => {
describe('test metadata api', () => {
// TODO add this after endpoint package changes are merged and in snapshot
// describe('with .metrics-endpoint.metadata_united_default index', () => {
// });
Expand Down Expand Up @@ -242,7 +241,7 @@ export default function ({ getService }: FtrProviderContext) {
(ip: string) => ip === targetEndpointIp
);
expect(resultIp).to.eql([targetEndpointIp]);
expect(body.hosts[0].metadata.event.created).to.eql(1626897841950);
expect(body.hosts[0].metadata.event.created).to.eql(1634656952181);
expect(body.hosts.length).to.eql(1);
expect(body.request_page_size).to.eql(10);
expect(body.request_page_index).to.eql(0);
Expand Down Expand Up @@ -284,7 +283,7 @@ export default function ({ getService }: FtrProviderContext) {
const resultElasticAgentId: string = body.hosts[0].metadata.elastic.agent.id;
expect(resultHostId).to.eql(targetEndpointId);
expect(resultElasticAgentId).to.eql(targetElasticAgentId);
expect(body.hosts[0].metadata.event.created).to.eql(1626897841950);
expect(body.hosts[0].metadata.event.created).to.eql(1634656952181);
expect(body.hosts[0].host_status).to.eql('unhealthy');
expect(body.hosts.length).to.eql(1);
expect(body.request_page_size).to.eql(10);
Expand Down

0 comments on commit c53004f

Please sign in to comment.