@@ -44,23 +44,12 @@ jobs:
44
44
name : Upgrade path test
45
45
runs-on : ubuntu-22.04
46
46
needs : build
47
-
47
+ timeout-minutes : 30
48
48
steps :
49
49
- name : Checking out repo
50
50
uses : actions/checkout@v4
51
- - name : Install test dependencies
52
- run : |
53
- set -x
54
- sudo apt-get install python3-setuptools
55
- sudo pip3 install --upgrade pip
56
- sudo pip3 install -U pytest sh psutil
57
- sudo apt-get -y install open-iscsi
58
- sudo systemctl enable iscsid
59
- - name : Fetch snap
60
- uses : actions/download-artifact@v4
61
- with :
62
- name : microk8s.snap
63
- path : build
51
+ - name : Prepare test prerequisites
52
+ uses : ./.github/actions/test-prep
64
53
- name : Running upgrade path test
65
54
run : |
66
55
sudo -E UPGRADE_MICROK8S_FROM=latest/edge UPGRADE_MICROK8S_TO=$PWD/build/microk8s.snap pytest -s ./tests/test-upgrade-path.py
@@ -70,28 +59,11 @@ jobs:
70
59
runs-on : ubuntu-22.04
71
60
needs : build
72
61
timeout-minutes : 30
73
-
74
62
steps :
75
63
- name : Checking out repo
76
64
uses : actions/checkout@v4
77
- - name : Install test dependencies
78
- run : |
79
- set -x
80
- sudo apt-get install python3-setuptools
81
- sudo pip3 install --upgrade pip
82
- sudo pip3 install -U pytest==8.3.4 sh psutil
83
- sudo apt-get -y install open-iscsi
84
- sudo systemctl enable iscsid
85
- # Docker sets iptables rules that interfere with LXD or K8s.
86
- # https://documentation.ubuntu.com/lxd/en/latest/howto/network_bridge_firewalld/#prevent-connectivity-issues-with-lxd-and-docker
87
- - name : Apply Docker iptables workaround
88
- shell : bash
89
- run : sudo iptables -I DOCKER-USER -j ACCEPT
90
- - name : Fetch snap
91
- uses : actions/download-artifact@v4
92
- with :
93
- name : microk8s.snap
94
- path : build
65
+ - name : Prepare test prerequisites
66
+ uses : ./.github/actions/test-prep
95
67
- name : Running addons tests
96
68
env :
97
69
UNDER_TIME_PRESSURE : ${{ !contains(github.event.pull_request.labels.*.name, 'run-all-tests') }}
@@ -106,25 +78,12 @@ jobs:
106
78
name : Test community addons
107
79
runs-on : ubuntu-22.04
108
80
needs : build
109
-
81
+ timeout-minutes : 30
110
82
steps :
111
83
- name : Checking out repo
112
84
uses : actions/checkout@v4
113
- - name : Install test dependencies
114
- run : |
115
- set -x
116
- sudo apt-get install python3-setuptools
117
- sudo pip3 install --upgrade pip
118
- sudo pip3 install -U pytest sh
119
- sudo apt-get -y install open-iscsi
120
- sudo systemctl enable iscsid
121
- - name : Fetch snap
122
- uses : actions/download-artifact@v4
123
- with :
124
- name : microk8s.snap
125
- path : build
126
- # - name: Setup tmate session
127
- # uses: mxschmitt/action-tmate@v3
85
+ - name : Prepare test prerequisites
86
+ uses : ./.github/actions/test-prep
128
87
- name : Running addons tests
129
88
env :
130
89
UNDER_TIME_PRESSURE : ${{ !contains(github.event.pull_request.labels.*.name, 'run-all-tests') }}
@@ -139,30 +98,11 @@ jobs:
139
98
runs-on : ubuntu-22.04
140
99
needs : build
141
100
timeout-minutes : 30
142
-
143
101
steps :
144
102
- name : Checking out repo
145
103
uses : actions/checkout@v4
146
- # - name: Setup tmate session
147
- # uses: mxschmitt/action-tmate@v3
148
- - name : Install test dependencies
149
- run : |
150
- set -x
151
- sudo apt-get install python3-setuptools
152
- sudo pip3 install --upgrade pip
153
- sudo pip3 install -U pytest sh psutil
154
- sudo apt-get -y install open-iscsi
155
- sudo systemctl enable iscsid
156
- # Docker sets iptables rules that interfere with LXD or K8s.
157
- # https://documentation.ubuntu.com/lxd/en/latest/howto/network_bridge_firewalld/#prevent-connectivity-issues-with-lxd-and-docker
158
- - name : Apply Docker iptables workaround
159
- shell : bash
160
- run : sudo iptables -I DOCKER-USER -j ACCEPT
161
- - name : Fetch snap
162
- uses : actions/download-artifact@v4
163
- with :
164
- name : microk8s.snap
165
- path : build
104
+ - name : Prepare test prerequisites
105
+ uses : ./.github/actions/test-prep
166
106
- name : Running upgrade tests
167
107
env :
168
108
UNDER_TIME_PRESSURE : ${{ !contains(github.event.pull_request.labels.*.name, 'run-all-tests') }}
@@ -174,21 +114,12 @@ jobs:
174
114
name : Cluster agent health check
175
115
runs-on : ubuntu-22.04
176
116
needs : build
177
-
117
+ timeout-minutes : 30
178
118
steps :
179
119
- name : Checking out repo
180
120
uses : actions/checkout@v4
181
- - name : Install test dependencies
182
- run : |
183
- set -x
184
- sudo apt-get install python3-setuptools
185
- sudo pip3 install --upgrade pip
186
- sudo pip3 install -U pytest sh requests
187
- - name : Fetch snap
188
- uses : actions/download-artifact@v4
189
- with :
190
- name : microk8s.snap
191
- path : build
121
+ - name : Prepare test prerequisites
122
+ uses : ./.github/actions/test-prep
192
123
- name : Running cluster agent health check
193
124
run : |
194
125
set -x
@@ -199,26 +130,18 @@ jobs:
199
130
name : Test airgap installation
200
131
runs-on : ubuntu-22.04
201
132
needs : build
202
-
133
+ timeout-minutes : 30
203
134
steps :
204
135
- name : Checking out repo
205
136
uses : actions/checkout@v4
206
- - name : Fetch snap
207
- uses : actions/download-artifact@v4
208
- with :
209
- name : microk8s.snap
210
- path : build
137
+ - name : Prepare test prerequisites
138
+ uses : ./.github/actions/test-prep
211
139
- name : Initialize LXD
212
140
run : |
213
141
sudo lxd init --auto
214
142
sudo lxc network set lxdbr0 ipv6.address=none
215
143
sudo usermod --append --groups lxd $USER
216
144
sg lxd -c 'lxc version'
217
- # Docker sets iptables rules that interfere with LXD or K8s.
218
- # https://documentation.ubuntu.com/lxd/en/latest/howto/network_bridge_firewalld/#prevent-connectivity-issues-with-lxd-and-docker
219
- - name : Apply Docker iptables workaround
220
- shell : bash
221
- run : sudo iptables -I DOCKER-USER -j ACCEPT
222
145
- name : Run airgap tests
223
146
run : |
224
147
sudo -E bash -x -c "./tests/libs/airgap.sh --distro ubuntu:22.04 --channel $PWD/build/microk8s.snap"
@@ -227,6 +150,7 @@ jobs:
227
150
name : Security scan
228
151
runs-on : ubuntu-22.04
229
152
needs : build
153
+ timeout-minutes : 30
230
154
steps :
231
155
- name : Checking out repo
232
156
uses : actions/checkout@v4
0 commit comments