~gmb/launchpad/bug-644346

« back to all changes in this revision

Viewing changes to lib/lp/soyuz/doc/buildd-slavescanner.txt

  • Committer: Graham Binns
  • Date: 2010-09-23 08:59:28 UTC
  • mfrom: (11575.1.37 launchpad)
  • Revision ID: graham@canonical.com-20100923085928-4x8vlt72gvzppb11
Merged devel.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
 
32
32
Import MockBuilder and a series of MockSlaves to be used in this test.
33
33
 
34
 
    >>> from lp.soyuz.tests.soyuzbuilddhelpers import (
 
34
    >>> from lp.buildmaster.tests.mock_slaves import (
35
35
    ...    AbortedSlave, AbortingSlave, BuildingSlave,
36
36
    ...    LostBuildingBrokenSlave, MockBuilder, OkSlave, WaitingSlave)
37
37
 
112
112
 
113
113
Make sure that a_builder has no active builds:
114
114
 
115
 
    >>> from canonical.launchpad.ftests import syncUpdate
116
115
    >>> if a_builder.currentjob is not None:
117
116
    ...     currentjob = a_builder.currentjob
118
117
    ...     currentjob.setDateStarted(None)
119
118
    ...     currentjob.builder = None
120
 
    ...     syncUpdate(currentjob)
121
119
 
122
120
Force the test builder to be 'ok' as the code required to do this
123
121
automatically is not yet factored into the content class.
595
593
    >>> resurrect_build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(
596
594
    ...     current_job)
597
595
    >>> resurrect_build.status = BuildStatus.NEEDSBUILD
598
 
    >>> syncUpdate(resurrect_build)
599
596
    >>> current_job.builder = None
600
597
    >>> current_job.setDateStarted(None)
601
598
    >>> current_job.lastscore = 0
602
 
    >>> syncUpdate(current_job)
603
599
 
604
600
IBuilder.findCandidate also identifies if there are builds for
605
601
superseded source package releases in the queue and marks the
740
736
    >>> commit()
741
737
    >>> LaunchpadZopelessLayer.switchDbUser(config.builddmaster.dbuser)
742
738
 
743
 
For building a candidate in the release pocket for the main component
744
 
and the primary archive It will pass an 'archives' argument to the
745
 
slave that contains sources.list entries for each pocket required in
746
 
the primary archive dependency tree.
747
 
 
748
 
We also pass arguments called 'suite' which is the current distroseries and
749
 
pocket, (e.g. edgy-updates) and 'archive_purpose' which contains the build's
750
 
archive.purpose (e.g. PRIMARY or PPA).  These latter two arguments are
751
 
used in the chroot to determine whether it needs to turn on some features
752
 
or not (like pkgstriptranslations and pkgmaintainermangler).
753
 
 
754
 
Please note also that the 'archive_private' flag is passed to the slave
755
 
builder.  It is True for private archives and False otherwise.
756
 
 
757
 
    >>> a_builder.setSlaveForTesting(OkSlave())
758
 
    >>> a_builder.is_available
759
 
    True
760
 
    >>> candidate = a_build.queueBuild()
761
 
    >>> removeSecurityProxy(a_builder)._dispatchBuildCandidate(candidate)
762
 
    ensurepresent called, url=...
763
 
    ensurepresent called,
764
 
        url=http://localhost:58000/3/firefox_0.9.2.orig.tar.gz
765
 
    OkSlave BUILDING
766
 
    Archives:
767
 
     deb http://ftpmaster.internal/ubuntu hoary main
768
 
    Suite: hoary
769
 
    Ogre-component: main
770
 
    Archive Purpose: PRIMARY
771
 
    Archive Private: False
772
 
 
773
 
    >>> candidate.destroySelf()
774
 
 
775
 
Currently we can theoretically dispatch a build candidate for a
776
 
builder in 'manual' mode.
777
 
 
778
 
Although this will not be optimal, because we can only
779
 
do it once the manual builder has been collected (due to the
780
 
BuildQueue.builder constraint). Also because we don't yet provide a
781
 
API/UI method to request the dispatch in advance.
782
 
 
783
 
    >>> a_builder.manual = True
784
 
    >>> commit()
785
 
    >>> a_builder.setSlaveForTesting(OkSlave())
786
 
    >>> a_builder.is_available
787
 
    True
788
 
    >>> candidate = a_build.queueBuild()
789
 
    >>> removeSecurityProxy(a_builder)._dispatchBuildCandidate(candidate)
790
 
    ensurepresent called, url=...
791
 
    ensurepresent called,
792
 
        url=http://localhost:58000/3/firefox_0.9.2.orig.tar.gz
793
 
    OkSlave BUILDING
794
 
    Archives:
795
 
     deb http://ftpmaster.internal/ubuntu hoary main
796
 
    Suite: hoary
797
 
    Ogre-component: main
798
 
    Archive Purpose: PRIMARY
799
 
    Archive Private: False
800
 
 
801
 
    >>> candidate.destroySelf()
802
 
 
803
739
Partner archive builds will set up the 'archives' argument such that it
804
740
references all the required pockets/components in the primary archive, in
805
741
addition to a reference to the release pocket in the partner archive itself.
812
748
    >>> a_builder.is_available
813
749
    True
814
750
 
815
 
    >>> candidate = a_build.queueBuild()
816
 
    >>> setupBuildQueue(candidate, a_builder)
817
 
    >>> last_stub_mail_count = len(stub.test_emails)
818
 
 
819
751
The partner archive won't be passed to the builder unless it has at
820
752
least one published binary availble in the target distroarchseries.
821
753
This feature fixes bug #196782, when archive/suites got passed to
823
755
any PPA/suite will fail during the first 20 minutes because no empty
824
756
indexes are published.
825
757
 
826
 
Note that only a published binary in the right context will make the
827
 
archive relevant, anything PENDING or published in another context
828
 
wouldn't work.
829
 
 
830
 
    >>> warty = getUtility(IDistributionSet)['ubuntu']['warty']
831
 
    >>> create_binary_publication_for(
832
 
    ...    partner_archive, warty, PackagePublishingStatus.PUBLISHED)
833
 
 
834
 
    >>> hoary = getUtility(IDistributionSet)['ubuntu']['hoary']
835
 
    >>> create_binary_publication_for(
836
 
    ...    partner_archive, hoary, PackagePublishingStatus.PENDING)
837
 
 
838
 
So, at moment, partner archive is still not relevant for builds in
839
 
hoary/i386. It's not passed to the builder.
840
 
 
841
 
    >>> removeSecurityProxy(a_builder)._dispatchBuildCandidate(candidate)
842
 
    ensurepresent called, url=...
843
 
    ensurepresent called,
844
 
        url=http://localhost:58000/3/firefox_0.9.2.orig.tar.gz
845
 
    OkSlave BUILDING
846
 
    Archives:
847
 
     deb http://ftpmaster.internal/ubuntu hoary main restricted universe multiverse
848
 
     deb http://ftpmaster.internal/ubuntu hoary-security main restricted universe multiverse
849
 
     deb http://ftpmaster.internal/ubuntu hoary-updates main restricted universe multiverse
850
 
    Suite: hoary
851
 
    Ogre-component: main
852
 
    Archive Purpose: PARTNER
853
 
    Archive Private: False
854
 
 
855
 
Let's try it again.
856
 
 
857
 
    >>> candidate.destroySelf()
858
 
    >>> a_builder.setSlaveForTesting(OkSlave())
859
 
    >>> a_builder.is_available
860
 
    True
861
 
 
862
 
    >>> candidate = a_build.queueBuild()
863
 
    >>> setupBuildQueue(candidate, a_builder)
864
 
    >>> last_stub_mail_count = len(stub.test_emails)
865
 
 
866
 
    >>> removeSecurityProxy(a_build).archive = ubuntu.main_archive
867
 
    >>> candidate.destroySelf()
868
 
 
869
 
But this time We will create a valid publication on partner hoary/i386.
870
 
 
871
 
    >>> from lp.soyuz.interfaces.component import IComponentSet
872
 
    >>> commit()
873
 
    >>> LaunchpadZopelessLayer.switchDbUser('launchpad')
874
 
    >>> login('foo.bar@canonical.com')
875
 
    >>> pub_source = test_publisher.getPubSource(
876
 
    ...    archive=partner_archive, distroseries=hoary,
877
 
    ...    status=PackagePublishingStatus.PUBLISHED,
878
 
    ...    component='partner')
879
 
    >>> pub_binaries = test_publisher.getPubBinaries(
880
 
    ...     archive=partner_archive, pub_source=pub_source,
881
 
    ...     distroseries=hoary, status=PackagePublishingStatus.PUBLISHED)
882
 
    >>> partner_build = pub_binaries[0].binarypackagerelease.build
883
 
    >>> partner_candidate = partner_build.buildqueue_record
884
 
    >>> commit()
885
 
    >>> LaunchpadZopelessLayer.switchDbUser(config.builddmaster.dbuser)
886
 
 
887
 
Now when we dispatch the partner build, since it has one published
888
 
binary in hoary/i386, the partner archive gets included in the builder
889
 
sources_list.
890
 
 
891
 
    >>> removeSecurityProxy(
892
 
    ...     a_builder)._dispatchBuildCandidate(partner_candidate)
893
 
    ensurepresent called, url=...
894
 
    ensurepresent called, url=http://localhost:58000/.../foo_666.dsc
895
 
    OkSlave BUILDING
896
 
    Archives:
897
 
     deb http://ftpmaster.internal/ubuntu hoary
898
 
         main restricted universe multiverse
899
 
     deb http://ftpmaster.internal/ubuntu hoary-security
900
 
         main restricted universe multiverse
901
 
     deb http://ftpmaster.internal/ubuntu hoary-updates
902
 
         main restricted universe multiverse
903
 
     deb http://ftpmaster.internal/ubuntu-partner hoary partner
904
 
    Suite: hoary
905
 
    Ogre-component: partner
906
 
    Archive Purpose: PARTNER
907
 
    Archive Private: False
908
 
 
909
 
    >>> partner_candidate.destroySelf()
910
 
 
911
 
Similarly, PPA builds pass the 'archives' arguments:
912
 
 
913
 
    >>> from canonical.launchpad.interfaces import IPersonSet
914
 
    >>> cprov_archive = getUtility(IPersonSet).getByName('cprov').archive
915
 
    >>> removeSecurityProxy(a_build).archive = cprov_archive
916
 
    >>> a_builder.virtualized = True
917
 
    >>> a_builder.vm_host = 'localhost.ppa'
918
 
    >>> commit()
919
 
    >>> a_builder.setSlaveForTesting(OkSlave())
920
 
    >>> a_builder.is_available
921
 
    True
922
 
 
923
 
    >>> candidate = a_build.queueBuild()
924
 
    >>> setupBuildQueue(candidate, a_builder)
925
 
    >>> last_stub_mail_count = len(stub.test_emails)
926
 
 
927
 
Exactly as Partner, Celso's PPA won't be included if it doesn't
928
 
contain any published binary in hoary/i386. We will create it before
929
 
dispatching.
930
 
 
931
 
    >>> create_binary_publication_for(
932
 
    ...    cprov_archive, hoary, PackagePublishingStatus.PUBLISHED)
933
 
 
934
 
    >>> removeSecurityProxy(a_builder)._dispatchBuildCandidate(candidate)
935
 
    ensurepresent called, url=...
936
 
    ensurepresent called,
937
 
        url=http://localhost:58000/3/firefox_0.9.2.orig.tar.gz
938
 
    OkSlave BUILDING
939
 
    Archives:
940
 
     deb http://ftpmaster.internal/ubuntu hoary main restricted universe multiverse
941
 
     deb http://ftpmaster.internal/ubuntu hoary-security main restricted universe multiverse
942
 
     deb http://ftpmaster.internal/ubuntu hoary-updates main restricted universe multiverse
943
 
     deb http://ppa.launchpad.dev/cprov/ppa/ubuntu hoary main
944
 
    Suite: hoary
945
 
    Ogre-component: main
946
 
    Archive Purpose: PPA
947
 
    Archive Private: False
948
 
 
949
 
If the build is for a private PPA, the slave scanner will pass a
950
 
sources.list entry that contains a password to access the archive.
951
 
 
952
 
    >>> from canonical.testing import LaunchpadZopelessLayer
953
 
    >>> commit()
954
 
    >>> LaunchpadZopelessLayer.switchDbUser('launchpad')
955
 
    >>> login('foo.bar@canonical.com')
956
 
    >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(
957
 
    ...     candidate)
958
 
    >>> for build_file in build.source_package_release.files:
959
 
    ...     removeSecurityProxy(build_file).libraryfile.restricted = True
960
 
    >>> private_ppa = factory.makeArchive(
961
 
    ...     owner=cprov_archive.owner, name='pppa', private=True,
962
 
    ...     virtualized=False, distribution=ubuntu)
963
 
 
964
 
It's necessary to publish some binaries into the private PPA, otherwise
965
 
the PPA won't be included as a dependency in the sources list below.
966
 
 
967
 
    >>> binaries = test_publisher.getPubBinaries(
968
 
    ...     distroseries=ubuntu['hoary'], archive=private_ppa,
969
 
    ...     status=PackagePublishingStatus.PUBLISHED)
970
 
    >>> removeSecurityProxy(build).archive = private_ppa
971
 
    >>> commit()
972
 
    >>> LaunchpadZopelessLayer.switchDbUser(test_dbuser)
973
 
    >>> login(ANONYMOUS)
974
 
 
975
 
Dispatch the build again. Celso's archive sources.list entry now has the
976
 
buildd:secret@ part in the URL.
977
 
 
978
 
Also note that when ensurepresent() is called, it receives a URL that
979
 
points to the private archive rather than the librarian for the private
980
 
firefox file.  This is because the build slaves are not allowed to
981
 
access the restricted librarian as it cannot provide access via
982
 
credentials, unlike the archive itself.
983
 
 
984
 
Finally, the archive purpose is overridden to PRIMARY instead of PPA
985
 
for any archives that have require_virtualized as False.
986
 
 
987
 
In this circumstance, it also uses the component override from the PRIMARY
988
 
archive and not the one from the PPA, which on the absence of ancestry
989
 
defaults to 'universe'.
990
 
 
991
 
    >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(candidate)
992
 
    >>> print build.current_component.name
993
 
    main
994
 
 
995
 
This is so that the mangling tools will run over the built packages.
996
 
 
997
 
    >>> removeSecurityProxy(a_builder)._dispatchBuildCandidate(candidate)
998
 
    ensurepresent called, url=...
999
 
    ensurepresent called,
1000
 
     url=http://private-ppa.../cprov/pppa/.../firefox_0.9.2.orig.tar.gz
1001
 
    URL authorisation with buildd/sekrit
1002
 
    OkSlave BUILDING
1003
 
    Archives:
1004
 
     deb http://buildd:sekrit@private-ppa.../cprov/pppa/ubuntu hoary main
1005
 
     deb http://ftpmaster.internal/ubuntu hoary
1006
 
         main restricted universe multiverse
1007
 
     deb http://ftpmaster.internal/ubuntu hoary-security
1008
 
         main restricted universe multiverse
1009
 
     deb http://ftpmaster.internal/ubuntu hoary-updates
1010
 
         main restricted universe multiverse
1011
 
    Suite: hoary
1012
 
    Ogre-component: universe
1013
 
    Archive Purpose: PRIMARY
1014
 
    Archive Private: True
1015
 
 
1016
 
We will create an ancestry in the primary archive target to the 'main'
1017
 
component and this time the dispatching will follow that component.
1018
 
 
1019
 
    >>> sourcename = build.source_package_release.name
1020
 
 
1021
 
    >>> LaunchpadZopelessLayer.switchDbUser('launchpad')
1022
 
    >>> login('foo.bar@canonical.com')
1023
 
 
1024
 
    >>> ancestry = test_publisher.getPubSource(
1025
 
    ...     sourcename=sourcename, version='0.1', distroseries=hoary)
1026
 
 
1027
 
    >>> print ancestry.displayname
1028
 
    mozilla-firefox 0.1 in hoary
1029
 
 
1030
 
    >>> print ancestry.component.name
1031
 
    main
1032
 
 
1033
 
    >>> commit()
1034
 
    >>> LaunchpadZopelessLayer.switchDbUser(config.builddmaster.dbuser)
1035
 
    >>> login(ANONYMOUS)
1036
 
 
1037
 
    >>> removeSecurityProxy(a_builder)._dispatchBuildCandidate(candidate)
1038
 
    ensurepresent called, ...
1039
 
    ...
1040
 
    Ogre-component: main
1041
 
    ...
1042
 
 
1043
 
    >>> candidate.destroySelf()
1044
 
 
1045
758
Since this is a build in a private archive, the log was uploaded to
1046
759
the restricted librarian.
1047
760
 
1048
 
    >>> candidate = a_build.queueBuild()
 
761
    >>> removeSecurityProxy(build).archive = private_ppa
 
762
    >>> commit()
 
763
    >>> candidate = build.queueBuild()
1049
764
    >>> setupBuildQueue(candidate, a_builder)
1050
765
    >>> build.upload_log = None
1051
766
    >>> candidate.builder.setSlaveForTesting(WaitingSlave('BuildStatus.OK'))
1059
774
    >>> lfa.restricted
1060
775
    True
1061
776
    >>> print lfa.filename
1062
 
    buildlog_ubuntu-hoary-i386.mozilla-firefox_0.9_BUILDING.txt.gz
 
777
    buildlog_ubuntu-warty-i386.mozilla-firefox_0.9_BUILDING.txt.gz
1063
778
 
1064
779
The attempt to fetch the buildlog from the common librarian will fail
1065
780
since this is a build in a private archive and the buildlog was thus
1079
794
    ...     getUtility(IRestrictedLibrarianClient).getFileByAlias(lfa.id))
