mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
ci: Don't run unit tests in a privileged container
The unit tests require some specific Linux capabilities and also to have access to /dev/kvm device. This commit makes sure we enable only what's necessary instead of blindly enable full priviliges with --privileged option. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
committed by
Samuel Ortiz
parent
27247164b5
commit
7fabca3548
@@ -233,8 +233,9 @@ cmd_tests() {
|
|||||||
$DOCKER_RUNTIME run \
|
$DOCKER_RUNTIME run \
|
||||||
--workdir "$CTR_CLH_ROOT_DIR" \
|
--workdir "$CTR_CLH_ROOT_DIR" \
|
||||||
--rm \
|
--rm \
|
||||||
--privileged \
|
--device /dev/kvm \
|
||||||
--volume /dev:/dev \
|
--device /dev/net/tun \
|
||||||
|
--cap-add net_admin \
|
||||||
--volume "$CLH_ROOT_DIR:$CTR_CLH_ROOT_DIR" \
|
--volume "$CLH_ROOT_DIR:$CTR_CLH_ROOT_DIR" \
|
||||||
"$CTR_IMAGE" \
|
"$CTR_IMAGE" \
|
||||||
./scripts/run_unit_tests.sh "$@" || fix_dir_perms $? || exit $?
|
./scripts/run_unit_tests.sh "$@" || fix_dir_perms $? || exit $?
|
||||||
|
|||||||
Reference in New Issue
Block a user