From f392dab28632cc02d7fb1c8d7f169ac32aef45cf Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Wed, 8 Jan 2025 18:29:31 +0100 Subject: [PATCH] tests: check memory locking Check reserved memory and stack is able to disable mlocking. --- test/shell/mlock-no-locking.sh | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 test/shell/mlock-no-locking.sh diff --git a/test/shell/mlock-no-locking.sh b/test/shell/mlock-no-locking.sh new file mode 100644 index 000000000..1d0e33fbc --- /dev/null +++ b/test/shell/mlock-no-locking.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +# Copyright (C) 2025 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing to use, +# modify, copy, or redistribute it subject to the terms and conditions +# of the GNU General Public License v.2. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# Check whether activation without memory locking works as expected +. lib/inittest + +aux prepare_vg + +lvcreate -L1 -n $lv1 $vg + +# Create snapshot which normally requires suspend -> locking memory +lvcreate -s -L1 $vg/$lv1 -vvvv &> log + +grep "Locking memory" log + +# This should be making snapshot without memory locking +lvcreate -s --config 'activation/reserved_memory=0' -L1 $vg/$lv1 -vvvv &> log +grep "Skipping memory locking" log +not grep "Locking memory" log + +lvcreate -s --config 'activation/reserved_stack=0' -L1 $vg/$lv1 -vvvv &> log +grep "Skipping memory locking" log +not grep "Locking memory" log + +lvcreate -s --config 'activation/reserved_stack=0 activation/reserved_memory=0' -L1 $vg/$lv1 -vvvv &> log +grep "Skipping memory locking" log +not grep "Locking memory" log + +vgremove -f $vg