linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] Align FAILED to test name to be parsable
@ 2012-10-20 16:03 Gilles Espinasse
  2012-10-21 22:08 ` NeilBrown
  0 siblings, 1 reply; 6+ messages in thread
From: Gilles Espinasse @ 2012-10-20 16:03 UTC (permalink / raw)
  To: linux-raid, neilb; +Cc: Gilles Espinasse

Signed-off-by: Gilles Espinasse <g.esp@free.fr>

So 'grep FAILED log' is now meaningfull.
Let both stdout and sderr be displayed after a failed test
---
 test |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/test b/test
index 9340afe..2bb482c 100755
--- a/test
+++ b/test
@@ -222,12 +222,13 @@ do_test() {
     # source script in a subshell, so it has access to our
     # namespace, but cannot change it.
     echo -ne "$_script... "
-    if ( set -ex ; . $_script )  2> $targetdir/log
+    if ( set -ex ; . $_script ) &> $targetdir/log
     then
       echo "succeeded"
       _fail=0
     else
-      echo "FAILED - see $targetdir/log for details"
+      echo "FAILED"
+      cat $targetdir/log
       _fail=1
     fi
     if [ "$savelogs" == "1" ]; then
-- 
1.7.2.5


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/3] Align FAILED to test name to be parsable
  2012-10-20 16:03 [PATCH 1/3] Align FAILED to test name to be parsable Gilles Espinasse
@ 2012-10-21 22:08 ` NeilBrown
  2012-10-22  8:31   ` g.esp
  0 siblings, 1 reply; 6+ messages in thread
From: NeilBrown @ 2012-10-21 22:08 UTC (permalink / raw)
  To: Gilles Espinasse; +Cc: linux-raid

[-- Attachment #1: Type: text/plain, Size: 1143 bytes --]

On Sat, 20 Oct 2012 18:03:22 +0200 Gilles Espinasse <g.esp@free.fr> wrote:

> Signed-off-by: Gilles Espinasse <g.esp@free.fr>
> 
> So 'grep FAILED log' is now meaningfull.
> Let both stdout and sderr be displayed after a failed test
> ---
>  test |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/test b/test
> index 9340afe..2bb482c 100755
> --- a/test
> +++ b/test
> @@ -222,12 +222,13 @@ do_test() {
>      # source script in a subshell, so it has access to our
>      # namespace, but cannot change it.
>      echo -ne "$_script... "
> -    if ( set -ex ; . $_script )  2> $targetdir/log
> +    if ( set -ex ; . $_script ) &> $targetdir/log
>      then
>        echo "succeeded"
>        _fail=0
>      else
> -      echo "FAILED - see $targetdir/log for details"
> +      echo "FAILED"
> +      cat $targetdir/log
>        _fail=1
>      fi
>      if [ "$savelogs" == "1" ]; then

Hi,
 the patch makes some sense, but it doesn't seem to match the description,
 though maybe I'm just being dense.

 How does the patch "Align FAILED to test name" ?

Thanks,
NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/3] Align FAILED to test name to be parsable
  2012-10-21 22:08 ` NeilBrown
@ 2012-10-22  8:31   ` g.esp
  2012-10-22 22:23     ` NeilBrown
  0 siblings, 1 reply; 6+ messages in thread
From: g.esp @ 2012-10-22  8:31 UTC (permalink / raw)
  To: NeilBrown; +Cc: linux-raid



