All of lore.kernel.org
 help / color / mirror / Atom feed
* [OSSTEST PATCH 1/3] ts-livepatch-run: Treat (just) falseish from OutputCheck as fail
@ 2019-01-16 11:36 Ian Jackson
  2019-01-16 11:36 ` [OSSTEST PATCH 2/3] ts-livepatch-run: Print a message about expected failures Ian Jackson
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Ian Jackson @ 2019-01-16 11:36 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Konrad Rzeszutek Wilk

This is more idiomatic.  All existing OutputChecks return booleans, so
no functional change.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 ts-livepatch-run | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ts-livepatch-run b/ts-livepatch-run
index f1194586..8fdb8004 100755
--- a/ts-livepatch-run
+++ b/ts-livepatch-run
@@ -147,8 +147,8 @@ sub livepatch_test () {
         }
         if (defined($test->{OutputCheck})) {
             $_ = $output;
-            $rc=$test->{OutputCheck}->();
-            if ($rc ne 1) {
+            my $ok = $test->{OutputCheck}->();
+            if (!$ok) {
                 die "FAILED! OutputCheck=$test->{OutputCheck}, input=$output\n";
             }
         }
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* [OSSTEST PATCH 2/3] ts-livepatch-run: Print a message about expected failures
  2019-01-16 11:36 [OSSTEST PATCH 1/3] ts-livepatch-run: Treat (just) falseish from OutputCheck as fail Ian Jackson
@ 2019-01-16 11:36 ` Ian Jackson
  2019-01-16 16:37   ` Konrad Rzeszutek Wilk
  2019-01-16 11:36 ` [OSSTEST PATCH 3/3] ts-livepatch-run: Fix erroneous $$ in double-check Ian Jackson
  2019-01-16 16:36 ` [OSSTEST PATCH 1/3] ts-livepatch-run: Treat (just) falseish from OutputCheck as fail Konrad Rzeszutek Wilk
  2 siblings, 1 reply; 6+ messages in thread
From: Ian Jackson @ 2019-01-16 11:36 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Konrad Rzeszutek Wilk

target_cmd_output_root_status prints the command exit status.  If that
was a failure and the failure was as expected, this can be confusing
to readers who do not know that this is a possibility.  So print a
message about it.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 ts-livepatch-run | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ts-livepatch-run b/ts-livepatch-run
index 8fdb8004..f011e64e 100755
--- a/ts-livepatch-run
+++ b/ts-livepatch-run
@@ -152,6 +152,9 @@ sub livepatch_test () {
                 die "FAILED! OutputCheck=$test->{OutputCheck}, input=$output\n";
             }
         }
+	if ($expected_rc) {
+	    logm "... that failure ($rc) was as required; all is well.";
+        }
    }
    return 0;
 }
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* [OSSTEST PATCH 3/3] ts-livepatch-run: Fix erroneous $$ in double-check
  2019-01-16 11:36 [OSSTEST PATCH 1/3] ts-livepatch-run: Treat (just) falseish from OutputCheck as fail Ian Jackson
  2019-01-16 11:36 ` [OSSTEST PATCH 2/3] ts-livepatch-run: Print a message about expected failures Ian Jackson
@ 2019-01-16 11:36 ` Ian Jackson
  2019-01-16 16:37   ` Konrad Rzeszutek Wilk
  2019-01-16 16:36 ` [OSSTEST PATCH 1/3] ts-livepatch-run: Treat (just) falseish from OutputCheck as fail Konrad Rzeszutek Wilk
  2 siblings, 1 reply; 6+ messages in thread
From: Ian Jackson @ 2019-01-16 11:36 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Konrad Rzeszutek Wilk

The doubled $s here are simply a mistake.  The result is to make this
test ineffective, since `$$file' means `the value of the variable
whose name is in the variable $file', which here will never exist.
This produces a `Use of uninitialized value' warning and substitutes
the empty string, so overall we test the existence of the directory.

The missing check is not of much consequence since this check is not
really expected ever to fail, and if it does, some actual test
execution would fail due to the missing file.

So overall I think the only change is to log output.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 ts-livepatch-run | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ts-livepatch-run b/ts-livepatch-run
index f011e64e..86a79791 100755
--- a/ts-livepatch-run
+++ b/ts-livepatch-run
@@ -161,7 +161,7 @@ sub livepatch_test () {
 
 sub livepatch_check () {
     foreach my $file (@livepatch_files) {
-        if (!target_file_exists($ho, "/usr/lib/debug/xen-livepatch/$$file")) {
+        if (!target_file_exists($ho, "/usr/lib/debug/xen-livepatch/$file")) {
             die "$file is missing!\n";
         }
     }
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [OSSTEST PATCH 1/3] ts-livepatch-run: Treat (just) falseish from OutputCheck as fail
  2019-01-16 11:36 [OSSTEST PATCH 1/3] ts-livepatch-run: Treat (just) falseish from OutputCheck as fail Ian Jackson
  2019-01-16 11:36 ` [OSSTEST PATCH 2/3] ts-livepatch-run: Print a message about expected failures Ian Jackson
  2019-01-16 11:36 ` [OSSTEST PATCH 3/3] ts-livepatch-run: Fix erroneous $$ in double-check Ian Jackson
@ 2019-01-16 16:36 ` Konrad Rzeszutek Wilk
  2 siblings, 0 replies; 6+ messages in thread