1080
795
    >>> url_parts = urlparse.urlsplit(lfa2.file.geturl())
1081
796
    >>> print os.path.basename(url_parts[2])
1082
 
    buildlog_ubuntu-hoary-i386.mozilla-firefox_0.9_BUILDING.txt.gz
 
797
    buildlog_ubuntu-warty-i386.mozilla-firefox_0.9_BUILDING.txt.gz
1083
798
 
1084
799
A PPA can depend on another PPA. We can make Celso's PPA depend on
1085
800
Mark's PPA:
1088
803
    >>> LaunchpadZopelessLayer.switchDbUser('launchpad')
1089
804
    >>> login('foo.bar@canonical.com')
1090
805
 
1091
 
We'll switch the build's archive back to Celso's PPA and set the PPA to
1092
 
virtualized before adding the dependency on Mark's PPA.
1093
 
 
1094
 
    >>> removeSecurityProxy(build).archive = cprov_archive
1095
 
    >>> cprov_archive.require_virtualized = True
1096
 
    >>> for build_file in a_build.source_package_release.files:
1097
 
    ...     removeSecurityProxy(build_file).libraryfile.restricted = False
1098
 
    >>> mark_archive = getUtility(IPersonSet).getByName('mark').archive
1099
 
 
1100
 
    >>> unused_dep = cprov_archive.addArchiveDependency(
1101
 
    ...      mark_archive, PackagePublishingPocket.RELEASE,
1102
 
    ...      getUtility(IComponentSet)['main'])
