diff --git a/tests/Regression/locale-archive-test/Makefile b/tests/Regression/locale-archive-test/Makefile new file mode 100644 index 0000000..187e4e9 --- /dev/null +++ b/tests/Regression/locale-archive-test/Makefile @@ -0,0 +1,63 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/glibc/Regression/locale-archive-test +# Description: What the test does +# Author: Sergey Kolosov +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2022 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty 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, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/glibc/Regression/locale-archive-test +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE test-locale.py + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Sergey Kolosov " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: What the test does" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 20m" >> $(METADATA) + @echo "RunFor: glibc" >> $(METADATA) + @echo "Requires: glibc glibc-all-langpacks python3" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Releases: RHEL8 RHEL9" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/locale-archive-test/PURPOSE b/tests/Regression/locale-archive-test/PURPOSE new file mode 100644 index 0000000..9cb209c --- /dev/null +++ b/tests/Regression/locale-archive-test/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/glibc/Regression/locale-archive-test +Description: What the test does +Author: Sergey Kolosov + +Test for locale-archive(glibc-all-langpacks). It came from https://bugzilla.redhat.com/show_bug.cgi?id=2057697 diff --git a/tests/Regression/locale-archive-test/main.fmf b/tests/Regression/locale-archive-test/main.fmf new file mode 100644 index 0000000..c0d4e04 --- /dev/null +++ b/tests/Regression/locale-archive-test/main.fmf @@ -0,0 +1,15 @@ +summary: What the test does +description: | + Test for locale-archive(glibc-all-langpacks). It came from https://bugzilla.redhat.com/show_bug.cgi?id=2057697 +contact: Sergey Kolosov +component: + - glibc +test: ./runtest.sh +framework: beakerlib +recommend: + - glibc + - glibc-all-langpacks + - python3 +duration: 20m +extra-summary: /tools/glibc/Regression/locale-archive-test +extra-task: /tools/glibc/Regression/locale-archive-test diff --git a/tests/Regression/locale-archive-test/runtest.sh b/tests/Regression/locale-archive-test/runtest.sh new file mode 100755 index 0000000..d47197c --- /dev/null +++ b/tests/Regression/locale-archive-test/runtest.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/glibc/Regression/locale-archive-test +# Description: What the test does +# Author: Sergey Kolosov +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2022 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty 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, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="glibc" +LANGPACK="glibc-all-langpacks" +TESTPROG=test-locale.py + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlAssertRpm $LANGPACK + rlAssertNotRpm glibc-minimal-langpack + rlRun -c "dnf remove -y glibc-langpack-*" + rlRun -c "rpm -qa|grep glibc-langpack" 1 + rlRun "TESTTMPDIR=$(mktemp -d)" + rlRun "cp ${TESTPROG} $TESTTMPDIR" + rlRun "pushd $TESTTMPDIR" + rlPhaseEnd + + rlPhaseStartTest + rlRun -l "ls -l /usr/lib/locale/" + rlRun -l "locale -a" + rlRun -l "python3 ${TESTPROG}" + rlRun -l "LANG=en_US.UTF-8 /bin/true" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TESTTMPDIR" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/locale-archive-test/test-locale.py b/tests/Regression/locale-archive-test/test-locale.py new file mode 100644 index 0000000..e2177b9 --- /dev/null +++ b/tests/Regression/locale-archive-test/test-locale.py @@ -0,0 +1,4 @@ +#!/usr/bin/python3 + +import locale +locale.setlocale(locale.LC_ALL,"en_US.UTF-8")