Reworking yaml tests for rolling upgrades

This commit is contained in:
Ali Beyad 2016-09-12 18:46:06 -04:00
parent 0b3eb11712
commit 0c7dd1865c
4 changed files with 23 additions and 8 deletions

View File

@ -206,6 +206,9 @@ class NodeInfo {
/** Returns the data directory for this node */
File getDataDir() {
if (!(dataDir instanceof File)) {
return new File(dataDir)
}
return dataDir
}

View File

@ -39,7 +39,7 @@ task mixedClusterTest(type: RestIntegTestTask) {
distribution = 'zip'
clusterName = 'rolling-upgrade'
unicastTransportUri = { seedNode, node, ant -> oldClusterTest.nodes.get(0).transportUri() }
dataDir = "${-> oldClusterTest.nodes[1].dataDir}"
dataDir = "${-> oldClusterTest.nodes[1].getDataDir()}"
}
systemProperty 'tests.rest.suite', 'mixed_cluster'
@ -51,7 +51,7 @@ task upgradedClusterTest(type: RestIntegTestTask) {
distribution = 'zip'
clusterName = 'rolling-upgrade'
unicastTransportUri = { seedNode, node, ant -> mixedClusterTest.nodes.get(0).transportUri() }
dataDir = "${-> oldClusterTest.nodes[0].dataDir}"
dataDir = "${-> oldClusterTest.nodes[0].getDataDir()}"
}
systemProperty 'tests.rest.suite', 'upgraded_cluster'
}

View File

@ -1,7 +1,13 @@
---
"Index data and search on the mixed cluster":
- do:
bulk:
- do:
search:
index: test_index
- match: { hits.total: 5 } # no new indexed data, so expect the original 5 documents from the old cluster
- do:
bulk:
refresh: true
body:
- '{"index": {"_index": "test_index", "_type": "test_type"}}'
@ -19,4 +25,4 @@
search:
index: test_index
- match: { hits.total: 10 }
- match: { hits.total: 10 } # 5 docs from old cluster, 5 docs from mixed cluster

View File

@ -1,7 +1,13 @@
---
"Index data and search on the upgraded cluster":
- do:
bulk:
- do:
search:
index: test_index
- match: { hits.total: 10 } # no new indexed data, so expect the original 10 documents from the old and mixed clusters
- do:
bulk:
refresh: true
body:
- '{"index": {"_index": "test_index", "_type": "test_type"}}'
@ -19,4 +25,4 @@
search:
index: test_index
- match: { hits.total: 15 }
- match: { hits.total: 15 } # 10 docs from previous clusters plus 5 new docs