#!/bin/bash
#
# Helper script for running anaconda tests with rawhide packages
#
# Copyright (C) 2015 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# 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 Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see .
#
# Author: Brian C. Lane
#
MOCKCFG=fedora-rawhide-x86_64
if [ -z "$DISPLAY" ]; then
echo "Run script on a desktop system with a GUI"
exit 1
fi
# Pass the script anything to skip re-initializing the chroot
[ -z "$1" ] && mock -r $MOCKCFG --init
mock -r $MOCKCFG -i python3-blivet -i python3-kickstart -i ostree -i anaconda-gui -i python3-nose
mock -r $MOCKCFG --copyin $PWD /builddir/anaconda/
# Note that DISPLAY is needed to make GTK happy, so this needs to be run from a system with a GUI
mock -r $MOCKCFG --chroot "cd /builddir/anaconda/; DISPLAY=$DISPLAY ./tests/nosetests.sh"