[Fuego] [PATCH 03/29] shell: modifications for the python parser to see some env variables

Bird, Timothy Tim.Bird at sony.com
Tue Aug 1 00:02:39 UTC 2017


OK - I have to admit that the RETURN_VALUE variable really through me off for a while.
I thought it was the RETURN_VALUE from the actual test program (that is, what test_run()
returns).  It turns out it's the value returned by test_processing, if I'm not mistaken.
This ultimately becomes the return value for the whole fuego test, but I was confused
by the name.  Maybe a more specific name would be good.

It's confusing because it's used as an input and an output from processing() (because
generic_parser.py uses it).
 -- Tim


> -----Original Message-----
> From: Daniel Sangorrin [mailto:daniel.sangorrin at toshiba.co.jp]
> Sent: Sunday, July 30, 2017 11:24 PM
> To: Bird, Timothy <Tim.Bird at sony.com>; fuego at lists.linuxfoundation.org
> Subject: RE: [Fuego] [PATCH 03/29] shell: modifications for the python parser
> to see some env variables
> 
> 
> 
> > -----Original Message-----
> > From: Bird, Timothy [mailto:Tim.Bird at sony.com]
> > Sent: Tuesday, July 25, 2017 8:55 AM
> > To: Daniel Sangorrin; fuego at lists.linuxfoundation.org
> > Subject: RE: [Fuego] [PATCH 03/29] shell: modifications for the python
> parser to see some env variables
> >
> >
> >
> > > -----Original Message-----
> > > From Daniel Sangorrin on Friday, July 21, 2017 1:02 AM
> > >
> > > For some reason that is probably explained in the bash
> > > documentation but I don't understand the return value and
> > > platform environment variables are not available from the
> > > parser (common.py: os.environ[xxx]). This modifications made
> > > it work, but if somebody knows why it behaves like this and
> > > is able to provide a fix, I'll be happy to use it.
> >
> > These are shell variables unless they are exported.  Then they become
> > environment variables.  I suspect we just the changes I show below.
> > I'll test and let you know.
> 
> Thanks, I'll test too.
> 
> >
> > >
> > > Signed-off-by: Daniel Sangorrin <daniel.sangorrin at toshiba.co.jp>
> > > ---
> > >  engine/scripts/common.sh    | 2 +-
> > >  engine/scripts/functions.sh | 2 --
> > >  engine/scripts/main.sh      | 4 ++--
> > >  3 files changed, 3 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/engine/scripts/common.sh b/engine/scripts/common.sh
> > > index 961dbe9..150655e 100644
> > > --- a/engine/scripts/common.sh
> > > +++ b/engine/scripts/common.sh
> > > @@ -27,7 +27,7 @@ function run_python() {
> > >      if [ ! -z $ORIG_PATH ]
> > >      then
> > >          echo "running python with PATH=$ORIG_PATH"
> > > -        PATH=$ORIG_PATH python "$@"
> > export PLATFORM
> >
> > > +        PATH=$ORIG_PATH PLATFORM=$PLATFORM
> > > RETURN_VALUE=$RETURN_VALUE python "$@"
> >
> > >      else
> > >          python "$@"
> > >      fi
> > > diff --git a/engine/scripts/functions.sh b/engine/scripts/functions.sh
> > > index 8a6194a..ddb628f 100755
> > > --- a/engine/scripts/functions.sh
> > > +++ b/engine/scripts/functions.sh
> > > @@ -361,8 +361,6 @@ function fetch_results {
> > >  }
> > >
> > >  function processing {
> > > -    local RETURN_VALUE=0
> > > -
> > >      # process the fetched data
> > >      call_if_present test_processing
> > >      if [ $? -ne 0 ]; then
> > > diff --git a/engine/scripts/main.sh b/engine/scripts/main.sh
> > > index a09bb20..4d49c48 100644
> > > --- a/engine/scripts/main.sh
> > > +++ b/engine/scripts/main.sh
> > > @@ -47,8 +47,8 @@ echo "##### doing fuego phase: post_test
> ########"
> > >  post_test
> > >
> > >  echo "##### doing fuego phase: processing ########"
> > > +RETURN_VALUE=0
> > export RETURN_VALUE=0
> > >  processing
> > > -FUEGO_RESULT=$?
> > >
> > >  echo "Fuego: all test phases complete!"
> > > -exit $FUEGO_RESULT
> > > +exit $RETURN_VALUE
> > > --
> > > 2.7.4
> > >
> > >
> > > _______________________________________________
> > > Fuego mailing list
> > > Fuego at lists.linuxfoundation.org
> > > https://lists.linuxfoundation.org/mailman/listinfo/fuego
> 
> 



More information about the Fuego mailing list