[Checkins] SVN: zc.recipe.rhrc/trunk/s Initial version from zope.com repo.

Amos Latteier amos at latteier.com
Fri Dec 1 12:49:25 EST 2006


Log message for revision 71363:
  Initial version from zope.com repo.
  

Changed:
  A   zc.recipe.rhrc/trunk/setup.py
  A   zc.recipe.rhrc/trunk/src/
  A   zc.recipe.rhrc/trunk/src/zc/
  A   zc.recipe.rhrc/trunk/src/zc/__init__.py
  A   zc.recipe.rhrc/trunk/src/zc/recipe/
  A   zc.recipe.rhrc/trunk/src/zc/recipe/__init__.py
  A   zc.recipe.rhrc/trunk/src/zc/recipe/rhrc/
  A   zc.recipe.rhrc/trunk/src/zc/recipe/rhrc/README.txt
  A   zc.recipe.rhrc/trunk/src/zc/recipe/rhrc/__init__.py
  A   zc.recipe.rhrc/trunk/src/zc/recipe/rhrc/tests.py

-=-
Added: zc.recipe.rhrc/trunk/setup.py
===================================================================
--- zc.recipe.rhrc/trunk/setup.py	2006-12-01 17:41:39 UTC (rev 71362)
+++ zc.recipe.rhrc/trunk/setup.py	2006-12-01 17:49:24 UTC (rev 71363)
@@ -0,0 +1,9 @@
+from setuptools import setup
+
+name = 'zc.recipe.rhrc'
+setup(
+    name=name,
+    entry_points='[zc.buildout]\ndefault=%s:Recipe' % name,
+    package_dir = {'': 'src'},
+    install_requires = "zc.buildout" # XXX Grrr should use tests_require
+    )

Added: zc.recipe.rhrc/trunk/src/zc/__init__.py
===================================================================
--- zc.recipe.rhrc/trunk/src/zc/__init__.py	2006-12-01 17:41:39 UTC (rev 71362)
+++ zc.recipe.rhrc/trunk/src/zc/__init__.py	2006-12-01 17:49:24 UTC (rev 71363)
@@ -0,0 +1 @@
+__import__('pkg_resources').declare_namespace(__name__)

Added: zc.recipe.rhrc/trunk/src/zc/recipe/__init__.py
===================================================================
--- zc.recipe.rhrc/trunk/src/zc/recipe/__init__.py	2006-12-01 17:41:39 UTC (rev 71362)
+++ zc.recipe.rhrc/trunk/src/zc/recipe/__init__.py	2006-12-01 17:49:24 UTC (rev 71363)
@@ -0,0 +1 @@
+__import__('pkg_resources').declare_namespace(__name__)

