Skip to content

Commit

Permalink
PE-39228 Smoke test created and added to workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronShannon committed Sep 5, 2024
1 parent 82596b7 commit 78cb9e7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/test-add-replica.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ jobs:
--inventoryfile spec/fixtures/litmus_inventory.yaml \
--modulepath spec/fixtures/modules \
--stream
- name: Verify that replica was added
timeout-minutes: 10
run: |
bundle exec bolt plan run peadm_spec::verify_replica -v \
--inventoryfile spec/fixtures/litmus_inventory.yaml \
--modulepath spec/fixtures/modules
- name: Wait as long as the file ${HOME}/pause file is present
if: ${{ always() && github.event.inputs.ssh-debugging == 'true' }}
run: |
Expand Down
20 changes: 20 additions & 0 deletions spec/acceptance/peadm_spec/plans/verify_replica.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
plan peadm_spec::verify_replica() {
$t = get_targets('*')
wait_until_available($t)

$primary_host = $t.filter |$n| { $n.vars['role'] == 'primary' }

if $primary_host == [] {
fail_plan('"primary" role missing from inventory, cannot continue')
}

$result = run_task('peadm::get_peadm_config', $primary_host, '_catch_errors' => true)

$replica_host = $result.first['result']['params']['replica_host']

if $replica_host == undef or $replica_host == null {
fail_plan("No replica was found in the PE configuration")
} else {
out::message("Replica added successfully: ${replica_host}")
}
}

0 comments on commit 78cb9e7

Please sign in to comment.