~xnox/launchpad-buildd/riscv64

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env python
# Copyright 2010 Canonical Ltd.  This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
#
# This is a script to do end-to-end testing of the buildd with a bzr-builder
# recipe, without involving the BuilderBehaviour.

country_code = 'us'
apt_cacher_ng_host = 'stumpy'
distroseries_name = 'maverick'
recipe_text = """# bzr-builder format 0.2 deb-version {debupstream}-0~{revno}
http://bazaar.launchpad.dev/~ppa-user/+junk/wakeonlan"""

def deb_line(host, suites):
    prefix = 'deb http://'
    if apt_cacher_ng_host != None:
        prefix += '%s:3142/' % apt_cacher_ng_host
    return '%s%s %s %s' % (prefix, host, distroseries_name, suites)

import sys
from xmlrpclib import ServerProxy

proxy = ServerProxy('http://localhost:8221/rpc')
print proxy.echo('Hello World')
print proxy.info()
status = proxy.status()
print status
if status[0] != 'BuilderStatus.IDLE':
    print "Aborting due to non-IDLE builder."
    sys.exit(1)
print proxy.build(
    '1-2', 'sourcepackagerecipe', '1ef177161c3cb073e66bf1550931c6fbaa0a94b0',
    {}, {'author_name': u'Steve\u1234',
         'author_email': 'stevea@example.org',
         'suite': distroseries_name,
         'distroseries_name': distroseries_name,
         'ogrecomponent': 'universe',
         'archive_purpose': 'puppies',
         'recipe_text': recipe_text,
         'archives': [
            deb_line('%s.archive.ubuntu.com/ubuntu' % country_code,
                     'main universe'),
            deb_line('ppa.launchpad.net/launchpad/bzr-builder-dev/ubuntu',
                     'main'),]})
#status = proxy.status()
#for filename, sha1 in status[3].iteritems():
#    print filename
#proxy.clean()