1103
 
 
1104
 
    >>> commit()
1105
 
    >>> LaunchpadZopelessLayer.switchDbUser(test_dbuser)
1106
 
    >>> login(ANONYMOUS)
1107
 
 
1108
 
Now we can see that a build from Celso's PPA will be able to install
1109
 
dependencies from Mark's PPA, if Mark's PPA has at least one binary
1110
 
published in hoary/i386, which is not the case.
1111
 
 
1112
 
    >>> a_builder.setSlaveForTesting(OkSlave())
1113
 
    >>> a_builder.is_available
1114
 
    True
1115
 
 
1116
 
    >>> candidate = a_build.queueBuild()
1117
 
    >>> setupBuildQueue(candidate, a_builder)
1118
 
    >>> last_stub_mail_count = len(stub.test_emails)
1119
 
 
1120
 
    >>> removeSecurityProxy(a_builder)._dispatchBuildCandidate(candidate)
1121
 
    ensurepresent called, url=...
1122
 
    ensurepresent called,
1123
 
        url=http://localhost:58000/3/firefox_0.9.2.orig.tar.gz
1124
 
    OkSlave BUILDING
1125
 
    Archives:
1126
 
     deb http://ftpmaster.internal/ubuntu hoary main restricted universe multiverse
1127
 
     deb http://ftpmaster.internal/ubuntu hoary-security main restricted universe multiverse
