|
11 | 11 | install uninstall \
|
12 | 12 | test \
|
13 | 13 | test-sysbox test-sysbox-ci test-sysbox-systemd test-sysbox-installer \
|
14 |
| - test-runc test-fs test-mgr \ |
| 14 | + test-runc test-fs test-mgr test-sysbox-libs \ |
15 | 15 | test-shell test-shell-debug test-shell-systemd test-shell-systemd-debug test-shell-installer test-shell-installer-debug \
|
16 | 16 | test-img test-img-systemd test-cleanup \
|
17 |
| - test-sysbox-local test-sysbox-local-installer test-sysbox-local-ci test-fs-local test-mgr-local \ |
18 |
| - test-sind test-sind-local test-sind-shell \ |
| 17 | + test-sysbox-local test-sysbox-local-installer test-sysbox-local-ci test-fs-local test-mgr-local test-sysbox-libs-local \ |
19 | 18 | lint lint-local lint-sysbox-local lint-tests-local shfmt \
|
20 | 19 | sysbox-runc-recvtty \
|
21 |
| - listRuncPkgs listFsPkgs listMgrPkgs \ |
| 20 | + listRuncPkgs listFsPkgs listMgrPkgs listSysboxLibsPkgs \ |
22 | 21 | clean
|
23 | 22 |
|
24 | 23 | export SHELL=bash
|
@@ -341,7 +340,7 @@ DOCKER_STOP := docker stop -t0 sysbox-test
|
341 | 340 | ##@ Testing targets
|
342 | 341 |
|
343 | 342 | test: ## Run all sysbox test suites
|
344 |
| -test: test-fs test-mgr test-runc test-sysbox test-sysbox-systemd |
| 343 | +test: test-fs test-mgr test-runc test-sysbox-libs test-sysbox test-sysbox-systemd |
345 | 344 |
|
346 | 345 | test-sysbox: ## Run sysbox integration tests
|
347 | 346 | test-sysbox: test-prereq test-img
|
@@ -393,6 +392,13 @@ test-mgr: test-prereq test-img
|
393 | 392 | @printf "\n** Running sysbox-mgr unit tests **\n\n"
|
394 | 393 | $(DOCKER_RUN) /bin/bash -c "make --no-print-directory test-mgr-local"
|
395 | 394 |
|
| 395 | +test-sysbox-libs: test-prereq sysbox |
| 396 | + @printf "\n** Running sysbox-libs unit tests **\n\n" |
| 397 | + $(TEST_DIR)/scr/testContainerPre $(TEST_VOL1) $(TEST_VOL2) $(TEST_VOL3) |
| 398 | + $(DOCKER_RUN) /bin/bash -c "export PHY_EGRESS_IFACE_MTU=$(EGRESS_IFACE_MTU) && \ |
| 399 | + testContainerInit && \ |
| 400 | + make --no-print-directory test-sysbox-libs-local" |
| 401 | + |
396 | 402 | test-shell: ## Get a shell in the test container (useful for debug)
|
397 | 403 | test-shell: test-prereq test-img
|
398 | 404 | $(TEST_DIR)/scr/testContainerPre $(TEST_VOL1) $(TEST_VOL2) $(TEST_VOL3)
|
@@ -507,6 +513,13 @@ test-mgr-local: sysbox-ipc
|
507 | 513 | sleep 2
|
508 | 514 | cd $(SYSMGR_DIR) && go test -buildvcs=false -timeout 3m -v $(mgrPkgs)
|
509 | 515 |
|
| 516 | +test-sysbox-libs-local: |
| 517 | + @for dir in $(sysboxLibsPkgDirs); do \ |
| 518 | + pushd $$dir > /dev/null; \ |
| 519 | + go test ./... || break; \ |
| 520 | + popd > /dev/null; \ |
| 521 | + done |
| 522 | + |
510 | 523 | ##@ Code Hygiene targets
|
511 | 524 |
|
512 | 525 | lint: ## Runs lint checker on sysbox source code and tests
|
@@ -552,6 +565,9 @@ listFsPkgs:
|
552 | 565 | listMgrPkgs:
|
553 | 566 | @echo $(mgrPkgs)
|
554 | 567 |
|
| 568 | +listSysboxLibsPkgs: |
| 569 | + @echo $(sysboxLibsPkgs) |
| 570 | + |
555 | 571 | #
|
556 | 572 | # cleanup targets
|
557 | 573 | #
|
@@ -592,3 +608,6 @@ fsPkgs = $(if $(__fsPkgs),,$(eval __fsPkgs := $$(_fsPkgs)))$(__fsPkgs)
|
592 | 608 |
|
593 | 609 | _mgrPkgs = $(shell cd $(SYSMGR_DIR) && go list -buildvcs=false ./... | grep -v vendor)
|
594 | 610 | mgrPkgs = $(if $(__mgrPkgs),,$(eval __mgrPkgs := $$(_mgrPkgs)))$(__mgrPkgs)
|
| 611 | + |
| 612 | +sysboxLibsPkgDirs := $(shell find $(SYSLIBS_DIR) -type f -name "go.mod" -exec dirname {} \;) |
| 613 | +sysboxLibsPkgs := $(foreach dir,$(sysboxLibsPkgDirs),$(shell cd $(dir); go list ./...; cd ..)) |
0 commit comments