Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37537831
en ru br
Репозитории ALT

Группа :: Система/Библиотеки
Пакет: alt-test

 Главная   Изменения   Спек   Патчи   Исходники   Загрузить   Gear   Bugs and FR  Repocop 

pax_global_header00006660000000000000000000000064123341266270014520gustar00rootroot0000000000000052 comment=886282bab8e1883cbf7200b80d8327fd078e5396
alt-test-1.1.3/000075500000000000000000000000001233412662700132555ustar00rootroot00000000000000alt-test-1.1.3/.gear-rules000064400000000000000000000000071233412662700153210ustar00rootroot00000000000000tar: .
alt-test-1.1.3/alt-test000075500000000000000000000032041233412662700147370ustar00rootroot00000000000000#!/bin/sh

# This is part on ALT Linux tests environment based on Tapper
# (c) 2013 Andrey Cherepanov <cas@altlinux.org>
# License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.

. shell-error

prg_version="@version@"

tests_path="/usr/lib/alt-test"
tests_program="prove"

# Default parameters
VERBOSE_OUTPUT=""
FAILED_OUTPUT=""
tests=""

show_tests()
{
find "$tests_path" -mindepth 1 -maxdepth 1 -type f -name '*.t' | sed 's/^.*\///' | sed 's/\.t$//' | sort
exit 0
}

show_usage()
{
cat << _EOF_
alt-test is utility for Tapper test run. Version ${prg_version}
(c) 2013 Andrey Cherepanov <cas@altlinux.org>
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.

Usage: alt-test [option] [test1 ...]

Options:
-l list all available tests (from ${tests_path})
-h show help
-f show only failed tests
-v run with verbose output
--version show version

Supported environment variables:
TEST_PACKAGE_SOURCE ISO image for existing package checks
_EOF_
exit 0;
}

show_version()
{
echo "$prg_version"
exit 0
}

for i in $@
do
case "$i" in
-l)
show_tests
;;
-h)
show_usage
;;
-v)
VERBOSE_OUTPUT="-v"
;;
-f)
FAILED_OUTPUT="1"
;;
--version)
show_version
;;
*)
# add test to list
if [ -e "$tests_path/${i}.t" ] ; then
tests="$tests $tests_path/${i}.t"
else
if [ -e "$i" ] ; then
tests="$tests $i"
else
fatal "Test '$i' is not found" >&2
fi
fi
esac
done

test -z "$tests" && show_tests

# Run tests
if [ -n "$FAILED_OUTPUT" ] ; then
$tests_program -v $tests | grep '^not ok '
else
$tests_program $VERBOSE_OUTPUT $tests
fi
alt-test-1.1.3/alt-test-functions000075500000000000000000000053701233412662700167530ustar00rootroot00000000000000#!/bin/sh -efu

# This is part on ALT Linux tests environment based on Tapper
# (c) 2013 Andrey Cherepanov <cas@altlinux.org>
# License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.

if [ -z "${__included_alt_test_functions:-}" ]; then
__included_alt_test_functions=1

. /usr/share/perl5/auto/Tapper/Cmd/Init/hello-world/01-executing-tests/tapper-autoreport --import-utils

SUITEVERSION=2.01

. shell-error
. shell-quote
. shell-var

# Test existing file
test_file()
{
file="${1:-UNKNOWNFILE}"
explanation="${2:-Missing file $file}"

if test -e "$file" >/dev/null 2>&1; then
ok $_SUCCESS "File $file exists"
return $_SUCCESS
else
ok $_FAILURE "$explanation"
return $_FAILURE
fi
}

# Test available executable
test_exec()
{
program="${1:-UNKNOWNPROGRAM}"
explanation="${2:-Missing program $program}"

if type -P "$program" >/dev/null ; then
ok $_SUCCESS "Program $program exists"
return $_SUCCESS
else
ok $_FAILURE "$explanation"
return $_FAILURE
fi
}

