Blame src/tests/ibus-desktop-testing-runner.in

rpm-build dbbf76
#!/bin/sh
rpm-build dbbf76
# -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*-
rpm-build dbbf76
# vim:set noet ts=4:
rpm-build dbbf76
#
rpm-build dbbf76
# ibus - The Input Bus
rpm-build dbbf76
#
rpm-build dbbf76
# Copyright (c) 2018-2020 Takao Fujiwara <takao.fujiwara1@gmail.com>
rpm-build dbbf76
# Copyright (c) 2018 Red Hat, Inc.
rpm-build dbbf76
#
rpm-build dbbf76
# This program is free software; you can redistribute it and/or modify
rpm-build dbbf76
# it under the terms of the GNU General Public License as published by
rpm-build dbbf76
# the Free Software Foundation; either version 2 of the License, or
rpm-build dbbf76
# (at your option) any later version.
rpm-build dbbf76
#
rpm-build dbbf76
# This program is distributed in the hope that it will be useful,
rpm-build dbbf76
# but WITHOUT ANY WARRANTY; without even the implied warranty of
rpm-build dbbf76
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
rpm-build dbbf76
# GNU General Public License for more details.
rpm-build dbbf76
#
rpm-build dbbf76
# You should have received a copy of the GNU General Public License along
rpm-build dbbf76
# with this program; if not, write to the Free Software Foundation, Inc.,
rpm-build dbbf76
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
rpm-build dbbf76
rpm-build dbbf76
# This test runs /usr/bin/ibus-daemon after install ibus
rpm-build dbbf76
#
rpm-build dbbf76
# # init 3
rpm-build dbbf76
# Login as root
rpm-build dbbf76
# # /root/ibus/tests/test-console.sh --tests ibus-compose \
rpm-build dbbf76
#   --builddir /root/ibus/src/tests --srcdir /root/ibus/src/tests
rpm-build dbbf76
rpm-build dbbf76
# POSIX sh has no 'echo -e'
rpm-build dbbf76
: ${ECHO:='/usr/bin/echo'}
rpm-build dbbf76
# POSIX sh has $UID
rpm-build dbbf76
# DASH saves the graves in '``' as characters not to be extracted
rpm-build dbbf76
: ${UID:=`id -u`}
rpm-build dbbf76
rpm-build dbbf76
rpm-build dbbf76
PROGNAME=`basename $0`
rpm-build dbbf76
VERSION=0.1
rpm-build dbbf76
DISPLAY=:99.0
rpm-build dbbf76
BUILDDIR="."
rpm-build dbbf76
SRCDIR="."
rpm-build dbbf76
TEST_LOG="test-suite.log"
rpm-build dbbf76
TEST_LOG_STDOUT=0
rpm-build dbbf76
RESULT_LOG=""
rpm-build dbbf76
HAVE_GRAPHICS=1
rpm-build dbbf76
DESKTOP_COMMAND="dbus-launch --exit-with-session gnome-session"
rpm-build dbbf76
PID_XORG=0
rpm-build dbbf76
PID_GNOME_SESSION=0
rpm-build dbbf76
TESTING_RUNNER="default"
rpm-build dbbf76
TESTS=""
rpm-build dbbf76
TIMEOUT=300
rpm-build dbbf76
GREEN='\033[0;32m'
rpm-build dbbf76
RED='\033[0;31m'
rpm-build dbbf76
NC='\033[0m'
rpm-build dbbf76
rpm-build dbbf76
print_log()
rpm-build dbbf76
{
rpm-build dbbf76
    if [ x"$RESULT_LOG" != x ] ; then
rpm-build dbbf76
        # avoid 'echo -e' before call 'sed'.
rpm-build dbbf76
        if [ x"$1" = x'-e' ] ; then
rpm-build dbbf76
            shift
rpm-build dbbf76
        fi
rpm-build dbbf76
        NO_ESCAPE=`echo "$@" | sed -e 's/\\\033\\[0;3.m//g' -e 's/\\\033\\[0m//g'`
rpm-build dbbf76
        $ECHO $NO_ESCAPE >> $RESULT_LOG
rpm-build dbbf76
    else
rpm-build dbbf76
        $ECHO "$@"
rpm-build dbbf76
    fi
rpm-build dbbf76
}
rpm-build dbbf76
rpm-build dbbf76
usage()
rpm-build dbbf76
{
rpm-build dbbf76
    $ECHO -e \
rpm-build dbbf76
"This test runs /usr/bin/ibus-daemon after install ibus\n"                     \
rpm-build dbbf76
"$PROGNAME [OPTIONS…]\n"                                                       \
rpm-build dbbf76
"\n"                                                                           \
rpm-build dbbf76
"OPTIONS:\n"                                                                   \
rpm-build dbbf76
"-h, --help                       This help\n"                                 \
rpm-build dbbf76
"-v, --version                    Show version\n"                              \
rpm-build dbbf76
"-b, --builddir=BUILDDIR          Set the BUILDDIR\n"                          \
rpm-build dbbf76
"-s, --srcdir=SOURCEDIR           Set the SOURCEDIR\n"                         \
rpm-build dbbf76
"-c, --no-graphics                Use Xvfb instead of Xorg\n"                  \
rpm-build dbbf76
"-d, --desktop=DESKTOP            Run DESTKTOP. The default is gnome-session\n" \
rpm-build dbbf76
"-t, --tests=\"TESTS...\"           Run TESTS programs which is separated by space\n" \
rpm-build dbbf76
"-r, --runner=RUNNER              Run TESTS programs with a test RUNNER.\n"    \
rpm-build dbbf76
"                                 RUNNDER = gnome or default.\n"               \
rpm-build dbbf76
"                                 default is an embedded runner.\n"            \
rpm-build dbbf76
"-T, --timeout=TIMEOUT            Set timeout (default TIMEOUT is 300 sec).\n" \
rpm-build dbbf76
"-o, --output=OUTPUT_FILE         OUtput the log to OUTPUT_FILE\n"             \
rpm-build dbbf76
"-O, --result=RESULT_FILE         OUtput the result to RESULT_FILE\n"          \
rpm-build dbbf76
""
rpm-build dbbf76
}
rpm-build dbbf76
rpm-build dbbf76
parse_args()
rpm-build dbbf76
{
rpm-build dbbf76
    # This is GNU getopt. "sudo port getopt" in BSD?
rpm-build dbbf76
    ARGS=`getopt -o hvb:s:cd:t:r:T:o:O: --long \
rpm-build dbbf76
          help,version,builddir:,srcdir:,no-graphics,desktop:,tests:,runner:,timeout:,output:,result:\
rpm-build dbbf76
        -- "$@"`;
rpm-build dbbf76
    eval set -- "$ARGS"
rpm-build dbbf76
    while [ 1 ] ; do
rpm-build dbbf76
        case "$1" in
rpm-build dbbf76
        -h | --help )        usage; exit 0;;
