All of lore.kernel.org
 help / color / mirror / Atom feed
* [Fuego] [PATCH] functions: Support for test sets with a horizontal line in the name.
@ 2019-04-25 15:49 Wang Mingyu
  2019-05-02  0:59 ` Tim.Bird
  0 siblings, 1 reply; 4+ messages in thread
From: Wang Mingyu @ 2019-04-25 15:49 UTC (permalink / raw)
  To: fuego

Signed-off-by: Wang Mingyu <wangmy@cn.fujitsu.com>
---
 scripts/functions.sh | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/scripts/functions.sh b/scripts/functions.sh
index 5251dd9..56e39cc 100755
--- a/scripts/functions.sh
+++ b/scripts/functions.sh
@@ -147,10 +147,11 @@ function untar {
 #   spec gitrepo > spec tarball > fuego_test gitrepo > fuego_test tarball
 function unpack {
     # prepare variables
-    upName=`echo "${TESTDIR^^}"| tr '.' '_'`
-    spec_gitrepo="${upName}_GITREPO"
-    spec_gitref="${upName}_GITREF"
-    spec_tarball="${upName}_TARBALL"
+    upName="${TESTDIR^^}"
+    specName="${upName//[-,.]/_}"
+    spec_gitrepo="${specName}_GITREPO"
+    spec_gitref="${specName}_GITREF"
+    spec_tarball="${specName}_TARBALL"
     # 1) spec gitrepo
     if [ ! -z "${!spec_gitrepo}" ]; then
         gitrepo=${!spec_gitrepo}
@@ -394,7 +395,8 @@ function pre_build {
     # If the spec requests it, create a job-specifc
     # build directory.
     # e.g. "PER_JOB_BUILD": "true" in spec file
-    pjName=`echo "${TESTDIR^^}_PER_JOB_BUILD"| tr '.' '_'`
+    upName="${TESTDIR^^}"
+    pjName="${upName//[-,.]/_}_PER_JOB_BUILD"
     if [ "${!pjName}" == "true" ] ; then
         mkdir -p $JOB_BUILD_DIR
     else
@@ -696,8 +698,8 @@ function fail_check_cases () {
     testlog="${LOGDIR}/testlog.txt"
     slog_prefix="${LOGDIR}/syslog"
 
-    upName=`echo "${TESTDIR^^}"| tr '.' '_'`
-    fcname="${upName}"_FAIL_CASE_COUNT
+    upName="${TESTDIR^^}"
+    fcname="${upName//[-,.]/_}_FAIL_CASE_COUNT"
 
     fcc="${!fcname}"
 
-- 
1.8.3.1




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

* Re: [Fuego] [PATCH] functions: Support for test sets with a horizontal line in the name.
  2019-04-25 15:49 [Fuego] [PATCH] functions: Support for test sets with a horizontal line in the name Wang Mingyu
@ 2019-05-02  0:59 ` Tim.Bird
  2019-05-05  7:25   ` Wang, Mingyu
  0 siblings, 1 reply; 4+ messages in thread
From: Tim.Bird @ 2019-05-02  0:59 UTC (permalink / raw)
  To: wangmy, fuego

I've applied this, because I like the removal of the call to 'tr',
and handling more characters makes the code more robust.

However, any test with a '-' or ',' in the name would violate
the Fuego naming rules.  See
http://fuegotest.org/wiki/Fuego_naming_rules#Fuego_test_name

 Thanks for the patch.
 -- Tim

> -----Original Message-----
> From: Wang Mingyu
> 
> Signed-off-by: Wang Mingyu <wangmy@cn.fujitsu.com>
> ---
>  scripts/functions.sh | 16 +++++++++-------
>  1 file changed, 9 insertions(+), 7 deletions(-)
> 
> diff --git a/scripts/functions.sh b/scripts/functions.sh
> index 5251dd9..56e39cc 100755
> --- a/scripts/functions.sh
> +++ b/scripts/functions.sh
> @@ -147,10 +147,11 @@ function untar {
>  #   spec gitrepo > spec tarball > fuego_test gitrepo > fuego_test tarball
>  function unpack {
>      # prepare variables
> -    upName=`echo "${TESTDIR^^}"| tr '.' '_'`
> -    spec_gitrepo="${upName}_GITREPO"
> -    spec_gitref="${upName}_GITREF"
> -    spec_tarball="${upName}_TARBALL"
> +    upName="${TESTDIR^^}"
> +    specName="${upName//[-,.]/_}"
> +    spec_gitrepo="${specName}_GITREPO"
> +    spec_gitref="${specName}_GITREF"
> +    spec_tarball="${specName}_TARBALL"
>      # 1) spec gitrepo
>      if [ ! -z "${!spec_gitrepo}" ]; then
>          gitrepo=${!spec_gitrepo}
> @@ -394,7 +395,8 @@ function pre_build {
>      # If the spec requests it, create a job-specifc
>      # build directory.
>      # e.g. "PER_JOB_BUILD": "true" in spec file
> -    pjName=`echo "${TESTDIR^^}_PER_JOB_BUILD"| tr '.' '_'`
> +    upName="${TESTDIR^^}"
> +    pjName="${upName//[-,.]/_}_PER_JOB_BUILD"
>      if [ "${!pjName}" == "true" ] ; then
>          mkdir -p $JOB_BUILD_DIR
>      else
> @@ -696,8 +698,8 @@ function fail_check_cases () {
>      testlog="${LOGDIR}/testlog.txt"
>      slog_prefix="${LOGDIR}/syslog"
> 
> -    upName=`echo "${TESTDIR^^}"| tr '.' '_'`
> -    fcname="${upName}"_FAIL_CASE_COUNT
> +    upName="${TESTDIR^^}"
> +    fcname="${upName//[-,.]/_}_FAIL_CASE_COUNT"
> 
>      fcc="${!fcname}"
> 
> --
> 1.8.3.1
> 
> 
> 
> _______________________________________________
> Fuego mailing list
> Fuego@lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/fuego

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

* Re: [Fuego] [PATCH] functions: Support for test sets with a horizontal line in the name.
  2019-05-02  0:59 ` Tim.Bird
