From 2d887cc6d1662de6bdfb7852667ded94ee2fa572 Mon Sep 17 00:00:00 2001 From: Radek Vykydal Date: Tue, 28 Nov 2023 14:16:50 +0100 Subject: [PATCH] Add test for setting non-common valid timezones Related: jira#RHEL-13150 Related: jira#RHEL-13151 Related: rhbz#1452873 Upstream solution: https://github.com/rhinstaller/anaconda/pull/3167 --- timezone-noncommon.ks.in | 35 +++++++++++++++++++++++++++++++++++ timezone-noncommon.sh | 24 ++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 timezone-noncommon.ks.in create mode 100755 timezone-noncommon.sh diff --git a/timezone-noncommon.ks.in b/timezone-noncommon.ks.in new file mode 100644 index 00000000..8759af39 --- /dev/null +++ b/timezone-noncommon.ks.in @@ -0,0 +1,35 @@ +#version=DEVEL +#test name: timezone-noncommon +# Test that timezones that are in pytz.all_timezones but not in +# pytz.common_timezones can be used in kickstart +# (jira#RHEL-13150, jira#RHEL-13151, rhbz#1452873) +%ksappend repos/default.ks +network --bootproto=dhcp + +bootloader --timeout=1 +zerombr +clearpart --all --initlabel +autopart + +keyboard us +lang en +timezone Japan +rootpw testcase + +shutdown + +%packages +%end + +%post + +link=$(readlink /etc/localtime) +if [[ ${link#*zoneinfo/} != "Japan" ]]; then + echo "*** /etc/localtime does not point to the configured timezone" >> /root/RESULT +fi + +# everything passes +if [[ ! -e /root/RESULT ]]; then + echo SUCCESS > /root/RESULT +fi +%end diff --git a/timezone-noncommon.sh b/timezone-noncommon.sh new file mode 100755 index 00000000..58cef7fd --- /dev/null +++ b/timezone-noncommon.sh @@ -0,0 +1,24 @@ +# +# Copyright (C) 2023 Red Hat, Inc. +# +# This copyrighted material is made available to anyone wishing to use, +# modify, copy, or redistribute it subject to the terms and conditions of +# the GNU General Public License v.2, or (at your option) any later version. +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY expressed or implied, including the implied warranties of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. You should have received a copy of the +# GNU General Public License along with this program; if not, write to the +# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. Any Red Hat trademarks that are incorporated in the +# source code or documentation are not subject to the GNU General Public +# License and may only be used or replicated with the express permission of +# Red Hat, Inc. +# +# Red Hat Author(s): Radek Vykydal + +# Ignore unused variable parsed out by tooling scripts as test tags metadata +# shellcheck disable=SC2034 +TESTTYPE="time" + +. ${KSTESTDIR}/functions.sh