summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiziano Müller <dev-zero@gentoo.org>2007-01-23 20:37:06 +0000
committerTiziano Müller <dev-zero@gentoo.org>2007-01-23 20:37:06 +0000
commit6639f4b526e5c55766ecdc363e44f7e5ac8faa0c (patch)
tree5f015b9bff6a0bde9f1c263409f8471d5ef8d6f9 /sys-fs/evms/evms-2.5.5-r4.ebuild
parentStable on ppc wrt bug 154198 (diff)
downloadgentoo-2-6639f4b526e5c55766ecdc363e44f7e5ac8faa0c.tar.gz
gentoo-2-6639f4b526e5c55766ecdc363e44f7e5ac8faa0c.tar.bz2
gentoo-2-6639f4b526e5c55766ecdc363e44f7e5ac8faa0c.zip
Added src_test(). Added patch from Debian to set group for /dev/evms/* to disk, bug #159358
(Portage version: 2.1.2-r1)
Diffstat (limited to 'sys-fs/evms/evms-2.5.5-r4.ebuild')
-rw-r--r--sys-fs/evms/evms-2.5.5-r4.ebuild43
1 files changed, 41 insertions, 2 deletions
diff --git a/sys-fs/evms/evms-2.5.5-r4.ebuild b/sys-fs/evms/evms-2.5.5-r4.ebuild
index fff4b0b4017f..8725ad6fc049 100644
--- a/sys-fs/evms/evms-2.5.5-r4.ebuild
+++ b/sys-fs/evms/evms-2.5.5-r4.ebuild
@@ -1,6 +1,6 @@
-# Copyright 1999-2006 Gentoo Foundation
+# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/evms/evms-2.5.5-r4.ebuild,v 1.2 2006/12/09 09:09:17 dev-zero Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/evms/evms-2.5.5-r4.ebuild,v 1.3 2007/01/23 20:37:06 dev-zero Exp $
WANT_AUTOMAKE="latest"
WANT_AUTOCONF="latest"
@@ -110,3 +110,42 @@ src_install() {
# Needed for bug #51252
dosym libevms-2.5.so.0.0 /$(get_libdir)/libevms-2.5.so.0
}
+
+src_test() {
+ if [[ -z ${EVMS_TEST_VOLUME} ]] ; then
+ eerror "This is a volume manager and it therefore needs a volume"
+ eerror "for testing. You have to define EVMS_TEST_VOLUME as"
+ eerror "a volume evms can operate on."
+ eerror "Example: export EVMS_TEST_VOLUME=sda"
+ eerror "Note: The volume-name can not be a symlink."
+ eerror "WARNING: EVMS WILL DESTROY EVERYTHING ON IT."
+ einfo "If you don't have an empty disk, you can use the loopback-device:"
+ einfo "- Create a large file using dd (this creates a 4GB file):"
+ einfo " dd if=/dev/zero of=/tmp/evms_test_file bs=1M count=4096"
+ einfo "- Activate a loop device on this file:"
+ einfo " losetup /dev/loop0 /tmp/evms_test_file"
+ einfo "- export EVMS_TEST_VOLUME=loop0"
+ einfo "The disk has to be at least 4GB!"
+ einfo "To deactivate the loop-device afterwards:"
+ einfo "- losetup -d /dev/loop0"
+ hasq userpriv ${FEATURES} && ewarn "These tests have to run as root. Disable userpriv!"
+ die "need test-volume"
+ fi
+
+ if hasq userpriv ${FEATURES} ; then
+ eerror "These tests need root privileges. Disable userpriv!"
+ die "userpriv is not supported"
+ fi
+
+ volume=$(readlink "/dev/${EVMS_TEST_VOLUME}")
+ einfo "Disabling sandbox for:"
+ einfo " - /dev/${volume:-${EVMS_TEST_VOLUME}}"
+ addwrite /dev/${volume:-${EVMS_TEST_VOLUME}}
+ einfo " - /dev/evms"
+ addwrite /dev/evms
+ einfo " - /var/lock/evms-engine"
+ addwrite /var/lock/evms-engine
+
+ cd "${S}/tests/suite"
+ PATH="${PATH}:/sbin:/${S}/tests" ./run_tests ${EVMS_TEST_VOLUME} || die "tests failed"
+}