# Test installed RPM package
test_package()
{
package="${1:-UNKNOWNPACKAGE}"
explanation="${2:-Missing package $package}"
cond=""
needed=""

# Check if version condition is defined
if [ $(expr match "$package" '.*[<=>]') -gt 0 ] ; then
p="$(echo "$package" | sed 's/[[:space:]]*\([=<>]\+\)[[:space:]]*/ \1 /')"
read -r package cond needed <<< "$p"
#append_comment "package=$package cond=$cond needed=$needed"
fi

ver="$(get_package_version "$package")"
if [ -n "$ver" ] ; then
# Check version
if [ "$cond" -a "$needed" ] ; then
res="$(rpmvercmp "$ver" "$needed")"

case "$cond" in
">")
test "$res" -le 0 && ver=""
;;
">=")
test "$res" -lt 0 && ver=""
;;
"<")
test "$res" -gt 0 && ver=""
;;
"<=")
test "$res" -ge 0 && ver=""
;;
"=")
test "$res" -ne 0 && ver=""
;;
esac
fi

if [ -z "$ver" ] ; then
ok $_FAILURE "$explanation"
return $_FAILURE
fi
ok $_SUCCESS "Package $package exists with version $ver"
return $_SUCCESS
else
ok $_FAILURE "$explanation"
return $_FAILURE
fi
}

# End of test
test_end()
{
done_testing
}

# Return version and release number for package
get_package_version()
{
package="${1:-UNKNOWNPACKAGE}"
if [ -n "$TEST_PACKAGE_SOURCE" ]; then
# Look in iso image
test -e "$TEST_PACKAGE_SOURCE" || fatal "Cannot open ISO file $TEST_PACKAGE_SOURCE"
isoinfo -lR -i "$TEST_PACKAGE_SOURCE" | \
awk '/\.rpm/ {print $NF}' | \
sed 's/%3a/:/g;s/%5f/_/g' | \
sed 's/-\([^-]*-[^-]*\)\.[a-z5864_]\+\.rpm$/ \1/' | \
grep "^$package " | \
cut -f2 -d' '
else
rpm -q "$package" --qf "%{version}-%{release}" 2>/dev/null
fi
}


