-
Notifications
You must be signed in to change notification settings - Fork 2
53 lines (45 loc) · 1.64 KB
/
test_pytest.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
name: Test Environment Reuse
on:
- push
- pull_request
jobs:
test-environment-reuse:
name: Test environment reuse
runs-on: ubuntu-24.04
steps:
- name: Clone the repository
uses: actions/checkout@v4
- name: Deploy environment
# uses: rjeffman/FreeIPA-Cluster-Test@<version|main>
uses: ./
with:
cluster_configuration: tests/environments/server_only.yaml
shutdown: false
- name: Check if cluster is up
run: |
podman ps -f "name=server" -f "pod=pod_ipa-lab" --format="{{ .Names }}"
test -n "$(podman ps -f "name=server" -f "pod=pod_ipa-lab" --format="{{ .Names }}")"
- name: Update /etc/hosts
run: |
podman ps
host_entry="$(podman exec server bash -c 'echo "$(hostname -I) $(hostname)"')"
echo "${host_entry}" | sudo tee -a /etc/hosts
- name: Install test dependencies
run: |
pip install pytest requests
- name: Run Pytest
# note that any command that needs to access the pod network
# should be executed with `podman unshare --rootless-netns`
run: |
podman unshare --rootless-netns pytest
- name: Shutdown environment
# uses: rjeffman/FreeIPA-Cluster-Test@<version|main>
uses: ./
with:
cluster_configuration: tests/environments/server_only.yaml
shutdown: true
- name: Check if cluster is down
run: |
podman ps -f "name=server" -f "pod=pod_ipa-lab" --format="{{ .Names }}"
test -z "$(podman ps -f "name=server" -f "pod=pod_ipa-lab" --format="{{ .Names }}")"