[Fuego] [PATCH] dovecot: fix test of logfile and ps.

Tim.Bird at sony.com Tim.Bird at sony.com
Tue Oct 9 18:41:35 UTC 2018


Question inline below.

> -----Original Message-----
> From: Wang Mingyu

There is no explanation in the body of the commit message, explaining
the rationale for these changes.  I'm going to need such information to
be included in the commit body from now on.

> Signed-off-by: Wang Mingyu <wangmy at cn.fujitsu.com>
> ---
>  engine/tests/Functional.dovecot/tests/dovecot_logfile.sh | 8 ++++++--
>  engine/tests/Functional.dovecot/tests/dovecot_ps.sh      | 4 ++--
>  2 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/engine/tests/Functional.dovecot/tests/dovecot_logfile.sh
> b/engine/tests/Functional.dovecot/tests/dovecot_logfile.sh
> index 7489103..89fc199 100644
> --- a/engine/tests/Functional.dovecot/tests/dovecot_logfile.sh
> +++ b/engine/tests/Functional.dovecot/tests/dovecot_logfile.sh
> @@ -5,16 +5,18 @@
> 
> 
>  test="logfile"
> -service_name=""
> 
>  . "./fuego_board_function_lib.sh"
> 
>  set_init_manager
> +logger_service=$(detect_logger_service)
> 
>  exec_service_on_target dovecot stop
>  rm -f /var/log/mail.log
> 
> -exec_service_on_target $service_name restart
> +exec_service_on_target $logger_service restart
> +
> +sleep 3
I'm not sure I'm following this.  Is the board logger service
writing the data to /var/log/mail.log?  I would have thought
that messages going through the board's system logger
would show up in /var/log/messages.  I'm not familiar
with dovecot, but is it using the system logger, or doing
its own logging to /var/log/mail.log?

I'm just trying to clarify this.

> 
>  if exec_service_on_target dovecot start
>  then
> @@ -24,6 +26,8 @@ else
>      echo " -> $test: TEST-FAIL"
>  fi
> 
> +sleep 3
> +
>  if tail /var/log/mail.log | grep "dovecot"
>  then
>      echo " -> $test: TEST-PASS"
> diff --git a/engine/tests/Functional.dovecot/tests/dovecot_ps.sh
> b/engine/tests/Functional.dovecot/tests/dovecot_ps.sh
> index 2c627bb..0585cf2 100644
> --- a/engine/tests/Functional.dovecot/tests/dovecot_ps.sh
> +++ b/engine/tests/Functional.dovecot/tests/dovecot_ps.sh
> @@ -19,7 +19,7 @@ else
>      exit
>  fi
> 
> -if ps -N a | grep [d]ovecot
> +if ps -N a | grep "[/]usr/sbin/dovecot"

Why is it preferred to include the path?
'grep [d]ovecot' would catch ps output that included '/usr/sbin/dovecot'.

Are there more than one dovecot processes started, and you only
want to match one?

>  then
>      echo " -> get the pid of dovecot."
>  else
> @@ -38,7 +38,7 @@ else
>      exit
>  fi
> 
> -if ps -N a | grep [d]ovecot
> +if ps -N a | grep "[/]usr/sbin/dovecot"
>  then
>      echo " -> $test: TEST-FAIL"
>  else
> --
> 1.8.3.1



More information about the Fuego mailing list