parted/0090-tests-Add-emit_superuser_warning-for-gpt-tests.patch
Brian C. Lane 0b7af917e2 - Rebase on new upstream master commit cc382c3
- Drop patches incorporated into upstream
- Still adds the various DASD patches
2014-04-08 11:46:37 -07:00

74 lines
3.0 KiB
Diff

From 5652c9fc136ecf1a209bae40ba25fde2a44d8edc Mon Sep 17 00:00:00 2001
From: "Brian C. Lane" <bcl@redhat.com>
Date: Tue, 25 Mar 2014 17:44:08 -0700
Subject: [PATCH 90/91] tests: Add emit_superuser_warning for gpt tests
When parted runs without script mode it will print a warning about not
being superuser. Add the library call to add this to expected output
from the tests.
* tests/t0281-gpt-grow.sh: Add emit_superuser_warning
* tests/t0282-gpt-move-backup.sh: Add emit_superuser_warning
* tests/t0283-overlap-partitions.sh: Add emit_superuser_warning
---
tests/t0281-gpt-grow.sh | 3 ++-
tests/t0282-gpt-move-backup.sh | 3 ++-
tests/t0283-overlap-partitions.sh | 6 ++++--
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/tests/t0281-gpt-grow.sh b/tests/t0281-gpt-grow.sh
index e373578..0cef138 100644
--- a/tests/t0281-gpt-grow.sh
+++ b/tests/t0281-gpt-grow.sh
@@ -75,7 +75,8 @@ mv out o2 && sed -e "s,/.*/$dev,DEVICE,;s,
*
,,g;s, $,," \
-e "s,^.*/lt-parted: ,parted: ," o2 > out
# check for expected diagnostic
-cat <<EOF > exp || fail=1
+emit_superuser_warning > exp || fail=1
+cat <<EOF >> exp || fail=1
Warning: Not all of the space available to DEVICE appears to be used, you can fix the GPT to use all of the space (an extra 500 blocks) or continue with the current setting?
Fix/Ignore? f
Model: (file)
diff --git a/tests/t0282-gpt-move-backup.sh b/tests/t0282-gpt-move-backup.sh
index 9750ed7..1a296ad 100644
--- a/tests/t0282-gpt-move-backup.sh
+++ b/tests/t0282-gpt-move-backup.sh
@@ -75,7 +75,8 @@ mv out o2 && sed -e "s,/.*/$dev,DEVICE,;s,
*
,,g;s, $,," \
-e "s,^.*/lt-parted: ,parted: ," o2 > out
# check for expected diagnostic
-cat <<EOF > exp || fail=1
+emit_superuser_warning > exp || fail=1
+cat <<EOF >> exp || fail=1
Error: The backup GPT table is not at the end of the disk, as it should be. Fix, by moving the backup to the end (and removing the old backup)?
Fix/Ignore? f
Model: (file)
diff --git a/tests/t0283-overlap-partitions.sh b/tests/t0283-overlap-partitions.sh
index 2a53407..c7ae52a 100644
--- a/tests/t0283-overlap-partitions.sh
+++ b/tests/t0283-overlap-partitions.sh
@@ -74,7 +74,8 @@ mv out o2 && sed -e "s,/.*/$dev,DEVICE,;s,
*
,,g;s, $,," \
-e "s,^.*/lt-parted: ,parted: ," -e "s/^GNU Parted .*$/GNU Parted VERSION/" o2 > out
# check for expected output
-cat <<EOF > exp || fail=1
+emit_superuser_warning > exp || fail=1
+cat <<EOF >> exp || fail=1
GNU Parted VERSION
Using DEVICE
Welcome to GNU Parted! Type 'help' to view a list of commands.
@@ -116,7 +117,8 @@ mv out o2 && sed -e "s,/.*/$dev,DEVICE,;s,
*
,,g;s, $,," \
-e "s,^.*/lt-parted: ,parted: ," -e "s/^GNU Parted .*$/GNU Parted VERSION/" o2 > out
# check for expected output
-cat <<EOF > exp || fail=1
+emit_superuser_warning > exp || fail=1
+cat <<EOF >> exp || fail=1
GNU Parted VERSION
Using DEVICE
Welcome to GNU Parted! Type 'help' to view a list of commands.
--
1.9.0