----- Mail original -----
> De: "NeilBrown" <neilb@suse.de>
> À: "Gilles Espinasse" <g.esp@free.fr>
> Cc: linux-raid@vger.kernel.org
> Envoyé: Lundi 22 Octobre 2012 00:08:55
> Objet: Re: [PATCH 1/3] Align FAILED to test name to be parsable
> 
> On Sat, 20 Oct 2012 18:03:22 +0200 Gilles Espinasse <g.esp@free.fr>
> wrote:
> 
> > Signed-off-by: Gilles Espinasse <g.esp@free.fr>
> > 
> > So 'grep FAILED log' is now meaningfull.
> > Let both stdout and sderr be displayed after a failed test
> > ---
> >  test |    5 +++--
> >  1 files changed, 3 insertions(+), 2 deletions(-)
> > 
> > diff --git a/test b/test
> > index 9340afe..2bb482c 100755
> > --- a/test
> > +++ b/test
> > @@ -222,12 +222,13 @@ do_test() {
> >      # source script in a subshell, so it has access to our
> >      # namespace, but cannot change it.
> >      echo -ne "$_script... "
> > -    if ( set -ex ; . $_script )  2> $targetdir/log
> > +    if ( set -ex ; . $_script ) &> $targetdir/log
> >      then
> >        echo "succeeded"
> >        _fail=0
> >      else
> > -      echo "FAILED - see $targetdir/log for details"
> > +      echo "FAILED"
> > +      cat $targetdir/log
> >        _fail=1
> >      fi
> >      if [ "$savelogs" == "1" ]; then
> 
> Hi,
>  the patch makes some sense, but it doesn't seem to match the
>  description,
>  though maybe I'm just being dense.
> 
>  How does the patch "Align FAILED to test name" ?
> 
> Thanks,
> NeilBrown
> 
I have a test that failed with
tests/06r5swap... --- /var/tmp/d1	2012-10-20 08:36:12.000000000 +0200
+++ /var/tmp/d1s	2012-10-20 08:36:12.000000000 +0200
@@ -1,32 +0,0 @@
-/dev/loop1:
-          Magic : a92b4efc
-        Version : 0.90.00
-           UUID : 3a6a4fbd:b6c09cce:37479202:ddc39261 (local to host a7n8x-e)
-  Creation Time : Sat Oct 20 08:36:07 2012
-     Raid Level : raid5
-  Used Dev Size : 19456 (19.00 MiB 19.92 MB)
-     Array Size : 58368 (57.01 MiB 59.77 MB)
-   Raid Devices : 4
-  Total Devices : 4
-Preferred Minor : 0
-
-    Update Time : Sat Oct 20 08:36:11 2012
-          State : clean
- Active Devices : 3
-Working Devices : 4
- Failed Devices : 1
-  Spare Devices : 1
-       Checksum : 506e39b6 - correct
-         Events : 9
-
-         Layout : left-symmetric
-     Chunk Size : 512K
-
-      Number   Major   Minor   RaidDevice State
-this     1       7        8        1      active sync   /dev/loop1
-
-   0     0       7        0        0      active sync   /dev/loop0
-   1     1       7        8        1      active sync   /dev/loop1
-   2     2       7       16        2      active sync   /dev/loop2
-   3     3       0        0        3      faulty removed
-   4     4       7       24        4      spare   /dev/loop3
Personalities : [linear] [multipath] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] 
unused devices: <none>
FAILED - see /var/tmp/log for details

When standard output is redirected like in the patch, diff output goes to $targetdir/log and FAILED would be printed one the same line as the test name.

I hadn't yet reported that failure as I am only recently trying to run mdadm test suite and I had some issues to solve before on my build chroot scripts. I suppose there is less value to run that test suite if the running kernel is not from the same version as the 
Once using the same kernel (3.4.14), first failure is the one above.

Gilles
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/3] Align FAILED to test name to be parsable
  2012-10-22  8:31   ` g.esp
@ 2012-10-22 22:23     ` NeilBrown
  2012-10-23  8:31       ` g.esp
  0 siblings, 1 reply; 6+ messages in thread
From: NeilBrown @ 2012-10-22 22:23 UTC (permalink / raw)
  To: g.esp; +Cc: linux-raid

[-- Attachment #1: Type: text/plain, Size: 3782 bytes --]

On Mon, 22 Oct 2012 10:31:23 +0200 (CEST) g.esp@free.fr wrote:

> 
> 
> ----- Mail original -----
> > De: "NeilBrown" <neilb@suse.de>
> > À: "Gilles Espinasse" <g.esp@free.fr>
> > Cc: linux-raid@vger.kernel.org
> > Envoyé: Lundi 22 Octobre 2012 00:08:55
> > Objet: Re: [PATCH 1/3] Align FAILED to test name to be parsable
> > 
> > On Sat, 20 Oct 2012 18:03:22 +0200 Gilles Espinasse <g.esp@free.fr>
> > wrote:
> > 
> > > Signed-off-by: Gilles Espinasse <g.esp@free.fr>
> > > 
> > > So 'grep FAILED log' is now meaningfull.
> > > Let both stdout and sderr be displayed after a failed test
> > > ---
> > >  test |    5 +++--
> > >  1 files changed, 3 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/test b/test
> > > index 9340afe..2bb482c 100755
> > > --- a/test
> > > +++ b/test
> > > @@ -222,12 +222,13 @@ do_test() {
> > >      # source script in a subshell, so it has access to our
> > >      # namespace, but cannot change it.
> > >      echo -ne "$_script... "
> > > -    if ( set -ex ; . $_script )  2> $targetdir/log
> > > +    if ( set -ex ; . $_script ) &> $targetdir/log
> > >      then
> > >        echo "succeeded"
> > >        _fail=0
> > >      else
> > > -      echo "FAILED - see $targetdir/log for details"
> > > +      echo "FAILED"
> > > +      cat $targetdir/log
> > >        _fail=1
> > >      fi
> > >      if [ "$savelogs" == "1" ]; then
> > 
> > Hi,
> >  the patch makes some sense, but it doesn't seem to match the
> >  description,
> >  though maybe I'm just being dense.
> > 
> >  How does the patch "Align FAILED to test name" ?
> > 
> > Thanks,
> > NeilBrown
> > 
> I have a test that failed with
> tests/06r5swap... --- /var/tmp/d1	2012-10-20 08:36:12.000000000 +0200

Ahh, I see what you mean.

I've change the patch description and removed the change to the failed
message, because I don't want the log to appear in-line:

From 45e34015b6f3c9deb4f489095eeedc9343a34b5e Mon Sep 17 00:00:00 2001
From: Gilles Espinasse <g.esp@free.fr>
Date: Tue, 23 Oct 2012 09:12:15 +1100
Subject: [PATCH] test: redirect all output to log file to keep output clean

If a test sent anything to stdout, it would not get logged, and would
mess up the listing of test status.

Signed-off-by: Gilles Espinasse <g.esp@free.fr>
Signed-off-by: NeilBrown <neilb@suse.de>

diff --git a/test b/test
index 48b47d9..e313385 100755
--- a/test
+++ b/test
@@ -227,7 +227,7 @@ do_test() {
     # source script in a subshell, so it has access to our
     # namespace, but cannot change it.
     echo -ne "$_script... "
-    if ( set -ex ; . $_script )  2> $targetdir/log
+    if ( set -ex ; . $_script ) &> $targetdir/log
     then
       echo "succeeded"
       _fail=0


and I have added another patch which will make sure we don't lose the logs
when using --keep-going

From 1dc837e4edc805819a1ff40add3d0beecfeecdbb Mon Sep 17 00:00:00 2001
From: NeilBrown <neilb@suse.de>
Date: Tue, 23 Oct 2012 09:21:32 +1100
Subject: [PATCH] test: keep separate log file for each failed test.

If a test failed when --keep-going is selected, give the
log file a name based on the test name, so that all the logs
can be examined afterwards.

Signed-off-by: NeilBrown <neilb@suse.de>

diff --git a/test b/test
index e313385..3f8515f 100755
--- a/test
+++ b/test
@@ -232,7 +232,12 @@ do_test() {
       echo "succeeded"
       _fail=0
     else
-      echo "FAILED - see $targetdir/log for details"
+      log=log
+      if [ $exitonerror == 0 ]; then
+	  log=log-`basename $_script`
+	  mv $targetdir/log $targetdir/$log
+      fi
+      echo "FAILED - see $targetdir/$log for details"
       _fail=1
     fi
     if [ "$savelogs" == "1" ]; then


Thanks,
NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/3] Align FAILED to test name to be parsable
  2012-10-22 22:23     ` NeilBrown