fi # __included_alt_test_functions
# Put test name in comment
test ${#BASH_SOURCE[@]} -gt 1 && append_comment "${BASH_SOURCE[1]}"
alt-test-1.1.3/alt-test.spec000064400000000000000000000042211233412662700156650ustar00rootroot00000000000000Name: alt-test
Version: 1.1.3
Release: alt1

Summary: Test environment based on Tapper
License: GPLv3+
Group: System/Libraries
URL: http://altlinux.org/alt-test

Packager: Andrey Cherepanov <cas@altlinux.org>

Requires: perl-Tapper-Cmd
Requires: perl-devel
Requires: libshell
Requires: cdrkit-utils
Requires: gawk

Source: %name-%version.tar

BuildArch: noarch

%description
Test environment based on Tapper

%prep
%setup
subst 's/@version@/%version/' alt-test

%install
install -m 0755 -D %name %buildroot%_bindir/%name
install -m 0755 -D %name-functions %buildroot%_bindir/%name-functions
mkdir -p %buildroot%_libexecdir/%name
cp -av tests/* %buildroot%_libexecdir/%name/

%files
%_bindir/%{name}*
%_libexecdir/%name

%changelog
* Mon May 12 2014 Andrey Cherepanov <cas@altlinux.org> 1.1.3-alt1
- Fix environment variable name in program help

* Wed Apr 02 2014 Andrey Cherepanov <cas@altlinux.org> 1.1.2-alt1
- Version check support for test_package
- Rename TESTED_PACKAGE_SOURCE environment variable to TEST_PACKAGE_SOURCE
- Add many tests for SPT

* Mon Nov 11 2013 Andrey Cherepanov <cas@altlinux.org> 1.1.1-alt2
- Automatically use package version for alt-test script

* Fri Nov 08 2013 Andrey Cherepanov <cas@altlinux.org> 1.1.1-alt1
- Put in result successful tests too
- Put each test name in comment
- Add Qt4 driver for PostgreSQL and APC UPS monitoring daemon for spt test
- Add tests:
+ for desktop file localization (desktop-l10n)
+ for Mozilla extension versions (mozilla-extensions)
+ for unwaned echo in tests (tests-extra-log)

* Thu Oct 24 2013 Andrey Cherepanov <cas@altlinux.org> 1.1.0-alt1
- Support -f option to show only failed tests
- Support $TESTED_PACKAGE_SOURCE for ISO image for existing package checks
- Fix missing package name for default explanation
- Add test:
+ spt

* Wed Oct 09 2013 Andrey Cherepanov <cas@altlinux.org> 1.0.2-alt1
- Add tests:
+ process
+ system-statistic

* Tue Oct 08 2013 Andrey Cherepanov <cas@altlinux.org> 1.0.1-alt1
- Support full path to test file
- Add tests:
+ filesystems
+ text-editor
+ text-processing

* Thu Oct 03 2013 Andrey Cherepanov <cas@altlinux.org> 1.0-alt1
- Initial build in Sisyphus
alt-test-1.1.3/tests/000075500000000000000000000000001233412662700144175ustar00rootroot00000000000000alt-test-1.1.3/tests/altlinux.t000064400000000000000000000001561233412662700164460ustar00rootroot00000000000000#!/bin/sh

. alt-test-functions

test_file /etc/altlinux-release "It is not ALT Linux distribution"

test_end
alt-test-1.1.3/tests/desktop-l10n.t000064400000000000000000000043241233412662700170300ustar00rootroot00000000000000#!/bin/sh

. alt-test-functions
. shell-ini-config

# Test desktop file localization (language is defined in LC_MESSAGES environment variable)
test_desktop_l10n()
{
desktop="${1:-UNKNOWNFILE}"
lang="$(locale | sed -n 's/^LC_MESSAGES=\"\([^.]\+\)\..*$/\1/p')"
explanation="${2:-Desktop file $desktop is not localized in $lang}"
name=""
generic_name=""
comment=""
details=""

if [ ! -e "${desktop}" ] ; then
ok $_FAILURE "Missing file ${desktop}"
return $_FAILURE
fi

# Test for hidden and non-displayed item
test "$(ini_config_get "$desktop" 'Desktop Entry' Hidden)" = "true" && return $_SUCCESS
test "$(ini_config_get "$desktop" 'Desktop Entry' NoDisplay)" = "true" && return $_SUCCESS
has_comment="$(ini_config_get "$desktop" 'Desktop Entry' Comment)"

# Check for long and short form of language
for l in "$lang" "${lang%%_*}"; do
# Check for localized Name
v="$(sed -n "s/^[\t ]*Name\[$l\] *= *\(.*\)/\1/p" "$desktop")"
test -n "$v" && name="$v"

# Check for localized GenericName
v="$(sed -n "s/^[\t ]*GenericName\[$l\] *= *\(.*\)/\1/p" "$desktop")"
test -n "$v" && generic_name="$v"

# Check for localized Comment (if Comment exists)
v="$(sed -n "s/^[\t ]*Comment\[$l\] *= *\(.*\)/\1/p" "$desktop")"
test -n "$v" && comment="$v"
done

# If localized GenericName is empty localized Name can be used
test -n "$name" -a -z "$generic_name" && generic_name="$name"

# Check for localized Comment only if there is original Comment in desktop file
test -z "$has_comment" && comment="x"

# Return result
if [ -n "$generic_name" -a -n "$comment" ] ; then
ok $_SUCCESS "Desktop file $desktop is completely localized in $lang"
return $_SUCCESS
else
test -z "$generic_name" -a -z "$comment" && details=": no localized Name or GenericName and Comment"
test -z "$generic_name" -a -n "$comment" && details=": no localized Name or GenericName"
test -n "$generic_name" -a -z "$comment" && details=": no localized Comment"
ok $_FAILURE "$explanation$details"
return $_FAILURE
fi
}


# Check desktop file localization in current locale
out="$(mktemp)"
find /usr/share/applications -name \*.desktop > $out
while read -r desktop_file; do
test_desktop_l10n "$desktop_file"
done < $out
rm -f $out

test_end
alt-test-1.1.3/tests/filesystems.t000064400000000000000000000023611233412662700171550ustar00rootroot00000000000000#!/bin/sh

. alt-test-functions

test_exec /sbin/mkfs "mkfs utility"
test_package udftools "manipulate UDF filesystem"

# Base filesystems
test_package dosfstools "support FAT filesystem (dosfstools)"
test_package ntfs-3g "support NTFS filesystem (ntfs-3g)"
test_package e2fsprogs "support Ext2/3/4 filesystem (e2fsprogs)"
test_package squashfsprogs "support Squash filesystem (squashfsprogs)"

# Popular filesystems
test_package btrfs-progs "support Btr filesystem (btrfs-progs)"
test_package jfsutils "support JFS filesystem (jfsutils)"
test_package xfsprogs "support XFS filesystem (xfsprogs)"
test_package reiserfsprogs "support Reiser filesystem (reiserfsprogs)"

# Rare filesystems
test_package exfat-utils "support exFAT filesystem (exfat-utils)"
test_package exofs-utils "support Exo filesystem (exofs-utils)"
test_package logfsprogs "support Log filesystem (logfsprogs)"
test_package nilfs-utils "support Nil filesystem (nilfs-utils)"
test_package f2fs-tools "support F2 filesystem (f2fs-tools)"
test_package hfsprogs "support HFS filesystem (hfsprogs)"
test_package mtd-utils "support jffs2/ubifs filesystem (mtd-utils)"
test_package lustre "support Lustre filesystem (lustre)"
test_package ocfs2-tools "support OCFS2 filesystem (ocfs2-tools)"

test_end
alt-test-1.1.3/tests/mozilla-extensions.t000064400000000000000000000032251233412662700204520ustar00rootroot00000000000000#!/bin/sh

. alt-test-functions

# Test Mozilla extensions
uidtbl='
{ec8030f7-c20a-464f-9b0e-13a3a9e97384} Firefox 24.1.0
{3550f703-e582-4d05-9a08-453d09bdfdc6} Thunderbird 24.1.0
{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a} Seamonkey 2.21
'

uid3tbl='
toolkit@mozilla.org Firefox 24.1.0
'

uid2name() {
local uid="`printf %s "$1" |tr '[A-Z]' '[a-z]'`"
printf '%s\n' "$uidtbl$uid3tbl" |
grep "^$uid " |
cut -d ' ' -f2-3
}

get_extension_versions() {
f="$1"
cat $f | egrep ':(id|maxVersion)[=>]' | sed -e 's/^[^:]*:\([^>=]*\)[=>]\("\)\?\([^<"]*\)\("\)\?.*$/\1 \3/' | parse_rdf
}

parse_rdf() {
app=""
while read name val; do
if test "$name" = "id"; then
app="$(uid2name "$val")"
test -n "$app" && echo -en "$app\t"
fi
if test "$name" = "maxVersion" -a -n "$app"; then
app=""
printf '%s\n' "$val"
fi
done
}

# Get extension list
out="$(mktemp)"
find /usr/share/mozilla/extensions/ -maxdepth 3 -a -name install.rdf > $out
while read -r install_file; do
# Get extension UID and package name
ext="$(echo "$install_file" | sed -e 's,^/usr/share/mozilla/extensions/\([^/]*\)/.*$,\1,')"
pkg="$(rpm -qf "$install_file" --qf "%{name}-%{version}-%{release}")"

versions="$(mktemp)"
get_extension_versions "$install_file" > $versions

while read -r name cur_ver max_ver; do
if [ $(rpmvercmp "${max_ver/\*/z}" "${cur_ver/\*/z}") -ge 0 ] ; then
ok $_SUCCESS "Mozilla extension $ext from $pkg is sutable for $name $cur_ver (max version is $max_ver)"
else
ok $_FAILURE "Mozilla extension $ext from $pkg is not supported for $name $cur_ver (max version is $max_ver)"
fi
done < $versions

