Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion centos_ci_build
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
# Build steps used in CentOS CI

yum -y update
dnf -y update
uname -a
SKIP_QA_HARNESS=1 ./runtests.sh
4 changes: 2 additions & 2 deletions runtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

echo -e "\n[+] `date` -> CentOS QA $0 starting."

yum -d0 -y install bind-utils
dnf -d0 -y install bind-utils

if [ "$?" -ne "0" ] ;then
echo "[+] ERROR : not even able to install bind-utils pkg so all t_functional tests will fail"
Expand All @@ -21,7 +21,7 @@ LIB_FUNCTIONS='./tests/0_lib/functions.sh'
# Human friendly symbols
export readonly PASS=0
export readonly FAIL=1
# set debug level of yum install in t_InstallPackage
# set debug level of dnf install in t_InstallPackage
export YUMDEBUG=0

[ -f $LIB_FUNCTIONS ] && source $LIB_FUNCTIONS || { echo -e "\n[+] `date` -> Unable to source functions library. Cannot continue\n"; exit $FAIL; }
Expand Down
2 changes: 1 addition & 1 deletion tests/0_common/15_list_repos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

t_Log "Running $0 - Showing the repos we have configured"

yum -d0 repolist -v
dnf -d0 repolist -v

t_CheckExitStatus $?
4 changes: 2 additions & 2 deletions tests/0_common/20_upgrade_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ fi
if [ "$centos_ver" -lt 8 ];then
yum -d0 -y install deltarpm
fi
yum -d0 -y upgrade
dnf -d0 -y upgrade

t_Log "Running $0 - listing all used/available packages"

yum list
dnf list

t_CheckExitStatus $?
10 changes: 5 additions & 5 deletions tests/0_lib/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ function t_InstallPackage
mkdir /var/cache/{dnf,yum,system-upgrade}
dnf makecache
fi
t_Log "Attempting yum install: $*"
/usr/bin/yum -y -d${YUMDEBUG} install "$@"
t_Log "Attempting dnf install: $*"
/usr/bin/dnf -y -d${YUMDEBUG} install "$@"
# TODO: add a hook here, to make sure all binary files have ldd run
# against them, and that there are no missing linker targets
t_CheckExitStatus $?
Expand All @@ -42,12 +42,12 @@ function t_InstallPackageMinimal
t_CheckExitStatus $?
}

# Description: call this to perform a yum-based removal of packages
# Description: call this to perform a dnf-based removal of packages
# Arguments: a space separated list of package names to remove.
function t_RemovePackage
{
t_Log "Attempting yum remove: $*"
/usr/bin/yum -y -d0 remove "$@"
t_Log "Attempting dnf remove: $*"
/usr/bin/dnf -y -d0 remove "$@"
t_CheckExitStatus $?
}

Expand Down
10 changes: 5 additions & 5 deletions tests/p_ipa-server/0-preclean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if (t_GetPkgRel basesystem | grep -qE 'el(6|7)')
fi
if rpm -q httpd &> /dev/null
then
/usr/bin/yum -y remove httpd &> /dev/null
/usr/bin/dnf -y remove httpd &> /dev/null
rm -rf /etc/httpd
fi

Expand All @@ -23,7 +23,7 @@ if (t_GetPkgRel basesystem | grep -qE 'el(6|7)')
fi
if rpm -q bind &> /dev/null
then
/usr/bin/yum -y remove bind &> /dev/null
/usr/bin/dnf -y remove bind &> /dev/null
rm -rf /etc/named /var/named
fi

Expand All @@ -46,14 +46,14 @@ if (t_GetPkgRel basesystem | grep -qE 'el(6|7)')
cp /etc/ntp.conf /tmp/ntp.conf.ipa-tests
fi

t_Log "Running $0 - Backing up saving yum history id"
/usr/bin/yum history list | awk 'NR == 4 {print $1}' > /tmp/yum-rollback-id.ipa-tests
t_Log "Running $0 - Backing up saving dnf history id"
/usr/bin/dnf history list | awk 'NR == 4 {print $1}' > /tmp/yum-rollback-id.ipa-tests

t_Log "Running $0 - Cleaning up hosts file"
sed -i "s/127.0.0.1 $(hostname)//" /etc/hosts

t_Log "Running $0 - Cleaning previous tomcat/pki instances if any"
yum remove -d0 -y tomcat ipa-server >/dev/null 2>&1
dnf remove -d0 -y tomcat ipa-server >/dev/null 2>&1
/bin/rm -Rf /var/lib/pki/pki-tomcat/ /etc/sysconfig/pki-tomcat /var/log/pki/pki-tomcat /etc/pki/pki-tomcat /etc/sysconfig/pki/tomcat/pki-tomcat

t_Log "Running $0 - Backing up ssh_config"
Expand Down
2 changes: 1 addition & 1 deletion tests/p_ipa-server/99-postclean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if (t_GetPkgRel basesystem | grep -qE 'el(6|7)') && !(t_GetArch | grep -qE 'aarc
fi

t_Log "Running $0 - Rolling back to yum history id - this will take some time"
/usr/bin/yum -y history rollback $(cat /tmp/yum-rollback-id.ipa-tests) &> /dev/null
/usr/bin/dnf -y history rollback $(cat /tmp/yum-rollback-id.ipa-tests) &> /dev/null

t_Log "Running $0 - Restoring ssh_config"
${CP} /etc/ssh/ssh_config.ipa-tests /etc/ssh/ssh_config
Expand Down
4 changes: 2 additions & 2 deletions tests/p_kvdo/kvdo_runtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ rlPhaseEnd
rlPhaseStartSetup "Install software"
if ! rlCheckRpm kmod-kvdo
then
rlRun "yum install -y ${kvdo_pkg}" 0 "Installing kmod-kvdo" || rlDie "Unable to install 'kmod-kvdo' package"
rlRun "dnf install -y ${kvdo_pkg}" 0 "Installing kmod-kvdo" || rlDie "Unable to install 'kmod-kvdo' package"
rlAssertRpm kmod-kvdo
fi
if ! rlCheckRpm vdo
then
rlRun "yum install -y ${vdo_pkg}" 0 "Installing vdo" || rlDie "Unable to install 'vdo' package"
rlRun "dnf install -y ${vdo_pkg}" 0 "Installing vdo" || rlDie "Unable to install 'vdo' package"
rlAssertRpm vdo
fi
rlPhaseEnd
Expand Down
4 changes: 2 additions & 2 deletions tests/p_rpm/rpm_remove_pkg_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ rpm -q zsh | grep -q 'package zsh is not installed'

t_CheckExitStatus $?

t_Log "Clean yum metadata / cache"
yum -y clean all
t_Log "Clean dnf metadata / cache"
dnf -y clean all
2 changes: 1 addition & 1 deletion tests/p_yum/yum_remove_pkg_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ t_Log "Running $0 - yum remove package test."
# Install zsh pkg
t_InstallPackage zsh

yum -d0 -y remove zsh && \
dnf -d0 -y remove zsh && \
rpm -q zsh | grep -q 'package zsh is not installed'

t_CheckExitStatus $?
Loading