Added: zc.recipe.rhrc/trunk/src/zc/recipe/rhrc/README.txt
===================================================================
--- zc.recipe.rhrc/trunk/src/zc/recipe/rhrc/README.txt	2006-12-01 17:41:39 UTC (rev 71362)
+++ zc.recipe.rhrc/trunk/src/zc/recipe/rhrc/README.txt	2006-12-01 17:49:24 UTC (rev 71363)
@@ -0,0 +1,528 @@
+Create Red-Hat Linux (chkconfig) rc scripts
+===========================================
+
+The zc.recipes.rhrc recipe creates Red-Hat Linux (chkconfig) rc
+scripts.   It can create individual rc scripts, as well as combined rc
+scripts that start multiple applications.
+
+The recipe has a parts option that takes the names of sections that
+define run-script options, which contain one-line control scripts.  Let's
+look at a simple example.
+
+A simple example will, hopefully make this clearer. 
+
+    >>> demo = tmpdir('demo')
+
+    >>> write('buildout.cfg',
+    ... """
+    ... [buildout]
+    ... parts = zoperc
+    ...
+    ... [zoperc]
+    ... recipe = zc.recipe.rhrc
+    ... parts = zope
+    ... dest = %(dest)s
+    ...
+    ... [zope]
+    ... run-script = /opt/zope/bin/zopectl -C /etc/zope.conf
+    ... """ % dict(dest=demo))
+
+Normally the recipe writes scripts to /etc/init.d.  We can override
+the destivation, which we've done here, using a demonstration
+directory.  We specified a that it should get run-script source from
+the zope section.  Here the zope section is simply a configuration
+section with a run-script option set directly, but it could have been
+a part with a run-script option computed from the recipe.
+
+If we run the buildout:
+
+    >>> print system('bin/buildout'),
+    buildout: Installing zoperc
+
+We'll get a zoperc script in our demo directory:
+
+    >>> ls(demo)
+    -  zoperc
+    
+    >>> cat(demo, 'zoperc')
+    #!/bin/sh 
+    <BLANKLINE>
+    # This script is for adminstrator convenience.  It should
+    # NOT be installed as a system startup script!
+    <BLANKLINE>
+    <BLANKLINE>
+    if [ $(whoami) != "root" ]; then
+      echo "You must be root."
+      exit 1
+    fi
+    <BLANKLINE>
+    case $1 in 
+      start|status)
+    <BLANKLINE>
+        /opt/zope/bin/zopectl -C /etc/zope.conf $*
+    <BLANKLINE>
+        ;;
+      stop)
+    <BLANKLINE>
+        /opt/zope/bin/zopectl -C /etc/zope.conf $*
+    <BLANKLINE>
+        ;;
+      restart)
+    <BLANKLINE>
+        ${0} stop
+        sleep 1
+        ${0} start
+    <BLANKLINE>
+        ;;
+      *) 
+        echo "Usage: ${0} [ start | stop | status | restart ]"
+        exit 1
+        ;;
+    esac
+    <BLANKLINE>
+
+There are a couple of things to note about the generated script:
+
+- It uses $* to pass arguments, so arguments can't be quoted.  This is 
+  OK because the arguments will be simple verbs like start and stop.
+
+- It includes a comment saying that the script shouldn't be used as a
+  system startup script.
+
+For the script to be used for system startup, we need to specify
+run-level information.  We can to that using the chkconfig option:
+
+    >>> write('buildout.cfg',
+    ... """
+    ... [buildout]
+    ... parts = zoperc
+    ...
+    ... [zoperc]
+    ... recipe = zc.recipe.rhrc
+    ... parts = zope
+    ... dest = %(dest)s
+    ... chkconfig = 345 90 10
+    ... chkconfigcommand = echo
+    ...
+    ... [zope]
+    ... run-script = /opt/zope/bin/zopectl -C /etc/zope.conf
+    ... """ % dict(dest=demo))
+
+Here we included a chkconfig option saying that Zope should be started
+at run levels 3, 4, and 5 and that it's start and stop ordered should
+be 90 and 10.
+
+For demonstration purposes, we don't *really* want to run chkconfig,
+so we use the chkconfigcommand option to tell the recipe to run echo
+instead.
+
+    >>> print system('bin/buildout'),
+    buildout: Uninstalling zoperc
+    buildout: Installing zoperc
+    --add zoperc
+
+Now the script contains a chkconfig comment:
+
+    >>> cat(demo, 'zoperc')
+    #!/bin/sh 
+    <BLANKLINE>
+    # the next line is for chkconfig
+    # chkconfig: 345 90 10
+    # description: please, please work
+    <BLANKLINE>
+    <BLANKLINE>
+    if [ $(whoami) != "root" ]; then
+      echo "You must be root."
+      exit 1
+    fi
+    <BLANKLINE>
+    case $1 in 
+      start|status)
+    <BLANKLINE>
+        /opt/zope/bin/zopectl -C /etc/zope.conf $*
+    <BLANKLINE>
+        ;;
+      stop)
+    <BLANKLINE>
+        /opt/zope/bin/zopectl -C /etc/zope.conf $*
+    <BLANKLINE>
+        ;;
+      restart)
+    <BLANKLINE>
+        ${0} stop
+        sleep 1
+        ${0} start
+    <BLANKLINE>
+        ;;
+      *) 
+        echo "Usage: ${0} [ start | stop | status | restart ]"
+        exit 1
+        ;;
+    esac
+    <BLANKLINE>
+
+We can specify a user that the script should be run as:
+
+    >>> write('buildout.cfg',
+    ... """
+    ... [buildout]
+    ... parts = zoperc
+    ...
+    ... [zoperc]
+    ... recipe = zc.recipe.rhrc
+    ... parts = zope
+    ... dest = %(dest)s
+    ... chkconfig = 345 90 10
+    ... chkconfigcommand = echo
+    ... user = zope
+    ...
+    ... [zope]
+    ... run-script = /opt/zope/bin/zopectl -C /etc/zope.conf
+    ... """ % dict(dest=demo))
+
+    >>> print system('bin/buildout'),
+    buildout: Uninstalling zoperc
+    buildout: Installing zoperc
+    --add zoperc
+
+    >>> cat(demo, 'zoperc')
+    #!/bin/sh 
+    <BLANKLINE>
+    # the next line is for chkconfig
+    # chkconfig: 345 90 10
+    # description: please, please work
+    <BLANKLINE>
+    <BLANKLINE>
+    if [ $(whoami) != "root" ]; then
+      echo "You must be root."
+      exit 1
+    fi
+    <BLANKLINE>
+    case $1 in 
+      start|status)
+    <BLANKLINE>
+        su zope -c \
+          "/opt/zope/bin/zopectl -C /etc/zope.conf $*"
+    <BLANKLINE>
+        ;;
+      stop)
+    <BLANKLINE>
+        su zope -c \
+          "/opt/zope/bin/zopectl -C /etc/zope.conf $*"
+    <BLANKLINE>
+        ;;
+      restart)
+    <BLANKLINE>
+        ${0} stop
+        sleep 1
+        ${0} start
+    <BLANKLINE>
+        ;;
+      *) 
+        echo "Usage: ${0} [ start | stop | status | restart ]"
+        exit 1
+        ;;
+    esac
+    <BLANKLINE>
+
+Note that now the su command is used to run the script.  Because the
+script is included in double quotes, it can't contain double
+quotes. (The recipe makes no attempt to escape double quotes.)
+
+A part that defines a run script can also define environment-variable
+settings to be used by the rc script by supplying an env option:
+
+    >>> write('buildout.cfg',
+    ... """
+    ... [buildout]
+    ... parts = zoperc
+    ...
+    ... [zoperc]
+    ... recipe = zc.recipe.rhrc
+    ... parts = zope
+    ... dest = %(dest)s
+    ... chkconfig = 345 90 10
+    ... chkconfigcommand = echo
+    ... user = zope
+    ...
+    ... [zope]
+    ... run-script = /opt/zope/bin/zopectl -C /etc/zope.conf
+    ... env = LD_LIBRARY_PATH=/opt/foolib
+    ... """ % dict(dest=demo))
+
+    >>> print system('bin/buildout'),
+    buildout: Uninstalling zoperc
+    buildout: Installing zoperc
+    --add zoperc
+
+    >>> cat(demo, 'zoperc')
+    #!/bin/sh 
+    <BLANKLINE>
+    # the next line is for chkconfig
+    # chkconfig: 345 90 10
+    # description: please, please work
+    <BLANKLINE>
+    <BLANKLINE>
+    if [ $(whoami) != "root" ]; then
+      echo "You must be root."
+      exit 1
+    fi
+    <BLANKLINE>
+    case $1 in 
+      start|status)
+    <BLANKLINE>
+        LD_LIBRARY_PATH=/opt/foolib \
+          su zope -c \
+          "/opt/zope/bin/zopectl -C /etc/zope.conf $*"
+    <BLANKLINE>
+        ;;
+      stop)
+    <BLANKLINE>
+        LD_LIBRARY_PATH=/opt/foolib \
+          su zope -c \
+          "/opt/zope/bin/zopectl -C /etc/zope.conf $*"
+    <BLANKLINE>
+        ;;
+      restart)
+    <BLANKLINE>
+        ${0} stop
+        sleep 1
+        ${0} start
+    <BLANKLINE>
+        ;;
+      *) 
+        echo "Usage: ${0} [ start | stop | status | restart ]"
+        exit 1
+        ;;
+    esac
+    <BLANKLINE>
+
+Sometimes, you need to start multiple processes.  You can specify
+multiple parts. For example, suppose we wanted to start 2 Zope
+instances:
+
+    >>> write('buildout.cfg',
+    ... """
+    ... [buildout]
+    ... parts = zoperc
+    ...
+    ... [zoperc]
+    ... recipe = zc.recipe.rhrc
+    ... parts = instance1 instance2
+    ... dest = %(dest)s
+    ... chkconfig = 345 90 10
+    ... chkconfigcommand = echo
+    ... user = zope
+    ...
+    ... [instance1]
+    ... run-script = /opt/zope/bin/zopectl -C /etc/instance1.conf
+    ... env = LD_LIBRARY_PATH=/opt/foolib
+    ...
+    ... [instance2]
+    ... run-script = /opt/zope/bin/zopectl -C /etc/instance2.conf
+    ... env = LD_LIBRARY_PATH=/opt/foolib
+    ... """ % dict(dest=demo))
+
+    >>> print system('bin/buildout'),
+    buildout: Uninstalling zoperc
+    buildout: Installing zoperc
+    --add zoperc
+
+    >>> cat(demo, 'zoperc')
+    #!/bin/sh 
+    <BLANKLINE>
+    # the next line is for chkconfig
+    # chkconfig: 345 90 10
+    # description: please, please work
+    <BLANKLINE>
+    <BLANKLINE>
+    if [ $(whoami) != "root" ]; then
+      echo "You must be root."
+      exit 1
+    fi
+    <BLANKLINE>
+    case $1 in 
+      start|status)
+    <BLANKLINE>
+        LD_LIBRARY_PATH=/opt/foolib \
+          su zope -c \
+          "/opt/zope/bin/zopectl -C /etc/instance1.conf $*"
+    <BLANKLINE>
+        LD_LIBRARY_PATH=/opt/foolib \
+          su zope -c \
+          "/opt/zope/bin/zopectl -C /etc/instance2.conf $*"
+    <BLANKLINE>
+        ;;
+      stop)
+    <BLANKLINE>
+        LD_LIBRARY_PATH=/opt/foolib \
+          su zope -c \
+          "/opt/zope/bin/zopectl -C /etc/instance2.conf $*"
+    <BLANKLINE>
+        LD_LIBRARY_PATH=/opt/foolib \
+          su zope -c \
+          "/opt/zope/bin/zopectl -C /etc/instance1.conf $*"
+    <BLANKLINE>
+        ;;
+      restart)
+    <BLANKLINE>
+        ${0} stop
+        sleep 1
+        ${0} start
+    <BLANKLINE>
+        ;;
+      *) 
+        echo "Usage: ${0} [ start | stop | status | restart ]"
+        exit 1
+        ;;
+    esac
+    <BLANKLINE>
+
+Now the rc script starts both instances. Note that it stops them in
+reverese order.  This isn't so important in a case like this, but
+would be more important if a later script depended on an earlier one.
+
+In addition to the zoperc script, we got scripts for each instance:
+
+    >>> ls(demo)
+    -  zoperc
+    -  zoperc-instance1
+    -  zoperc-instance2
+
+    >>> cat(demo, 'zoperc-instance1')
+    #!/bin/sh 
+    <BLANKLINE>
+    # This script is for adminstrator convenience.  It should
+    # NOT be installed as a system startup script!
+    <BLANKLINE>
+    <BLANKLINE>
+    if [ $(whoami) != "root" ]; then
+      echo "You must be root."
+      exit 1
+    fi
+    <BLANKLINE>
+    case $1 in 
+      start|status)
+    <BLANKLINE>
+        LD_LIBRARY_PATH=/opt/foolib \
+          su zope -c \
+          "/opt/zope/bin/zopectl -C /etc/instance1.conf $*"
+    <BLANKLINE>
+        ;;
+      stop)
+    <BLANKLINE>
+        LD_LIBRARY_PATH=/opt/foolib \
+          su zope -c \
+          "/opt/zope/bin/zopectl -C /etc/instance1.conf $*"
+    <BLANKLINE>
+        ;;
+      restart)
+    <BLANKLINE>
+        ${0} stop
+        sleep 1
+        ${0} start
+    <BLANKLINE>
+        ;;
+      *) 
+        echo "Usage: ${0} [ start | stop | status | restart ]"
+        exit 1
+        ;;
+    esac
+    <BLANKLINE>
+
+The individual scripts don't have chkconfig information.
+
+The zc.recipe.rhrc recipe is designed to work with the
+zc.recipe.deployment recipe.  You can specify the name of a deployment
+section.  If a deployment section is specified, then that name will be
+used for the rc scripts and the user from the deployment section will
+be used if a user isn't specified in the rc script's own section:
+
+    >>> write('buildout.cfg',
+    ... """
+    ... [buildout]
+    ... parts = zoperc
+    ...
+    ... [acme]
+    ... user = acme
+    ...
+    ... [zoperc]
+    ... recipe = zc.recipe.rhrc
+    ... parts = instance1 instance2
+    ... dest = %(dest)s
+    ... chkconfig = 345 90 10
+    ... chkconfigcommand = echo
+    ... deployment = acme
+    ...
+    ... [instance1]
+    ... run-script = /opt/zope/bin/zopectl -C /etc/instance1.conf
+    ... env = LD_LIBRARY_PATH=/opt/foolib
+    ...
+    ... [instance2]
+    ... run-script = /opt/zope/bin/zopectl -C /etc/instance2.conf
+    ... env = LD_LIBRARY_PATH=/opt/foolib
+    ... """ % dict(dest=demo))
+
+    >>> print system('bin/buildout'),
+    buildout: Uninstalling zoperc
+    buildout: Installing zoperc
+    --add acme
+
+XXX of course, there is a problem here.  We really should run
+chkconfig --del on the old rc script, ut we would need uninstall
+recipes and zc.buildout doesn't support those yet.
+
+    >>> ls(demo)
+    -  acme
+    -  acme-instance1
+    -  acme-instance2
+
+    >>> cat(demo, 'acme')
+    #!/bin/sh 
+    <BLANKLINE>
+    # the next line is for chkconfig
+    # chkconfig: 345 90 10
+    # description: please, please work
+    <BLANKLINE>
+    <BLANKLINE>
+    if [ $(whoami) != "root" ]; then
+      echo "You must be root."
+      exit 1
+    fi
+    <BLANKLINE>
+    case $1 in 
+      start|status)
+    <BLANKLINE>
+        LD_LIBRARY_PATH=/opt/foolib \
+          su acme -c \
+          "/opt/zope/bin/zopectl -C /etc/instance1.conf $*"
+    <BLANKLINE>
+        LD_LIBRARY_PATH=/opt/foolib \
+          su acme -c \
+          "/opt/zope/bin/zopectl -C /etc/instance2.conf $*"
+    <BLANKLINE>
+        ;;
+      stop)
+    <BLANKLINE>
+        LD_LIBRARY_PATH=/opt/foolib \
+          su acme -c \
+          "/opt/zope/bin/zopectl -C /etc/instance2.conf $*"
+    <BLANKLINE>
+        LD_LIBRARY_PATH=/opt/foolib \
+          su acme -c \
+          "/opt/zope/bin/zopectl -C /etc/instance1.conf $*"
+    <BLANKLINE>
+        ;;
+      restart)
+    <BLANKLINE>
+        ${0} stop
+        sleep 1
+        ${0} start
+    <BLANKLINE>
+        ;;
+      *) 
+        echo "Usage: ${0} [ start | stop | status | restart ]"
+        exit 1
+        ;;
+    esac
+    <BLANKLINE>