rm -f $versions
done < $out
rm -f $out

test_end
alt-test-1.1.3/tests/process.t000064400000000000000000000003361233412662700162640ustar00rootroot00000000000000#!/bin/sh

. alt-test-functions

# Manipulate processes
test_exec kill
test_exec killall
test_exec renice
test_exec nice

test_exec ps
test_exec pstree
test_exec top
# Legacy for ubuntu switchers
test_exec htop

test_end
alt-test-1.1.3/tests/selftest.t000064400000000000000000000003071233412662700164350ustar00rootroot00000000000000#!/bin/sh

. alt-test-functions

test_file /etc/hosts
test_file /etc/host2

test_exec ls
test_exec bbb "Missing BBB executable"

test_package coreutils "Core utils"
test_package coreutils2

test_end
alt-test-1.1.3/tests/spt.t000064400000000000000000000057111233412662700154160ustar00rootroot00000000000000#!/bin/sh

. alt-test-functions

# Testcases for SPT distribution

# Test for build on c7 branch
test -n "$(get_package_version apt-conf-branch | grep '\.M70C\.')"
ok $? "Please, build on c7 branch"

# CryptoPro
test_package lsb # >= 3.0
test_package libopenmotif3
test_package pcsc-lite # >= 0:1.5.2
test_package libgcc1
test_package glibc-core
test_package glibc-pthread
test_package libstdc++6
test_package openssl-engines
test_package fonts-bitmap-cyr_rfx-iso8859-5

