-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
596 lines (537 loc) · 24.7 KB
/
.gitlab-ci.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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
---
stages:
- builds
- functional_test
- code_quality_test
- publish
image: buildpack-deps:bookworm
variables:
GIT_SUBMODULE_STRATEGY: recursive
build-posix-debug:
stage: builds
when: always
script:
- make werror=yes verbose=yes
build-posix-release:
stage: builds
when: always
script:
- make -j4 type=release optimize=yes werror=yes verbose=yes
build-clang-posix-debug:
stage: builds
when: always
image: registry.gitlab.com/d3tn/ud3tn-docker-images/ci-python-clang:3.8-bookworm
script:
- make werror=yes verbose=yes TOOLCHAIN=clang
build-clang-posix-release:
stage: builds
when: always
image: registry.gitlab.com/d3tn/ud3tn-docker-images/ci-python-clang:3.8-bookworm
script:
- make type=release optimize=yes werror=yes verbose=yes TOOLCHAIN=clang
build-nix-x86_64-linux:
stage: builds
when: always
image: nixos/nix:2.18.1
script:
- nix build --experimental-features 'nix-command flakes' '.?submodules=1#ud3tn'
- nix build --experimental-features 'nix-command flakes' '.?submodules=1#pyd3tn'
- nix build --experimental-features 'nix-command flakes' '.?submodules=1#python-ud3tn-utils'
build-posix-arm64-debug:
extends: build-posix-debug
tags: ["arm64"]
build-posix-arm64-release:
extends: build-posix-release
tags: ["arm64"]
build-clang-posix-arm64-debug:
extends: build-clang-posix-debug
tags: ["arm64"]
image: registry.gitlab.com/d3tn/ud3tn-docker-images/ci-python-clang:3.8-bookworm-arm64
build-clang-posix-arm64-release:
extends: build-clang-posix-release
tags: ["arm64"]
image: registry.gitlab.com/d3tn/ud3tn-docker-images/ci-python-clang:3.8-bookworm-arm64
build-posix-macos-debug:
extends: build-posix-debug
tags: ["macos"]
build-posix-macos-release:
extends: build-posix-release
tags: ["macos"]
build-freebsd:
extends: build-posix-debug
tags: ["freebsd"]
script:
- gmake werror=yes verbose=yes
build-library:
stage: functional_test
when: always
image: registry.gitlab.com/d3tn/ud3tn-docker-images/ci-python-clang:3.8-bookworm
script:
- bash test/dockerfiles/prepare_for_test.sh . /ud3tn_build
- cd /ud3tn_build
- rm -f ./ud3tn.socket ./ud3tn.aap2.socket
- make posix-lib
- gcc -I include/ -c components/daemon/main.c
- gcc -o ud3tn -L. main.o -l:build/posix/libud3tn.so
- ./ud3tn --allow-remote-config &
- source /ud3tn_venv/bin/activate
- pip install -e "pyd3tn"
- pip install -e "python-ud3tn-utils"
- while ! [ -r ./ud3tn.socket ]; do sleep 0.1; done
- while ! [ -r ./ud3tn.aap2.socket ]; do sleep 0.1; done
- pytest test/integration
unit-test-posix-debug:
stage: functional_test
when: always
image: registry.gitlab.com/d3tn/ud3tn-docker-images/ci-python-clang:3.8-bookworm
script:
- bash test/dockerfiles/prepare_for_test.sh . /ud3tn_build TOOLCHAIN=clang sanitize-strict=yes unittest-posix
- cd /ud3tn_build
- ASAN_OPTIONS=detect_leaks=0 UBSAN_OPTIONS=print_stacktrace=1 timeout 60 build/posix/testud3tn
unit-test-posix-release:
stage: functional_test
when: always
image: registry.gitlab.com/d3tn/ud3tn-docker-images/ci-python-clang:3.8-bookworm
script:
- bash test/dockerfiles/prepare_for_test.sh . /ud3tn_build type=release sanitize-strict=yes unittest-posix
- cd /ud3tn_build
- ASAN_OPTIONS=detect_leaks=0 UBSAN_OPTIONS=print_stacktrace=1 timeout 60 build/posix/testud3tn
unit-test-posix-arm64:
extends: unit-test-posix-debug
tags: ["arm64"]
image: registry.gitlab.com/d3tn/ud3tn-docker-images/ci-python-clang:3.8-bookworm-arm64
unit-test-posix-macos:
stage: functional_test
when: always
tags: ["macos"]
script:
- make unittest-posix -j4 sanitize-strict=yes
- ASAN_OPTIONS=detect_leaks=0 UBSAN_OPTIONS=print_stacktrace=1 gtimeout 60 build/posix/testud3tn
unit-test-posix-freebsd:
stage: functional_test
when: always
tags: ["freebsd"]
script:
- gmake unittest-posix sanitize-strict=yes
- ASAN_OPTIONS=detect_leaks=0 UBSAN_OPTIONS=print_stacktrace=1 timeout 60 build/posix/testud3tn
.integration-test-posix:
stage: functional_test
when: always
script:
- bash test/dockerfiles/prepare_for_test.sh . /ud3tn_build TOOLCHAIN=clang sanitize-strict=yes
- cd /ud3tn_build
- rm -f ./ud3tn.socket ./ud3tn.aap2.socket
- UBSAN_OPTIONS=print_stacktrace=1 build/posix/ud3tn --allow-remote-config & UD3TN_PID=$!
- source /ud3tn_venv/bin/activate
- pip install -e "pyd3tn"
- pip install -e "python-ud3tn-utils"
- while ! [ -r ./ud3tn.socket ]; do sleep 0.1; done
- while ! [ -r ./ud3tn.aap2.socket ]; do sleep 0.1; done
- pytest test/integration
- kill -TERM $UD3TN_PID
- echo "Waiting for uD3TN to exit gracefully - if it doesn't, check for sanitizer warnings."
- wait $UD3TN_PID
integration-test-posix-python-3.8:
extends: .integration-test-posix
image: registry.gitlab.com/d3tn/ud3tn-docker-images/ci-python-clang:3.8-bookworm
integration-test-posix-python-3.12:
extends: .integration-test-posix
image: registry.gitlab.com/d3tn/ud3tn-docker-images/ci-python-clang:3.12-bookworm
integration-test-posix-thread-sanitizer:
stage: functional_test
when: always
image: registry.gitlab.com/d3tn/ud3tn-docker-images/ci-python-clang:3.8-bookworm
script:
- bash test/dockerfiles/prepare_for_test.sh . /ud3tn_build TOOLCHAIN=clang sanitize=thread sanitize-strict=yes
- cd /ud3tn_build
- rm -f ./ud3tn.socket ./ud3tn.aap2.socket
- UBSAN_OPTIONS=print_stacktrace=1 build/posix/ud3tn --allow-remote-config & UD3TN_PID=$!
- source /ud3tn_venv/bin/activate
- pip install -e "pyd3tn"
- pip install -e "python-ud3tn-utils"
- while ! [ -r ./ud3tn.socket ]; do sleep 0.1; done
- while ! [ -r ./ud3tn.aap2.socket ]; do sleep 0.1; done
- pytest test/integration
- kill -TERM $UD3TN_PID
- echo "Waiting for uD3TN to exit gracefully - if it doesn't, check for sanitizer warnings."
- wait $UD3TN_PID
integration-test-posix-release:
stage: functional_test
when: always
image: registry.gitlab.com/d3tn/ud3tn-docker-images/ci-python-clang:3.8-bookworm
script:
- bash test/dockerfiles/prepare_for_test.sh . /ud3tn_build type=release optimize=yes
- cd /ud3tn_build
- rm -f ./ud3tn.socket ./ud3tn.aap2.socket
- build/posix/ud3tn --allow-remote-config &
- source /ud3tn_venv/bin/activate
- pip install -e "pyd3tn"
- pip install -e "python-ud3tn-utils"
- while ! [ -r ./ud3tn.socket ]; do sleep 0.1; done
- while ! [ -r ./ud3tn.aap2.socket ]; do sleep 0.1; done
- pytest test/integration
integration-test-posix-arm64:
extends: .integration-test-posix
tags: ["arm64"]
image: registry.gitlab.com/d3tn/ud3tn-docker-images/ci-python-clang:3.8-bookworm-arm64
integration-test-posix-macos:
stage: functional_test
when: always
tags: ["macos"]
script:
- make posix -j4 sanitize-strict=yes optimize=yes
- rm -f ./ud3tn.socket ./ud3tn.aap2.socket
- UBSAN_OPTIONS=print_stacktrace=1 build/posix/ud3tn --allow-remote-config & UD3TN_PID=$!
- make virtualenv
- source .venv/bin/activate
- while ! [ -r ./ud3tn.socket ]; do sleep 0.1; done
- while ! [ -r ./ud3tn.aap2.socket ]; do sleep 0.1; done
- pytest test/integration
- kill -TERM $UD3TN_PID
- echo "Waiting for uD3TN to exit gracefully - if it doesn't, check for sanitizer warnings."
- wait $UD3TN_PID
aap-test:
stage: functional_test
when: always
image: registry.gitlab.com/d3tn/ud3tn-docker-images/ci-python-clang:3.8-bookworm
script:
- bash test/dockerfiles/prepare_for_test.sh . /ud3tn_build sanitize-strict=yes
- cd /ud3tn_build
- source /ud3tn_venv/bin/activate
- pip install -e "pyd3tn"
- pip install -e "python-ud3tn-utils"
- rm -f ./ud3tn.socket
- UBSAN_OPTIONS=print_stacktrace=1 build/posix/ud3tn & UD3TN1_PID=$!
- while ! [ -r ./ud3tn.socket ]; do sleep 0.1; done
- python tools/aap/aap_test.py
- kill -TERM $UD3TN1_PID
- echo "Waiting for uD3TN to exit gracefully - if it doesn't, check for sanitizer warnings."
- wait $UD3TN1_PID
- UBSAN_OPTIONS=print_stacktrace=1 build/posix/ud3tn -e "dtn://ud3tn2.dtn/" -a '::1' -p 4242 -S ud3tn2.aap2.socket & UD3TN2_PID=$!
- while ! nc -z localhost 4242; do sleep 0.1; done
- python tools/aap/aap_test.py --tcp '::1' 4242
- kill -TERM $UD3TN2_PID
- echo "Waiting for uD3TN to exit gracefully - if it doesn't, check for sanitizer warnings."
- wait $UD3TN2_PID
aap2-test:
stage: functional_test
when: always
image: registry.gitlab.com/d3tn/ud3tn-docker-images/ci-python-clang:3.8-bookworm
script:
- bash test/dockerfiles/prepare_for_test.sh . /ud3tn_build sanitize-strict=yes
- cd /ud3tn_build
- source /ud3tn_venv/bin/activate
- pip install -e "pyd3tn"
- pip install -e "python-ud3tn-utils"
- rm -f ./ud3tn.aap2.socket
- UBSAN_OPTIONS=print_stacktrace=1 build/posix/ud3tn & UD3TN1_PID=$!
- while ! [ -r ./ud3tn.aap2.socket ]; do sleep 0.1; done
- python tools/aap2/aap2_ping.py dtn://ud3tn.dtn/echo -t 1 -c 1
- python tools/aap2/aap2_ping.py dtn://ud3tn.dtn/1 -a 1 -t 1 -c 1
- (sleep 1 && python tools/aap2/aap2_send.py -a 1 -s secret dtn://ud3tn.dtn/1 hello) & timeout 3 python tools/aap2/aap2_receive.py -a 1 -s secret -c 1 --verify-pl hello
- kill -TERM $UD3TN1_PID
- echo "Waiting for uD3TN to exit gracefully - if it doesn't, check for sanitizer warnings."
- wait $UD3TN1_PID
ion-ipn-bpv6-interoperability-test:
stage: functional_test
when: always
image: registry.gitlab.com/d3tn/ud3tn-docker-images/ion-interop:3.7.4
script:
- bash test/dockerfiles/prepare_for_test.sh . /ud3tn_build sanitize=yes
- cd /ud3tn_build
- source /ud3tn_venv/bin/activate
- bash test/ion_interoperability/minimal_forwarding_test/run.sh 6 ipn
ion-ipn-bpv7-interoperability-test:
stage: functional_test
when: always
image: registry.gitlab.com/d3tn/ud3tn-docker-images/ion-interop:4.1.2
script:
- bash test/dockerfiles/prepare_for_test.sh . /ud3tn_build sanitize=yes
- cd /ud3tn_build
- source /ud3tn_venv/bin/activate
- bash test/ion_interoperability/minimal_forwarding_test/run.sh 7 ipn
ione-ipn-bpv7-interoperability-test:
extends: ion-ipn-bpv7-interoperability-test
image: registry.gitlab.com/d3tn/ud3tn-docker-images/ione-interop:1.0.1
ion-dtn-bpv6-interoperability-test:
stage: functional_test
when: always
image: registry.gitlab.com/d3tn/ud3tn-docker-images/ion-interop:3.7.4
script:
- bash test/dockerfiles/prepare_for_test.sh . /ud3tn_build sanitize=yes
- cd /ud3tn_build
- source /ud3tn_venv/bin/activate
- bash test/ion_interoperability/minimal_forwarding_test/run.sh 6 dtn
ion-dtn-bpv7-interoperability-test:
stage: functional_test
when: always
image: registry.gitlab.com/d3tn/ud3tn-docker-images/ion-interop:4.1.2
script:
- bash test/dockerfiles/prepare_for_test.sh . /ud3tn_build sanitize=yes
- cd /ud3tn_build
- source /ud3tn_venv/bin/activate
- bash test/ion_interoperability/minimal_forwarding_test/run.sh 7 dtn
ione-dtn-bpv7-interoperability-test:
extends: ion-dtn-bpv7-interoperability-test
image: registry.gitlab.com/d3tn/ud3tn-docker-images/ione-interop:1.0.1
hdtn-interoperability-test:
stage: functional_test
when: always
image: registry.gitlab.com/d3tn/ud3tn-docker-images/hdtn-interop:1.0.0
script:
- bash test/dockerfiles/prepare_for_test.sh . /ud3tn_build sanitize=yes
- cd /ud3tn_build
- source /ud3tn_venv/bin/activate
- bash test/run_hdtn_test.sh
dtn7-interoperability-test:
stage: functional_test
when: always
image: registry.gitlab.com/d3tn/ud3tn-docker-images/dtn7-interop:0.19.0-732d1a0
script:
- bash test/dockerfiles/prepare_for_test.sh . /ud3tn_build sanitize=yes
- cd /ud3tn_build
- source /ud3tn_venv/bin/activate
- bash test/dtn7_interoperability/run_dtn7_test.sh
mtcp-test:
stage: functional_test
when: always
image: registry.gitlab.com/d3tn/ud3tn-docker-images/ci-python-clang:3.8-bookworm
script:
- bash test/dockerfiles/prepare_for_test.sh . /ud3tn_build sanitize-strict=yes
- cd /ud3tn_build
- rm -f ./ud3tn.socket
- UBSAN_OPTIONS=print_stacktrace=1 build/posix/ud3tn --allow-remote-config & UD3TN_PID=$!
- source /ud3tn_venv/bin/activate
- pip install -e "pyd3tn"
- pip install -e "python-ud3tn-utils"
- while ! [ -r ./ud3tn.socket ]; do sleep 0.1; done
- while ! nc -z localhost 4224; do sleep 0.1; done
- python tools/cla/mtcp_test.py -t mtcp --payload TESTPAYLOAD &
- timeout -v 5 python tools/cla/mtcp_sink.py --count 1 --verify-pl TESTPAYLOAD
- sleep 0.2
- kill -TERM $UD3TN_PID
- echo "Waiting for uD3TN to exit gracefully - if it doesn't, check for sanitizer warnings."
- wait $UD3TN_PID
fragment-reassembly-test:
stage: functional_test
when: always
image: registry.gitlab.com/d3tn/ud3tn-docker-images/ci-python-clang:3.8-bookworm
script:
- bash test/dockerfiles/prepare_for_test.sh . /ud3tn_build sanitize-strict=yes
- cd /ud3tn_build
- rm -f ./ud3tn1.socket
- rm -f ./ud3tn2.socket
- UBSAN_OPTIONS=print_stacktrace=1 build/posix/ud3tn -c "mtcp:*,4222" -e "dtn://ud3tn1.dtn/" -s ud3tn1.socket -S ud3tn1.aap2.socket & UD3TN1_PID=$!
- UBSAN_OPTIONS=print_stacktrace=1 build/posix/ud3tn -c "mtcp:*,4223" -e "dtn://ud3tn2.dtn/" -s ud3tn2.socket -S ud3tn2.aap2.socket & UD3TN2_PID=$!
- source /ud3tn_venv/bin/activate
- pip install -e "pyd3tn"
- pip install -e "python-ud3tn-utils"
- while ! nc -z localhost 4222; do sleep 0.1; done
- while ! nc -z localhost 4223; do sleep 0.1; done
- while ! [ -r ./ud3tn1.socket ]; do sleep 0.1; done
- while ! [ -r ./ud3tn2.socket ]; do sleep 0.1; done
- python tools/aap/aap_config.py --socket ud3tn1.socket --schedule 2 1 140 --schedule 4 1 140 dtn://ud3tn2.dtn/ mtcp:localhost:4223
- python tools/aap/aap_send.py --socket ud3tn1.socket dtn://ud3tn2.dtn/sink THISISAVERYLONGBUNDLEPAYLOADWHICHWILLBEFRAGMENTED -v
- timeout -v 5 python tools/aap/aap_receive.py --socket ud3tn2.socket --agentid sink --count 1 --verify-pl THISISAVERYLONGBUNDLEPAYLOADWHICHWILLBEFRAGMENTED --newline -vv
- kill -TERM $UD3TN1_PID
- kill -TERM $UD3TN2_PID
- echo "Waiting for uD3TN to exit gracefully - if it doesn't, check for sanitizer warnings."
- wait $UD3TN1_PID
- wait $UD3TN2_PID
ipv6-compatibility-test:
stage: functional_test
when: always
image: registry.gitlab.com/d3tn/ud3tn-docker-images/ci-python-clang:3.8-bookworm
script:
- bash test/dockerfiles/prepare_for_test.sh . /ud3tn_build sanitize-strict=yes
- cd /ud3tn_build
# IPv6 and IPv4
- UBSAN_OPTIONS=print_stacktrace=1 build/posix/ud3tn -c "mtcp:::,4222" -e "dtn://ud3tn1.dtn/" -a '::' -p 4242 -S ud3tn1.aap2.socket & UD3TN1_PID=$!
# IPv4-only
- UBSAN_OPTIONS=print_stacktrace=1 build/posix/ud3tn -c "mtcp:::,4223" -e "dtn://ud3tn2.dtn/" -a '127.0.0.1' -p 4243 -S ud3tn2.aap2.socket & UD3TN2_PID=$!
# Create venv and wait for uD3TN ports to be open
- source /ud3tn_venv/bin/activate
- pip install -e "pyd3tn"
- pip install -e "python-ud3tn-utils"
- while ! nc -z localhost 4222; do sleep 0.1; done
- while ! nc -z localhost 4223; do sleep 0.1; done
- while ! nc -z localhost 4242; do sleep 0.1; done
- while ! nc -z localhost 4243; do sleep 0.1; done
# Check v6 via AAP to ud3tn1 and via MTCP to ud3tn2
- python tools/aap/aap_config.py --tcp '::1' 4242 --schedule 2 1 140 --schedule 4 1 140 dtn://ud3tn2.dtn/ 'mtcp:[::1]:4223'
# Check v4 via AAP to ud3tn1
- python tools/aap/aap_send.py --tcp 127.0.0.1 4242 dtn://ud3tn2.dtn/sink PAYLOAD -v
# Check v4 reception of the correct bundle at ud3tn2
- timeout -v 5 python tools/aap/aap_receive.py --tcp 127.0.0.1 4243 --agentid sink --count 1 --verify-pl PAYLOAD --newline -vv
# Check that v6 does _not_ work on ud3tn2
- "if timeout -v 1 python tools/aap/aap_test.py --tcp '::1' 4243; then echo 'Error: Should not be able to connect via IPv6 here.'; false; else true; fi"
- kill -TERM $UD3TN1_PID
- kill -TERM $UD3TN2_PID
- echo "Waiting for uD3TN to exit gracefully - if it doesn't, check for sanitizer warnings."
- wait $UD3TN1_PID
- wait $UD3TN2_PID
bibe-internal-forwarding-test:
stage: functional_test
when: always
image: registry.gitlab.com/d3tn/ud3tn-docker-images/ci-python-clang:3.8-bookworm
script:
- bash test/dockerfiles/prepare_for_test.sh . /ud3tn_build sanitize-strict=yes
- cd /ud3tn_build
- source /ud3tn_venv/bin/activate
- bash test/functional/bibe_internal_forwarding_test/run.sh
ion-bibe-interoperability-test:
stage: functional_test
when: always
image: registry.gitlab.com/d3tn/ud3tn-docker-images/ion-interop:4.1.2
script:
- bash test/dockerfiles/prepare_for_test.sh . /ud3tn_build sanitize=yes "CFLAGS=-DBIBE_CL_DRAFT_1_COMPATIBILITY=1"
- cd /ud3tn_build
- source /ud3tn_venv/bin/activate
- bash test/ion_interoperability/bibe_forwarding_test/run.sh
ione-bibe-interoperability-test:
extends: ion-bibe-interoperability-test
image: registry.gitlab.com/d3tn/ud3tn-docker-images/ione-interop:1.0.1
data-decoder-test:
stage: functional_test
when: always
script:
- make clean
- make data-decoder
- build/posix/ud3tndecode -7 test/decoder/examples/bpv7_test/bpv7_1.bin
- build/posix/ud3tndecode -6 test/decoder/examples/bpv6_test/bpv6_1.bin
- build/posix/ud3tndecode -s test/decoder/examples/spp_test/spp_1.bin
- build/posix/ud3tndecode -a test/decoder/examples/aap_test/test_aap_ping_packet.bin
- build/posix/ud3tndecode -a test/decoder/examples/aap_test/test_aap_sendbundle_packet.bin
- build/posix/ud3tndecode -a test/decoder/examples/aap_test/test_aap_sendconfirm_packet.bin
- build/posix/ud3tndecode -a test/decoder/examples/aap_test/test_aap_welcome_packet.bin
unit-test-valgrind:
stage: functional_test
when: always
image: registry.gitlab.com/d3tn/ud3tn-docker-images/ci-python-clang:3.8-bookworm
script:
- make unittest-posix
- valgrind --leak-check=no --error-exitcode=1 build/posix/testud3tn
integration-test-valgrind-memory-check:
stage: functional_test
when: always
image: registry.gitlab.com/d3tn/ud3tn-docker-images/ci-python-clang:3.8-bookworm
script:
- bash test/dockerfiles/prepare_for_test.sh . /ud3tn_build
- cd /ud3tn_build
- rm -f ./ud3tn.socket ./ud3tn.aap2.socket
- UBSAN_OPTIONS=print_stacktrace=1 valgrind --leak-check=yes --error-exitcode=1 --errors-for-leak-kinds=definite build/posix/ud3tn --allow-remote-config & UD3TN_PID=$!
- source /ud3tn_venv/bin/activate
- pip install -e "pyd3tn"
- pip install -e "python-ud3tn-utils"
- while ! [ -r ./ud3tn.socket ]; do sleep 0.1; done
- while ! [ -r ./ud3tn.aap2.socket ]; do sleep 0.1; done
- pytest test/integration
- kill -TERM $UD3TN_PID
- echo "Waiting for uD3TN to exit gracefully - if it doesn't, check for sanitizer warnings."
- wait $UD3TN_PID
license-check:
stage: code_quality_test
when: always
script:
- bash tools/analysis/license-check.sh
stylecheck:
stage: code_quality_test
when: always
image: perl:5
script:
- make check-style
python-stylecheck:
stage: code_quality_test
when: always
image: registry.gitlab.com/d3tn/ud3tn-docker-images/ci-python-clang:3.8-bookworm
script:
- source /ud3tn_venv/bin/activate
- pip install -e "pyd3tn"
- pip install -e "python-ud3tn-utils"
- pip install -e "python-ud3tn-utils"
- python -m flake8 pyd3tn python-ud3tn-utils test/integration tools/aap tools/aap2 tools/cla --max-complexity=12 --exclude=generated
coverage-test:
stage: code_quality_test
when: always
image: registry.gitlab.com/d3tn/ud3tn-docker-images/ci-python-clang:3.8-bookworm
script:
- project_dir="$(pwd)"
- bash test/dockerfiles/prepare_for_test.sh . /ud3tn_build coverage=yes
- cd /ud3tn_build
- rm -f ./ud3tn.socket ./ud3tn.aap2.socket
- make unittest-posix coverage=yes
- timeout 60 build/posix/testud3tn
- build/posix/ud3tn --allow-remote-config & UD3TN_PID=$!
- source /ud3tn_venv/bin/activate
- while ! [ -r ./ud3tn.socket ]; do sleep 0.1; done
- while ! [ -r ./ud3tn.aap2.socket ]; do sleep 0.1; done
- pytest test/integration
- kill -TERM $UD3TN_PID
- echo "Waiting for uD3TN to exit gracefully - if it doesn't, check for sanitizer warnings."
- wait $UD3TN_PID
- gcovr --xml-pretty --exclude-unreachable-branches --gcov-ignore-parse-errors --print-summary -o coverage.xml --root .
- cp -v coverage.xml "$project_dir/"
coverage: /^\s*lines:\s*\d+.\d+\%/
artifacts:
name: ${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}
expire_in: 2 days
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
clang-tidy-posix-debug:
stage: code_quality_test
when: always
image: registry.gitlab.com/d3tn/ud3tn-docker-images/ci-python-clang:3.8-bookworm
script:
- make ccmds-posix -j4
- bash ./tools/analysis/clang-check.sh "clang-tidy-13 --use-color" "posix"
clang-tidy-posix-release:
stage: code_quality_test
when: always
image: registry.gitlab.com/d3tn/ud3tn-docker-images/ci-python-clang:3.8-bookworm
script:
- make ccmds-posix -j4 type=release
- bash ./tools/analysis/clang-check.sh "clang-tidy-13 --use-color" "posix"
cppcheck-static-analyzer:
stage: code_quality_test
when: always
image: registry.gitlab.com/d3tn/ud3tn-docker-images/ci-python-clang:3.8-bookworm
script:
- cppcheck --enable=warning --error-exitcode=2 --inline-suppr -I include -I external/tinycbor/src -I external/util/include components
publish-docker-image:
stage: publish
rules:
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+(.[0-9]+)+$/'
when: always
image:
# See https://docs.gitlab.com/ee/ci/docker/using_kaniko.html
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
variables:
CI_REGISTRY_IMAGE: registry.gitlab.com/d3tn/ud3tn-docker-images/ud3tn
script:
# find out if the docker image *also* should be tagged with "latest"
- |
# Download all existing ud3tn docker image tags from the docker image registry
wget -q "https://gitlab.com/api/v4/projects/23559871/registry/repositories/1616836/tags" -O tags.json
# Remove some json symbols, introduce line feeds for better filtering
sed -i -E 's/\]//g; s/\[//g; s/\},?/\n/g' tags.json
# Remove everything except the docker image tags (latest, v0.9.0, ...)
sed -i -E 's/(^.*"name":")(.*)(","path.*$)/\2/' tags.json
# Append the $CI_COMMIT_TAG to the list of tags
echo "$CI_COMMIT_TAG" >> tags.json
# Get the numerically highest *version* tag
highest_version=$(grep -E "v.*" tags.json | sort -rV | head -n1)
# Build the string $IMAGES that determines what image_name:image_tag the resulting docker image will have
TAGS="$CI_COMMIT_TAG"
if [ "$highest_version" = "$CI_COMMIT_TAG" ]; then TAGS="$TAGS latest"; fi
for TAG in $TAGS; do
IMAGES="${IMAGES} --destination $CI_REGISTRY_IMAGE:$TAG";
done;
- echo $IMAGES
# Prepare docker image registry access credentials
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$UD3TN_CI_DOCKER_DEPLOY_USER\",\"password\":\"$UD3TN_CI_DOCKER_DEPLOY_PASSWORD\"}}}" > /kaniko/.docker/config.json
# Build and push the docker image
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/dockerfiles/ud3tn --build-arg UD3TN_VERSION=$CI_COMMIT_TAG $IMAGES