1128
 
     deb http://ftpmaster.internal/ubuntu hoary-updates main restricted universe multiverse
1129
 
     deb http://ppa.launchpad.dev/cprov/ppa/ubuntu hoary main
1130
 
    Suite: hoary
1131
 
    Ogre-component: main
1132
 
    Archive Purpose: PPA
1133
 
    Archive Private: False
1134
 
 
1135
 
We will create the required publication in Mark's PPA and try again.
1136
 
 
1137
 
    >>> candidate.destroySelf()
1138
 
    >>> a_builder.setSlaveForTesting(OkSlave())
1139
 
    >>> a_builder.is_available
1140
 
    True
1141
 
 
1142
 
    >>> candidate = a_build.queueBuild()
1143
 
    >>> setupBuildQueue(candidate, a_builder)
1144
 
    >>> last_stub_mail_count = len(stub.test_emails)
1145
 
 
1146
 
    >>> create_binary_publication_for(
1147
 
    ...    mark_archive, hoary, PackagePublishingStatus.PUBLISHED)
1148
 
 
1149
 
    >>> removeSecurityProxy(a_builder)._dispatchBuildCandidate(candidate)
1150
 
    ensurepresent called, url=...
1151
 
    ensurepresent called,
1152
 
        url=http://localhost:58000/3/firefox_0.9.2.orig.tar.gz
