diff --git a/.github/workflows/test-add-replica-matrix.yaml b/.github/workflows/test-add-replica-matrix.yaml index df05dd054..1b6d98b5e 100644 --- a/.github/workflows/test-add-replica-matrix.yaml +++ b/.github/workflows/test-add-replica-matrix.yaml @@ -36,7 +36,7 @@ jobs: fail-fast: false matrix: architecture: [standard, standard-with-dr, large, extra-large] - version: [2021.7.7, 2023.6.0] + version: [2021.7.9, 2023.8.0] image: [almalinux-cloud/almalinux-8] steps: - name: Checkout Source @@ -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: Tear down test cluster if: ${{ always() }} continue-on-error: true diff --git a/.github/workflows/test-add-replica.yaml b/.github/workflows/test-add-replica.yaml index 217f1b1d2..5fe8787fe 100644 --- a/.github/workflows/test-add-replica.yaml +++ b/.github/workflows/test-add-replica.yaml @@ -14,7 +14,7 @@ on: version: description: PE version to install required: true - default: 2021.7.8 + default: 2021.7.9 ssh-debugging: description: Boolean; whether or not to pause for ssh debugging required: true @@ -84,7 +84,8 @@ jobs: --modulepath spec/fixtures/modules \ architecture=${{ matrix.architecture }} \ version=${{ matrix.version }} \ - console_password=${{ secrets.CONSOLE_PASSWORD }} + console_password=${{ secrets.CONSOLE_PASSWORD }} \ + code_manager_auto_configure=true - name: Run add_replica plan timeout-minutes: 60 run: | @@ -92,6 +93,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: | diff --git a/spec/acceptance/peadm_spec/plans/verify_replica.pp b/spec/acceptance/peadm_spec/plans/verify_replica.pp new file mode 100644 index 000000000..e1f484eb8 --- /dev/null +++ b/spec/acceptance/peadm_spec/plans/verify_replica.pp @@ -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).first.to_data() + + $replica_host = $result['value']['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}") + } +}