Skip to content

Commit 9bef2bd

Browse files
committed
Adds IP location database tests
1 parent d64f3db commit 9bef2bd

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed
+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
requires:
3+
stack: true
4+
serverless: false
5+
---
6+
"IP location Database":
7+
- do:
8+
ingest.put_ip_location_database:
9+
id: "my_database_1"
10+
body: >
11+
{
12+
"name": "GeoIP2-City",
13+
"maxmind": {
14+
"account_id": "1234"
15+
}
16+
}
17+
- match: { acknowledged: true }
18+
19+
- do:
20+
ingest.put_ip_location_database:
21+
id: "my_database_1"
22+
body: >
23+
{
24+
"name": "GeoIP2-Country",
25+
"maxmind": {
26+
"account_id": "4321"
27+
}
28+
}
29+
- match: { acknowledged: true }
30+
31+
- do:
32+
catch: /illegal_argument_exception/
33+
ingest.put_ip_location_database:
34+
id: "_web_TXlDdXN0b21HZW9MaXRlMi1DaXR5Lm1tZGI="
35+
body: >
36+
{
37+
"name": "GeoIP2-City",
38+
"web": {
39+
}
40+
}
41+
42+
- do:
43+
ingest.put_ip_location_database:
44+
id: "my_database_2"
45+
body: >
46+
{
47+
"name": "GeoIP2-City",
48+
"maxmind": {
49+
"account_id": "1234"
50+
}
51+
}
52+
- match: { acknowledged: true }
53+
54+
- do:
55+
ingest.get_ip_location_database:
56+
id: "my_database_1"
57+
- length: { databases: 1 }
58+
- match: { databases.0.id: "my_database_1" }
59+
- gte: { databases.0.modified_date_millis: 0 }
60+
- match: { databases.0.database.name: "GeoIP2-Country" }
61+
- match: { databases.0.database.maxmind.account_id: "4321" }
62+
63+
- do:
64+
ingest.get_ip_location_database:
65+
id: "my_database_1,my_database_2"
66+
- length: { databases: 2 }
67+
68+
- do:
69+
ingest.delete_ip_location_database:
70+
id: "my_database_1"
71+
- match: { acknowledged: true }
72+
73+
- do:
74+
ingest.delete_ip_location_database:
75+
id: "my_database_2"
76+
- match: { acknowledged: true }

0 commit comments

Comments
 (0)