~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/canonical/buildd/test_buildd_recipe

  • Committer: mbp at canonical
  • Date: 2011-11-20 23:37:23 UTC
  • mto: This revision was merged to the branch mainline in revision 14344.
  • Revision ID: mbp@canonical.com-20111120233723-370p96db2crru5tm
Delete canonical.buildd again

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env python
2
 
# Copyright 2010 Canonical Ltd.  This software is licensed under the
3
 
# GNU Affero General Public License version 3 (see the file LICENSE).
4
 
#
5
 
# This is a script to do end-to-end testing of the buildd with a bzr-builder
6
 
# recipe, without involving the BuilderBehaviour.
7
 
 
8
 
country_code = 'us'
9
 
apt_cacher_ng_host = 'stumpy'
10
 
distroseries_name = 'maverick'
11
 
recipe_text = """# bzr-builder format 0.2 deb-version {debupstream}-0~{revno}
12
 
http://bazaar.launchpad.dev/~ppa-user/+junk/wakeonlan"""
13
 
 
14
 
def deb_line(host, suites):
15
 
    prefix = 'deb http://'
16
 
    if apt_cacher_ng_host != None:
17
 
        prefix += '%s:3142/' % apt_cacher_ng_host
18
 
    return '%s%s %s %s' % (prefix, host, distroseries_name, suites)
19
 
 
20
 
import sys
21
 
from xmlrpclib import ServerProxy
22
 
 
23
 
proxy = ServerProxy('http://localhost:8221/rpc')
24
 
print proxy.echo('Hello World')
25
 
print proxy.info()
26
 
status = proxy.status()
27
 
print status
28
 
if status[0] != 'BuilderStatus.IDLE':
29
 
    print "Aborting due to non-IDLE builder."
30
 
    sys.exit(1)
31
 
print proxy.build(
32
 
    '1-2', 'sourcepackagerecipe', '1ef177161c3cb073e66bf1550931c6fbaa0a94b0',
33
 
    {}, {'author_name': u'Steve\u1234',
34
 
         'author_email': 'stevea@example.org',
35
 
         'suite': distroseries_name,
36
 
         'distroseries_name': distroseries_name,
37
 
         'ogrecomponent': 'universe',
38
 
         'archive_purpose': 'puppies',
39
 
         'recipe_text': recipe_text,
40
 
         'archives': [
41
 
            deb_line('%s.archive.ubuntu.com/ubuntu' % country_code,
42
 
                     'main universe'),
43
 
            deb_line('ppa.launchpad.net/launchpad/bzr-builder-dev/ubuntu',
44
 
                     'main'),]})
45
 
#status = proxy.status()
46
 
#for filename, sha1 in status[3].iteritems():
47
 
#    print filename
48
 
#proxy.clean()