tests/int/helpers: simplify set_cgroup_mount_writable

Use update_config like in all the other places.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin
2020-09-16 09:18:45 -07:00
parent 892477ca26
commit fdb0590c40
+2 -4
View File
@@ -214,10 +214,8 @@ function set_resources_limit() {
# Helper function to make /sys/fs/cgroup writable
function set_cgroup_mount_writable() {
bundle="${1:-.}"
cat "$bundle/config.json" \
| jq '.mounts |= map((select(.type == "cgroup") | .options -= ["ro"]) // .)' \
>"$bundle/config.json.tmp"
mv "$bundle/config.json"{.tmp,}
update_config '.mounts |= map((select(.type == "cgroup") | .options -= ["ro"]) // .)' \
$bundle
}
# Fails the current test, providing the error given.