mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
daemon: lvm: Use lvcreate --yes to avoid interactive prompts.
See https://bugzilla.redhat.com/show_bug.cgi?id=1930996#c1 Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1930996
This commit is contained in:
@@ -219,7 +219,7 @@ do_lvcreate (const char *logvol, const char *volgroup, int mbytes)
|
||||
snprintf (size, sizeof size, "%d", mbytes);
|
||||
|
||||
r = command (NULL, &err,
|
||||
"lvm", "lvcreate",
|
||||
"lvm", "lvcreate", "--yes",
|
||||
"-L", size, "-n", logvol, volgroup, NULL);
|
||||
if (r == -1) {
|
||||
reply_with_error ("%s", err);
|
||||
|
||||
@@ -49,6 +49,7 @@ EXTRA_DIST = \
|
||||
rhbz1370424.sh \
|
||||
rhbz1370424.xml \
|
||||
rhbz1477623.sh \
|
||||
rhbz1930996.sh \
|
||||
test-noexec-stack.pl
|
||||
|
||||
TESTS = \
|
||||
@@ -79,6 +80,7 @@ TESTS = \
|
||||
rhbz1285847.sh \
|
||||
rhbz1370424.sh \
|
||||
rhbz1477623.sh \
|
||||
rhbz1930996.sh \
|
||||
test-big-heap \
|
||||
test-noexec-stack.pl \
|
||||
$(SLOW_TESTS)
|
||||
|
||||
36
tests/regressions/rhbz1930996.sh
Executable file
36
tests/regressions/rhbz1930996.sh
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash -
|
||||
# libguestfs
|
||||
# Copyright (C) 2017-2021 Red Hat Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# 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.
|
||||
|
||||
# Regression test for:
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1930996#c1
|
||||
#
|
||||
# Actually a bug/change in LVM, previously we failed to create an LV
|
||||
# if the underlying disk contained a filesystem signature.
|
||||
|
||||
set -e
|
||||
|
||||
$TEST_FUNCTIONS
|
||||
skip_if_skipped
|
||||
skip_unless_phony_guest fedora.img
|
||||
|
||||
f=rhbz1930996.img
|
||||
rm -f $f
|
||||
|
||||
guestfish -N $f=lvfs vgremove VG : vgcreate VG /dev/sda1 : lvcreate LV2 VG 100
|
||||
|
||||
rm $f
|
||||
Reference in New Issue
Block a user