-
-
Notifications
You must be signed in to change notification settings - Fork 11
118 lines (97 loc) · 3.38 KB
/
integration.yml
File metadata and controls
118 lines (97 loc) · 3.38 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: integration test
# NOTE: Restricting branches prevents jobs from being doubled since
# a push to a pull request triggers two events.
on:
pull_request:
branches:
- "*"
push:
branches:
- master
jobs:
test-on-linux:
name: ${{ matrix.gssapi }} gssapi / Py${{ matrix.python-version }} @ ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# note: always use the -latest OS variants b/c if conditions
# match them as literals
os: [ubuntu-latest]
python-version: [3.11]
gssapi: [with, without]
steps:
- name: Check out code
uses: actions/checkout@v6
- name: Verify curl with Kerberos
if: matrix.gssapi == 'with'
run: |
make verify-curl-with-kerberos
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies on Linux
if: matrix.os == 'ubuntu-latest'
run: |
pip install -r devel.txt
- name: Install gssapi on Linux
if: matrix.os == 'ubuntu-latest' && matrix.gssapi == 'with'
run: |
sudo apt-get install libkrb5-dev
pip install gssapi
- name: Build & start services
run: |
make build-services
make run-services
WEB_ADDR=`docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' web_kiwitcms_org`
sudo sh -c "echo '$WEB_ADDR web.kiwitcms.org' >> /etc/hosts"
- name: Install & configure Kerberos client
if: matrix.os == 'ubuntu-latest' && matrix.gssapi == 'with'
run: |
KRB5_ADDR=`docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' krb5_kiwitcms_org`
sudo apt-get -y install krb5-user
sudo cp ./tests/krb5/krb5.conf /etc/
sudo sed -i "s/localhost\./$KRB5_ADDR/" /etc/krb5.conf
# this directory is missing and krb5.conf wants to include it
sudo mkdir /etc/krb5.conf.d/
- name: Obtain valid Kerberos ticket
if: matrix.os == 'ubuntu-latest' && matrix.gssapi == 'with'
run: |
echo changeme | kinit travis@KIWITCMS.ORG
klist
- name: Verify web login with Kerberos
if: matrix.os == 'ubuntu-latest' && matrix.gssapi == 'with'
run: |
make verify-web-login
klist
- name: Verify tcms-api can communicate via username/password
run: |
cat > ~/.tcms.conf << _EOF_
[tcms]
url = https://web.kiwitcms.org:8443/xml-rpc/
username = kiwitcms-bot
password = changeme
_EOF_
make verify-integration
make verify-credentials-via-python
- name: Verify tcms-api can communicate over Kerberos
if: matrix.os == 'ubuntu-latest' && matrix.gssapi == 'with'
run: |
cat > ~/.tcms.conf << _EOF_
[tcms]
url = https://web.kiwitcms.org:8443/xml-rpc/
use_kerberos = True
_EOF_
make verify-integration
- name: Collect logs
if: always()
run: |
docker compose -f tests/krb5/docker-compose.yml logs --no-color > /tmp/docker-compose-${{ matrix.gssapi }}-kerberos.log
- name: Upload logs
uses: actions/upload-artifact@v5
if: always()
with:
name: logs-${{ matrix.gssapi }}-gssapi
path: /tmp/*.log
if-no-files-found: ignore