Skip to content

Commit e8e2e30

Browse files
author
Tianli Feng
committed
Add yaml rest test for node role cluster_manager
Signed-off-by: Tianli Feng <ftianli@amazon.com>
1 parent 70c8f4a commit e8e2e30

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

rest-api-spec/src/main/resources/rest-api-spec/test/cluster.stats/10_basic.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,22 @@
9191
cluster.stats: {}
9292

9393
- is_true: nodes.packaging_types
94+
95+
---
96+
"get cluster stats nodes count with both master and cluster_manager":
97+
- skip:
98+
version: " - 1.4.99"
99+
reason: "node role cluster_manager is added in 2.0.0"
100+
101+
- do:
102+
cluster.stats: {}
103+
104+
- set:
105+
nodes.count.cluster_manager: cluster_manager_count
106+
107+
- gte: { nodes.count.total: 1}
108+
- match: { nodes.count.cluster_manager: $cluster_manager_count }
109+
- match: { nodes.count.master: $cluster_manager_count }
110+
- gte: { nodes.count.data: 1}
111+
- gte: { nodes.count.ingest: 0}
112+
- gte: { nodes.count.coordinating_only: 0}

rest-api-spec/src/main/resources/rest-api-spec/test/nodes.info/10_basic.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ setup:
1414
---
1515
"node_info role test":
1616
- skip:
17-
version: " - 7.7.99"
17+
version: " - 7.7.99 , 2.0.0 - "
1818
reason: "node roles were not sorted before 7.8.0"
1919

2020
- do:
@@ -28,4 +28,23 @@ setup:
2828
- match: { nodes.$node_id.roles.1: "ingest" }
2929
- match: { nodes.$node_id.roles.2: "master" }
3030
- match: { nodes.$node_id.roles.3: "remote_cluster_client" }
31+
32+
---
33+
"node_info role test with both master and cluster_manager":
34+
- skip:
35+
version: " - 1.4.99"
36+
reason: "node role cluster_manager is added in 2.0.0"
37+
38+
- do:
39+
nodes.info: {}
40+
- set:
41+
nodes._arbitrary_key_: node_id
42+
43+
- is_true: nodes.$node_id.roles
44+
# the roles output is sorted
45+
- match: { nodes.$node_id.roles.0: "cluster_manager" }
46+
- match: { nodes.$node_id.roles.1: "data" }
47+
- match: { nodes.$node_id.roles.2: "ingest" }
48+
- match: { nodes.$node_id.roles.3: "master" }
49+
- match: { nodes.$node_id.roles.4: "remote_cluster_client" }
3150

0 commit comments

Comments
 (0)