@ 2019-05-05  7:25   ` Wang, Mingyu
  2019-05-07  5:47     ` Tim.Bird
  0 siblings, 1 reply; 4+ messages in thread
From: Wang, Mingyu @ 2019-05-05  7:25 UTC (permalink / raw)
  To: fuego

Hi Tim,

There are some services or commands, the original name of which are with a '-'. Such as syslog-ng and net-tools. In this case, when the test set is named, should the '-' be changed to underscore or directly removed.
 Also, does it need to follow the same principle when naming the test case?

by Wangmy

-----Original Message-----
From: Tim.Bird@sony.com [mailto:Tim.Bird@sony.com] 
Sent: Thursday, May 02, 2019 8:59 AM
To: Wang, Mingyu/王 鸣瑜 <wangmy@cn.fujitsu.com>; fuego@lists.linuxfoundation.org
Subject: RE: [Fuego] [PATCH] functions: Support for test sets with a horizontal line in the name.

I've applied this, because I like the removal of the call to 'tr', and handling more characters makes the code more robust.

However, any test with a '-' or ',' in the name would violate the Fuego naming rules.  See http://fuegotest.org/wiki/Fuego_naming_rules#Fuego_test_name

 Thanks for the patch.
 -- Tim

> -----Original Message-----
> From: Wang Mingyu
> 
> Signed-off-by: Wang Mingyu <wangmy@cn.fujitsu.com>
> ---
>  scripts/functions.sh | 16 +++++++++-------
>  1 file changed, 9 insertions(+), 7 deletions(-)
> 
> diff --git a/scripts/functions.sh b/scripts/functions.sh index 
> 5251dd9..56e39cc 100755
> --- a/scripts/functions.sh
> +++ b/scripts/functions.sh
> @@ -147,10 +147,11 @@ function untar {
>  #   spec gitrepo > spec tarball > fuego_test gitrepo > fuego_test tarball
>  function unpack {
>      # prepare variables
> -    upName=`echo "${TESTDIR^^}"| tr '.' '_'`
> -    spec_gitrepo="${upName}_GITREPO"
> -    spec_gitref="${upName}_GITREF"
> -    spec_tarball="${upName}_TARBALL"
> +    upName="${TESTDIR^^}"
> +    specName="${upName//[-,.]/_}"
> +    spec_gitrepo="${specName}_GITREPO"
> +    spec_gitref="${specName}_GITREF"
> +    spec_tarball="${specName}_TARBALL"
>      # 1) spec gitrepo
>      if [ ! -z "${!spec_gitrepo}" ]; then
>          gitrepo=${!spec_gitrepo}
> @@ -394,7 +395,8 @@ function pre_build {
>      # If the spec requests it, create a job-specifc
>      # build directory.
>      # e.g. "PER_JOB_BUILD": "true" in spec file
> -    pjName=`echo "${TESTDIR^^}_PER_JOB_BUILD"| tr '.' '_'`
> +    upName="${TESTDIR^^}"
> +    pjName="${upName//[-,.]/_}_PER_JOB_BUILD"
>      if [ "${!pjName}" == "true" ] ; then
>          mkdir -p $JOB_BUILD_DIR
>      else
> @@ -696,8 +698,8 @@ function fail_check_cases () {
>      testlog="${LOGDIR}/testlog.txt"
>      slog_prefix="${LOGDIR}/syslog"
> 
> -    upName=`echo "${TESTDIR^^}"| tr '.' '_'`
> -    fcname="${upName}"_FAIL_CASE_COUNT
> +    upName="${TESTDIR^^}"
> +    fcname="${upName//[-,.]/_}_FAIL_CASE_COUNT"
> 
>      fcc="${!fcname}"
> 
> --
> 1.8.3.1
> 
> 
> 
> _______________________________________________
> Fuego mailing list
> Fuego@lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/fuego





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

* Re: [Fuego] [PATCH] functions: Support for test sets with a horizontal line in the name.
  2019-05-05  7:25   ` Wang, Mingyu
@ 2019-05-07  5:47     ` Tim.Bird
  0 siblings, 0 replies; 4+ messages in thread
From: Tim.Bird @ 2019-05-07  5:47 UTC (permalink / raw)
  To: wangmy, fuego

> -----Original Message-----
> From: Wang, Mingyu
> 
> Hi Tim,
> 
> There are some services or commands, the original name of which are with a
> '-'. Such as syslog-ng and net-tools. In this case, when the test set is named,
> should the '-' be changed to underscore or directly removed.

It is desirable to have the test name be as
close as possible to the component that it's testing.  However, the reason for
the no-dash policy is that a dash ('-') is used as the delimiter for parts of the run
identifier  (see 'ftc list-runs -q').  The run identifier used to have as part of its name
a timestamp, which had multiple dashes.  However, it doesn't have a timestamp
element currently.  It might be possible to allow dashes in the test name, if we
restrict other elements of the run identifier to a known number of dashes, or
alternatively use a different delimiter.

Let me think about the issues here and let you know if we will keep the
no-dash policy.  If we do, then yes, we would change a dash in the program
name to an underscore.

>  Also, does it need to follow the same principle when naming the test case?
The test case name uses periods ('.') as the delimiter, so it's OK to use dashes
in the name.

 -- Tim


> 
> by Wangmy
> 
> -----Original Message-----
> From: Tim.Bird@sony.com [mailto:Tim.Bird@sony.com]
> Sent: Thursday, May 02, 2019 8:59 AM
> To: Wang, Mingyu/王 鸣瑜 <wangmy@cn.fujitsu.com>;
> fuego@lists.linuxfoundation.org
> Subject: RE: [Fuego] [PATCH] functions: Support for test sets with a
> horizontal line in the name.
> 
> I've applied this, because I like the removal of the call to 'tr', and handling
> more characters makes the code more robust.
> 
> However, any test with a '-' or ',' in the name would violate the Fuego naming
> rules.  See
> http://fuegotest.org/wiki/Fuego_naming_rules#Fuego_test_name
> 
>  Thanks for the patch.
>  -- Tim
> 
> > -----Original Message-----
> > From: Wang Mingyu
> >
> > Signed-off-by: Wang Mingyu <wangmy@cn.fujitsu.com>
> > ---
> >  scripts/functions.sh | 16 +++++++++-------
> >  1 file changed, 9 insertions(+), 7 deletions(-)
> >
> > diff --git a/scripts/functions.sh b/scripts/functions.sh index
> > 5251dd9..56e39cc 100755
> > --- a/scripts/functions.sh
> > +++ b/scripts/functions.sh
> > @@ -147,10 +147,11 @@ function untar {
> >  #   spec gitrepo > spec tarball > fuego_test gitrepo > fuego_test tarball
> >  function unpack {
> >      # prepare variables
> > -    upName=`echo "${TESTDIR^^}"| tr '.' '_'`
> > -    spec_gitrepo="${upName}_GITREPO"
> > -    spec_gitref="${upName}_GITREF"
> > -    spec_tarball="${upName}_TARBALL"
> > +    upName="${TESTDIR^^}"
> > +    specName="${upName//[-,.]/_}"
> > +    spec_gitrepo="${specName}_GITREPO"
> > +    spec_gitref="${specName}_GITREF"
> > +    spec_tarball="${specName}_TARBALL"
> >      # 1) spec gitrepo
> >      if [ ! -z "${!spec_gitrepo}" ]; then
> >          gitrepo=${!spec_gitrepo}
> > @@ -394,7 +395,8 @@ function pre_build {
> >      # If the spec requests it, create a job-specifc
> >      # build directory.
> >      # e.g. "PER_JOB_BUILD": "true" in spec file
> > -    pjName=`echo "${TESTDIR^^}_PER_JOB_BUILD"| tr '.' '_'`
> > +    upName="${TESTDIR^^}"
> > +    pjName="${upName//[-,.]/_}_PER_JOB_BUILD"
> >      if [ "${!pjName}" == "true" ] ; then
> >          mkdir -p $JOB_BUILD_DIR
> >      else
> > @@ -696,8 +698,8 @@ function fail_check_cases () {
> >      testlog="${LOGDIR}/testlog.txt"
> >      slog_prefix="${LOGDIR}/syslog"
> >
> > -    upName=`echo "${TESTDIR^^}"| tr '.' '_'`
> > -    fcname="${upName}"_FAIL_CASE_COUNT
> > +    upName="${TESTDIR^^}"
> > +    fcname="${upName//[-,.]/_}_FAIL_CASE_COUNT"
> >
> >      fcc="${!fcname}"
> >
> > --
> > 1.8.3.1
> >
> >
> >
> > _______________________________________________
> > Fuego mailing list
> > Fuego@lists.linuxfoundation.org
> > https://lists.linuxfoundation.org/mailman/listinfo/fuego
> 
> 
> 
> 
> _______________________________________________
> Fuego mailing list
> Fuego@lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/fuego

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

end of thread, other threads:[~2019-05-07  5:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-25 15:49 [Fuego] [PATCH] functions: Support for test sets with a horizontal line in the name Wang Mingyu
2019-05-02  0:59 ` Tim.Bird
2019-05-05  7:25   ` Wang, Mingyu
2019-05-07  5:47     ` Tim.Bird

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.