From: Konrad Rzeszutek Wilk @ 2019-01-16 16:36 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel

On Wed, Jan 16, 2019 at 11:36:35AM +0000, Ian Jackson wrote:
> This is more idiomatic.  All existing OutputChecks return booleans, so
> no functional change.
> 
> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
> CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Thank you!
> ---
>  ts-livepatch-run | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/ts-livepatch-run b/ts-livepatch-run
> index f1194586..8fdb8004 100755
> --- a/ts-livepatch-run
> +++ b/ts-livepatch-run
> @@ -147,8 +147,8 @@ sub livepatch_test () {
>          }
>          if (defined($test->{OutputCheck})) {
>              $_ = $output;
> -            $rc=$test->{OutputCheck}->();
> -            if ($rc ne 1) {
> +            my $ok = $test->{OutputCheck}->();
> +            if (!$ok) {
>                  die "FAILED! OutputCheck=$test->{OutputCheck}, input=$output\n";
>              }
>          }
> -- 
> 2.11.0
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [OSSTEST PATCH 2/3] ts-livepatch-run: Print a message about expected failures
  2019-01-16 11:36 ` [OSSTEST PATCH 2/3] ts-livepatch-run: Print a message about expected failures Ian Jackson
@ 2019-01-16 16:37   ` Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 6+ messages in thread
From: Konrad Rzeszutek Wilk @ 2019-01-16 16:37 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel

On Wed, Jan 16, 2019 at 11:36:36AM +0000, Ian Jackson wrote:
> target_cmd_output_root_status prints the command exit status.  If that
> was a failure and the failure was as expected, this can be confusing
> to readers who do not know that this is a possibility.  So print a
> message about it.
> 
> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
> CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Thank you!
> ---
>  ts-livepatch-run | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/ts-livepatch-run b/ts-livepatch-run
> index 8fdb8004..f011e64e 100755
> --- a/ts-livepatch-run
> +++ b/ts-livepatch-run
> @@ -152,6 +152,9 @@ sub livepatch_test () {
>                  die "FAILED! OutputCheck=$test->{OutputCheck}, input=$output\n";
>              }
>          }
> +	if ($expected_rc) {
> +	    logm "... that failure ($rc) was as required; all is well.";
> +        }
>     }
>     return 0;
>  }
> -- 
> 2.11.0
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [OSSTEST PATCH 3/3] ts-livepatch-run: Fix erroneous $$ in double-check
  2019-01-16 11:36 ` [OSSTEST PATCH 3/3] ts-livepatch-run: Fix erroneous $$ in double-check Ian Jackson
@ 2019-01-16 16:37   ` Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 6+ messages in thread
From: Konrad Rzeszutek Wilk @ 2019-01-16 16:37 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel

On Wed, Jan 16, 2019 at 11:36:37AM +0000, Ian Jackson wrote:
> The doubled $s here are simply a mistake.  The result is to make this
> test ineffective, since `$$file' means `the value of the variable
> whose name is in the variable $file', which here will never exist.
> This produces a `Use of uninitialized value' warning and substitutes
> the empty string, so overall we test the existence of the directory.
> 
> The missing check is not of much consequence since this check is not
> really expected ever to fail, and if it does, some actual test
> execution would fail due to the missing file.
> 
> So overall I think the only change is to log output.
> 
> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
> CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Thank you!
> ---
>  ts-livepatch-run | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/ts-livepatch-run b/ts-livepatch-run
> index f011e64e..86a79791 100755
> --- a/ts-livepatch-run
> +++ b/ts-livepatch-run
> @@ -161,7 +161,7 @@ sub livepatch_test () {
>  
>  sub livepatch_check () {
>      foreach my $file (@livepatch_files) {
> -        if (!target_file_exists($ho, "/usr/lib/debug/xen-livepatch/$$file")) {
> +        if (!target_file_exists($ho, "/usr/lib/debug/xen-livepatch/$file")) {
>              die "$file is missing!\n";
>          }
>      }
> -- 
> 2.11.0
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

end of thread, other threads:[~2019-01-16 16:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-16 11:36 [OSSTEST PATCH 1/3] ts-livepatch-run: Treat (just) falseish from OutputCheck as fail Ian Jackson
2019-01-16 11:36 ` [OSSTEST PATCH 2/3] ts-livepatch-run: Print a message about expected failures Ian Jackson
2019-01-16 16:37   ` Konrad Rzeszutek Wilk
2019-01-16 11:36 ` [OSSTEST PATCH 3/3] ts-livepatch-run: Fix erroneous $$ in double-check Ian Jackson
2019-01-16 16:37   ` Konrad Rzeszutek Wilk
2019-01-16 16:36 ` [OSSTEST PATCH 1/3] ts-livepatch-run: Treat (just) falseish from OutputCheck as fail Konrad Rzeszutek Wilk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.