Skip to content

Commit 6559200

Browse files
Edge Virtualization Platform v1.45.0
1 parent e8b6764 commit 6559200

File tree

16 files changed

+188
-88
lines changed

16 files changed

+188
-88
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -95,19 +95,6 @@ jobs:
9595
ref: ${{ inputs.ref || github.sha }}
9696
package-namespace: ${{ needs.infos.outputs.package-namespace }}
9797

98-
build-modules:
99-
name: Build
100-
needs:
101-
- checks
102-
- builder
103-
- infos
104-
uses: ./.github/workflows/build-modules.yml
105-
secrets: inherit
106-
with:
107-
builder-tag: ${{ needs.builder.outputs.builder-tag }}
108-
ref: ${{ inputs.ref || github.sha }}
109-
package-namespace: ${{ needs.infos.outputs.package-namespace }}
110-
11198
build-agent:
11299
name: Build
113100
needs:
@@ -125,8 +112,6 @@ jobs:
125112
name: Tests
126113
needs:
127114
- checks
128-
- build-sdk
129-
- build-modules
130115
- builder
131116
- infos
132117
uses: ./.github/workflows/test.yml

.github/workflows/test.yml

Lines changed: 25 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,8 @@ jobs:
5050
with:
5151
ref: ${{ inputs.ref }}
5252

53-
- name: Download test modules
54-
uses: actions/download-artifact@v4
55-
with:
56-
name: test-modules-${{ matrix.name }}-${{ matrix.platform }}-${{ github.run_id }}
57-
path: test_modules/
58-
59-
- name: Download Python SDK
60-
uses: actions/download-artifact@v4
61-
with:
62-
name: python-sdk-${{ matrix.name }}-${{ matrix.platform }}-${{ github.run_id }}
63-
path: py-sdk
64-
65-
- name: Set permissions
66-
run: chmod +x test_modules/*.elf
67-
53+
# We need to build dependencies independently as we don't want the same
54+
# build flags i.e. `-Og -Werror` flag
6855
- name: Build dependencies
6956
run: |
7057
make -j$((`nproc` * 2)) \
@@ -73,37 +60,28 @@ jobs:
7360
TOOL=clang \
7461
depend
7562
76-
- name: Build agent
63+
# We need to build the modules independently as we don't want the same
64+
# build flags i.e. `-Werror` flag
65+
- name: Build modules
7766
run: |
7867
make -j$((`nproc` * 2))\
7968
KBUILD_DEFCONFIG=configs/unit-test-all-hubs-wasm.config\
80-
TOOL=clang \
81-
SANITIZER=ENABLED \
82-
COVERAGE=ccov \
83-
CFLAGS="-g -Og -Werror" \
84-
85-
- name: Build tests
86-
run: |
87-
make -C test -j$((`nproc` * 2))\
88-
TOOL=clang \
89-
SANITIZER=ENABLED \
90-
COVERAGE=ccov \
91-
CFLAGS="-g -Og -Werror" \
92-
LDFLAGS="-fuse-ld=lld -g" \
93-
build
94-
95-
- name: Install the Python SDK
96-
run: |
97-
python3 -m venv .venv
98-
. .venv/bin/activate
99-
pip3 install py-sdk/*.whl
100-
69+
test_modules/tests
70+
10171
- name: Run tests
10272
env:
10373
ASAN_OPTIONS: detect_leaks=1:detect_stack_use_after_return=1
10474
UBSAN_OPTIONS: print_stacktrace=1
10575
TERM: xterm
106-
run: . .venv/bin/activate && make -C test -j RUNFLAGS='-c -t 60'
76+
run: |
77+
make test -j$((`nproc` * 2))\
78+
KBUILD_DEFCONFIG=configs/unit-test-all-hubs-wasm.config\
79+
TOOL=clang \
80+
SANITIZER=ENABLED \
81+
COVERAGE=ccov \
82+
CFLAGS="-g -Og -Werror" \
83+
LDFLAGS="-g" \
84+
RUNFLAGS='-c -t 60'
10785
10886
- name: Report summary blob profiling
10987
if: always()
@@ -141,6 +119,15 @@ jobs:
141119
path: test/logs/**/*.log
142120
retention-days: ${{ job.status == 'success' && '7' || '14' }}
143121