1153
 
    OkSlave BUILDING
1154
 
    Archives:
1155
 
     deb http://ftpmaster.internal/ubuntu hoary main restricted universe multiverse
1156
 
     deb http://ftpmaster.internal/ubuntu hoary-security main restricted universe multiverse
1157
 
     deb http://ftpmaster.internal/ubuntu hoary-updates main restricted universe multiverse
1158
 
     deb http://ppa.launchpad.dev/cprov/ppa/ubuntu hoary main
1159
 
     deb http://ppa.launchpad.dev/mark/ppa/ubuntu hoary main
1160
 
    Suite: hoary
1161
 
    Ogre-component: main
1162
 
    Archive Purpose: PPA
1163
 
    Archive Private: False
1164
806
 
1165
807
Clean up before continuing:
1166
808
 
1167
 
    >>> candidate.destroySelf()
1168
809
    >>> a_builder.virtualized = False
1169
810
    >>> removeSecurityProxy(a_build).archive = ubuntu.main_archive
1170
811
    >>> commit()
1171
812
 
1172
 
Builddmaster stops before starting to build a denied build.
1173
 
Since hoary is in development, we are not able to dispatch
1174
 
builds for post-release pockets:
1175
 
 
1176
 
    >>> candidate = a_build.queueBuild()
