mirror of
https://github.com/kata-containers/cgroups-rs.git
synced 2026-08-05 02:13:23 +00:00
manager: Add unit test cases
The tests cover the methods of `conv` mod, `FsManager`, and `SystemdManager`. Since we have to manipulate the cgroups during testing, the tests related to this part are set to be run in sequence. Signed-off-by: Xuewei Niu <niuxuewei.nxw@antgroup.com>
This commit is contained in:
@@ -19,10 +19,14 @@ build: debug
|
||||
# Tests and linters
|
||||
#
|
||||
|
||||
.PHONY: test
|
||||
test: test-systemd
|
||||
cargo test -- --color always --nocapture \
|
||||
--skip systemd::dbus::client::tests
|
||||
# Tests that manipulate cgroups should run in sequence, so that
|
||||
# `--test-threads=1` is used.
|
||||
test: test-systemd test-fs-manager test-systemd-manager
|
||||
cargo test --all-features -- --color always \
|
||||
--nocapture \
|
||||
--skip systemd::dbus::client::tests \
|
||||
--skip manager::fs::tests \
|
||||
--skip manager::systemd::tests
|
||||
|
||||
.PHONY: test-systemd
|
||||
# Tests that manipulate cgroups should run in sequence, so that
|
||||
@@ -33,6 +37,20 @@ test-systemd:
|
||||
--color always --nocapture \
|
||||
--test-threads=1
|
||||
|
||||
.PHONY: test-fs-manager
|
||||
# See test-systemd
|
||||
test-fs-manager:
|
||||
cargo test --all-features --package cgroups-rs \
|
||||
--lib -- manager::fs::tests \
|
||||
--color always --nocapture --test-threads=1
|
||||
|
||||
.PHONY: test-systemd-manager
|
||||
# See test-systemd
|
||||
test-systemd-manager:
|
||||
cargo test --all-features --package cgroups-rs \
|
||||
--lib -- manager::systemd::tests \
|
||||
--color always --nocapture --test-threads=1
|
||||
|
||||
.PHONY: check
|
||||
check: fmt clippy
|
||||
|
||||
|
||||
Reference in New Issue
Block a user