Skip to content

Commit

Permalink
Adds IP location database tests
Browse files Browse the repository at this point in the history
  • Loading branch information
picandocodigo committed Nov 18, 2024
1 parent d64f3db commit 9bef2bd
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions tests/ingest/30_ip_location_database.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
requires:
stack: true
serverless: false
---
"IP location Database":
- do:
ingest.put_ip_location_database:
id: "my_database_1"
body: >
{
"name": "GeoIP2-City",
"maxmind": {
"account_id": "1234"
}
}
- match: { acknowledged: true }

- do:
ingest.put_ip_location_database:
id: "my_database_1"
body: >
{
"name": "GeoIP2-Country",
"maxmind": {
"account_id": "4321"
}
}
- match: { acknowledged: true }

- do:
catch: /illegal_argument_exception/
ingest.put_ip_location_database:
id: "_web_TXlDdXN0b21HZW9MaXRlMi1DaXR5Lm1tZGI="
body: >
{
"name": "GeoIP2-City",
"web": {
}
}
- do:
ingest.put_ip_location_database:
id: "my_database_2"
body: >
{
"name": "GeoIP2-City",
"maxmind": {
"account_id": "1234"
}
}
- match: { acknowledged: true }

- do:
ingest.get_ip_location_database:
id: "my_database_1"
- length: { databases: 1 }
- match: { databases.0.id: "my_database_1" }
- gte: { databases.0.modified_date_millis: 0 }
- match: { databases.0.database.name: "GeoIP2-Country" }
- match: { databases.0.database.maxmind.account_id: "4321" }

- do:
ingest.get_ip_location_database:
id: "my_database_1,my_database_2"
- length: { databases: 2 }

- do:
ingest.delete_ip_location_database:
id: "my_database_1"
- match: { acknowledged: true }

- do:
ingest.delete_ip_location_database:
id: "my_database_2"
- match: { acknowledged: true }

0 comments on commit 9bef2bd

Please sign in to comment.