Skip to content

Commit e2160cb

Browse files
AaronShannonCoMfUcIoS
authored andcommitted
PE-39228 add_replica smoke test (#497)
* PE-39228 Smoke test created and added to workflow * PE-39228 Workflow updated * PE-39228 Spec updated, smoke test added to matrix * PE-39228 Versions updated, push trigger removed from matrix * PE-39228 whitespace fixed
1 parent a7fe10c commit e2160cb

File tree

3 files changed

+35
-2
lines changed

3 files changed

+35
-2
lines changed

.github/workflows/test-add-replica-matrix.yaml

+7-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
fail-fast: false
3737
matrix:
3838
architecture: [standard, standard-with-dr, large, extra-large]
39-
version: [2021.7.7, 2023.6.0]
39+
version: [2021.7.9, 2023.8.0]
4040
image: [almalinux-cloud/almalinux-8]
4141
steps:
4242
- name: Checkout Source
@@ -92,6 +92,12 @@ jobs:
9292
--inventoryfile spec/fixtures/litmus_inventory.yaml \
9393
--modulepath spec/fixtures/modules \
9494
--stream
95+
- name: Verify that replica was added
96+
timeout-minutes: 10
97+
run: |
98+
bundle exec bolt plan run peadm_spec::verify_replica -v \
99+
--inventoryfile spec/fixtures/litmus_inventory.yaml \
100+
--modulepath spec/fixtures/modules
95101
- name: Tear down test cluster
96102
if: ${{ always() }}
97103
continue-on-error: true

.github/workflows/test-add-replica.yaml

+8-1
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,21 @@ jobs:
8484
--modulepath spec/fixtures/modules \
8585
architecture=${{ matrix.architecture }} \
8686
version=${{ matrix.version }} \
87-
console_password=${{ secrets.CONSOLE_PASSWORD }}
87+
console_password=${{ secrets.CONSOLE_PASSWORD }} \
88+
code_manager_auto_configure=true
8889
- name: Run add_replica plan
8990
timeout-minutes: 60
9091
run: |
9192
bundle exec bolt plan run peadm_spec::add_replica -v \
9293
--inventoryfile spec/fixtures/litmus_inventory.yaml \
9394
--modulepath spec/fixtures/modules \
9495
--stream
96+
- name: Verify that replica was added
97+
timeout-minutes: 10
98+
run: |
99+
bundle exec bolt plan run peadm_spec::verify_replica -v \
100+
--inventoryfile spec/fixtures/litmus_inventory.yaml \
101+
--modulepath spec/fixtures/modules
95102
- name: Wait as long as the file ${HOME}/pause file is present
96103
if: ${{ always() && github.event.inputs.ssh-debugging == 'true' }}
97104
run: |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
plan peadm_spec::verify_replica() {
2+
$t = get_targets('*')
3+
wait_until_available($t)
4+
5+
$primary_host = $t.filter |$n| { $n.vars['role'] == 'primary' }
6+
7+
if $primary_host == [] {
8+
fail_plan('"primary" role missing from inventory, cannot continue')
9+
}
10+
11+
$result = run_task('peadm::get_peadm_config', $primary_host, '_catch_errors' => true).first.to_data()
12+
13+
$replica_host = $result['value']['params']['replica_host']
14+
15+
if $replica_host == undef or $replica_host == null {
16+
fail_plan("No replica was found in the PE configuration")
17+
} else {
18+
out::message("Replica added successfully: ${replica_host}")
19+
}
20+
}

0 commit comments

Comments
 (0)