All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-virt][PATCH 1/1] lxc: check for busybox in run-ptest
@ 2020-08-05 17:44 Joe Slater
  2020-08-08  2:23 ` [meta-virtualization] " Bruce Ashfield
  0 siblings, 1 reply; 2+ messages in thread
From: Joe Slater @ 2020-08-05 17:44 UTC (permalink / raw)
  To: meta-virtualization; +Cc: joe.slater, randy.macleod

Lots of tests require busybox, so we look for it when
run-ptest starts.  We also sort logs depending on
success or failure.

Signed-off-by: Joe Slater <joe.slater@windriver.com>
---
 recipes-containers/lxc/files/run-ptest | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/recipes-containers/lxc/files/run-ptest b/recipes-containers/lxc/files/run-ptest
index 3f3a75f..948b893 100644
--- a/recipes-containers/lxc/files/run-ptest
+++ b/recipes-containers/lxc/files/run-ptest
@@ -18,16 +18,24 @@ failed=0
 skipped=0
 
 # Create logs dir and clear old logs if any
-mkdir logs 2> /dev/null
-rm -f logs/*
+rm -rf logs
+mkdir -p logs/pass
 
 echo "### Starting LXC ptest ###"
 
+if ! which busybox &> /dev/null
+then
+    echo "busybox must be installed and on PATH"
+    echo "### LXC ptest complete ###"
+    echo "FAIL: lxc ptest configuration"
+fi
+
 for test in ./tests/*
 do
     if [[ ! $blacklist = *$(basename $test)*  ]]
     then
-	$test >logs/$(basename $test).log 2>&1
+        lfile="logs/$(basename $test).log"
+	$test > $lfile 2>&1
     else
 	echo "SKIPPED: $(basename $test)"
 	skipped=$((skipped+1))
@@ -38,6 +46,7 @@ do
     then
 	echo "PASS: $(basename $test)"
 	passed=$((passed+1))
+        mv $lfile logs/pass
     else
 	echo "FAIL: $(basename $test)"
 	failed=$((failed+1))
-- 
2.7.4


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

* Re: [meta-virtualization] [meta-virt][PATCH 1/1] lxc: check for busybox in run-ptest
  2020-08-05 17:44 [meta-virt][PATCH 1/1] lxc: check for busybox in run-ptest Joe Slater
@ 2020-08-08  2:23 ` Bruce Ashfield
  0 siblings, 0 replies; 2+ messages in thread
From: Bruce Ashfield @ 2020-08-08  2:23 UTC (permalink / raw)
  To: Joe Slater; +Cc: meta-virtualization, Randy MacLeod

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

On Wed, Aug 5, 2020 at 1:44 PM Joe Slater <joe.slater@windriver.com> wrote:

> Lots of tests require busybox, so we look for it when
> run-ptest starts.  We also sort logs depending on
> success or failure.
>

But why don't the ptest packages just have busybox as a rdepends ?

The logging changes look ok, but these are better split into two patches.

Cheers,

Bruce



>
> Signed-off-by: Joe Slater <joe.slater@windriver.com>
> ---
>  recipes-containers/lxc/files/run-ptest | 15 ++++++++++++---
>  1 file changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/recipes-containers/lxc/files/run-ptest
> b/recipes-containers/lxc/files/run-ptest
> index 3f3a75f..948b893 100644
> --- a/recipes-containers/lxc/files/run-ptest
> +++ b/recipes-containers/lxc/files/run-ptest
> @@ -18,16 +18,24 @@ failed=0
>  skipped=0
>
>  # Create logs dir and clear old logs if any
> -mkdir logs 2> /dev/null
> -rm -f logs/*
> +rm -rf logs
> +mkdir -p logs/pass
>
>  echo "### Starting LXC ptest ###"
>
> +if ! which busybox &> /dev/null
> +then
> +    echo "busybox must be installed and on PATH"
> +    echo "### LXC ptest complete ###"
> +    echo "FAIL: lxc ptest configuration"
> +fi
> +
>  for test in ./tests/*
>  do
>      if [[ ! $blacklist = *$(basename $test)*  ]]
>      then
> -       $test >logs/$(basename $test).log 2>&1
> +        lfile="logs/$(basename $test).log"
> +       $test > $lfile 2>&1
>      else
>         echo "SKIPPED: $(basename $test)"
>         skipped=$((skipped+1))
> @@ -38,6 +46,7 @@ do
>      then
>         echo "PASS: $(basename $test)"
>         passed=$((passed+1))
> +        mv $lfile logs/pass
>      else
>         echo "FAIL: $(basename $test)"
>         failed=$((failed+1))
> --
> 2.7.4
>
> 
>


-- 
- Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end
- "Use the force Harry" - Gandalf, Star Trek II

[-- Attachment #2: Type: text/html, Size: 3325 bytes --]

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

end of thread, other threads:[~2020-08-08  2:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-05 17:44 [meta-virt][PATCH 1/1] lxc: check for busybox in run-ptest Joe Slater
2020-08-08  2:23 ` [meta-virtualization] " Bruce Ashfield

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.