# Oracle
test_package gcc4.[0-9]
test_package gcc4.[0-9]-c++
test_package findutils
test_package gawk
test_package pdksh
test_package glibc-devel
test_package libaio-devel
test_package libunixODBC-devel
test_package expat
test_package libstdc++3.3

test_package python-module-django
test_package mongo-server
test_package python-module-xmlsec
test_package libxmlsec1
test_package libxmlsec1-gnutls
test_package libxmlsec1-nss
test_package libxmlsec1-openssl

# Fingerprint scanner support
test_package pam_fprintd
test_package libfprint
test_package xprobe2

# Other requires
test_package libqt4-sql-mysql
test_package libqt4-sql-postgresql
test_package python-module-PyQt4
test_package python-module-ZSI
test_package php5-soap
test_package php5-calendar
test_package openssl-engines

# IM server
test_package openfire

# RDP server
test_package xrdp

# Legacy RDP client
test_package rdesktop

# For VirtualBox
test_package kernel-modules-virtualbox-addition-[a-z]*-[a-z]*
test_package virtualbox-guest-additions
test_package xorg-drv-vboxvideo

# Easy touchpad configuration
test_package gsynaptics

# New auth schema via LDAP
test_package nss-ldapd

# For webcam testing
test_package cheese

# Simple antivirus
test_package clamav
test_package clamav-db
test_package clamtk

# For 1C:Enterprise
test_package 1c-preinstall

# UPS support
test_package apcupsd

# Test for kernels
test_package kernel-image-std-def
test_package kernel-image-el-def
test_package kernel-image-ovz-el

# Test for versions with fixed vulnerabilities
test_package "samba>4.0.16"

# Deployment tools
test_package puppet
test_package puppet-server

# Antivirus
test_package clamav
test_package clamtk
test_package clamav-db

# Misc
test_package libini

# GIS
test_package qgis
test_package qgis-grass
test_package qgis-python
test_package qgis-mapserver

# ICAClient support
test_package ICAClient-preinstall

# eToken support
test_package IDProtectClient
test_package JaCartaGOST
test_package jcPKCS11
test_package jcPKCS11x

# Working virt-manager
test_package 'virt-manager>=1.0.0'

# Browsers with fixed vulnerabilites
test_package 'firefox>=24.4.0'
test_package 'thunderbird>=24.4.0'
test_package 'chromium>=33.0.1750.152'

# Smartcard support
test_package pcsc-lite-acsccid
test_package pcsc-lite-asedriveiiie-usb
test_package pcsc-lite-ccid
test_package pcsc-lite-rutokens
test_package pcsc-lite-openct

# Smartcard utilites
test_package pcsc-tools
test_package opensc
test_package openct

# Support tokens in web-browsers
test_package librtpkcs11ecp

test_end
alt-test-1.1.3/tests/system-statistic.t000064400000000000000000000003021233412662700201300ustar00rootroot00000000000000#!/bin/sh

. alt-test-functions

# Get system statistics
test_exec vmstat
test_exec free
test_exec uptime

test_exec top
# Legacy for ubuntu switchers
test_exec htop

test_exec iotop

test_end
alt-test-1.1.3/tests/tests-extra-log.t000064400000000000000000000003521233412662700176460ustar00rootroot00000000000000#!/bin/sh

. alt-test-functions

# Test for unwaned echo in tests

out="$(mktemp)"
egrep -n '^[[:space:]]*echo' /usr/lib/alt-test/*.t > $out
while read -r line; do
ok $_FAILURE "Unwanted echo: $line"
done < $out
rm -f $out

test_end
alt-test-1.1.3/tests/text-editor.t000064400000000000000000000001471233412662700170560ustar00rootroot00000000000000#!/bin/sh

. alt-test-functions

test_exec ed
test_exec vim
test_exec nano
test_exec mcedit

test_end
alt-test-1.1.3/tests/text-processing.t000064400000000000000000000003141233412662700177400ustar00rootroot00000000000000#!/bin/sh

. alt-test-functions

test_exec sed
test_exec grep
test_exec awk
test_exec cut
test_exec join
test_exec head
test_exec tail
test_exec cat
test_exec tac
test_exec sort
test_exec uniq

test_end
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin