#!/bin/bash -x
# Copyright (c) 2006 Red Hat, Inc. All rights reserved. This copyrighted material
# is made available to anyone wishing to use, modify, copy, or
# redistribute it subject to the terms and conditions of the GNU General
# Public License v.2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# Author: Tomas Pelka <tpelka@redhat.com>
set -x
ARCH=$(uname -m)
LOG=/tmp/$TEST
T=$1
user=test
#Check if test user exists
grep -e "^$user:" /etc/passwd > /dev/null
if [ $? -ne 0 ]; then
adduser $user
fi
if rpm -q gnome-desktop-testing 1>/dev/null; then
echo "gnome-desktop-testing already installed"
else
echo "The gnome-desktop-testing package is required in order to run this test."
echo "Please install gnome-desktop-testing and re-run the test."
exit 2
fi
sudo -u $user ginsttest-runner $T 2>&1 >$LOG
rc=$?
RESULT=FAIL
if [ $rc -eq 0 ]; then
RESULT="PASS"
fi
echo "Result is: $RESULT"
exit $rc