Skip to content

Commit

Permalink
Retrieve log files in case of error.
Browse files Browse the repository at this point in the history
  • Loading branch information
rjeffman committed Jan 3, 2023
1 parent 610362b commit bfd0104
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions .github/workflows/multihost.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,29 @@ jobs:
- name: Test IPA client deploy
run: ansible-playbook -i vagrant-inventory.yml --ssh-extra-args "-F vagrant-ssh" playbooks/install-client.yml

- name: Retrieve logs in case of ANY deploy failure
if: failure()
working-directory: .
run: |
ssh -F tests/multihost/vagrant-ssh server.ipa.test "sudo chmod a+r /var/log/*.log"
mkdir -p logs/server-logs
scp -F tests/multihost/vagrant-ssh [email protected]:/var/log/{ipaserver,ipaclient}-install.log logs/server-logs || true
ssh -F tests/multihost/vagrant-ssh rep-01.ipa.test "sudo chmod a+r /var/log/*.log"
mkdir -p logs/replica-logs
scp -F tests/multihost/vagrant-ssh [email protected]:/var/log/{ipareplica,ipaclient}-install.log logs/replica-logs || true
ssh -F tests/multihost/vagrant-ssh cli-01.ipa.test "sudo chmod a+r /var/log/*.log"
mkdir -p logs/client-logs
scp -F tests/multihost/vagrant-ssh [email protected]:/var/log/ipaclient-install.log logs/client-logs || true
tar czvf multihost-logs.tar.gz logs
- name: Save artifacts
if: failure()
# if: github.event.state == 'error' || github.event.state == 'failure'
uses: actions/upload-artifact@v3
with:
path: multihost-logs.tar.gz
if-no-files-found: "ignore"

# Cleanup
- name: Stop vagrant
run: vagrant destroy -f
2 changes: 1 addition & 1 deletion tests/multihost/README-vagrant.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Multihost testing with Vagrant
==============================

To test ipaserver role and ipabackup restore options, it is required that a target node without IPA installed is provided. To test ipareplica and ipacilent roles, it is required that a multihost environvent is available, and at least one target node does not have IPA installed. This environment must have proper networking configuration and some isolation for the tarkget nodes not provided by containers.
To test ipaserver role and ipabackup restore options, it is required that a target node without IPA installed is provided. To test ipareplica and ipaclient roles, it is required that a multihost environvent is available, and at least one target node does not have IPA installed. This environment must have proper networking configuration and some isolation for the tarkget nodes not provided by containers.

By using Vagrant along with Github Workflows we can have nested virtualization, allowing the creation of three virtual machine nodes that will play the roles of primary server, replica and client. The use of Vagrant also allows the use of a similar environment to run the tests in a developer's local machine, if desired.

Expand Down

0 comments on commit bfd0104

Please sign in to comment.