Skip to content

Commit

Permalink
Add test for setting non-common valid timezones
Browse files Browse the repository at this point in the history
Related: jira#RHEL-13150
Related: jira#RHEL-13151
Related: rhbz#1452873

Upstream solution: rhinstaller/anaconda#3167
  • Loading branch information
rvykydal committed Nov 28, 2023
1 parent 2c863ef commit 2d887cc
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
35 changes: 35 additions & 0 deletions 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
24 changes: 24 additions & 0 deletions 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 <rvykydal@redhat.com>

# Ignore unused variable parsed out by tooling scripts as test tags metadata
# shellcheck disable=SC2034
TESTTYPE="time"

. ${KSTESTDIR}/functions.sh

0 comments on commit 2d887cc

Please sign in to comment.