rpm-build dbbf76
        -v | --version )     $ECHO -e "$VERSION"; exit 0;;
rpm-build dbbf76
        -b | --builddir )    BUILDDIR="$2"; shift 2;;
rpm-build dbbf76
        -s | --srcdir )      SRCDIR="$2"; shift 2;;
rpm-build dbbf76
        -c | --no-graphics ) HAVE_GRAPHICS=0; shift;;
rpm-build dbbf76
        -d | --desktop )     DESKTOP_COMMAND="$2"; shift 2;;
rpm-build dbbf76
        -t | --tests )       TESTS="$2"; shift 2;;
rpm-build dbbf76
        -r | --runner )      TESTING_RUNNER="$2"; shift 2;;
rpm-build dbbf76
        -T | --timeout )     TIMEOUT="$2"; shift 2;;
rpm-build dbbf76
        -o | --output )      TEST_LOG="$2"; shift 2;;
rpm-build dbbf76
        -O | --result )      RESULT_LOG="$2"; shift 2;;
rpm-build dbbf76
        -- )                 shift; break;;
rpm-build dbbf76
        * )                  usage; exit 1;;
rpm-build dbbf76
        esac
rpm-build dbbf76
    done
rpm-build dbbf76
}
rpm-build dbbf76
rpm-build dbbf76
init_desktop()
rpm-build dbbf76
{
rpm-build dbbf76
    if [ "$RESULT_LOG" != "" ] ; then
rpm-build dbbf76
        if [ -f $RESULT_LOG ] ; then
rpm-build dbbf76
            rm $RESULT_LOG
rpm-build dbbf76
        fi
rpm-build dbbf76
    fi
rpm-build dbbf76
    HAS_STDOUT=`echo "$TEST_LOG" | grep ':stdout'`
rpm-build dbbf76
    if [ x"$HAS_STDOUT" != x ] ; then
rpm-build dbbf76
        TEST_LOG=`echo "$TEST_LOG" | sed -e 's|:stdout||'`
rpm-build dbbf76
        TEST_LOG_STDOUT=1
rpm-build dbbf76
    fi
rpm-build dbbf76
    if [ "$TEST_LOG" = "" ] ; then
rpm-build dbbf76
        print_log -e "${RED}FAIL${NC}: ${RED}ERROR${NC}: a log file is required to get return value with 'read' command"
rpm-build dbbf76
        exit 255
rpm-build dbbf76
    elif [ -f $TEST_LOG ] ; then
rpm-build dbbf76
        rm $TEST_LOG
rpm-build dbbf76
    fi
rpm-build dbbf76
    if [ x$FORCE_TEST != x ] ; then
rpm-build dbbf76
        RUN_ARGS="$RUN_ARGS --force"
rpm-build dbbf76
    fi
rpm-build dbbf76
rpm-build dbbf76
    if [ ! -f $HOME/.config/gnome-initial-setup-done ] ; then
rpm-build dbbf76
        IS_SYSTEM_ACCOUNT=false
rpm-build dbbf76
        if [ "$USER" = "root" ] ; then
rpm-build dbbf76
            IS_SYSTEM_ACCOUNT=true
rpm-build dbbf76
        fi
rpm-build dbbf76
        if test ! -f /var/lib/AccountsService/users/$USER ; then
rpm-build dbbf76
            mkdir -p /var/lib/AccountsService/users
rpm-build dbbf76
            cat >> /var/lib/AccountsService/users/$USER << _EOF
rpm-build dbbf76
[User]
rpm-build dbbf76
Language=ja_JP.UTF-8
rpm-build dbbf76
XSession=gnome
rpm-build dbbf76
SystemAccount=$IS_SYSTEM_ACCOUNT
rpm-build dbbf76
_EOF
rpm-build dbbf76
        fi
rpm-build dbbf76
        mkdir -p $HOME/.config
rpm-build dbbf76
        touch $HOME/.config/gnome-initial-setup-done
rpm-build dbbf76
    fi
rpm-build dbbf76
rpm-build dbbf76
    # Prevent from launching a XDG dialog
rpm-build dbbf76
    XDG_LOCALE_FILE="$HOME/.config/user-dirs.locale"
rpm-build dbbf76
    if [ -f $XDG_LOCALE_FILE ] ; then
rpm-build dbbf76
        XDG_LANG_ORIG=`cat $XDG_LOCALE_FILE`
rpm-build dbbf76
        XDG_LANG_NEW=`echo $LANG | sed -e 's/\(.*\)\..*/\1/'`
rpm-build dbbf76
        if [ "$XDG_LANG_ORIG" != "$XDG_LANG_NEW" ] ; then
rpm-build dbbf76
            echo "# Overriding XDG locale $XDG_LANG_ORIG with $XDG_LANG_NEW"
rpm-build dbbf76
            echo "$XDG_LANG_NEW" > $XDG_LOCALE_FILE
rpm-build dbbf76
        fi
rpm-build dbbf76
    fi
rpm-build dbbf76
    # `su` command does not run loginctl
rpm-build dbbf76
    export XDG_SESSION_TYPE='x11'
rpm-build dbbf76
    export XDG_SESSION_CLASS=user
rpm-build dbbf76
    # `su` command does not get focus in events without this variable.
rpm-build dbbf76
    # Need to restart sshd after set "PermitRootLogin yes" in sshd_config
rpm-build dbbf76
    if [ "x$XDG_RUNTIME_DIR" = x ] ; then
rpm-build dbbf76
        export XDG_RUNTIME_DIR="/run/user/$UID"
rpm-build dbbf76
        is_root_login=`grep "^PermitRootLogin" /etc/ssh/sshd_config | grep yes`
rpm-build dbbf76
        if [ "x$ANSIBLE" != x ] && [ "x$is_root_login" = x ] ; then
rpm-build dbbf76
            print_log -e "${RED}FAIL${NC}: No permission to get focus-in events in GtkWindow with ansible"
rpm-build dbbf76
            echo "su command does not configure necessary login info "         \
rpm-build dbbf76
                 "with systemd and GtkWindow cannot receive focus-events "     \
rpm-build dbbf76
                 "when ibus-desktop-testing-runner is executed by "            \
rpm-build dbbf76
                 "ansible-playbook." >> $TEST_LOG
rpm-build dbbf76
            echo "Enabling root login via sshd, restarting sshd, set "         \
rpm-build dbbf76
                 "XDG_RUNTIME_DIR can resolve the problem under "              \
rpm-build dbbf76
                 "ansible-playbook." >> $TEST_LOG
rpm-build dbbf76
            exit 255
rpm-build dbbf76
        fi
rpm-build dbbf76
    fi
rpm-build dbbf76
    #  Do we need XDG_SESSION_ID and XDG_SEAT?
rpm-build dbbf76
    #export XDG_CONFIG_DIRS=/etc/xdg
rpm-build dbbf76
    #export XDG_SESSION_ID=10
rpm-build dbbf76
    #export XDG_SESSION_DESKTOP=gnome
rpm-build dbbf76
    #export XDG_SEAT=seat0
rpm-build dbbf76
}
rpm-build dbbf76
rpm-build dbbf76
run_dbus_daemon()
rpm-build dbbf76
{
rpm-build dbbf76
    # Use dbus-launch --exit-with-session later instead of --sh-syntax
rpm-build dbbf76
    # GNOME uses a unix:abstract address and it effects gsettings set values
rpm-build dbbf76
    # in each test case.
rpm-build dbbf76
    # TODO: Should we comment out this line?
rpm-build dbbf76
    export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$UID/bus"
rpm-build dbbf76
}
rpm-build dbbf76
rpm-build dbbf76
run_desktop()
rpm-build dbbf76
{
rpm-build dbbf76
    if test $HAVE_GRAPHICS -eq 1 ; then
rpm-build dbbf76
        /usr/libexec/Xorg.wrap -noreset +extension GLX +extension RANDR +extension RENDER -logfile ./xorg.log -config ./xorg.conf -configdir . $DISPLAY &
rpm-build dbbf76
    else
rpm-build dbbf76
        /usr/bin/Xvfb $DISPLAY -noreset +extension GLX +extension RANDR +extension RENDER -screen 0 1280x1024x24 &
rpm-build dbbf76
    fi
rpm-build dbbf76
    PID_XORG=$!
rpm-build dbbf76
    sleep 1
rpm-build dbbf76
    export DISPLAY=$DISPLAY
rpm-build dbbf76
    echo "Running $DESKTOP_COMMAND with $USER in `tty`"
rpm-build dbbf76
    $DESKTOP_COMMAND &
rpm-build dbbf76
    PID_GNOME_SESSION=$!
rpm-build dbbf76
    sleep 30
rpm-build dbbf76
    HAS_GNOME=`echo $DESKTOP_COMMAND | grep gnome-session`
rpm-build dbbf76
    if [ x"$HAS_GNOME" = x ] ; then
rpm-build dbbf76
        ibus-daemon --daemonize --verbose
rpm-build dbbf76
        sleep 3
rpm-build dbbf76
    fi
rpm-build dbbf76
}
rpm-build dbbf76
rpm-build dbbf76
count_case_result()
rpm-build dbbf76
{
rpm-build dbbf76
    retval=$1
rpm-build dbbf76
    pass=$2
rpm-build dbbf76
    fail=$3
rpm-build dbbf76
rpm-build dbbf76
    if test $retval -eq  0 ; then
rpm-build dbbf76
        pass=`expr $pass + 1`
rpm-build dbbf76
    else
rpm-build dbbf76
        fail=`expr $fail + 1`
rpm-build dbbf76
    fi
rpm-build dbbf76
    echo $pass $fail
rpm-build dbbf76
}
rpm-build dbbf76
rpm-build dbbf76
echo_case_result()
rpm-build dbbf76
{
rpm-build dbbf76
    retval=$1
rpm-build dbbf76
    tst=$2
rpm-build dbbf76
    subtst=${3:-''}
rpm-build dbbf76
rpm-build dbbf76
    if test $retval -eq  0 ; then
rpm-build dbbf76
        echo "PASS: $tst $subtst" >>$TEST_LOG
rpm-build dbbf76
    else
rpm-build dbbf76
        echo "FAIL: $tst $subtst" >>$TEST_LOG
rpm-build dbbf76
    fi
rpm-build dbbf76
}
rpm-build dbbf76
rpm-build dbbf76
run_direct_test_cases()
rpm-build dbbf76
{
rpm-build dbbf76
    pass=0
rpm-build dbbf76
    fail=0
rpm-build dbbf76
    for tst in $TESTS; do
rpm-build dbbf76
        ENVS=
rpm-build dbbf76
        if test -f $SRCDIR/${tst}.env ; then
rpm-build dbbf76
            ENVS="`cat $SRCDIR/${tst}.env`"
rpm-build dbbf76
        fi
rpm-build dbbf76
        if test x"$ENVS" = x ; then
rpm-build dbbf76
            $BUILDDIR/$tst $SRCDIR 2>>$TEST_LOG 1>>$TEST_LOG
rpm-build dbbf76
            retval=$?
rpm-build dbbf76
            read pass fail << EOF_COUNT
rpm-build dbbf76
            `count_case_result $retval $pass $fail`
rpm-build dbbf76
EOF_COUNT
rpm-build dbbf76
            echo_case_result $retval $tst
rpm-build dbbf76
            CACHE_FILES=`ls *.cache`
rpm-build dbbf76
            if [ x"$CACHE_FILES" != x ] ; then
rpm-build dbbf76
                echo "# Clean $CACHE_FILES" >>$TEST_LOG
rpm-build dbbf76
                rm $CACHE_FILES
rpm-build dbbf76
            fi
rpm-build dbbf76
        else
rpm-build dbbf76
            i=1
rpm-build dbbf76
            # Deleted for var in "$ENVS" because IFS=$'\n' is not supported
rpm-build dbbf76
            # in POSIX sh
rpm-build dbbf76
            while read e ; do
rpm-build dbbf76
                first=`echo "$e" | grep '^#'`
rpm-build dbbf76
                if test x"$first" = x"#" ; then
rpm-build dbbf76
                    continue
rpm-build dbbf76
                fi
rpm-build dbbf76
                echo "# Starting $e $BUILDDIR/$tst $SRCDIR" >>$TEST_LOG
rpm-build dbbf76
                env $e $BUILDDIR/$tst $SRCDIR 2>>$TEST_LOG 1>>$TEST_LOG
rpm-build dbbf76
                retval=$?
rpm-build dbbf76
                echo "# Finished $e $BUILDDIR/$tst $SRCDIR with $retval" >>$TEST_LOG
rpm-build dbbf76
                read pass fail << EOF_COUNT
rpm-build dbbf76
                `count_case_result $retval $pass $fail`
rpm-build dbbf76
EOF_COUNT
rpm-build dbbf76
                echo_case_result $retval $tst $e
rpm-build dbbf76
                CACHE_FILES=`ls *.cache`
rpm-build dbbf76
                if [ x"$CACHE_FILES" != x ] ; then
rpm-build dbbf76
                    echo "# Clean $CACHE_FILES" >>$TEST_LOG
rpm-build dbbf76
                    rm $CACHE_FILES
rpm-build dbbf76
                fi
rpm-build dbbf76
                i=`expr $i + 1`
rpm-build dbbf76
            done << EOF_ENVS
rpm-build dbbf76
            `echo "$ENVS"`
rpm-build dbbf76
EOF_ENVS
rpm-build dbbf76
        fi
rpm-build dbbf76
    done
rpm-build dbbf76
    echo $pass $fail
rpm-build dbbf76
}
rpm-build dbbf76
rpm-build dbbf76
run_gnome_desktop_testing_runner()
rpm-build dbbf76
{
rpm-build dbbf76
    pass=0
rpm-build dbbf76
    fail=0
rpm-build dbbf76
    if [ x"$TESTS" = x ] ; then
rpm-build dbbf76
        TESTS='ibus'
rpm-build dbbf76
    fi
rpm-build dbbf76
    for tst in $TESTS; do
rpm-build dbbf76
        tst_dir="@INSTALLEDDIR@/$tst"
rpm-build dbbf76
        if [ ! -d "$tst_dir" ] ; then
rpm-build dbbf76
            print_log -e "${RED}FAIL${NC}: Not found %tst_dir"
rpm-build dbbf76
            fail=1
rpm-build dbbf76
            continue
rpm-build dbbf76
        fi
rpm-build dbbf76
        gnome-desktop-testing-runner --timeout=$TIMEOUT $tst \
rpm-build dbbf76
                2>>$TEST_LOG 1>>$TEST_LOG
rpm-build dbbf76
        retval=$?
rpm-build dbbf76
        read pass fail << EOF
rpm-build dbbf76
        `count_case_result $retval $pass $fail`
rpm-build dbbf76
EOF
rpm-build dbbf76
    done
rpm-build dbbf76
    child_pass=`grep '^PASS:' $TEST_LOG | wc -l`
rpm-build dbbf76
    child_fail=`grep '^FAIL:' $TEST_LOG | wc -l`
rpm-build dbbf76
    if [ $child_pass -ne 0 ] || [ $child_fail -ne 0 ] ; then
rpm-build dbbf76
        pass=$child_pass
rpm-build dbbf76
        if [ $child_fail -ne 0 ] ; then
rpm-build dbbf76
            fail=`expr $child_fail / 2`
rpm-build dbbf76
        else
rpm-build dbbf76
            fail=0
rpm-build dbbf76
        fi
rpm-build dbbf76
    fi
rpm-build dbbf76
    echo $pass $fail
rpm-build dbbf76
}
rpm-build dbbf76
rpm-build dbbf76
run_test_suite()
rpm-build dbbf76
{
rpm-build dbbf76
    pass=0
rpm-build dbbf76
    fail=0
rpm-build dbbf76
    export GTK_IM_MODULE=ibus
rpm-build dbbf76
    export IBUS_COMPOSE_CACHE_DIR=$PWD
rpm-build dbbf76
    if [ x"$TESTING_RUNNER" = x ] ; then
rpm-build dbbf76
        TESTING_RUNNER="default"
rpm-build dbbf76
    fi
rpm-build dbbf76
    case $TESTING_RUNNER in
rpm-build dbbf76
    default)
