Skip to content

Commit

Permalink
Merge pull request #35 from redhat-performance/package_2
Browse files Browse the repository at this point in the history
Update to use package tool
  • Loading branch information
dvalinrh authored Sep 21, 2023
2 parents 08d5120 + 9bc271f commit 3c2e5e2
Showing 1 changed file with 29 additions and 26 deletions.
55 changes: 29 additions & 26 deletions phoronix/run_phoronix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ else
fi
fi

dnf update -y
test_name="phoronix"
GIT_VERSION="v10.8.1"
if [ ! -f "/tmp/${test_name}.out" ]; then
Expand All @@ -77,31 +76,6 @@ fi
#
tools_git=https://github.com/redhat-performance/test_tools-wrappers

#
# Amazon linux is running the wrong version of php by default, install a version that phoronix likes
#
uname -a | grep -q amzn
if [ $? -eq 0 ]; then
#
# Check to see if we need to remove the old php
#
yum list installed | grep -q php-cli.x86_64
if [ $? -eq 0 ]; then
packages="php-cli.x86_64 php-common.x86_64 php-xml.x86_64"
#
# Remove and add the proper php
#
yum remove -y $packages
if [ $? -ne 0 ]; then
error_out "Failed to remove $packages" 1
fi
fi
packages="php73-cli.x86_64 php73-common.x86_64 php73-xml.x86_64"
yum install -y $packages
if [ $? -ne 0 ]; then
error_out "Failed to install $packages" 1
fi
fi

#
# Clone the repo that contains the common code and tools
Expand Down Expand Up @@ -144,6 +118,35 @@ if [ $show_usage -eq 1 ]; then
usage $0
fi

test_tools/package_tool --update
test_tools/package_tool --packages php73-cli.x86_64,php73-common.x86_64,php73-xml.x86_64
if [[ $? != "0" ]]; then
#
# Check to see if we need to remove the old php
#
test_tools/package_tool --is_installed php-cli.x86_64
if [ $? -eq 0 ]; then
packages="php-cli.x86_64 php-common.x86_64 php-xml.x86_64"
#
# Remove and add the proper php
#
test_tools/package_tool --remove_packages $packages
if [ $? -ne 0 ]; then
error_out "Failed to remove $packages" 1
fi
fi
test_tools/package_tool --packages php73-cli.x86_64,php73-common.x86_64,php73-xml.x86_64
if [ $? -ne 0 ]; then
#
# Just to be difficult Amazon 2 uses even different packages.
#
test_tools/package_tool --packages git,php-cli,php-xml,php-json
if [ $? -ne 0 ]; then
error_out "Failed to install $packages" 1
fi
fi
fi

# Variables set by general setup.
#
# TOOLS_BIN: points to the tool directory
Expand Down

0 comments on commit 3c2e5e2

Please sign in to comment.