[PATCH] tests: avoid failure when run as non-root

Jim Meyering meyering at redhat.com
Fri Jun 20 10:01:42 UTC 2008


* tests/t7000-scripting.sh: and avoid some duplication
---
 tests/t7000-scripting.sh |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/tests/t7000-scripting.sh b/tests/t7000-scripting.sh
index 5022f91..d3c7342 100755
--- a/tests/t7000-scripting.sh
+++ b/tests/t7000-scripting.sh
@@ -21,17 +21,14 @@ test_description=3D'Make sure the scripting option wo=
rks (-s) properly.'
 . $srcdir/test-lib.sh

 # The failure messages.
-cat << EOF >> errS || fail=3D1
+cat << EOF > errS || fail=3D1
 Error: You requested a partition from 512B to 50.7kB.
 The closest location we can manage is 17.4kB to 33.8kB.
 EOF

-cat << EOF >> errI || fail=3D1
-Warning: You requested a partition from 512B to 50.7kB.
-The closest location we can manage is 17.4kB to 33.8kB.
-Is this still acceptable to you?
-EOF
-echo -n "Yes/No? " >> errI
+{ emit_superuser_warning
+  sed s/Error/Warning/ errS
+  printf 'Is this still acceptable to you?\nYes/No? '; } >> errI || fail=
=3D1

 # Test for mkpart in scripting mode
 test_expect_success \
--
1.5.6.7.g67e08b




More information about the parted-devel mailing list