test-suite: update numpy test for multiple module files
@@ -7,13 +7,21 @@ if [ -s ./common/TEST_ENV ];then
source ./common/TEST_ENV
fi
+declare -A python_module_prefixes=( ["python2"]="py2" ["python3"]="py3")
+if [ "x$DISTRO_FAMILY" == "xCentOS" -o "x$DISTRO_FAMILY" == "xRHEL" ];then
+ declare -A python_package_prefixes=( ["python2"]="python" ["python3"]="python34")
+else
+ declare -A python_package_prefixes=( ["python2"]="python" ["python3"]="python3")
+fi
+
PKG=NUMPY
-module=$python_module_prefix-numpy
-testname=$python-Numpy
-rpm=$python_package_prefix-numpy-$LMOD_FAMILY_COMPILER${DELIM}
+testname=Numpy
-@test "[$testname] Verify $PKG module is loaded and matches rpm version ($LMOD_FAMILY_COMPILER)" {
+@test "[$testname] Verify $PKG modules can be loaded and match rpm version ($LMOD_FAMILY_COMPILER)" {
+ for python in "${!python_module_prefixes[@]}"; do
+ module=${python_module_prefixes[$python]}-numpy
+ rpm=${python_package_prefixes[$python]}-numpy-$LMOD_FAMILY_COMPILER${DELIM}
module list $module | grep "1) $module" >& .cmd_output || exit 1
run grep $module .cmd_output
assert_success
@@ -24,6 +32,7 @@ rpm=$python_package_prefix-numpy-$LMOD_FAMILY_COMPILER${DELIM}
assert_output " 1) $module/$version"
rm -f .cmd_output
+ done
}
@test "[$testname] Verify module ${PKG}_DIR is defined and exists ($LMOD_FAMILY_COMPILER)" {
