Skip to content

Commit 1b57520

Browse files
committed
ci: Add test plan that runs CI tests and customize it for the network role
* Add 6 managed nodes to make tests faster * Provision each test node with 2 NICs eth0 and eth1 Signed-off-by: Sergei Petrosian <[email protected]>
1 parent 3dc49b9 commit 1b57520

File tree

2 files changed

+111
-3
lines changed

2 files changed

+111
-3
lines changed

.github/workflows/tft.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ jobs:
157157
uses: sclorg/testing-farm-as-github-action@v3
158158
if: contains(needs.prepare_vars.outputs.supported_platforms, matrix.platform)
159159
with:
160-
git_url: https://github.com/linux-system-roles/tft-tests
161160
git_ref: main
162161
pipeline_settings: '{ "type": "tmt-multihost" }'
163162
environment_settings: '{ "provisioning": { "tags": { "BusinessUnit": "system_roles" } } }'
@@ -180,8 +179,7 @@ jobs:
180179
tf_scope: private
181180
api_key: ${{ secrets.TF_API_KEY_RH }}
182181
update_pull_request_status: false
183-
tmt_hardware: '{ "memory": ">= ${{ needs.prepare_vars.outputs.memory }} MB", "network": [{"type": "eth", "device-name": "eth0"}, {"type": "eth", "device-name": "eth1"}] }'
184-
tmt_plan_filter: "tag:general,network"
182+
tmt_plan_filter: "tag:playbooks_parallel,network"
185183

186184
- name: Set final commit status
187185
uses: myrotvorets/set-commit-status-action@master

plans/test_playbooks_parallel.fmf

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
summary: A general test for a system role
2+
tag: playbooks_parallel
3+
provision:
4+
# TF uses `how: artemis`, and `tmt try`` uses `how: virtual`.
5+
# Hence there is no need to define `how` explicitly.
6+
- name: control-node1
7+
role: control_node
8+
# `connection: system` is required for `how: virtual` to assign VMs a real
9+
# IP making SSH configuration easier.
10+
# This setting is ignored in `artemis`, so we can leave it as is.
11+
connection: system
12+
- name: managed-node1
13+
role: managed_node
14+
connection: system
15+
hardware:
16+
network:
17+
- type: eth
18+
- type: eth
19+
- name: managed-node2
20+
role: managed_node
21+
connection: system
22+
hardware:
23+
network:
24+
- type: eth
25+
- type: eth
26+
- name: managed-node3
27+
role: managed_node
28+
connection: system
29+
hardware:
30+
network:
31+
- type: eth
32+
- type: eth
33+
- name: managed-node4
34+
role: managed_node
35+
connection: system
36+
hardware:
37+
network:
38+
- type: eth
39+
- type: eth
40+
- name: managed-node5
41+
role: managed_node
42+
connection: system
43+
hardware:
44+
network:
45+
- type: eth
46+
- type: eth
47+
- name: managed-node6
48+
role: managed_node
49+
connection: system
50+
hardware:
51+
network:
52+
- type: eth
53+
- type: eth
54+
environment:
55+
ANSIBLE_VER: 2.17
56+
REPO_NAME: network
57+
PYTHON_VERSION: 3.12
58+
SYSTEM_ROLES_ONLY_TESTS: ""
59+
TEST_LOCAL_CHANGES: true
60+
PR_NUM: ""
61+
LINUXSYSTEMROLES_USER: ""
62+
LINUXSYSTEMROLES_DOMAIN: ""
63+
LINUXSYSTEMROLES_SSH_KEY: ""
64+
ARTIFACTS_DIR: ""
65+
ARTIFACTS_URL: ""
66+
LSR_TFT_DEBUG: false
67+
prepare:
68+
- name: Use vault.centos.org repos (CS 7, 8 EOL workaround)
69+
script: |
70+
if grep -q 'CentOS Stream release 8' /etc/redhat-release; then
71+
sed -i '/^mirror/d;s/#\(baseurl=http:\/\/\)mirror/\1vault/' /etc/yum.repos.d/*.repo
72+
fi
73+
if grep -q 'CentOS Linux release 7.9' /etc/redhat-release; then
74+
sed -i '/^mirror/d;s/#\?\(baseurl=http:\/\/\)mirror/\1vault/' /etc/yum.repos.d/*.repo
75+
fi
76+
# Replace with feature: epel: enabled once https://github.com/teemtee/tmt/pull/3128 is merged
77+
- name: Enable epel to install beakerlib
78+
script: |
79+
# CS 10 and Fedora doesn't require epel
80+
if grep -q -e 'CentOS Stream release 10' -e 'Fedora release' /etc/redhat-release; then
81+
exit 0
82+
fi
83+
yum install epel-release yum-utils -y
84+
yum-config-manager --enable epel epel-debuginfo epel-source
85+
- name: Test NICs
86+
script: lshw -C network
87+
discover:
88+
- name: Prepare managed node
89+
how: fmf
90+
where: managed_node
91+
filter: tag:prep_managed_node
92+
url: https://github.com/linux-system-roles/tft-tests
93+
ref: main
94+
- name: Run test playbooks from control_node
95+
how: fmf
96+
where: control_node
97+
filter: tag:test_playbooks
98+
url: https://github.com/linux-system-roles/tft-tests
99+
ref: main
100+
# Uncomment this step for troubleshooting
101+
# This is required because currently testing-farm cli doesn't support running multi-node plans
102+
# You can set ID_RSA_PUB in the environment section above to your public key to distribute it to nodes
103+
# - name: Inject your ssh public key to test systems
104+
# how: fmf
105+
# where: control_node
106+
# filter: tag:reserve_system
107+
# url: https://github.com/linux-system-roles/tft-tests
108+
# ref: main
109+
execute:
110+
how: tmt

0 commit comments

Comments
 (0)