Skip to content

Commit 3c2e5e2

Browse files
authored
Merge pull request #35 from redhat-performance/package_2
Update to use package tool
2 parents 08d5120 + 9bc271f commit 3c2e5e2

File tree

1 file changed

+29
-26
lines changed

1 file changed

+29
-26
lines changed

phoronix/run_phoronix.sh

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ else
5757
fi
5858
fi
5959

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

80-
#
81-
# Amazon linux is running the wrong version of php by default, install a version that phoronix likes
82-
#
83-
uname -a | grep -q amzn
84-
if [ $? -eq 0 ]; then
85-
#
86-
# Check to see if we need to remove the old php
87-
#
88-
yum list installed | grep -q php-cli.x86_64
89-
if [ $? -eq 0 ]; then
90-
packages="php-cli.x86_64 php-common.x86_64 php-xml.x86_64"
91-
#
92-
# Remove and add the proper php
93-
#
94-
yum remove -y $packages
95-
if [ $? -ne 0 ]; then
96-
error_out "Failed to remove $packages" 1
97-
fi
98-
fi
99-
packages="php73-cli.x86_64 php73-common.x86_64 php73-xml.x86_64"
100-
yum install -y $packages
101-
if [ $? -ne 0 ]; then
102-
error_out "Failed to install $packages" 1
103-
fi
104-
fi
10579

10680
#
10781
# Clone the repo that contains the common code and tools
@@ -144,6 +118,35 @@ if [ $show_usage -eq 1 ]; then
144118
usage $0
145119
fi
146120

121+
test_tools/package_tool --update
122+
test_tools/package_tool --packages php73-cli.x86_64,php73-common.x86_64,php73-xml.x86_64
123+
if [[ $? != "0" ]]; then
124+
#
125+
# Check to see if we need to remove the old php
126+
#
127+
test_tools/package_tool --is_installed php-cli.x86_64
128+
if [ $? -eq 0 ]; then
129+
packages="php-cli.x86_64 php-common.x86_64 php-xml.x86_64"
130+
#
131+
# Remove and add the proper php
132+
#
133+
test_tools/package_tool --remove_packages $packages
134+
if [ $? -ne 0 ]; then
135+
error_out "Failed to remove $packages" 1
136+
fi
137+
fi
138+
test_tools/package_tool --packages php73-cli.x86_64,php73-common.x86_64,php73-xml.x86_64
139+
if [ $? -ne 0 ]; then
140+
#
141+
# Just to be difficult Amazon 2 uses even different packages.
142+
#
143+
test_tools/package_tool --packages git,php-cli,php-xml,php-json
144+
if [ $? -ne 0 ]; then
145+
error_out "Failed to install $packages" 1
146+
fi
147+
fi
148+
fi
149+
147150
# Variables set by general setup.
148151
#
149152
# TOOLS_BIN: points to the tool directory

0 commit comments

Comments
 (0)