1177
 
    >>> setupBuildQueue(candidate, a_builder)
1178
 
    >>> last_stub_mail_count = len(stub.test_emails)
1179
 
 
1180
 
Make a build in the updates pocket:
1181
 
 
1182
 
    >>> hoary = hoary_i386.distroseries
1183
 
    >>> hoary_evo = hoary.getSourcePackage(
1184
 
    ...    'evolution').currentrelease.sourcepackagerelease
1185
 
    >>> updates_build = hoary_evo.createBuild(
1186
 
    ...     distro_arch_series=hoary_i386,
1187
 
    ...     pocket=PackagePublishingPocket.UPDATES,
1188
 
    ...     processor=hoary_i386.default_processor,
1189
 
    ...     archive=hoary_i386.main_archive)
1190
 
    >>> updates_bqItem = updates_build.queueBuild()
1191
 
 
1192
 
    >>> hoary_i386.distroseries.status.name
1193
 
    'DEVELOPMENT'
1194
 
    >>> removeSecurityProxy(a_builder)._dispatchBuildCandidate(updates_bqItem)
1195
 
    Traceback (most recent call last):
1196
 
    ...
1197
 
    AssertionError: i386 build of evolution 1.0 in ubuntu hoary UPDATES (...) can not be built for pocket UPDATES: invalid pocket due to the series status of hoary.
1198
 
 
1199
 
== Pocket dependencies ==
1200
 
 
1201
 
Change the distroseries status for testing. FROZEN allows building in
1202
 
all pockets:
1203
 
 
1204
 
    >>> from canonical.launchpad.interfaces import SeriesStatus
1205
 
    >>> hoary_i386.distroseries.status = SeriesStatus.FROZEN
1206
 
 
1207
 
Now we can start a build in other pockets, and see what archives are
1208
 
passed to the slave.
1209
 
 
1210
 
A build in the updates pocket:
1211
 
 
1212
 
    >>> a_builder.currentjob.destroySelf()
1213
 
 
1214
 
    >>> bqItem3 = a_build.queueBuild()
1215
 
    >>> build = getUtility(IBinaryPackageBuildSet).getByQueueEntry(bqItem3)
1216
 
    >>> removeSecurityProxy(build).pocket = (
1217
 
    ...     PackagePublishingPocket.UPDATES)
1218
 
    >>> last_stub_mail_count = len(stub.test_emails)
1219
 
    >>> removeSecurityProxy(a_builder)._dispatchBuildCandidate(bqItem3)
1220
 
    ensurepresent called, url=...
1221
 
    ensurepresent called,
1222
 
        url=http://localhost:58000/3/firefox_0.9.2.orig.tar.gz
1223
 
    OkSlave BUILDING
1224
 
    Archives:
1225
 
     deb http://ftpmaster.internal/ubuntu hoary main
1226
 
     deb http://ftpmaster.internal/ubuntu hoary-security main
1227
 
     deb http://ftpmaster.internal/ubuntu hoary-updates main
1228
 
    Suite: hoary-updates
1229
 
    Ogre-component: main
1230
 
    Archive Purpose: PRIMARY
1231
 
    Archive Private: False
1232
 
 
1233
 
A build in the proposed pocket:
1234
 
 
1235
 
    >>> a_builder.currentjob.destroySelf()
1236
 
 
1237
 
    >>> bqItem3 = a_build.queueBuild()
