- tests: Test incomplete resizepart command

- Fix end_input usage in do_resizepart
  Resolves: rhbz#1701411
This commit is contained in:
Brian C. Lane 2019-12-16 14:31:02 -08:00
parent 9afea59440
commit 512a61e4a8
4 changed files with 73 additions and 6 deletions

View File

@ -1,8 +1,9 @@
From 38badae4d6b858da713b383b9bc7bdad6294ca1b Mon Sep 17 00:00:00 2001
From 22a4baba11ab299722e68f9ea37a53869afef7e1 Mon Sep 17 00:00:00 2001
From: "Brian C. Lane" <bcl@redhat.com>
Date: Wed, 27 Jun 2018 13:47:33 -0700
Subject: [PATCH 92/92] Switch gpt-header-move and msdos-overlap to python3
Subject: [PATCH 1/4] Switch gpt-header-move and msdos-overlap to python3
python2 is EOL on January 1, 2020 so it is time to switch to python3.
---
tests/gpt-header-move | 2 +-
tests/msdos-overlap | 2 +-
@ -29,5 +30,5 @@ index d6ae8d6..b2b03e6 100755
Write an overlapping partition to a msdos disk
--
2.17.1
2.23.0

View File

@ -0,0 +1,25 @@
From 679da92c54c75d7fca1fd825f1d42a750d115f2d Mon Sep 17 00:00:00 2001
From: "Brian C. Lane" <bcl@redhat.com>
Date: Tue, 23 Apr 2019 10:25:20 -0700
Subject: [PATCH 3/4] tests: Test incomplete resizepart command
---
tests/t3200-resize-partition.sh | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tests/t3200-resize-partition.sh b/tests/t3200-resize-partition.sh
index 4565e99..06dbe68 100755
--- a/tests/t3200-resize-partition.sh
+++ b/tests/t3200-resize-partition.sh
@@ -63,6 +63,8 @@ parted -m -s $dev u s p > out 2>&1 || fail=1
wait_for_dev_to_appear_ ${dev}1 || { warn_ "${dev}1 did not appear" fail=1; }
sleep 1
+# Running it without end should not core-dump or prompt
+parted -s $dev resizepart 1 > out 2> err || fail=1
# extend the filesystem to end on sector 4096
new_end=4096s
--
2.23.0

View File

@ -0,0 +1,34 @@
From ca845aeeddb17343c9289816833ca352f7c0d87b Mon Sep 17 00:00:00 2001
From: "Brian C. Lane" <bcl@redhat.com>
Date: Tue, 23 Apr 2019 13:52:25 -0700
Subject: [PATCH 4/4] Fix end_input usage in do_resizepart
It needs to be set to NULL, since it may not get set by the call to
command_line_get_sector
---
parted/parted.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/parted/parted.c b/parted/parted.c
index 9dcdb05..df0c7ed 100644
--- a/parted/parted.c
+++ b/parted/parted.c
@@ -1545,6 +1545,7 @@ do_resizepart (PedDevice** dev, PedDisk** diskp)
PedGeometry *range_end = NULL;
PedConstraint* constraint;
int rc = 0;
+ char* end_input = NULL;
if (!disk) {
disk = ped_disk_new (*dev);
@@ -1565,7 +1566,6 @@ do_resizepart (PedDevice** dev, PedDisk** diskp)
start = part->geom.start;
end = oldend = part->geom.end;
- char *end_input;
if (!command_line_get_sector (_("End?"), *dev, &end, &range_end, &end_input))
goto error;
_adjust_end_if_iec(&start, &end, range_end, end_input);
--
2.23.0

View File

@ -4,7 +4,7 @@
Summary: The GNU disk partition manipulation program
Name: parted
Version: 3.3
Release: 1%{?dist}
Release: 2%{?dist}
License: GPLv3+
URL: http://www.gnu.org/software/parted
@ -13,8 +13,10 @@ Source1: https://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz.sig
Source2: pubkey.phillip.susi
Source3: pubkey.brian.lane
# Upstream still uses python2 for these scripts
Patch0092: 0092-Switch-gpt-header-move-and-msdos-overlap-to-python3.patch
# Upstream patches since v3.3 release
Patch0001: 0001-Switch-gpt-header-move-and-msdos-overlap-to-python3.patch
Patch0002: 0003-tests-Test-incomplete-resizepart-command.patch
Patch0003: 0004-Fix-end_input-usage-in-do_resizepart.patch
BuildRequires: gcc
BuildRequires: e2fsprogs-devel
@ -126,6 +128,11 @@ make check
%changelog
* Mon Dec 16 2019 Brian C. Lane <bcl@redhat.com> - 3.3-2
- tests: Test incomplete resizepart command
- Fix end_input usage in do_resizepart
Resolves: rhbz#1701411
* Fri Oct 11 2019 Brian C. Lane <bcl@redhat.com> - 3.3-1
- New upstream release v3.3
Includes the DASD virtio-blk fix.