Gentoo Archives: gentoo-commits

From: "Robin H. Johnson (robbat2)" <robbat2@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-db/redis: ChangeLog redis-1.2.5.ebuild
Date: Sun, 02 May 2010 22:30:23
Message-Id: 20100502223020.15CB62C289@corvid.gentoo.org
1 robbat2 10/05/02 22:30:19
2
3 Modified: ChangeLog redis-1.2.5.ebuild
4 Log:
5 Bug #316767: implement a full src_test that does server setup first.
6 (Portage version: 2.2_rc67/cvs/Linux x86_64)
7
8 Revision Changes Path
9 1.4 dev-db/redis/ChangeLog
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-db/redis/ChangeLog?rev=1.4&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-db/redis/ChangeLog?rev=1.4&content-type=text/plain
13 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-db/redis/ChangeLog?r1=1.3&r2=1.4
14
15 Index: ChangeLog
16 ===================================================================
17 RCS file: /var/cvsroot/gentoo-x86/dev-db/redis/ChangeLog,v
18 retrieving revision 1.3
19 retrieving revision 1.4
20 diff -p -w -b -B -u -u -r1.3 -r1.4
21 --- ChangeLog 25 Mar 2010 19:01:03 -0000 1.3
22 +++ ChangeLog 2 May 2010 22:30:19 -0000 1.4
23 @@ -1,6 +1,9 @@
24 # ChangeLog for dev-db/redis
25 # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
26 -# $Header: /var/cvsroot/gentoo-x86/dev-db/redis/ChangeLog,v 1.3 2010/03/25 19:01:03 robbat2 Exp $
27 +# $Header: /var/cvsroot/gentoo-x86/dev-db/redis/ChangeLog,v 1.4 2010/05/02 22:30:19 robbat2 Exp $
28 +
29 + 02 May 2010; Robin H. Johnson <robbat2@g.o> redis-1.2.5.ebuild:
30 + Bug #316767: implement a full src_test that does server setup first.
31
32 25 Mar 2010; Robin H. Johnson <robbat2@g.o> metadata.xml:
33 Add lu_zero as another maintainer.
34
35
36
37 1.3 dev-db/redis/redis-1.2.5.ebuild
38
39 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-db/redis/redis-1.2.5.ebuild?rev=1.3&view=markup
40 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-db/redis/redis-1.2.5.ebuild?rev=1.3&content-type=text/plain
41 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-db/redis/redis-1.2.5.ebuild?r1=1.2&r2=1.3
42
43 Index: redis-1.2.5.ebuild
44 ===================================================================
45 RCS file: /var/cvsroot/gentoo-x86/dev-db/redis/redis-1.2.5.ebuild,v
46 retrieving revision 1.2
47 retrieving revision 1.3
48 diff -p -w -b -B -u -u -r1.2 -r1.3
49 --- redis-1.2.5.ebuild 25 Mar 2010 07:36:36 -0000 1.2
50 +++ redis-1.2.5.ebuild 2 May 2010 22:30:19 -0000 1.3
51 @@ -1,6 +1,6 @@
52 # Copyright 1999-2010 Gentoo Foundation
53 # Distributed under the terms of the GNU General Public License v2
54 -# $Header: /var/cvsroot/gentoo-x86/dev-db/redis/redis-1.2.5.ebuild,v 1.2 2010/03/25 07:36:36 robbat2 Exp $
55 +# $Header: /var/cvsroot/gentoo-x86/dev-db/redis/redis-1.2.5.ebuild,v 1.3 2010/05/02 22:30:19 robbat2 Exp $
56
57 EAPI=2
58
59 @@ -12,11 +12,11 @@ SRC_URI="http://redis.googlecode.com/fil
60
61 LICENSE="BSD"
62 KEYWORDS="~amd64 ~x86"
63 -IUSE=""
64 +IUSE="test"
65 SLOT="0"
66
67 RDEPEND=""
68 -DEPEND=""
69 +DEPEND="test? ( dev-lang/tcl )"
70
71 REDIS_PIDDIR=/var/run/redis/
72 REDIS_PIDFILE=${REDIS_PIDDIR}/redis.pid
73 @@ -79,3 +79,41 @@ src_install() {
74 diropts -m0750 -o redis -g redis
75 keepdir ${REDIS_DATAPATH} ${REDIS_LOGFILE} ${REDIS_PIDDIR}
76 }
77 +
78 +src_test() {
79 + local PORT=$(((RANDOM % 32767)+32768))
80 + local PIDFILE=redis-test.pid
81 + einfo "Preparing redis test config"
82 + # The port number is hardcoded in lots of places
83 + sed -r <redis.conf >redis-test.conf \
84 + -e "/^pidfile/s~ .*~ ${PIDFILE}~" \
85 + -e '/^daemonize/s~ no~ yes~' \
86 + -e "/^port/s~ [0-9]+~ ${PORT}~" \
87 + -e '/^(# )?bind/s,^,#,g' \
88 + -e '/\<bind\>/abind 127.0.0.1' \
89 + || die "Failed to build test server config"
90 + # The port number is hardcoded in lots of places
91 + for i in test-redis.tcl redis.tcl ; do
92 + sed -r <$i >${i/.tcl/-${PORT}.tcl} \
93 + -e "/^source redis.tcl/s,redis.tcl,redis-${PORT}.tcl,g" \
94 + -e "/6379/s~6379~${PORT}~" \
95 + || die "Failed to build test client config ($i)"
96 + done
97 + einfo "Starting test server"
98 + ./redis-server redis-test.conf
99 + rc1=$?
100 + sleep 2
101 + [[ $rc1 -ne 0 ]] && die "Failed to start redis server!"
102 + pidof redis-server | fgrep -f ${PIDFILE}
103 + rc1=$?
104 + [[ $rc1 -ne 0 ]] && die "Could not find started redis server!"
105 + unset rc1
106 +
107 + einfo "Starting redis tests"
108 + tclsh test-redis-$PORT.tcl
109 + rc1=$?
110 + kill -9 $(<${PIDFILE})
111 + rc2=$?
112 + [[ $rc1 -ne 0 ]] && die "Failed testsuite"
113 + [[ $rc2 -ne 0 ]] && die "Failed to shut down redis server"
114 +}