Skip to content

Commit bc61051

Browse files
committed
ci: extend workflows with pysim test suite
1 parent 55c0385 commit bc61051

File tree

1 file changed

+126
-0
lines changed

1 file changed

+126
-0
lines changed
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
name: Extended CI for UICC Project
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
pysim-integration-tests:
15+
runs-on: ubuntu-24.04
16+
timeout-minutes: 30
17+
18+
strategy:
19+
matrix:
20+
# Only test the most common configuration to avoid redundancy with ci_uicc.yml
21+
flags: [""]
22+
compiler: [gcc]
23+
24+
steps:
25+
- name: Checkout Project
26+
uses: actions/checkout@v4
27+
28+
- name: Install CMake
29+
uses: lukka/get-cmake@latest
30+
with:
31+
cmakeVersion: 3.27.0
32+
ninjaVersion: 1.11.1
33+
34+
- name: Install Embedded Toolchain
35+
uses: carlosperate/arm-none-eabi-gcc-action@v1.8.1
36+
37+
- name: Configure and Build Project
38+
run: |
39+
cmake -S . -B build -DBUILD_TESTING=y -DCONFIG_USE_SYSTEM_HEAP=y -DCONFIG_ENABLE_SANITIZE=y ${{ matrix.flags }}
40+
cmake --build build
41+
env:
42+
CC: ${{ matrix.compiler }}
43+
CXX: ${{ matrix.compiler }}++
44+
45+
- name: Copy executables to src dir
46+
run: |
47+
cp build/src/softsim/softsim src/softsim/softsim
48+
49+
- name: Checkout vsmartcard
50+
uses: actions/checkout@v4
51+
with:
52+
repository: frankmorgner/vsmartcard
53+
path: vsmartcard
54+
55+
- name: Setup VPCD
56+
run: |
57+
sudo apt install libpcsclite-dev help2man
58+
cd vsmartcard/virtualsmartcard
59+
autoreconf --verbose --install --force
60+
sudo ./configure --sysconfdir=/etc
61+
sudo make
62+
sudo make install
63+
64+
- name: Start pcscd service
65+
run: |
66+
sudo apt install pcscd
67+
sudo systemctl start pcscd
68+
69+
- name: Checkout onomondo-softsim-test-suite (Private)
70+
uses: actions/checkout@v4
71+
with:
72+
repository: onomondo/onomondo-softsim-test-suite
73+
submodules: recursive
74+
path: onomondo-softsim-test-suite
75+
token: ${{ secrets.GH_AUTH_TOKEN }}
76+
77+
- name: Setup Python for pySim
78+
uses: actions/setup-python@v5
79+
with:
80+
python-version: "3.12"
81+
82+
- name: Clone pySim and Install Requirements
83+
run: |
84+
git clone https://gitea.osmocom.org/sim-card/pysim.git "$GITHUB_WORKSPACE/pysim"
85+
pip3 install -r "$GITHUB_WORKSPACE/onomondo-softsim-test-suite/requirements.txt"
86+
pip3 install -r "$GITHUB_WORKSPACE/pysim/requirements.txt"
87+
# Downgrade cmd2 to version compatible with test suite's import style
88+
pip3 install --force-reinstall 'cmd2<2.0.0'
89+
90+
- name: Remove files before restoring them
91+
run: |
92+
git rm -rf files/3f00 files/3f00.def || true
93+
mkdir -p files
94+
95+
- name: Start SoftSIM
96+
run: |
97+
src/softsim/softsim &
98+
sleep 2
99+
100+
- name: Restore files and verify integrity
101+
run: |
102+
set -e
103+
./pysim/pySim-shell.py -p0 --script ./utils/files-creation/all.pysim
104+
git add files
105+
git diff --cached --exit-code
106+
107+
- name: Run onomondo-softsim-test-suite
108+
run: |
109+
cd "$GITHUB_WORKSPACE/onomondo-softsim-test-suite/"
110+
# Note: this only logs, expected to fail but does not report error code
111+
python test_SIM_OS.py || true
112+
113+
- name: Stop SoftSIM
114+
run: |
115+
pkill -f softsim -USR1 || true
116+
sleep 5
117+
118+
- name: Install libosmocore-utils (for Milenage testing)
119+
run: |
120+
sudo apt-get update
121+
sudo apt-get install -y --no-install-recommends libosmocore-utils
122+
123+
- name: Run onomondo-softsim-test-suite (standalone version)
124+
run: |
125+
cd "$GITHUB_WORKSPACE/onomondo-softsim-test-suite/"
126+
SOFTSIM_TEST_RUNNER=execute_softsim PYTHONPATH=./pysim SOFTSIM=../src/softsim/softsim python3 -m unittest -v

0 commit comments

Comments
 (0)