rpm-build dbbf76
        # Get only the last value with do-while.
rpm-build dbbf76
        read pass fail << EOF_RUNNER
rpm-build dbbf76
        `run_direct_test_cases`
rpm-build dbbf76
EOF_RUNNER
rpm-build dbbf76
        ;;
rpm-build dbbf76
    gnome)
rpm-build dbbf76
        read pass fail << EOF_RUNNER
rpm-build dbbf76
        `run_gnome_desktop_testing_runner`
rpm-build dbbf76
EOF_RUNNER
rpm-build dbbf76
        ;;
rpm-build dbbf76
    esac
rpm-build dbbf76
    echo ""
rpm-build dbbf76
    print_log -e "${GREEN}PASS${NC}: $pass"
rpm-build dbbf76
    print_log -e "${RED}FAIL${NC}: $fail"
rpm-build dbbf76
    echo ""
rpm-build dbbf76
    if [ $TEST_LOG_STDOUT -eq 1 ] ; then
rpm-build dbbf76
        cat $TEST_LOG
rpm-build dbbf76
    else
rpm-build dbbf76
        echo "# See $TEST_LOG"
rpm-build dbbf76
    fi
rpm-build dbbf76
}
rpm-build dbbf76
rpm-build dbbf76
finit()
rpm-build dbbf76
{
rpm-build dbbf76
    echo "# Killing left gnome-session and Xorg"
rpm-build dbbf76
    kill $PID_GNOME_SESSION $PID_XORG
rpm-build dbbf76
    ibus exit
rpm-build dbbf76
    SUSER=`echo "$USER" | cut -c 1-7`
rpm-build dbbf76
    LEFT_CALENDAR=`ps -ef | grep gnome-shell-calendar-server | grep $SUSER | grep -v grep`
rpm-build dbbf76
    if [ x"$LEFT_CALENDAR" != x ] ; then
rpm-build dbbf76
        echo "# Killing left gnome-shell-calendar-server"
rpm-build dbbf76
        echo "$LEFT_CALENDAR"
rpm-build dbbf76
        echo "$LEFT_CALENDAR" | awk '{print $2}' | xargs kill
rpm-build dbbf76
    fi
rpm-build dbbf76
rpm-build dbbf76
    echo "# Finished $PROGNAME testing"
rpm-build dbbf76
}
rpm-build dbbf76
rpm-build dbbf76
main()
rpm-build dbbf76
{
rpm-build dbbf76
    parse_args "$@"
rpm-build dbbf76
    init_desktop
rpm-build dbbf76
    run_dbus_daemon 2>>$TEST_LOG 1>>$TEST_LOG
rpm-build dbbf76
    run_desktop 2>>$TEST_LOG 1>>$TEST_LOG
rpm-build dbbf76
    run_test_suite
rpm-build dbbf76
    finit
rpm-build dbbf76
}
rpm-build dbbf76
rpm-build dbbf76
# Need to enclose $@ with double quotes not to split the array.
rpm-build dbbf76
main "$@"