From 89e56aa3b46acd9cd82339fa0e1423dcc6615fb5 Mon Sep 17 00:00:00 2001 From: Alexander Todorov Date: Thu, 1 Aug 2019 14:34:57 +0300 Subject: [PATCH] Install python2-pip in the test VM and disable EPEL repo so we don't use EPEL when actually building the images Related: rhbz#1698366 --- test/vm.install | 21 ++++++++++++++++++++ tests/cli/test_build_and_deploy_openstack.sh | 8 ++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/test/vm.install b/test/vm.install index 9c82a425..ba512bb2 100755 --- a/test/vm.install +++ b/test/vm.install @@ -29,6 +29,27 @@ if ! rpm -q beakerlib; then fi fi +EPEL_REPO="/etc/yum.repos.d/epel7.repo" +if [ ! -f "$EPEL_REPO" ]; then + cat > $EPEL_REPO << __EOF__ +[epel7] +name=epel7 +failovermethod=priority +enabled=1 +skip_if_unavailable=0 +mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=\$basearch +gpgcheck=0 +__EOF__ +fi + +# EPEL packages used in tests +if ! rpm -q python2-pip; then + yum -y install python2-pip +fi + +# don't build images with EPEL enabled +rm -f $EPEL_REPO + if rpm -q python2-cryptography; then yum remove -y python2-cryptography fi diff --git a/tests/cli/test_build_and_deploy_openstack.sh b/tests/cli/test_build_and_deploy_openstack.sh index 646b38d8..aad97718 100755 --- a/tests/cli/test_build_and_deploy_openstack.sh +++ b/tests/cli/test_build_and_deploy_openstack.sh @@ -39,8 +39,12 @@ rlJournalStart rlLogInfo "OS_PASSWORD is configured" fi - rlRun -t -c "yum -y install python2-pip python-virtualenv" - rlAssertRpm python2-pip + if ! rlCheckRpm "python2-pip"; then + rlRun -t -c "yum -y install python2-pip" + rlAssertRpm python2-pip + fi + + rlRun -t -c "yum -y install python-virtualenv" rlAssertRpm python-virtualenv rlRun -t -c "virtualenv $VENV"