@ 2012-10-23  8:31       ` g.esp
  2012-11-12  5:48         ` NeilBrown
  0 siblings, 1 reply; 6+ messages in thread
From: g.esp @ 2012-10-23  8:31 UTC (permalink / raw)
  To: NeilBrown; +Cc: linux-raid



----- Mail original -----
> De: "NeilBrown" <neilb@suse.de>
> À: "g esp" <g.esp@free.fr>
> Cc: linux-raid@vger.kernel.org
> Envoyé: Mardi 23 Octobre 2012 00:23:56
> Objet: Re: [PATCH 1/3] Align FAILED to test name to be parsable
> 
> On Mon, 22 Oct 2012 10:31:23 +0200 (CEST) g.esp@free.fr wrote:
> 
...
> I've change the patch description and removed the change to the failed
> message, because I don't want the log to appear in-line:
> 
When using an automated build system (like I do in the linux from sources way), usually the last action is to remove the package source that was just build. So that would remove any log needed to check the reasons of the failures.

coreutils, after the test suite end, add all logs for failed and skipped tests.
I think this is a good compromise.

Did you want that sort of behavior?


Gilles
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/3] Align FAILED to test name to be parsable
  2012-10-23  8:31       ` g.esp
@ 2012-11-12  5:48         ` NeilBrown
  0 siblings, 0 replies; 6+ messages in thread
From: NeilBrown @ 2012-11-12  5:48 UTC (permalink / raw)
  To: g.esp; +Cc: linux-raid

[-- Attachment #1: Type: text/plain, Size: 1042 bytes --]

On Tue, 23 Oct 2012 10:31:15 +0200 (CEST) g.esp@free.fr wrote:

> 
> 
> ----- Mail original -----
> > De: "NeilBrown" <neilb@suse.de>
> > À: "g esp" <g.esp@free.fr>
> > Cc: linux-raid@vger.kernel.org
> > Envoyé: Mardi 23 Octobre 2012 00:23:56
> > Objet: Re: [PATCH 1/3] Align FAILED to test name to be parsable
> > 
> > On Mon, 22 Oct 2012 10:31:23 +0200 (CEST) g.esp@free.fr wrote:
> > 
> ...
> > I've change the patch description and removed the change to the failed
> > message, because I don't want the log to appear in-line:
> > 
> When using an automated build system (like I do in the linux from sources way), usually the last action is to remove the package source that was just build. So that would remove any log needed to check the reasons of the failures.
> 
> coreutils, after the test suite end, add all logs for failed and skipped tests.
> I think this is a good compromise.
> 
> Did you want that sort of behavior?

I wouldn't object to it as an option.  --errors-in-line or something.

NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-11-12  5:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-20 16:03 [PATCH 1/3] Align FAILED to test name to be parsable Gilles Espinasse
2012-10-21 22:08 ` NeilBrown
2012-10-22  8:31   ` g.esp
2012-10-22 22:23     ` NeilBrown
2012-10-23  8:31       ` g.esp
2012-11-12  5:48         ` NeilBrown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).