[Ovirt-devel] [PATCH] separate test results log

Jim Meyering jim at meyering.net
Thu Aug 21 14:11:34 UTC 2008


Hi Alan,
Looks good, modulo a nit at the end.

Alan Pevec <apevec at redhat.com> wrote:
> diff --git a/autobuild.sh b/autobuild.sh
> index 19ff5a4..4eee9ea 100755
> --- a/autobuild.sh
> +++ b/autobuild.sh
> @@ -23,6 +23,8 @@ ME=$(basename "$0")
>  warn() { printf "$ME: $@\n" >&2; }
>  die() { warn "$@"; exit 1; }
>
> +test -n "$1" && RESULTS="$1" || RESULTS="results.log"

You can drop some of those quotes (in the name of removing
unnecessary syntax):

  test -n "$1" && RESULTS=$1 || RESULTS=results.log

>  echo "Running oVirt Autobuild"
>
>  SSHKEY=~/.ssh/id_autobuild
> @@ -81,7 +83,8 @@ $ssh_cmd \
>     service ovirt-mongrel-rails restart && service httpd restart && \
>     curl -i http://management.priv.ovirt.org/ovirt/ | \
>         grep 'HTTP/1.1 200 OK' && \
> -   cd /usr/share/ovirt-wui && rake test"
> +   cd /usr/share/ovirt-wui && rake test" > $RESULTS 2>&1 \
> +  || die "wui tests failed"

The above requires quotes around "$RESULTS":

    cd /usr/share/ovirt-wui && rake test" > "$RESULTS" 2>&1 \

The quotes are useful when the value contains e.g., a space:

  $ f='a b'
  $ echo a > $f
  bash: $f: ambiguous redirect

with quotes, a poorly chosen name doesn't cause a malfunction:

  $ f='a b'
  $ echo a > "$f"




More information about the ovirt-devel mailing list