Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions tests/run_all_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,19 @@ if [ -t 1 ]; then
COLOR="yes"
fi

for i in test_*.py
do
./tap-driver.sh --test-name "$i" --log-file "$i.log" --trs-file "$i.trs" --color-tests "${COLOR}" --enable-hard-errors yes --expect-failure no -- /usr/bin/python "$i"
managers="cgroupfs"
if grep -q systemd /proc/1/comm && $OCI_RUNTIME --version | grep -qF +SYSTEMD; then
managers="$managers systemd"
fi

for cm in cgroupfs systemd; do
export CGROUP_MANAGER=$cm
echo "#"
echo "# CGROUP_MANAGER=$cm"
echo "#"
for i in test_*.py; do
./tap-driver.sh --test-name "$i" --log-file "${i}_${cm}.log" --trs-file "${i}_${cm}.trs" --color-tests "${COLOR}" --enable-hard-errors yes --expect-failure no -- /usr/bin/python "$i"
done
done

if grep FAIL -- *.trs; then
Expand Down
4 changes: 3 additions & 1 deletion tests/tests_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def get_crun_path():

def run_and_get_output(config, detach=False, preserve_fds=None, pid_file=None,
keep=False,
command='run', env=None, use_popen=False, hide_stderr=False, cgroup_manager='cgroupfs',
command='run', env=None, use_popen=False, hide_stderr=False, cgroup_manager=None,
all_dev_null=False, id_container=None, relative_config_path="config.json",
chown_rootfs_to=None, callback_prepare_rootfs=None, debug_on_error=None):

Expand Down Expand Up @@ -287,6 +287,8 @@ def run_and_get_output(config, detach=False, preserve_fds=None, pid_file=None,
relative_config_path = ['--config', relative_config_path] if relative_config_path else []

root = get_tests_root_status()
if cgroup_manager is None:
cgroup_manager = os.environ.get('CGROUP_MANAGER', 'cgroupfs')
args = [crun, "--cgroup-manager", cgroup_manager, "--root", root, command] + relative_config_path + preserve_fds_arg + detach_arg + keep_arg + pid_file_arg + [id_container]

stderr = subprocess.STDOUT
Expand Down