1238
 
    >>> removeSecurityProxy(build).pocket = (
1239
 
    ...     PackagePublishingPocket.PROPOSED)
1240
 
    >>> last_stub_mail_count = len(stub.test_emails)
1241
 
    >>> removeSecurityProxy(a_builder)._dispatchBuildCandidate(bqItem3)
1242
 
    ensurepresent called, url=...
1243
 
    ensurepresent called,
1244
 
        url=http://localhost:58000/3/firefox_0.9.2.orig.tar.gz
1245
 
    OkSlave BUILDING
1246
 
    Archives:
1247
 
     deb http://ftpmaster.internal/ubuntu hoary main
1248
 
     deb http://ftpmaster.internal/ubuntu hoary-proposed main
1249
 
     deb http://ftpmaster.internal/ubuntu hoary-security main
1250
 
     deb http://ftpmaster.internal/ubuntu hoary-updates main
1251
 
    Suite: hoary-proposed
1252
 
    Ogre-component: main
1253
 
    Archive Purpose: PRIMARY
1254
 
    Archive Private: False
1255
 
 
1256
 
A build in the backports pocket:
1257
 
 
1258
 
    >>> a_builder.currentjob.destroySelf()
1259
 
 
1260
 
    >>> bqItem3 = a_build.queueBuild()
1261
 
    >>> removeSecurityProxy(build).pocket = (
1262
 
    ...     PackagePublishingPocket.BACKPORTS)
1263
 
    >>> last_stub_mail_count = len(stub.test_emails)
1264
 
    >>> removeSecurityProxy(a_builder)._dispatchBuildCandidate(bqItem3)
1265
 
    ensurepresent called, url=...
1266
 
    ensurepresent called,
1267
 
        url=http://localhost:58000/3/firefox_0.9.2.orig.tar.gz
1268
 
    OkSlave BUILDING
1269
 
    Archives:
1270
 
     deb http://ftpmaster.internal/ubuntu hoary main restricted universe multiverse
1271
 
     deb http://ftpmaster.internal/ubuntu hoary-backports main restricted universe multiverse
1272
 
     deb http://ftpmaster.internal/ubuntu hoary-security main restricted universe multiverse
1273
 
     deb http://ftpmaster.internal/ubuntu hoary-updates main restricted universe multiverse
1274
 
    Suite: hoary-backports
1275
 
    Ogre-component: main
1276
 
    Archive Purpose: PRIMARY
1277
 
    Archive Private: False
1278
 
 
1279
 
A build in the security pocket:
1280
 
 
1281
 
    >>> a_builder.currentjob.destroySelf()
1282
 
 
1283
 
    >>> bqItem3 = a_build.queueBuild()
1284
 
    >>> removeSecurityProxy(build).status = (
1285
 
    ...     BuildStatus.NEEDSBUILD)
1286
 
    >>> removeSecurityProxy(build).pocket = (
1287
 
    ...     PackagePublishingPocket.SECURITY)
1288
 
    >>> last_stub_mail_count = len(stub.test_emails)
1289
 
 
1290
 
The pocket-dependency infrastructure is ready to deal with SECURITY
1291
 
pocket, however we explicitly skip security builds when dispatching
1292
 
because Embargoed-Archives and Restricted-UI implementations are not
1293
 
yet ready.
1294
 
 
1295
 
    >>> removeSecurityProxy(a_builder)._dispatchBuildCandidate(bqItem3)
1296
 
    Traceback (most recent call last):
1297
 
    ...
1298
 
    AssertionError: Soyuz is not yet capable of building SECURITY uploads.
1299
 
 
1300
 
Builds for security pocket are marked as FAILEDTOBUILD inside the
1301
 
_findBuildCandidate() method, see doc/buildd-dispatching.txt
1302
 
 
1303
813
 
1304
814
== Builder Status Handler ==
1305
815