The test, t0001-tiny.sh, when run as root, was failing due to control
characters parted would emit, leading to a spurious difference
and hence to a test failure.

This fixes it.

BTW, currently the new, root-only test, t3200-type-change.sh,
is failing on rawhide, but that is merely reflecting legacy behavior
that I want to change.

>From dd35d7248e77917d9c3ad665360b9cd70f59a2f1 Mon Sep 17 00:00:00 2001
From: Jim Meyering <[email protected]>
Date: Tue, 17 Nov 2009 15:39:00 +0100
Subject: [PATCH] tests: t0001-tiny.sh: avoid spurious failure when run as root.

* tests/t0001-tiny.sh: Control characters were getting in the way.
Filter them out.
---
 tests/t0001-tiny.sh |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/tests/t0001-tiny.sh b/tests/t0001-tiny.sh
index 373a68d..c2ea128 100755
--- a/tests/t0001-tiny.sh
+++ b/tests/t0001-tiny.sh
@@ -40,7 +40,11 @@ for opt in '' -s; do
   parted $opt $dev mklabel msdos ---pretend-input-tty </dev/null > out 2>&1 \
       || fail=1
   # expect no output
-  sed 's/.*WARNING: You are not superuser.*//;/^$/d' out > k && mv k out || 
fail=1
+  sed 's/.*WARNING: You are not superuser.*//;/^$/d' out > k && mv k out \
+      || fail=1
+  # When run as root, there are just curses-related control chars. Remove them.
+  sed 's/^.\{1,12\}$//;/^$/d' out > k && mv k out \
+      || fail=1
   compare out /dev/null || fail=1

   parted -s $dev p || fail=1
--
1.6.6.rc0.236.ge0b94

_______________________________________________
parted-devel mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/parted-devel

Reply via email to