adds Regression/locale-archive-test(glibc-all-langpacks) test

This commit is contained in:
Sergey Kolosov 2022-04-07 15:18:02 +02:00 committed by mcermak
parent fc64649722
commit 157efe36a2
5 changed files with 146 additions and 0 deletions

View File

@ -0,0 +1,63 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /tools/glibc/Regression/locale-archive-test
# Description: What the test does
# Author: Sergey Kolosov <skolosov@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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 <skolosov@redhat.com>" > $(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)

View File

@ -0,0 +1,5 @@
PURPOSE of /tools/glibc/Regression/locale-archive-test
Description: What the test does
Author: Sergey Kolosov <skolosov@redhat.com>
Test for locale-archive(glibc-all-langpacks). It came from https://bugzilla.redhat.com/show_bug.cgi?id=2057697

View File

@ -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 <skolosov@redhat.com>
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

View File

@ -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 <skolosov@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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

View File

@ -0,0 +1,4 @@
#!/usr/bin/python3
import locale
locale.setlocale(locale.LC_ALL,"en_US.UTF-8")