@@ -43,6 +43,14 @@ SPEC_FILE=packaging/nmstate.spec
43
43
RPM_DATA =$(shell date +"% a % b % d % Y")
44
44
RUST_SOURCES := $(shell find rust/ -name "* .rs" -print)
45
45
46
+ # Due to tokio bug https://github.com/tokio-rs/tokio/issues/6889
47
+ # We only check for definite memory leak
48
+ define VALGRIND_OPTS
49
+ --errors-for-leak-kinds=definite --trace-children=yes \
50
+ --leak-check=full --error-exitcode=1
51
+ endef
52
+
53
+
46
54
# outdir is used by COPR as well: https://docs.pagure.org/copr.copr/user_documentation.html
47
55
outdir ?= $(ROOT_DIR )
48
56
@@ -209,28 +217,22 @@ clib_check: $(CLIB_SO_DEV_DEBUG) $(CLIB_HEADER)
209
217
-o $(TMPDIR ) /nmstate_fmt_test \
210
218
rust/src/clib/test/nmstate_fmt_test.c -lnmstate
211
219
LD_LIBRARY_PATH=$(TMPDIR ) \
212
- valgrind --trace-children=yes --leak-check=full \
213
- --error-exitcode=1 \
220
+ valgrind $(VALGRIND_OPTS ) \
214
221
$(TMPDIR ) /nmstate_json_test 1> /dev/null
215
222
LD_LIBRARY_PATH=$(TMPDIR ) \
216
- valgrind --trace-children=yes --leak-check=full \
217
- --error-exitcode=1 \
223
+ valgrind $(VALGRIND_OPTS ) \
218
224
$(TMPDIR ) /nmpolicy_json_test 1> /dev/null
219
225
LD_LIBRARY_PATH=$(TMPDIR ) \
220
- valgrind --trace-children=yes --leak-check=full \
221
- --error-exitcode=1 \
226
+ valgrind $(VALGRIND_OPTS ) \
222
227
$(TMPDIR ) /nmstate_yaml_test 1> /dev/null
223
228
LD_LIBRARY_PATH=$(TMPDIR ) \
224
- valgrind --trace-children=yes --leak-check=full \
225
- --error-exitcode=1 \
229
+ valgrind $(VALGRIND_OPTS ) \
226
230
$(TMPDIR ) /nmpolicy_yaml_test 1> /dev/null
227
231
LD_LIBRARY_PATH=$(TMPDIR ) \
228
- valgrind --trace-children=yes --leak-check=full \
229
- --error-exitcode=1 \
232
+ valgrind $(VALGRIND_OPTS ) \
230
233
$(TMPDIR ) /nmstate_gen_diff_test 1> /dev/null
231
234
LD_LIBRARY_PATH=$(TMPDIR ) \
232
- valgrind --trace-children=yes --leak-check=full \
233
- --error-exitcode=1 \
235
+ valgrind $(VALGRIND_OPTS ) \
234
236
$(TMPDIR ) /nmstate_fmt_test 1> /dev/null
235
237
rm -rf $(TMPDIR )
236
238
0 commit comments