summaryrefslogtreecommitdiff
path: root/automated
diff options
context:
space:
mode:
authorNicolas Dechesne <nicolas.dechesne@linaro.org>2017-01-25 12:07:08 +0100
committerNicolas Dechesne <nicolas.dechesne@linaro.org>2017-01-25 12:35:23 +0100
commitb7e3876bb33cdd55f645c2f55f5c9bb57d051eac (patch)
treed864d552f426abed427b568c7f4288e37f9a9dd0 /automated
parent14c77d935aa059e9cad906f996885c163ed17f3f (diff)
downloadtest-definitions-pipe-b7e3876bb33cdd55f645c2f55f5c9bb57d051eac.tar.gz
automated: switch to using ID field for distro
Let's standardadize all test cases to use lowercase distro ID field from /etc/os-release, instead of the 'pretty' (capitalized) name that we used so far. This is an invasive change, all test scripts were modified with this command: $ sed -i -e 's|Debian\(.*\))|debian\1)|g' \ -e 's|Ubuntu\(.*\))|ubuntu\1)|g' \ -e 's|CentOS\(.*\))|centos\1)|g' \ -e 's|Fedora\(.*\))|fedora\1)|g' \ -e 's|Unknown\(.*\))|unknown\1)|g' And the remaining instances were fixed manually. dist_name() function was updated to always report lowercase distro name. Also when /etc/os-release is not available and that we use lsb_release output, we convert the old capitalized name into the new lowercase ones. Change-Id: I1f1ce0932ab04476567f0338e902656470267a74 Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Diffstat (limited to 'automated')
-rw-r--r--automated/doc/test-writting-guidelines.rst12
-rwxr-xr-xautomated/lib/sh-test-lib36
-rwxr-xr-xautomated/linux/apache-apache-bench/apache-bench.sh4
-rwxr-xr-xautomated/linux/docker/docker.sh4
-rwxr-xr-xautomated/linux/dsdbench/dsdbench.sh4
-rwxr-xr-xautomated/linux/fio-test/fio-test.sh4
-rwxr-xr-xautomated/linux/iperf/iperf.sh4
-rwxr-xr-xautomated/linux/kernel-compilation/kernel-compilation.sh4
-rwxr-xr-xautomated/linux/lamp/lamp.sh8
-rwxr-xr-xautomated/linux/lemp/lemp.sh8
-rwxr-xr-xautomated/linux/libhugetlbfs/libhugetlbfs.sh4
-rwxr-xr-xautomated/linux/ltp-realtime/ltp-realtime.sh4
-rwxr-xr-xautomated/linux/ltp/ltp.sh4
-rwxr-xr-xautomated/linux/nginx-apache-bench/apache-bench.sh4
-rwxr-xr-xautomated/linux/openjdk/openjdk-smoke.sh4
-rwxr-xr-xautomated/linux/smoke/smoke.sh6
-rwxr-xr-xautomated/linux/sysbench/sysbench.sh6
-rwxr-xr-xautomated/linux/toolchain-smoke/toolchain-smoke.sh6
-rwxr-xr-xautomated/linux/ui-browser-test/ui-browser-test.sh2
19 files changed, 64 insertions, 64 deletions
diff --git a/automated/doc/test-writting-guidelines.rst b/automated/doc/test-writting-guidelines.rst
index 656f827..eb422f6 100644
--- a/automated/doc/test-writting-guidelines.rst
+++ b/automated/doc/test-writting-guidelines.rst
@@ -107,9 +107,9 @@ Example 2::
dist_name
case "${dist}" in
- Debian|Ubuntu) install_deps "lsb-release" "${SKIP_INSTALL}" ;;
- Fedora|CentOS) install_deps "redhat-lsb-core" "${SKIP_INSTALL}" ;;
- Unknown) warn_msg "Unsupported distro: package install skipped" ;;
+ debian|ubuntu) install_deps "lsb-release" "${SKIP_INSTALL}" ;;
+ fedora|centos) install_deps "redhat-lsb-core" "${SKIP_INSTALL}" ;;
+ unknown) warn_msg "Unsupported distro: package install skipped" ;;
esac
Except automated package installation, you may also need to download and install
@@ -121,9 +121,9 @@ Example 3::
if [ "${SKIP_INSTALL}" = "true" ] || [ "${SKIP_INSTALL}" = "True" ]; then
dist_name
case "${dist}" in
- Debian|Ubuntu) install_deps "${pkgs}" ;;
- Fedora|CentOS) install_deps "${pkgs}" ;;
- Unknown) warn_msg "Unsupported distro: package install skipped" ;;
+ debian|ubuntu) install_deps "${pkgs}" ;;
+ fedora|centos) install_deps "${pkgs}" ;;
+ unknown) warn_msg "Unsupported distro: package install skipped" ;;
esac
# manually install steps.
diff --git a/automated/lib/sh-test-lib b/automated/lib/sh-test-lib
index 32c481f..6aac8a7 100755
--- a/automated/lib/sh-test-lib
+++ b/automated/lib/sh-test-lib
@@ -160,21 +160,21 @@ dist_name() {
# shellcheck disable=SC1091
dist="$(. /etc/lsb-release && echo "${DISTRIB_ID}")"
elif [ -f /etc/debian_version ]; then
- dist="Debian"
+ dist="debian"
elif [ -f /etc/fedora-release ]; then
- dist="Fedora"
+ dist="fedora"
elif [ -f /etc/centos-release ]; then
- dist="CentOS"
+ dist="centos"
else
- dist="Unknown"
+ dist="unknown"
warn_msg "Unsupported distro: cannot determine distribution name"
fi
case "${dist}" in
- debian) dist="Debian" ;;
- ubuntu) dist="Ubuntu" ;;
- fedora) dist="Fedora" ;;
- centos) dist="CentOS" ;;
+ Debian) dist="debian" ;;
+ Ubuntu) dist="ubuntu" ;;
+ Fedora) dist="fedora" ;;
+ CentOS) dist="centos" ;;
rpb|rpb-wayland|rpb-eglfs) dist="oe-based" ;;
esac
}
@@ -191,21 +191,21 @@ install_deps() {
info_msg "Installing ${pkgs}"
dist_name
case "${dist}" in
- Debian|Ubuntu)
+ debian|ubuntu)
# Use the default answers for all questions.
DEBIAN_FRONTEND=noninteractive apt-get update -q -y
# shellcheck disable=SC2086
DEBIAN_FRONTEND=noninteractive apt-get install -q -y ${pkgs}
;;
- CentOS)
+ centos)
# shellcheck disable=SC2086
yum -e 0 -y install ${pkgs}
;;
- Fedora)
+ fedora)
# shellcheck disable=SC2086
dnf -e 0 -y install ${pkgs}
;;
- Unknown)
+ unknown)
warn_msg "Unsupported distro: package install skipped"
;;
esac
@@ -268,8 +268,8 @@ dist_info() {
if ! command -v lsb_release > /dev/null; then
dist_name
case "${dist}" in
- Debian|Ubuntu) install_deps "lsb-release" ;;
- CentOS|Fedora) install_deps "redhat-lsb-core" ;;
+ debian|ubuntu) install_deps "lsb-release" ;;
+ centos|fedora) install_deps "redhat-lsb-core" ;;
*) warn_msg "Unsupported distro: dist_info skipped"
esac
fi
@@ -285,8 +285,8 @@ add_key() {
dist_name
case "${dist}" in
- Debian|Ubuntu) wget -O - "${url}" | apt-key add - ;;
- CentOS|Fedora) infor_msg "add_key isn't needed on ${dist}" ;;
+ debian|ubuntu) wget -O - "${url}" | apt-key add - ;;
+ centos|fedora) infor_msg "add_key isn't needed on ${dist}" ;;
*) warn_msg "Unsupported distro: add_key skipped"
esac
}
@@ -299,7 +299,7 @@ add_repo() {
case "${dist}" in
# Detect Debian/Ubuntu codename and add repo automatically. The same url
# should work on all distributions supported by the repo.
- Debian|Ubuntu)
+ debian|ubuntu)
dist_info
if [ -z "$2" ]; then
backports=""
@@ -314,7 +314,7 @@ add_repo() {
;;
# It is not easy to amend url with distro version as its format may vary
# by repo. Test definition/plan should provide a correct repo url.
- CentOS|Fedora)
+ centos|fedora)
wget -O - "${url}" >> "/etc/yum.repos.d/3rd-party.repo"
;;
*)
diff --git a/automated/linux/apache-apache-bench/apache-bench.sh b/automated/linux/apache-apache-bench/apache-bench.sh
index 551ce7f..2395efc 100755
--- a/automated/linux/apache-apache-bench/apache-bench.sh
+++ b/automated/linux/apache-apache-bench/apache-bench.sh
@@ -35,12 +35,12 @@ else
dist_name
# shellcheck disable=SC2154
case "${dist}" in
- Debian|Ubuntu)
+ debian|ubuntu)
pkgs="apache2 apache2-utils"
install_deps "${pkgs}"
systemctl restart apache2
;;
- CentOS|Fedora)
+ centos|fedora)
pkgs="httpd httpd-tools"
install_deps "${pkgs}"
systemctl start httpd.service
diff --git a/automated/linux/docker/docker.sh b/automated/linux/docker/docker.sh
index eb23e56..bebf482 100755
--- a/automated/linux/docker/docker.sh
+++ b/automated/linux/docker/docker.sh
@@ -26,8 +26,8 @@ mkdir -p "${OUTPUT}"
dist_name
# shellcheck disable=SC2154
case "${dist}" in
- Debian|Ubuntu) pkgs="docker-engine" ;;
- Fedora|CentOS) pkgs="docker" ;;
+ debian|ubuntu) pkgs="docker-engine" ;;
+ fedora|centos) pkgs="docker" ;;
*) error_msg "Unsupported distribution" ;;
esac
diff --git a/automated/linux/dsdbench/dsdbench.sh b/automated/linux/dsdbench/dsdbench.sh
index e403a40..4b8f4cf 100755
--- a/automated/linux/dsdbench/dsdbench.sh
+++ b/automated/linux/dsdbench/dsdbench.sh
@@ -26,8 +26,8 @@ done
dist_name
# shellcheck disable=SC2154
case "${dist}" in
- Debian|Ubuntu) pkgs="git golang libdevmapper-dev" ;;
- Fedora|CentOS) pkgs="git golang device-mapper-devel" ;;
+ debian|ubuntu) pkgs="git golang libdevmapper-dev" ;;
+ fedora|centos) pkgs="git golang device-mapper-devel" ;;
esac
install_deps "${pkgs}" "${SKIP_INSTALL}"
diff --git a/automated/linux/fio-test/fio-test.sh b/automated/linux/fio-test/fio-test.sh
index 90e7b4a..4a70756 100755
--- a/automated/linux/fio-test/fio-test.sh
+++ b/automated/linux/fio-test/fio-test.sh
@@ -40,11 +40,11 @@ install() {
dist_name
# shellcheck disable=SC2154
case "${dist}" in
- Debian|Ubuntu)
+ debian|ubuntu)
pkgs="fio"
install_deps "${pkgs}" "${SKIP_INSTALL}"
;;
- Fedora|CentOS)
+ fedora|centos)
pkgs="libaio-devel gcc tar wget"
install_deps "${pkgs}" "${SKIP_INSTALL}"
fio_build_install
diff --git a/automated/linux/iperf/iperf.sh b/automated/linux/iperf/iperf.sh
index f2ad3d1..0dd230f 100755
--- a/automated/linux/iperf/iperf.sh
+++ b/automated/linux/iperf/iperf.sh
@@ -43,10 +43,10 @@ else
dist_name
# shellcheck disable=SC2154
case "${dist}" in
- Debian|Ubuntu|Fedora)
+ debian|ubuntu|fedora)
install_deps "iperf3"
;;
- CentOS)
+ centos)
install_deps "wget gcc make"
wget https://github.com/esnet/iperf/archive/"${VERSION}".tar.gz
tar xf "${VERSION}".tar.gz
diff --git a/automated/linux/kernel-compilation/kernel-compilation.sh b/automated/linux/kernel-compilation/kernel-compilation.sh
index 7040e93..b9b8d2a 100755
--- a/automated/linux/kernel-compilation/kernel-compilation.sh
+++ b/automated/linux/kernel-compilation/kernel-compilation.sh
@@ -25,8 +25,8 @@ done
dist_name
# shellcheck disable=SC2154
case "${dist}" in
- Debian|Ubuntu) pkgs="wget time bc xz-utils build-essential" ;;
- CentOS|Fedora) pkgs="wget time bc xz gcc make" ;;
+ debian|ubuntu) pkgs="wget time bc xz-utils build-essential" ;;
+ centos|fedora) pkgs="wget time bc xz gcc make" ;;
esac
! check_root && error_msg "You need to be root to install packages!"
# install_deps supports the above distributions.
diff --git a/automated/linux/lamp/lamp.sh b/automated/linux/lamp/lamp.sh
index c25b1c1..f2197a1 100755
--- a/automated/linux/lamp/lamp.sh
+++ b/automated/linux/lamp/lamp.sh
@@ -34,10 +34,10 @@ else
dist_name
# shellcheck disable=SC2154
case "${dist}" in
- Debian|Ubuntu)
- if [ "${dist}" = "Debian" ]; then
+ debian|ubuntu)
+ if [ "${dist}" = "debian" ]; then
pkgs="apache2 mysql-server php5-mysql php5-common libapache2-mod-php5"
- elif [ "${dist}" = "Ubuntu" ]; then
+ elif [ "${dist}" = "ubuntu" ]; then
pkgs="apache2 mysql-server php-mysql php-common libapache2-mod-php"
fi
install_deps "curl ${pkgs}"
@@ -45,7 +45,7 @@ else
systemctl restart apache2
systemctl restart mysql
;;
- CentOS|Fedora)
+ centos|fedora)
pkgs="httpd mariadb-server mariadb php php-mysql"
install_deps "curl ${pkgs}"
systemctl start httpd.service
diff --git a/automated/linux/lemp/lemp.sh b/automated/linux/lemp/lemp.sh
index 92a4f28..06be62f 100755
--- a/automated/linux/lemp/lemp.sh
+++ b/automated/linux/lemp/lemp.sh
@@ -18,7 +18,7 @@ dist_name
# systemctl available on Debian 8, CentOS 7 and newer releases.
# shellcheck disable=SC2154
case "${dist}" in
- Debian)
+ debian)
pkgs="nginx mysql-server php5-mysql php5-fpm curl"
install_deps "${pkgs}"
@@ -38,7 +38,7 @@ case "${dist}" in
cp ./debian-nginx.conf /etc/nginx/sites-available/default
systemctl restart nginx
;;
- CentOS)
+ centos)
# x86_64 nginx package can be installed from epel repo. However, epel
# project doesn't support ARM arch yet. RPB repo should provide nginx.
[ "$(uname -m)" = "x86_64" ] && install_deps "epel-release"
@@ -142,11 +142,11 @@ rm -rf /usr/share/nginx/html
mv /usr/share/nginx/html.bak /usr/share/nginx/html
# shellcheck disable=SC2154
case "${dist}" in
- Debian)
+ debian)
mv -f /etc/php5/fpm/php.ini.bak /etc/php5/fpm/php.ini
mv -f /etc/nginx/sites-available/default.bak /etc/nginx/sites-available/default
;;
- CentOS)
+ centos)
mv -f /etc/php.ini.bak /etc/php.ini
rm -f /etc/nginx/default.d/default.conf
;;
diff --git a/automated/linux/libhugetlbfs/libhugetlbfs.sh b/automated/linux/libhugetlbfs/libhugetlbfs.sh
index 252dc1c..9d6db37 100755
--- a/automated/linux/libhugetlbfs/libhugetlbfs.sh
+++ b/automated/linux/libhugetlbfs/libhugetlbfs.sh
@@ -84,11 +84,11 @@ install() {
dist_name
# shellcheck disable=SC2154
case "${dist}" in
- Debian|Ubuntu)
+ debian|ubuntu)
pkgs="binutils gcc make python sed tar wget"
install_deps "${pkgs}" "${SKIP_INSTALL}"
;;
- Fedora|CentOS)
+ fedora|centos)
pkgs="binutils gcc glibc-static make python sed tar wget"
install_deps "${pkgs}" "${SKIP_INSTALL}"
;;
diff --git a/automated/linux/ltp-realtime/ltp-realtime.sh b/automated/linux/ltp-realtime/ltp-realtime.sh
index 0fcd40c..fda708a 100755
--- a/automated/linux/ltp-realtime/ltp-realtime.sh
+++ b/automated/linux/ltp-realtime/ltp-realtime.sh
@@ -73,11 +73,11 @@ else
dist_name
# shellcheck disable=SC2154
case "${dist}" in
- Debian|Ubuntu)
+ debian|ubuntu)
pkgs="xz-utils flex bison build-essential wget curl net-tools"
install_deps "${pkgs}" "${SKIP_INSTALL}"
;;
- CentOS|Fedora)
+ centos|fedora)
pkgs="xz flex bison make automake gcc gcc-c++ kernel-devel wget curl net-tools"
install_deps "${pkgs}" "${SKIP_INSTALL}"
;;
diff --git a/automated/linux/ltp/ltp.sh b/automated/linux/ltp/ltp.sh
index e015b3d..7788d81 100755
--- a/automated/linux/ltp/ltp.sh
+++ b/automated/linux/ltp/ltp.sh
@@ -92,11 +92,11 @@ else
dist_name
# shellcheck disable=SC2154
case "${dist}" in
- Debian|Ubuntu)
+ debian|ubuntu)
pkgs="xz-utils flex bison build-essential wget curl net-tools"
install_deps "${pkgs}" "${SKIP_INSTALL}"
;;
- CentOS|Fedora)
+ centos|fedora)
pkgs="xz flex bison make automake gcc gcc-c++ kernel-devel wget curl net-tools"
install_deps "${pkgs}" "${SKIP_INSTALL}"
;;
diff --git a/automated/linux/nginx-apache-bench/apache-bench.sh b/automated/linux/nginx-apache-bench/apache-bench.sh
index f4c774c..88752e6 100755
--- a/automated/linux/nginx-apache-bench/apache-bench.sh
+++ b/automated/linux/nginx-apache-bench/apache-bench.sh
@@ -32,7 +32,7 @@ dist_name
# systemctl available on Debian 8, CentOS 7 and newer releases.
# shellcheck disable=SC2154
case "${dist}" in
- Debian)
+ debian)
pkgs="nginx apache2-utils"
install_deps "${pkgs}" "${SKIP_INSTALL}"
@@ -41,7 +41,7 @@ case "${dist}" in
systemctl restart nginx
;;
- CentOS)
+ centos)
# x86_64 nginx package can be installed from epel repo. However, epel
# project doesn't support ARM arch yet. RPB repo should provide nginx.
[ "$(uname -m)" = "x86_64" ] && install_deps "epel-release" "${SKIP_INSTALL}"
diff --git a/automated/linux/openjdk/openjdk-smoke.sh b/automated/linux/openjdk/openjdk-smoke.sh
index 7202a85..29e9c28 100755
--- a/automated/linux/openjdk/openjdk-smoke.sh
+++ b/automated/linux/openjdk/openjdk-smoke.sh
@@ -27,8 +27,8 @@ if [ "${SKIP_INSTALL}" = "True" ] || [ "${SKIP_INSTALL}" = "true" ]; then
else
dist_name
case "${dist}" in
- Debian|Ubuntu) pkg="openjdk-${VERSION}-jdk" ;;
- CentOS|Fedora) pkg="java-1.${VERSION}.0-openjdk-devel" ;;
+ debian|ubuntu) pkg="openjdk-${VERSION}-jdk" ;;
+ centos|fedora) pkg="java-1.${VERSION}.0-openjdk-devel" ;;
*) error_msg "Unsupported distribution" ;;
esac
install_deps "${pkg}"
diff --git a/automated/linux/smoke/smoke.sh b/automated/linux/smoke/smoke.sh
index 32f71b0..96f68f9 100755
--- a/automated/linux/smoke/smoke.sh
+++ b/automated/linux/smoke/smoke.sh
@@ -22,9 +22,9 @@ install() {
dist_name
# shellcheck disable=SC2154
case "${dist}" in
- Debian|Ubuntu) install_deps "lsb-release" "${SKIP_INSTALL}";;
- Fedora|CentOS) install_deps "redhat-lsb-core" "${SKIP_INSTALL}";;
- Unknown) warn_msg "Unsupported distro: package install skipped" ;;
+ debian|ubuntu) install_deps "lsb-release" "${SKIP_INSTALL}";;
+ fedora|centos) install_deps "redhat-lsb-core" "${SKIP_INSTALL}";;
+ unknown) warn_msg "Unsupported distro: package install skipped" ;;
esac
}
diff --git a/automated/linux/sysbench/sysbench.sh b/automated/linux/sysbench/sysbench.sh
index 6c54a84..9aa420d 100755
--- a/automated/linux/sysbench/sysbench.sh
+++ b/automated/linux/sysbench/sysbench.sh
@@ -56,7 +56,7 @@ else
dist_name
# shellcheck disable=SC2154
case "${dist}" in
- Debian|Ubuntu)
+ debian|ubuntu)
install_deps "git build-essential automake libtool"
if echo "${TESTS}" | grep "oltp"; then
install_deps "libmysqlclient-dev mysql-server"
@@ -66,7 +66,7 @@ else
install_sysbench "--without-mysql"
fi
;;
- Fedora|CentOS)
+ fedora|centos)
install_deps "git gcc make automake libtool"
if echo "${TESTS}" | grep "oltp"; then
install_deps "mysql-devel mariadb-server mariadb"
@@ -76,7 +76,7 @@ else
install_sysbench "--without-mysql"
fi
;;
- Unknown)
+ unknown)
warn_msg "Unsupported distro: package install skipped"
;;
esac
diff --git a/automated/linux/toolchain-smoke/toolchain-smoke.sh b/automated/linux/toolchain-smoke/toolchain-smoke.sh
index 2dc76ed..7cdead1 100755
--- a/automated/linux/toolchain-smoke/toolchain-smoke.sh
+++ b/automated/linux/toolchain-smoke/toolchain-smoke.sh
@@ -24,9 +24,9 @@ install() {
dist_name
# shellcheck disable=SC2154
case "${dist}" in
- Debian|Ubuntu) install_deps "build-essential" "${SKIP_INSTALL}" ;;
- Fedora|CentOS) install_deps "gcc glibc-static" "${SKIP_INSTALL}" ;;
- Unknown) warn_msg "Unsupported distro: package install skipped" ;;
+ debian|ubuntu) install_deps "build-essential" "${SKIP_INSTALL}" ;;
+ fedora|centos) install_deps "gcc glibc-static" "${SKIP_INSTALL}" ;;
+ unknown) warn_msg "Unsupported distro: package install skipped" ;;
esac
}
diff --git a/automated/linux/ui-browser-test/ui-browser-test.sh b/automated/linux/ui-browser-test/ui-browser-test.sh
index 9d7b377..44e886b 100755
--- a/automated/linux/ui-browser-test/ui-browser-test.sh
+++ b/automated/linux/ui-browser-test/ui-browser-test.sh
@@ -59,7 +59,7 @@ install_deps "${pkgs}" "${SKIP_INSTALL}"
mkdir -p "${OUTPUT}"
dist_name
-if [ "${dist}" = "Debian" ] || [ "${dist}" = "Ubuntu" ]; then
+if [ "${dist}" = "debian" ] || [ "${dist}" = "ubuntu" ]; then
"${WD}"/install-on-debian.sh
else
echo "Not a debian machine"