-
Notifications
You must be signed in to change notification settings - Fork 7
144 lines (127 loc) · 4.35 KB
/
test.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
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
---
name: Run DTS tests
on:
pull_request:
branches:
- "main"
jobs:
build-dts:
uses: ./.github/workflows/build.yml
with:
cacheless: false
checkout-osfv:
runs-on: dts-builder
steps:
- name: Checkout OSFV repo
uses: actions/checkout@v4
with:
repository: "Dasharo/open-source-firmware-validation"
path: "open-source-firmware-validation"
submodules: "recursive"
ref: "develop"
run-tests:
name: Run DTS tests
needs: [build-dts, checkout-osfv]
runs-on:
labels: dts-builder
strategy:
matrix:
include:
- test: msi_comm
dpp_download_key: $MSI_DOWNLOAD
dpp_logs_key: $MSI_LOGS
log_file: output_msi.log
- test: msi_dpp
dpp_download_key: $MSI_DOWNLOAD
dpp_logs_key: $MSI_LOGS
log_file: output_msi.log
- test: msi_heads
dpp_download_key: $MSI_HEADS_DOWNLOAD
dpp_logs_key: $MSI_HEADS_LOGS
log_file: output_msi_heads.log
- test: optiplex_dpp
dpp_download_key: $OPTIPLEX_DOWNLOAD
dpp_logs_key: $OPTIPLEX_LOGS
log_file: output_nc_heads.log
- test: novacustom_heads
dpp_download_key: $OPTIPLEX_DOWNLOAD
dpp_logs_key: $OPTIPLEX_LOGS
log_file: output_nc_heads.log
- test: novacustom_comm
dpp_download_key: $OPTIPLEX_DOWNLOAD
dpp_logs_key: $OPTIPLEX_LOGS
log_file: output_nc_heads.log
- test: pcengines_dpp
dpp_download_key: $PCENGINES_DOWNLOAD
dpp_logs_key: $PCENGINES_LOGS
log_file: output_pcengines.log
- test: pcengines_seabios
dpp_download_key: $PCENGINES_SEABIOS_DOWNLOAD
dpp_logs_key: $PCENGINES_SEABIOS_LOGS
log_file: output_pcengines_seabios.log
steps:
- name: Run IPXE server
shell: bash
run: ./open-source-firmware-validation/scripts/ci/ipxe-run.sh \
build/tmp/deploy/images/genericx86-64/dts-base-image-genericx86-64.cpio.gz \
build/tmp/deploy/images/genericx86-64/bzImage &
- name: Install requirements
shell: bash
run: |
cd open-source-firmware-validation
if [ ! -d "venv" ]; then
python3 -m venv venv
fi
source venv/bin/activate
pip install -r requirements.txt
- name: Run QEMU
shell: bash
id: run_qemu
run: |
cd open-source-firmware-validation/scripts/ci
mkdir -p qemu-data
touch qemu-data/hdd.qcow2
./qemu-run.sh nographic os &
- name: Create directory for logs
shell: bash
id: create_log_dirs
run: |
LOG_DIR="/tmp/dst-test-ci-${{ github.run_id }}/${{ matrix.test }}"
mkdir -p $LOG_DIR
echo "LOG_DIR=$LOG_DIR" >> $GITHUB_ENV
- name: Run ${{ matrix.test }}
shell: bash
run: |
cd open-source-firmware-validation
source venv/bin/activate
# This file is already present on dts-builder.
# It contains credentials for DPP subscriptions.
# It has the following form:
# DPP_PASSWORD="..."
# <SUBSCRIPTION_TYPE>_DOWNLOADS="download key"
# <SUBSCRIPTION_TYPE>_LOGS="logs key"
# (...)
source ~/.secrets/dpp-keys
ip_addr=$(ip -o -4 addr list eno2 | awk '{print $4}' | cut -d/ -f1)
robot -L TRACE -v config:qemu -v rte_ip:127.0.0.1 -v snipeit:no \
-v dpp_password:$DPP_PASSWORD -v dpp_download_key:${{ matrix.dpp_download_key }} \
-v dpp_logs_key:${{ matrix.dpp_logs_key }} -v netboot_utilities_support:True \
-v dts_ipxe_link:http://${ip_addr}:4321/dts.ipxe \
-i ${{ matrix.test }} dts/dts-e2e.robot 2>&1 \
| tee ${{ env.LOG_DIR }}/${{ matrix.log_file }} | grep "| PASS |\|| FAIL |"
- name: Copy log
shell: bash
if: ${{ !cancelled() }}
run: |
cp open-source-firmware-validation/log.html ${{ env.LOG_DIR }}/log.html
cleanup:
name: Cleanup
if: always()
needs: run-tests
runs-on:
labels: dts-builder
steps:
- name: Cleanup after tests
shell: bash
run: |
rm -rf $GITHUB_WORKSPACE; mkdir $GITHUB_WORKSPACE