Added: zc.recipe.rhrc/trunk/src/zc/recipe/rhrc/__init__.py
===================================================================
--- zc.recipe.rhrc/trunk/src/zc/recipe/rhrc/__init__.py	2006-12-01 17:41:39 UTC (rev 71362)
+++ zc.recipe.rhrc/trunk/src/zc/recipe/rhrc/__init__.py	2006-12-01 17:49:24 UTC (rev 71363)
@@ -0,0 +1,153 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Create a system deployment for an application
+
+$Id: __init__.py 15402 2006-12-01 15:58:08Z jim $
+"""
+
+import os, shutil, stat
+
+class Recipe:
+
+    def __init__(self, buildout, name, options):
+        self.name, self.options = name, options
+        deployment = options.get('deployment')
+        if deployment:
+            self.name = deployment
+            if 'user' not in options:
+                options['user'] = buildout[deployment].get('user', '')
+
+        options['scripts'] = '\n'.join([buildout[part]['run-script']
+                                        for part in options['parts'].split()
+                                        ])
+        options['envs'] = '\n'.join([buildout[part].get('env', '')
+                                     for part in options['parts'].split()
+                                     ])
+
+    def install(self):
+        options = self.options
+        parts = options['parts'].split()
+        if not parts:
+            return
+        scripts = options['scripts'].split('\n')
+        chkconfig = self.options.get('chkconfig')
+        user = options.get('user', '')
+        envs = options['envs'].split('\n')
+        created = []
+        try:
+            if len(scripts) == 1:
+                # No mongo script
+                script = scripts[0]
+                if user:
+                    script = 'su %s -c \\\n      "%s $*"' % (user, script)
+                else:
+                    script += ' $*'
+                    
+                env = envs[0]
+                if env:
+                    script = env + ' \\\n      ' + script
+                self.output(chkconfig, script, self.name, created)
+            else:
+                cooked = []
+                for env, script in zip(envs, scripts):
+                    if user:
+                        script = 'su %s -c \\\n      "%s $*"' % (user, script)
+                    else:
+                        script += ' $*'
+
+                    if env:
+                        script = env + ' \\\n      ' + script
+
+                    cooked.append(script)
+                    
+                for part, script in zip(parts, cooked):
+                    self.output('', script, self.name+'-'+part, created)
+                script = '\n\n    '.join(cooked)
+                cooked.reverse()
+                rscript = '\n\n    '.join(cooked)
+                self.output(chkconfig, script, self.name, created, rscript)
+            return created
+        except:
+            [os.remove(f) for f in created]
+            raise
+
+    def output(self, chkconfig, script, ctl, created, rscript=None):
+        if rscript is None:
+            rscript = script
+        rc = rc_template % dict(
+            CHKCONFIG = (chkconfig
+                         and (chkconfig_template % chkconfig)
+                         or non_chkconfig_template),
+            CTL_SCRIPT = script,
+            CTL_SCRIPT_R = rscript,
+            )
+        dest = self.options.get('dest', '/etc/init.d')
+        ctlpath = os.path.join(dest, ctl)
+        open(ctlpath, 'w').write(rc)
+        created.append(ctlpath)
+        os.chmod(ctlpath,
+                 os.stat(ctlpath).st_mode | stat.S_IEXEC | stat.S_IXGRP)
+        if chkconfig:
+            chkconfigcommand = self.options.get('chkconfigcommand',
+                                                'chkconfig')
+            os.system(chkconfigcommand+' --add '+ctl)
+
+    def update(self):
+        pass
+
+chkconfig_template = '''\
+# the next line is for chkconfig
+# chkconfig: %s
+# description: please, please work
+'''
+
+non_chkconfig_template = '''\
+# This script is for adminstrator convenience.  It should
+# NOT be installed as a system startup script!
+'''
+
+rc_template = """#!/bin/sh 
+
+%(CHKCONFIG)s
+
+if [ $(whoami) != "root" ]; then
+  echo "You must be root."
+  exit 1
+fi
+
+case $1 in 
+  start|status)
+  
+    %(CTL_SCRIPT)s
+
+    ;;
+  stop)
+  
+    %(CTL_SCRIPT_R)s
+
+    ;;
+  restart)
+
+    ${0} stop
+    sleep 1
+    ${0} start
+
+    ;;
+  *) 
+    echo "Usage: ${0} [ start | stop | status | restart ]"
+    exit 1
+    ;;
+esac
+
+"""

Added: zc.recipe.rhrc/trunk/src/zc/recipe/rhrc/tests.py
===================================================================
--- zc.recipe.rhrc/trunk/src/zc/recipe/rhrc/tests.py	2006-12-01 17:41:39 UTC (rev 71362)
+++ zc.recipe.rhrc/trunk/src/zc/recipe/rhrc/tests.py	2006-12-01 17:49:24 UTC (rev 71363)
@@ -0,0 +1,36 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+
+import re, unittest
+from zope.testing import doctest, renormalizing
+import zc.buildout.testing
+
+def setUp(test):
+    zc.buildout.testing.buildoutSetUp(test)
+    zc.buildout.testing.install_develop('zc.recipe.rhrc', test)
+    
+
+def test_suite():
+    return unittest.TestSuite((
+        doctest.DocFileSuite(
+            'README.txt',
+            setUp=setUp, tearDown=zc.buildout.testing.buildoutTearDown,
+            checker=renormalizing.RENormalizing([
+               zc.buildout.testing.normalize_path,
+               zc.buildout.testing.normalize_script,
+               zc.buildout.testing.normalize_egg_py,
+               ])
+            ),
+        
+        ))



More information about the Checkins mailing list