This repository has been archived by the owner on Mar 28, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 59
/
Makefile.am
852 lines (694 loc) · 20 KB
/
Makefile.am
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
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
# This file is part of cc-oci-runtime.
#
# Copyright (C) 2016 Intel Corporation
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
CLEANFILES = *.log
ACLOCAL_AMFLAGS = -I m4
AUTOMAKE_OPTIONS = parallel-tests
CHECK_DEPS =
FUNCTIONAL_TESTS_DEPS =
PROXY_DEPS =
# Has a value if building in a git tree
GIT_COMMIT := $(shell git rev-parse HEAD 2>/dev/null)
# Has a value if building in a git-archive(1)-generated tree
# (see .gitattributes).
GENERATED_COMMIT = $(shell cat commit_id.fmt 2>/dev/null \| grep \'^[a-f0-9][a-f0-9]*\$\')
commit_id:
$(AM_V_GEN)if [ "x$(GIT_COMMIT)" != "x" ]; then \
echo "Determining commit id from git"; \
echo "$(GIT_COMMIT)" > commit_id; \
elif [ "x$(GENERATED_COMMIT)" != "x" ]; then \
echo "Determining commit id from generated value"; \
echo "$(GENERATED_COMMIT)" > commit_id; \
else \
echo "WARNING: cannot determine actual commit id"; \
echo "0" > commit_id; \
fi
STORED_COMMIT = $(shell cat $(builddir)/commit_id 2>/dev/null || cat $(srcdir)/commit_id 2>/dev/null)
SYSCONFDIR = $(sysconfdir)/$(PACKAGE_NAME)
DEFAULTSDIR = $(datadir)/defaults/$(PACKAGE_NAME)
src/commands/cc_oci_runtime-version.$(OBJEXT): \
commit_id
GENERATED_FILES = \
data/cc-oci-runtime.sh \
data/config.json \
data/run-bats.sh \
data/vm.json \
tests/functional/common.bash \
tests/functional/run-functional-tests.sh \
tests/functional/data/config-minimal-cc-oci.json \
tests/metrics/density/docker_cpu_usage.sh \
tests/metrics/density/docker_memory_usage.sh \
tests/metrics/workload_time/cor_create_time.sh \
tests/metrics/network/network-metrics-cpu-consumption.sh \
tests/metrics/network/network-metrics-memory-pss.sh \
tests/metrics/network/network-metrics-memory-rss-1g.sh \
tests/metrics/network/network-metrics-memory-pss-1g.sh \
tests/lib/send_results.sh \
tests/lib/test-common.bash
$(GENERATED_FILES): %: %.in Makefile
@mkdir -p `dirname $@`
$(AM_V_GEN) \
bindir="$(bindir)" \
srcdir="$(srcdir)" \
libexecdir="$(libexecdir)" \
localstatedir="$(localstatedir)" \
BUNDLE_TEST_PATH="$(BUNDLE_TEST_PATH)" \
CMDLINE="$(CMDLINE)" \
CONTAINER_KERNEL="$(CONTAINER_KERNEL)" \
CONTAINERS_IMG="$(CONTAINERS_IMG)" \
DEFAULTSDIR="$(DEFAULTSDIR)" \
PACKAGE_NAME="$(PACKAGE_NAME)" \
QEMU_PATH="$(QEMU_PATH)" \
BATS_PATH="$(BATS_PATH)" \
ROOTFS_PATH="$(BUNDLE_TEST_PATH)/rootfs" \
SYSCONFDIR="$(SYSCONFDIR)" \
DOCKER_FEDORA_VERSION="$(DOCKER_FEDORA_VERSION)" \
DOCKER_ENGINE_FEDORA_VERSION="$(DOCKER_ENGINE_FEDORA_VERSION)" \
DOCKER_UBUNTU_VERSION="$(DOCKER_UBUNTU_VERSION)" \
DOCKER_ENGINE_UBUNTU_VERSION="$(DOCKER_ENGINE_UBUNTU_VERSION)" \
CRIO_CACHE="$(CRIO_CACHE)" \
abs_builddir="$(abs_builddir)" \
$(top_srcdir)/data/genfile.sh "$<" "$@"
# Sometimes you just want to generate the generated files without having
# to do a full build or run some tests - so add a simple target rule
# to allow that.
generate-files: $(GENERATED_FILES)
if FUNCTIONAL_TESTS
if AUTO_BUNDLE_CREATION
FUNCTIONAL_TESTS_DEPS += $(BUNDLE_TEST_PATH)
# XXX: don't fail if the bundle cannot be generated - docker might not
# be running for example. Those tests that need a bundle will detect
# that it doesn't exist and they will be skipped.
$(BUNDLE_TEST_PATH):
$(AM_V_GEN)$(top_srcdir)/data/make-bundle-dir.sh $@ || true
endif
endif
CLEANFILES += $(GENERATED_FILES)
AM_CPPFLAGS = -I $(top_srcdir)/src -DG_LOG_DOMAIN=\"$(PACKAGE_NAME)\" \
-DSYSCONFDIR=\"$(SYSCONFDIR)\" \
-DDEFAULTSDIR=\"$(DEFAULTSDIR)\" \
-DLOCALSTATEDIR=\"$(localstatedir)\" \
-DGIT_COMMIT=\"$(STORED_COMMIT)\" \
-DLIBEXECDIR=\"$(libexecdir)\"
defaultsdir = $(datadir)/defaults/$(PACKAGE_NAME)
defaults_DATA = data/vm.json data/hypervisor.args data/kernel-cmdline
cc_image_systemd_files = \
data/cc-agent.target \
data/cc-agent.service
if CC_IMAGE_SYSTEMDSYSTEMUNIT
ccimage_systemdfilesdir= @CC_IMAGE_SYSTEMDSYSTEMUNIT_PATH@
ccimage_systemdfiles_DATA = $(cc_image_systemd_files)
endif
if CC_IMAGE_BOOTCHART_CONFIG
ccimage_bootchart_filesdir = @CC_IMAGE_BOOTCHART_CONFIG_DIR@
ccimage_bootchart_files_DATA = data/cc-bootchart.conf
endif
AM_CFLAGS = -std=gnu99 -fstack-protector -Wall -pedantic \
-Wstrict-prototypes -Wundef -fno-common \
-Werror-implicit-function-declaration \
-Wformat -Wformat-security -Werror=format-security \
-Wconversion -Wunreachable-code \
-fPIE
AM_LDFLAGS = -pie -z noexecstack -z relro -z now
# We set --with-systemdunitdir here so make distcheck can run make install as a
# normal user and not fail.
# This directory doesn't have to be unique and doing several make distcheck
# will not end up clobbering /tmp this way.
DISTCHECK_CONFIGURE_FLAGS = \
--enable-debug \
--enable-tests \
--enable-cppcheck \
--enable-valgrind \
--disable-valgrind-helgrind \
--disable-valgrind-drd \
--disable-valgrind-sgcheck \
--enable-code-coverage \
--enable-functional-tests \
--with-systemdsystemunitdir=/tmp/cc-distcheck/systemdunitdir/
bin_PROGRAMS = cc-oci-runtime
dist_bin_SCRIPTS = data/cc-oci-runtime.sh
common_sources = \
src/util.c src/util.h \
src/logging.c src/logging.h \
src/oci.c src/oci.h \
src/process.c src/process.h \
src/mount.c src/mount.h \
src/network.c src/network.h \
src/networking.c src/networking.h \
src/netlink.c src/netlink.h \
src/state.c src/state.h \
src/events.c src/events.h \
src/runtime.c src/runtime.h \
src/semver.c src/semver.h \
src/annotation.c src/annotation.h \
src/namespace.c src/namespace.h \
src/priv.c src/priv.h \
src/oci-config.c src/oci-config.h \
src/hypervisor.c src/hypervisor.h \
src/json.c src/json.h \
src/proxy.c src/proxy.h \
src/spec_handler.c src/spec_handler.h \
src/pod.c src/pod.h \
src/common.h \
src/command.c src/command.h \
src/commands/create.c \
src/commands/delete.c \
src/commands/exec.c \
src/commands/events.c \
src/commands/help.c \
src/commands/kill.c \
src/commands/list.c \
src/commands/run.c \
src/commands/start.c \
src/commands/state.c \
src/commands/stop.c \
src/commands/pause.c \
src/commands/ps.c \
src/commands/resume.c \
src/commands/version.c \
src/commands/checkpoint.c \
src/commands/restore.c \
src/commands/update.c \
src/spec_handlers/hooks.c \
src/spec_handlers/platform.c \
src/spec_handlers/process.c \
src/spec_handlers/root.c \
src/spec_handlers/vm.c \
src/spec_handlers/linux.c \
src/spec_handlers/mounts.c \
src/spec_handlers/annotations.c
cc_oci_runtime_SOURCES = \
src/main.c \
$(common_sources)
cc_oci_runtime_LDADD = \
$(GLIB_LIBS) \
$(GIO_LIBS) \
$(JSON_GLIB_LIBS) \
$(LIBMNL_LIBS) \
$(UUID_LIBS)
cc_oci_runtime_CFLAGS = \
$(AM_CFLAGS) \
$(GLIB_CFLAGS) \
$(GIO_CFLAGS) \
$(JSON_GLIB_CFLAGS) \
$(LIBMNL_CFLAGS) \
$(UUID_CFLAGS)
libexec_SCRIPTS = cc-proxy
CLEANFILES += cc-proxy
AM_V_GO = $(am__v_GO_@AM_V@)
am__v_GO_ = $(am__v_GO_@AM_DEFAULT_V@)
am__v_GO_0 = @echo " GOBUILD " $@;
am__v_GO_1 =
systemdservice_in_files = \
proxy/cc-proxy.service.in \
proxy/cc-proxy.socket.in
systemdservice_files = \
proxy/cc-proxy.service \
proxy/cc-proxy.socket
CLEANFILES += $(systemdservice_files)
if HAVE_SYSTEMD
GENERATED_FILES += $(systemdservice_files)
systemdservicedir = $(systemdsystemunitdir)
systemdservice_DATA = $(systemdservice_files)
endif
if AUTOGOPATH
export GOPATH := $(shell mktemp -d --suffix=-cor-gopath)
PKG_LINK_BASE = $(GOPATH)/src/github.com/01org
PKG_LINK = $(PKG_LINK_BASE)/cc-oci-runtime
$(PKG_LINK):
mkdir -p $(PKG_LINK_BASE)
ln -sfn $(CURDIR) $(PKG_LINK)
cp -r $(CURDIR)/vendor/* $(GOPATH)/src
PROXY_DEPS += $(PKG_LINK)
endif
proxy_ldflags = "-X main.DefaultSocketPath=$(localstatedir)/run/cc-oci-runtime/proxy.sock"
cc-proxy: $(cc_proxy_sources) | $(PROXY_DEPS)
$(AM_V_GO)go build -o $@ -ldflags=$(proxy_ldflags) $(srcdir)/proxy
cc_proxy_sources = \
proxy/api/api.go \
proxy/api/client.go \
proxy/api/common_test.go \
proxy/api/fdpassing.go \
proxy/api/fdpassing_test.go \
proxy/api/protocol.go \
proxy/fdleak_test.go \
proxy/protocol.go \
proxy/protocol_test.go \
proxy/proxy.go \
proxy/proxy_test.go \
proxy/socket_activation.go \
proxy/syscall.go \
proxy/vm.go
cc_proxy_extra_dist = \
proxy/README.md \
proxy/LICENSE
CHECK_DEPS += check-proxy
check-proxy: $(cc_proxy_sources) | $(PROXY_DEPS)
$(AM_V_GEN)proxy_test_common_args="-v -timeout 2s $(srcdir)/proxy $(srcdir)/proxy/api" ; \
go test -race $$proxy_test_common_args || go test $$proxy_test_common_args
check-go:
@$(top_srcdir)/.ci/ci-go-static-checks.sh
libexec_PROGRAMS = cc-shim
cc_shim_SOURCES = \
shim/shim.c \
shim/shim.h \
shim/utils.c \
shim/utils.h \
shim/log.c \
shim/log.h
cc_shim_extra_dist = \
shim/README.md \
shim/LICENSE
cc_shim_CFLAGS = \
$(AM_CFLAGS)
cc_shim_LDFLAGS = \
$(AM_LDFLAGS)
bats_test_sources = \
tests/functional/common.bash.in \
data/run-bats.sh.in \
tests/functional/data/config-minimal-cc-oci.json.in \
tests/functional/data/exec.json \
tests/functional/data/exec_false.json \
tests/functional/help.bats \
tests/functional/kill.bats \
tests/functional/pause.bats \
tests/functional/README \
tests/functional/README.rst \
tests/functional/start.bats \
tests/functional/state.bats \
tests/functional/version.bats
documentation_extra_dist = \
documentation
EXTRA_DIST = \
.ci \
LICENSE \
CONTRIBUTING.md \
DESIGN.rst \
Doxyfile \
data/config.json.in \
data/vm.json.in \
data/make-bundle-dir.sh \
tests/data \
commit_id \
versions.txt \
$(documentation_extra_dist) \
$(defaults_DATA) \
$(cc_image_systemd_files) \
$(cc_proxy_sources) \
$(cc_proxy_extra_dist) \
$(cc_shim_extra_dist) \
$(systemdservice_in_files) \
data/cc-oci-runtime.sh.in \
$(bats_test_sources) \
tests/functional/run-functional-tests.sh.in \
tests/integration \
tests/lib \
tests/metrics/density/docker_cpu_usage.sh.in \
tests/metrics/density/docker_memory_usage.sh.in \
tests/metrics/workload_time/cor_create_time.sh.in \
tests/metrics/network/network-metrics-cpu-consumption.sh.in \
tests/metrics/network/network-metrics-memory-rss-1g.sh.in \
tests/metrics/network/network-metrics-memory-pss.sh.in \
tests/metrics/network/network-metrics-memory-pss-1g.sh.in \
vendor \
data/genfile.sh \
data/cc-bootchart.conf
if CPPCHECK
CHECK_DEPS += cppcheck
cppcheck:
@$(CPPCHECK_PATH) --enable=performance,unusedFunction,missingInclude \
--language=c --std=c99 --std=posix \
--error-exitcode=1 -I$(srcdir)/src $(srcdir)/src
endif
if FUNCTIONAL_TESTS
CHECK_DEPS += functional-tests
FUNCTIONAL_TESTS_DEPS += cc-oci-runtime cc-proxy cc-shim $(GENERATED_FILES)
functional-tests: $(FUNCTIONAL_TESTS_DEPS)
$(AM_V_GEN)test -n "$(BUNDLE_TEST_PATH)" && \
echo "Using bundle '$(BUNDLE_TEST_PATH)'" || true
@if [ "$(builddir)" != "$(srcdir)" ]; then \
rm -f $(builddir)/tests/functional/*.bats ; \
for f in $(abs_top_srcdir)/tests/functional/*.bats; do \
ln -s $$f $(builddir)/tests/functional/ ; \
done; \
fi
@bash -f $(abs_builddir)/tests/functional/run-functional-tests.sh
endif
if DOCKER_TESTS
CHECK_DEPS += docker-tests
docker-tests: cc-oci-runtime tests/lib/test-common.bash
@$(BATS_PATH) -t $(srcdir)/tests/integration/docker
endif
if CRIO_TESTS
CHECK_DEPS += crio-tests
GENERATED_FILES += tests/lib/test-crio.bats
crio-tests: cc-oci-runtime cc-proxy cc-shim tests/lib/test-crio.bats
@timeout 4m $(BATS_PATH) -t $(srcdir)/tests/integration/cri-o
endif
if METRICS_TESTS
METRICS_PATH := "$(abs_top_srcdir)/tests/metrics"
metrics-tests: cc-oci-runtime cc-proxy cc-shim $(GENERATED_FILES)
@pushd $(METRICS_PATH); \
./run_docker_metrics; \
popd ; \
echo "Metrics results can be found on $(METRICS_PATH)/results"
endif
#### tests ####
if BUILD_TESTS
if VALGRIND_ENABLED
@VALGRIND_CHECK_RULES@
VALGRIND_memcheck_FLAGS = --tool=memcheck --error-exitcode=1 --leak-check=full --errors-for-leak-kinds=definite,indirect --show-possibly-lost=no
# by default ax_valgrind_check.m4 adds fatal-warnings and fatal-criticals to G_DEBUG causing
# that glib aborts the program at the first call to g_warning() or g_critical().
# this target is quite similar to check-valgrind but without fatal-warnings and fatal-criticals
check-valgrind-local:
$(A''M_V_at)$(foreach tool,$(valgrind_enabled_tools), \
VALGRIND_TESTS_ENVIRONMENT=$(VALGRIND_TESTS_ENVIRONMENT) G_DEBUG=gc-friendly $(MAKE) -e $(AM_MAKEFLAGS) -k check-valgrind-$(tool) \
)
CHECK_DEPS += check-valgrind-local
endif
if CODE_COVERAGE_ENABLED
@CODE_COVERAGE_RULES@
CHECK_DEPS += code-coverage-capture
endif
check_LTLIBRARIES = libtest.la
libtest_la_SOURCES = \
$(common_sources)
libtest_la_CFLAGS = \
$(AM_CFLAGS) \
$(CODE_COVERAGE_CFLAGS) \
$(GLIB_CFLAGS) \
$(GIO_CFLAGS) \
$(JSON_GLIB_CFLAGS) \
$(LIBMNL_CFLAGS) \
$(UUID_CFLAGS) \
-DTEST_DATA_DIR=\"$(abs_srcdir)/tests/data\" \
-DUNIT_TESTING
libtest_la_LIBS = \
$(CODE_COVERAGE_LDFLAGS)
TEST_COMMON_CFLAGS = \
$(AM_CFLAGS) \
$(CODE_COVERAGE_CFLAGS) \
$(JSON_GLIB_CFLAGS) \
$(GLIB_CFLAGS) \
$(CHECK_CFLAGS) \
-std=gnu99 \
-DTEST_DATA_DIR=\"$(abs_srcdir)/tests/data\" \
-DUNIT_TESTING
TEST_COMMON_LDADD = \
libtest.la \
$(CODE_COVERAGE_LDFLAGS) \
$(JSON_GLIB_LIBS) \
$(GLIB_LIBS) \
$(CHECK_LIBS) \
$(LIBMNL_LIBS) \
$(UUID_LIBS)
TEST_COMMON_SOURCES = \
tests/test_common.c \
tests/test_common.h
TESTS = \
hypervisor_test \
json_test \
logging_test \
namespace_test \
oci_config_test \
oci_test \
pod_test \
priv_test \
proxy_test \
process_test \
runtime_test \
semver_test \
state_test \
util_test \
mount_test \
annotation_test \
network_test \
spec_handler_test \
sh_annotations_test \
sh_linux_test \
sh_vm_test \
sh_platform_test \
sh_process_test \
sh_root_test \
sh_mounts_test \
sh_hooks_test
noinst_PROGRAMS = \
$(TESTS)
check_PROGRAMS = \
$(TESTS)
## hypervisor.c test ##
hypervisor_test_SOURCES = \
$(TEST_COMMON_SOURCES) \
tests/hypervisor_test.c
hypervisor_test_CFLAGS = \
$(TEST_COMMON_CFLAGS)
hypervisor_test_LDADD = \
$(TEST_COMMON_LDADD)
## json.c test ##
json_test_SOURCES = \
$(TEST_COMMON_SOURCES) \
tests/json_test.c
json_test_CFLAGS = \
$(TEST_COMMON_CFLAGS)
json_test_LDADD = \
$(TEST_COMMON_LDADD)
## logging.c test ##
logging_test_SOURCES = \
$(TEST_COMMON_SOURCES) \
tests/logging_test.c
logging_test_CFLAGS = \
$(TEST_COMMON_CFLAGS)
logging_test_LDADD = \
$(TEST_COMMON_LDADD)
## namespace.c test ##
namespace_test_SOURCES = \
$(TEST_COMMON_SOURCES) \
tests/namespace_test.c
namespace_test_CFLAGS = \
$(TEST_COMMON_CFLAGS)
namespace_test_LDADD = \
$(TEST_COMMON_LDADD)
## oci-config.c test ##
oci_config_test_SOURCES = \
$(TEST_COMMON_SOURCES) \
tests/oci-config_test.c
oci_config_test_CFLAGS = \
$(TEST_COMMON_CFLAGS)
oci_config_test_LDADD = \
$(TEST_COMMON_LDADD)
## oci.c test ##
oci_test_SOURCES = \
$(TEST_COMMON_SOURCES) \
tests/oci_test.c
oci_test_CFLAGS = \
$(TEST_COMMON_CFLAGS)
oci_test_LDADD = \
$(TEST_COMMON_LDADD)
## process.c test ##
process_test_SOURCES = \
$(TEST_COMMON_SOURCES) \
tests/process_test.c
process_test_CFLAGS = \
$(TEST_COMMON_CFLAGS)
process_test_LDADD = \
$(TEST_COMMON_LDADD)
## runtime.c test ##
runtime_test_SOURCES = \
$(TEST_COMMON_SOURCES) \
tests/runtime_test.c
runtime_test_CFLAGS = \
$(TEST_COMMON_CFLAGS)
runtime_test_LDADD = \
$(TEST_COMMON_LDADD)
## semver.c test ##
semver_test_SOURCES = \
$(TEST_COMMON_SOURCES) \
tests/semver_test.c
semver_test_CFLAGS = \
$(TEST_COMMON_CFLAGS)
semver_test_LDADD = \
$(TEST_COMMON_LDADD)
## state.c test ##
state_test_SOURCES = \
$(TEST_COMMON_SOURCES) \
tests/state_test.c
state_test_CFLAGS = \
$(TEST_COMMON_CFLAGS)
state_test_LDADD = \
$(TEST_COMMON_LDADD)
## util.c test ##
util_test_SOURCES = \
$(TEST_COMMON_SOURCES) \
tests/util_test.c
util_test_CFLAGS = \
$(TEST_COMMON_CFLAGS)
util_test_LDADD = \
$(TEST_COMMON_LDADD)
## priv.c test ##
priv_test_SOURCES = \
$(TEST_COMMON_SOURCES) \
tests/priv_test.c
priv_test_CFLAGS = \
$(TEST_COMMON_CFLAGS)
priv_test_LDADD = \
$(TEST_COMMON_LDADD)
## proxy.c test ##
proxy_test_SOURCES = \
$(TEST_COMMON_SOURCES) \
tests/proxy_test.c
proxy_test_CFLAGS = \
$(TEST_COMMON_CFLAGS)
proxy_test_LDADD = \
$(TEST_COMMON_LDADD)
## mount.c test ##
mount_test_SOURCES = \
$(TEST_COMMON_SOURCES) \
tests/mount_test.c
mount_test_CFLAGS = \
$(TEST_COMMON_CFLAGS)
mount_test_LDADD = \
$(TEST_COMMON_LDADD)
## annotation.c test ##
annotation_test_SOURCES = \
$(TEST_COMMON_SOURCES) \
tests/annotation_test.c
annotation_test_CFLAGS = \
$(TEST_COMMON_CFLAGS)
annotation_test_LDADD = \
$(TEST_COMMON_LDADD)
## network.c test ##
network_test_SOURCES = \
$(TEST_COMMON_SOURCES) \
tests/network_test.c
network_test_CFLAGS = \
$(TEST_COMMON_CFLAGS)
network_test_LDADD = \
$(TEST_COMMON_LDADD)
## spec_handler.c ##
spec_handler_test_SOURCES = \
$(TEST_COMMON_SOURCES) \
tests/spec_handler_test.c
spec_handler_test_CFLAGS = \
$(TEST_COMMON_CFLAGS)
spec_handler_test_LDADD = \
$(TEST_COMMON_LDADD)
## spec_handlers/annotations.c test ##
sh_annotations_test_SOURCES = \
$(TEST_COMMON_SOURCES) \
tests/spec_handlers/annotations_test.c
sh_annotations_test_CFLAGS = \
$(TEST_COMMON_CFLAGS)
sh_annotations_test_LDADD = \
$(TEST_COMMON_LDADD)
## spec_handlers/linux.c test ##
sh_linux_test_SOURCES = \
$(TEST_COMMON_SOURCES) \
tests/spec_handlers/linux_test.c
sh_linux_test_CFLAGS = \
$(TEST_COMMON_CFLAGS)
sh_linux_test_LDADD = \
$(TEST_COMMON_LDADD)
## spec_handlers/vm.c test ##
sh_vm_test_SOURCES = \
$(TEST_COMMON_SOURCES) \
tests/spec_handlers/vm_test.c
sh_vm_test_CFLAGS = \
$(TEST_COMMON_CFLAGS)
sh_vm_test_LDADD = \
$(TEST_COMMON_LDADD)
## spec_handlers/platform.c test ##
sh_platform_test_SOURCES = \
$(TEST_COMMON_SOURCES) \
tests/spec_handlers/platform_test.c
sh_platform_test_CFLAGS = \
$(TEST_COMMON_CFLAGS)
sh_platform_test_LDADD = \
$(TEST_COMMON_LDADD)
## spec_handlers/process.c test ##
sh_process_test_SOURCES = \
$(TEST_COMMON_SOURCES) \
tests/spec_handlers/process_test.c
sh_process_test_CFLAGS = \
$(TEST_COMMON_CFLAGS)
sh_process_test_LDADD = \
$(TEST_COMMON_LDADD)
## spec_handlers/root.c test ##
sh_root_test_SOURCES = \
$(TEST_COMMON_SOURCES) \
tests/spec_handlers/root_test.c
sh_root_test_CFLAGS = \
$(TEST_COMMON_CFLAGS)
sh_root_test_LDADD = \
$(TEST_COMMON_LDADD)
## spec_handlers/mounts.c test ##
sh_mounts_test_SOURCES = \
$(TEST_COMMON_SOURCES) \
tests/spec_handlers/mounts_test.c
sh_mounts_test_CFLAGS = \
$(TEST_COMMON_CFLAGS)
sh_mounts_test_LDADD = \
$(TEST_COMMON_LDADD)
## spec_handlers/hooks.c test ##
sh_hooks_test_SOURCES = \
$(TEST_COMMON_SOURCES) \
tests/spec_handlers/hooks_test.c
sh_hooks_test_CFLAGS = \
$(TEST_COMMON_CFLAGS)
sh_hooks_test_LDADD = \
$(TEST_COMMON_LDADD)
## pod.c test ##
pod_test_SOURCES = \
$(TEST_COMMON_SOURCES) \
tests/pod_test.c
pod_test_CFLAGS = \
$(TEST_COMMON_CFLAGS)
pod_test_LDADD = \
$(TEST_COMMON_LDADD)
CLEANFILES += tests/*~ tests/*.log tests/*.trs
CLEANFILES += core core.* vgcore.*
endif
check: $(CHECK_DEPS)
artifacts: | install-image install-kernel
# Get clear containers image path
IMAGE_PATH := $(shell dirname $(CONTAINERS_IMG))
install-image:
@if [ $(shell id -u) -ne 0 ]; then \
$(srcdir)/installation/install_clear_image.sh $(CLEAR_VM_IMAGE_VERSION) $(IMAGE_PATH) ; \
else \
>&2 echo "ERROR: do not run $@ as root" ; \
fi
# Get clear containers kernel path
KERNEL_PATH := $(shell dirname $(CONTAINER_KERNEL))
install-kernel:
@if [ $(shell id -u) -ne 0 ]; then \
$(srcdir)/installation/install_clear_kernel.sh $(CLEAR_VM_IMAGE_VERSION) $(CLEAR_VM_KERNEL_VERSION) $(KERNEL_PATH) ; \
else \
>&2 echo "ERROR: do not run $@ as root" ; \
fi
clean-local:
rm -f commit_id
if AUTOGOPATH
rm -rf /tmp/*cor-gopath
endif
if FUNCTIONAL_TESTS
if AUTO_BUNDLE_CREATION
$(AM_V_GEN)echo "Deleting generated bundle '$(BUNDLE_TEST_PATH)'"
$(AM_V_GEN)rm -rf "$(BUNDLE_TEST_PATH)"
endif
endif