122+
- uses: actions/upload-artifact@v4
123+
with:
124+
name: test-modules-${{ matrix.name }}-${{ matrix.platform }}-${{ github.run_id }}
125+
path: |
126+
test_modules/*.elf
127+
test_modules/*.wasm
128+
test_modules/*.wasm.*
129+
test_modules/python/*.zip
130+
144131
- name: Upload coverage results
145132
uses: actions/upload-artifact@v4
146133
with:

Makefile

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,17 @@ depend sdk src libs: lib bin deps.mk include/version.h .config
1818
libs depend: FORCE
1919
+cd src && $(MAKE) $@
2020

21+
libs: sdk
22+
2123
sdk: FORCE
2224
+cd src && $(MAKE) libevp-app-sdk
2325

26+
pysdk: sdk
27+
+cd src && $(MAKE) python-evp-app-sdk
28+
2429
lib bin:
2530
mkdir -p $@
2631

27-
wasm_test_modules: sdk
28-
+cd test_modules && $(MAKE) elf wasm
29-
3032
check: FORCE
3133
$(MAKE) -f check.mk $@
3234

@@ -38,11 +40,27 @@ check_test_config: FORCE
3840
exit 1;\
3941
fi
4042

41-
test: check_test_config libs test_modules
43+
test: check_test_config libs test_modules/tests pysdk
4244

4345
test_modules: sdk
4446

45-
signed_test_modules: test_modules
47+
# NOTE: Kept for backward compatibility with private tests
48+
signed_test_modules: test_modules/signed
49+
50+
test_modules/tests: sdk
51+
+cd test_modules && $(MAKE) elf wasm python
52+
53+
test_modules/wasm: sdk
54+
+cd test_modules && $(MAKE) wasm
55+
56+
test_modules/elf:
57+
+cd test_modules && $(MAKE) elf
58+
59+
test_modules/python:
60+
+cd test_modules && $(MAKE) python
61+
.PHONY: test_modules/python
62+
63+
test_modules/signed: test_modules
4664
+cd test_modules && $(MAKE) signed
4765

4866
include/version.h: FORCE

docs/testing/index.rst

Lines changed: 53 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -183,13 +183,13 @@ one matching parameter of a variable length argument list.
183183
Special patterns
184184
^^^^^^^^^^^^^^^^
185185

186-
Suboject pattern
187-
""""""""""""""""
186+
Subobject pattern
187+
"""""""""""""""""
188188

189189
.. code:: C
190190
191191
verify_json(txt,
192-
"suboject={"
192+
"subobject={"
193193
" key1=%s,"
194194
" key2=%s}",
195195
"value3", "value4");
@@ -206,7 +206,7 @@ The previous example would match something like:
206206
{
207207
"key1": "value1",
208208
"key2": "value2",
209-
"suboject": {
209+
"subobject": {
210210
"key1": "value3",
211211
"key2": "value4"
212212
}
@@ -215,8 +215,8 @@ The previous example would match something like:
215215
Subobject patterns can be nested.
216216

217217

218-
Suboject pattern
219-
""""""""""""""""
218+
String subobject pattern
219+
""""""""""""""""""""""""
220220

221221
.. code:: C
222222
@@ -226,7 +226,7 @@ Suboject pattern
226226
" key2=%s}",
227227
"value3", "value4");
228228
229-
This pattern is similar to the suboject pattern,
229+
This pattern is similar to the subobject pattern,
230230
but in this case
231231
the preceding dot expression must point to a JSON string value
232232
that contains a literal JSON object.
@@ -296,7 +296,7 @@ The full list of checks enabled is:
296296
fsanitize=vla-bound
297297
298298
More information about every specific option can be found in the
299-
`Clang Undefined behavior sanitizer` and `Clang Address sanitizer` documentation.
299+
``Clang Undefined behavior sanitizer`` and ``Clang Address sanitizer`` documentation.
300300
More information about how this is done
301301
can be found in :ref:`toolchain`.
302302

@@ -305,15 +305,58 @@ Code coverage
305305

306306
The tests are designed to cover
307307
as much code as possible
308-
and the coverage level is measured using `llvm-cov`.
308+
and the coverage level is measured using ``llvm-cov``.
309309
When the tests are compiled for the CI execution
310-
they are instrumented to generate output `llvm-cov` coverage information
310+
they are instrumented to generate output ``llvm-cov`` coverage information
311311
that later is processed by some scripts and
312312
reported to the CI
313313
to ensure that the minimun coverage level is matched.
314314
More information about how this is done
315315
can be found in :ref:`toolchain`.
316316

317+
Execution
318+
*********
319+
320+
The tests must be compiled with ``unit-test-all-hubs-wasm.config``.
321+
322+
.. code:: shell
323+
324+
make config KBUILD_DEFCONFIG=configs/unit-test-all-hubs-wasm.config
325+
326+
Tests can then be run with the single make target ``test``.
327+
328+
.. code:: shell
329+
330+
make test KBUILD_DEFCONFIG=configs/unit-test-all-hubs-wasm.config
331+
332+
This target will build everything the tests require,
333+
create a virtual environment (``.venv``),
334+
install the python sdk,
335+
and execute all tests in parallel inside
336+
the virtual environment.
337+
338+
The completed tests will be reported
339+
as ``PASS`` or ``FAIL`` upon completion,
340+
and a global summary will show the test results:
341+
342+
.. code:: shell
343+
344+
make test
345+
...
346+
PASS EVP1 src/systest/test_instance_state.elf
347+
FAIL TB src/systest/test_python_mod_zombie.elf
348+
PASS EVP1 src/systest/test_capture_mode.elf
349+
PASS TB src/systest/test_capture_mode.elf
350+
PASS TB src/st-nohub/test_start_stop.elf
351+
FAIL TB src/evp2-tb/test_embed_backdoor.elf
352+
----------- SUMMARY -----------
353+
RUN 203
354+
PASSED 201
355+
FAILED 2
356+
FAIL TB src/systest/test_python_mod_zombie.elf
357+
FAIL TB src/evp2-tb/test_embed_backdoor.elf
358+
359+
317360
--------------
318361

319362
.. _Cmocka: https://cmocka.org

scripts/cmake-flatcc.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ cmake \
2828
-DFLATCC_TEST=0 \
2929
-DFLATCC_INSTALL=ON \
3030
-DFLATCC_DEBUG_CLANG_SANITIZE=OFF \
31+
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
3132
..
3233

3334
trap "" EXIT INT TERM HUP

scripts/cmake-libweb.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ cmake \
2424
-DCMAKE_C_COMPILER="${CC:-cc}" \
2525
-DCMAKE_CXX_COMPILER="${CXX:-c++}" \
2626
-DCMAKE_C_FLAGS="${CFLAGS}" \
27+
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
2728
..
2829

2930
trap "" EXIT INT TERM HUP

scripts/cmake-mbedtls.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ cmake \
2727
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
2828
-DENABLE_TESTING=OFF \
2929
-DENABLE_PROGRAMS=OFF \
30+
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
3031
${MBEDTLS_USER_CONFIG_FILE:+-DMBEDTLS_USER_CONFIG_FILE="$MBEDTLS_USER_CONFIG_FILE"} \
3132
..
3233

scripts/cmake-wasm-micro-runtime.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ cmake \
6767
-DWAMR_BUILD_BULK_MEMORY=1 \
6868
-DWAMR_DISABLE_WRITE_GS_BASE=1 \
6969
-DCMAKE_STRIP=0 \
70+
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
7071
..
7172

7273
trap "" EXIT INT TERM HUP

scripts/rules.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
all:
88

99
# Macros related to the version of the agent
10-
VERSION = 1.43.0
10+
VERSION = 1.45.0
1111
SDK_VERSION = 1.0.0
1212

1313
# Default value for configuration macros

src/Makefile

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,25 @@
44

55
PROJECTDIR = ..
66

7-
EVP_LIBS = \
8-
libevp-agent\
9-
libevp-utils\
10-
libevp-app-sdk \
11-
127
DIRS = \
138
evp_agent\
149
libparson\
1510
sdkenc\
16-
$(EVP_LIBS)
11+
libevp-agent\
12+
libevp-utils\
13+
libevp-app-sdk\
14+
python-evp-app-sdk\
1715

1816
include $(PROJECTDIR)/scripts/rules.mk
1917
-include $(PROJECTDIR)/deps.mk
18+
-include $(PROJECTDIR)/.config
19+
20+
EVP_LIBS-y += \
21+
libevp-agent\
22+
libevp-utils\
23+
24+
EVP_LIBS-$(CONFIG_EVP_SDK_SOCKET) +=\
25+
libevp-app-sdk\
2026

2127
# After build try to remove the cmake directory that
2228
# some cmake projects create in the top directory
@@ -25,10 +31,12 @@ all: evp_agent libs
2531

2632
depend: $(LIBDIRS)
2733

28-
libs: $(EVP_LIBS)
34+
libs: $(EVP_LIBS-y)
2935

3036
libevp-agent libevp-app-sdk: $(LIBDIRS)
3137

38+
python-evp-app-sdk: libevp-app-sdk
39+
3240
libevp-agent: libevp-utils
3341

3442
evp_agent: libevp-agent libevp-utils

0 commit comments

Comments
 (0)