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>
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 @@
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 @@
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.