Merge lp:~michael.nelson/launchpad/ppa-privatisation-test-refactor5 into lp:launchpad
- ppa-privatisation-test-refactor5
- Merge into devel
Proposed by
Michael Nelson
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | not available | ||||
Proposed branch: | lp:~michael.nelson/launchpad/ppa-privatisation-test-refactor5 | ||||
Merge into: | lp:launchpad | ||||
Prerequisite: | lp:~michael.nelson/launchpad/ppa-privatisation-test-refactor4 | ||||
Diff against target: |
821 lines (+218/-170) 6 files modified
lib/lp/soyuz/stories/ppa/xx-ppa-packages.txt (+56/-24) lib/lp/soyuz/stories/ppa/xx-private-ppa-presentation.txt (+14/-11) lib/lp/soyuz/stories/ppa/xx-private-ppa-subscription-stories.txt (+47/-41) lib/lp/soyuz/stories/ppa/xx-private-ppa-subscriptions.txt (+32/-30) lib/lp/soyuz/stories/ppa/xx-private-ppas.txt (+20/-14) lib/lp/soyuz/stories/soyuz/xx-person-packages.txt (+49/-50) |
||||
To merge this branch: | bzr merge lp:~michael.nelson/launchpad/ppa-privatisation-test-refactor5 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Abel Deuring (community) | code | Approve | |
Review via email: mp+20207@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Michael Nelson (michael.nelson) wrote : | # |
Revision history for this message
Abel Deuring (adeuring) : | # |
review:
Approve
(code)
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'lib/lp/soyuz/stories/ppa/xx-ppa-packages.txt' | |||
2 | --- lib/lp/soyuz/stories/ppa/xx-ppa-packages.txt 2010-01-20 14:29:59 +0000 | |||
3 | +++ lib/lp/soyuz/stories/ppa/xx-ppa-packages.txt 2010-02-26 15:48:21 +0000 | |||
4 | @@ -134,7 +134,8 @@ | |||
5 | 134 | >>> login('foo.bar@canonical.com') | 134 | >>> login('foo.bar@canonical.com') |
6 | 135 | >>> from zope.component import getUtility | 135 | >>> from zope.component import getUtility |
7 | 136 | >>> from lp.registry.interfaces.person import IPersonSet | 136 | >>> from lp.registry.interfaces.person import IPersonSet |
9 | 137 | >>> cprov_ppa = getUtility(IPersonSet).getByName('cprov').archive | 137 | >>> cprov = getUtility(IPersonSet).getByName('cprov') |
10 | 138 | >>> cprov_ppa = cprov.archive | ||
11 | 138 | >>> pmount_i386_pub = cprov_ppa.getAllPublishedBinaries( | 139 | >>> pmount_i386_pub = cprov_ppa.getAllPublishedBinaries( |
12 | 139 | ... name='pmount', version='0.1-1')[1] | 140 | ... name='pmount', version='0.1-1')[1] |
13 | 140 | >>> print pmount_i386_pub.displayname | 141 | >>> print pmount_i386_pub.displayname |
14 | @@ -178,39 +179,70 @@ | |||
15 | 178 | 'http://launchpad.dev/~mark/+archive/ppa' | 179 | 'http://launchpad.dev/~mark/+archive/ppa' |
16 | 179 | 180 | ||
17 | 180 | This link is not present if the user does not have permission to view | 181 | This link is not present if the user does not have permission to view |
25 | 181 | the PPA. If we make mark's PPA private and then browse back as | 182 | the PPA. We create a private PPA with a published source and then copy |
26 | 182 | an anonymous user, the link will be gone. | 183 | the source into a public PPA to demonstrate this. |
27 | 183 | 184 | ||
28 | 184 | >>> admin_browser.open("http://launchpad.dev/~mark/+archive/ppa/+admin") | 185 | >>> login('foo.bar@canonical.com') |
29 | 185 | >>> admin_browser.getControl(name="field.private").value = True | 186 | >>> from lp.registry.interfaces.distribution import IDistributionSet |
30 | 186 | >>> admin_browser.getControl(name="field.buildd_secret").value = "secret" | 187 | >>> ubuntu = getUtility(IDistributionSet).getByName( |
31 | 187 | >>> admin_browser.getControl("Save").click() | 188 | ... 'ubuntu') |
32 | 189 | >>> warty = ubuntu.getSeries('warty') | ||
33 | 190 | >>> private_ppa = factory.makeArchive( | ||
34 | 191 | ... name='p3a', private=True, owner=cprov, | ||
35 | 192 | ... distribution=ubuntu) | ||
36 | 193 | >>> joe = factory.makePerson(name="joe") | ||
37 | 194 | >>> public_ppa = factory.makeArchive( | ||
38 | 195 | ... owner=joe, distribution=ubuntu) | ||
39 | 196 | >>> from lp.soyuz.tests.test_publishing import SoyuzTestPublisher | ||
40 | 197 | >>> test_publisher = SoyuzTestPublisher() | ||
41 | 198 | >>> test_publisher.prepareBreezyAutotest() | ||
42 | 199 | >>> source = test_publisher.getPubSource( | ||
43 | 200 | ... sourcename='foo', archive=private_ppa, distroseries=warty) | ||
44 | 201 | >>> copied_source = source.copyTo( | ||
45 | 202 | ... source.distroseries, source.pocket, public_ppa) | ||
46 | 203 | >>> expander_link_id = "pub%s-expander" % copied_source.id | ||
47 | 204 | >>> logout() | ||
48 | 205 | |||
49 | 206 | |||
50 | 207 | We can view the link on the public PPA to Celso's private PPA when logged | ||
51 | 208 | in as Celso. | ||
52 | 209 | |||
53 | 210 | >>> cprov_browser = setupBrowser( | ||
54 | 211 | ... auth="Basic celso.providelo@canonical.com:cprov") | ||
55 | 212 | >>> cprov_browser.open( | ||
56 | 213 | ... "http://launchpad.dev/~joe/+archive/ppa/+packages") | ||
57 | 214 | >>> expander_url = cprov_browser.getLink(id=expander_link_id).url | ||
58 | 215 | >>> cprov_browser.open(expander_url) | ||
59 | 216 | >>> print cprov_browser.getLink("PPA named p3a for Celso Providelo").url | ||
60 | 217 | http://launchpad.dev/~cprov/+archive/p3a | ||
61 | 218 | |||
62 | 219 | But Joe himself will not see the link. | ||
63 | 220 | |||
64 | 221 | >>> joe_browser = setupBrowser( | ||
65 | 222 | ... auth="Basic joe@example.com:test") | ||
66 | 223 | >>> joe_browser.open(expander_url) | ||
67 | 224 | >>> joe_browser.getLink("PPA named p3a for Celso Providelo") | ||
68 | 225 | Traceback (most recent call last): | ||
69 | 226 | ... | ||
70 | 227 | LinkNotFoundError | ||
71 | 228 | |||
72 | 229 | And neither can an anonymous user. | ||
73 | 188 | 230 | ||
74 | 189 | >>> anon_browser.open(expander_url) | 231 | >>> anon_browser.open(expander_url) |
76 | 190 | >>> anon_browser.getLink("PPA for Mark Shuttleworth") | 232 | >>> anon_browser.getLink("PPA named p3a for Celso Providelo") |
77 | 191 | Traceback (most recent call last): | 233 | Traceback (most recent call last): |
78 | 192 | ... | 234 | ... |
79 | 193 | LinkNotFoundError | 235 | LinkNotFoundError |
80 | 194 | 236 | ||
83 | 195 | While we are there, we can also see that Mark's PPA 'repository-size' | 237 | While we are there, we can also see that the private PPA's 'repository-size' |
84 | 196 | pagelet isn't publicly available once the PPA was marked private. | 238 | pagelet isn't publicly available. |
85 | 197 | 239 | ||
86 | 198 | >>> anon_browser.open( | 240 | >>> anon_browser.open( |
88 | 199 | ... "http://launchpad.dev/~mark/+archive/ppa/+repository-size") | 241 | ... "http://launchpad.dev/~cprov/+archive/p3a/+repository-size") |
89 | 200 | Traceback (most recent call last): | 242 | Traceback (most recent call last): |
90 | 201 | ... | 243 | ... |
91 | 202 | Unauthorized: (..., 'launchpad.View') | 244 | Unauthorized: (..., 'launchpad.View') |
92 | 203 | 245 | ||
93 | 204 | >>> anon_browser.open( | ||
94 | 205 | ... "http://launchpad.dev/~cprov/+archive/ppa/+packages") | ||
95 | 206 | |||
96 | 207 | Set mark's archive back to public before continuing. | ||
97 | 208 | |||
98 | 209 | >>> admin_browser.open("http://launchpad.dev/~mark/+archive/ppa/+admin") | ||
99 | 210 | >>> admin_browser.getControl(name="field.private").value = False | ||
100 | 211 | >>> admin_browser.getControl(name="field.buildd_secret").value = "" | ||
101 | 212 | >>> admin_browser.getControl("Save").click() | ||
102 | 213 | |||
103 | 214 | 246 | ||
104 | 215 | Searching the packages list | 247 | Searching the packages list |
105 | 216 | =========================== | 248 | =========================== |
106 | @@ -218,6 +250,8 @@ | |||
107 | 218 | We can search a PPA for a particular package. A non-existent package shows | 250 | We can search a PPA for a particular package. A non-existent package shows |
108 | 219 | no results. | 251 | no results. |
109 | 220 | 252 | ||
110 | 253 | >>> anon_browser.open( | ||
111 | 254 | ... "http://launchpad.dev/~cprov/+archive/ppa/+packages") | ||
112 | 221 | >>> field = anon_browser.getControl(name='field.name_filter') | 255 | >>> field = anon_browser.getControl(name='field.name_filter') |
113 | 222 | >>> field.value = 'nonexistentpackage' | 256 | >>> field.value = 'nonexistentpackage' |
114 | 223 | >>> anon_browser.getControl('Filter', index=0).click() | 257 | >>> anon_browser.getControl('Filter', index=0).click() |
115 | @@ -244,8 +278,6 @@ | |||
116 | 244 | >>> cprov = getUtility(IPersonSet).getByName('cprov') | 278 | >>> cprov = getUtility(IPersonSet).getByName('cprov') |
117 | 245 | >>> iceweasel_pub = cprov.archive.getPublishedSources( | 279 | >>> iceweasel_pub = cprov.archive.getPublishedSources( |
118 | 246 | ... name='iceweasel')[0] | 280 | ... name='iceweasel')[0] |
119 | 247 | >>> from lp.soyuz.tests.test_publishing import SoyuzTestPublisher | ||
120 | 248 | >>> test_publisher = SoyuzTestPublisher() | ||
121 | 249 | >>> bpr = test_publisher.uploadBinaryForBuild( | 281 | >>> bpr = test_publisher.uploadBinaryForBuild( |
122 | 250 | ... iceweasel_pub.getBuilds()[0], 'bar-bin') | 282 | ... iceweasel_pub.getBuilds()[0], 'bar-bin') |
123 | 251 | >>> pub_bins = test_publisher.publishBinaryInArchive( | 283 | >>> pub_bins = test_publisher.publishBinaryInArchive( |
124 | 252 | 284 | ||
125 | === modified file 'lib/lp/soyuz/stories/ppa/xx-private-ppa-presentation.txt' | |||
126 | --- lib/lp/soyuz/stories/ppa/xx-private-ppa-presentation.txt 2009-09-09 20:39:52 +0000 | |||
127 | +++ lib/lp/soyuz/stories/ppa/xx-private-ppa-presentation.txt 2010-02-26 15:48:21 +0000 | |||
128 | @@ -15,21 +15,24 @@ | |||
129 | 15 | 15 | ||
130 | 16 | == Private presentation == | 16 | == Private presentation == |
131 | 17 | 17 | ||
142 | 18 | Let's make "cprov's" PPA private. To do this we need to be an | 18 | Let's create a private PPA for Celso and see what it looks like. |
143 | 19 | admin, and go to his admin page. | 19 | |
144 | 20 | 20 | >>> from zope.component import getUtility | |
145 | 21 | >>> admin_browser.open("http://launchpad.dev/~cprov/+archive") | 21 | >>> from lp.registry.interfaces.person import IPersonSet |
146 | 22 | >>> admin_browser.getLink("Administer archive").click() | 22 | >>> login('admin@canonical.com') |
147 | 23 | >>> admin_browser.getControl(name="field.private").value = True | 23 | >>> cprov = getUtility(IPersonSet).getByName('cprov') |
148 | 24 | >>> admin_browser.getControl(name="field.buildd_secret").value = "secret" | 24 | >>> from lp.registry.interfaces.distribution import IDistributionSet |
149 | 25 | >>> admin_browser.getControl("Save").click() | 25 | >>> ubuntu = getUtility(IDistributionSet).getByName('ubuntu') |
150 | 26 | 26 | >>> private_ppa = factory.makeArchive( | |
151 | 27 | When the PPA is marked private it gains the standard Launchpad | 27 | ... owner=cprov, name="p3a", distribution=ubuntu, private=True) |
152 | 28 | >>> logout() | ||
153 | 29 | |||
154 | 30 | When the PPA is private it gains the standard Launchpad | ||
155 | 28 | presentation for private items. | 31 | presentation for private items. |
156 | 29 | 32 | ||
157 | 30 | >>> cprov_browser = setupBrowser( | 33 | >>> cprov_browser = setupBrowser( |
158 | 31 | ... auth='Basic celso.providelo@canonical.com:cprov') | 34 | ... auth='Basic celso.providelo@canonical.com:cprov') |
160 | 32 | >>> cprov_browser.open("http://launchpad.dev/~cprov/+archive") | 35 | >>> cprov_browser.open("http://launchpad.dev/~cprov/+archive/p3a") |
161 | 33 | >>> from BeautifulSoup import BeautifulSoup, SoupStrainer | 36 | >>> from BeautifulSoup import BeautifulSoup, SoupStrainer |
162 | 34 | >>> body_el = BeautifulSoup(cprov_browser.contents).first('body') | 37 | >>> body_el = BeautifulSoup(cprov_browser.contents).first('body') |
163 | 35 | >>> 'private' in body_el['class'] | 38 | >>> 'private' in body_el['class'] |
164 | 36 | 39 | ||
165 | === modified file 'lib/lp/soyuz/stories/ppa/xx-private-ppa-subscription-stories.txt' | |||
166 | --- lib/lp/soyuz/stories/ppa/xx-private-ppa-subscription-stories.txt 2010-02-12 12:39:24 +0000 | |||
167 | +++ lib/lp/soyuz/stories/ppa/xx-private-ppa-subscription-stories.txt 2010-02-26 15:48:21 +0000 | |||
168 | @@ -31,18 +31,22 @@ | |||
169 | 31 | 31 | ||
170 | 32 | Given a private PPA for Celso, | 32 | Given a private PPA for Celso, |
171 | 33 | 33 | ||
177 | 34 | >>> admin_browser.open("http://launchpad.dev/~cprov/+archive/ppa") | 34 | >>> from zope.component import getUtility |
178 | 35 | >>> admin_browser.getLink("Administer archive").click() | 35 | >>> from lp.registry.interfaces.person import IPersonSet |
179 | 36 | >>> admin_browser.getControl(name="field.private").value = True | 36 | >>> login('admin@canonical.com') |
180 | 37 | >>> admin_browser.getControl(name="field.buildd_secret").value = "secret" | 37 | >>> cprov = getUtility(IPersonSet).getByName('cprov') |
181 | 38 | >>> admin_browser.getControl("Save").click() | 38 | >>> from lp.registry.interfaces.distribution import IDistributionSet |
182 | 39 | >>> ubuntu = getUtility(IDistributionSet).getByName('ubuntu') | ||
183 | 40 | >>> private_ppa = factory.makeArchive( | ||
184 | 41 | ... owner=cprov, name="p3a", distribution=ubuntu, private=True) | ||
185 | 42 | >>> logout() | ||
186 | 39 | 43 | ||
187 | 40 | and a browser for Celso currently navigated to the Manage Subscriptions page, | 44 | and a browser for Celso currently navigated to the Manage Subscriptions page, |
188 | 41 | 45 | ||
189 | 42 | >>> cprov_browser = setupBrowser( | 46 | >>> cprov_browser = setupBrowser( |
190 | 43 | ... auth="Basic celso.providelo@canonical.com:cprov") | 47 | ... auth="Basic celso.providelo@canonical.com:cprov") |
191 | 44 | >>> cprov_browser.open( | 48 | >>> cprov_browser.open( |
193 | 45 | ... "http://launchpad.dev/~cprov/+archive/ppa/+subscriptions") | 49 | ... "http://launchpad.dev/~cprov/+archive/p3a/+subscriptions") |
194 | 46 | 50 | ||
195 | 47 | and a client of Celso's who has a launchpad name of 'joesmith' | 51 | and a client of Celso's who has a launchpad name of 'joesmith' |
196 | 48 | 52 | ||
197 | @@ -51,7 +55,9 @@ | |||
198 | 51 | ... password="test", email="joe@example.com") | 55 | ... password="test", email="joe@example.com") |
199 | 52 | >>> logout() | 56 | >>> logout() |
200 | 53 | 57 | ||
202 | 54 | When Celso fills in the form with 'joesmith' as the subscriber, a blank subscription expiry, a description of "Joe is my friend" and clicks on the "Add subscriber" button, | 58 | When Celso fills in the form with 'joesmith' as the subscriber, a blank |
203 | 59 | subscription expiry, a description of "Joe is my friend" and clicks on the | ||
204 | 60 | "Add subscriber" button, | ||
205 | 55 | 61 | ||
206 | 56 | >>> cprov_browser.getControl(name='field.subscriber').value = 'joesmith' | 62 | >>> cprov_browser.getControl(name='field.subscriber').value = 'joesmith' |
207 | 57 | >>> cprov_browser.getControl( | 63 | >>> cprov_browser.getControl( |
208 | @@ -75,7 +81,7 @@ | |||
209 | 75 | >>> for msg in get_feedback_messages(cprov_browser.contents): | 81 | >>> for msg in get_feedback_messages(cprov_browser.contents): |
210 | 76 | ... print msg | 82 | ... print msg |
211 | 77 | You have granted access for Joe Smith to install software from | 83 | You have granted access for Joe Smith to install software from |
213 | 78 | PPA for Celso Providelo. Joe Smith will be notified of the | 84 | PPA named p3a for Celso Providelo. Joe Smith will be notified of the |
214 | 79 | access via email. | 85 | access via email. |
215 | 80 | 86 | ||
216 | 81 | 87 | ||
217 | @@ -88,7 +94,7 @@ | |||
218 | 88 | "Add subscriber" button, | 94 | "Add subscriber" button, |
219 | 89 | 95 | ||
220 | 90 | >>> cprov_browser.open( | 96 | >>> cprov_browser.open( |
222 | 91 | ... "http://launchpad.dev/~cprov/+archive/ppa/+subscriptions") | 97 | ... "http://launchpad.dev/~cprov/+archive/p3a/+subscriptions") |
223 | 92 | >>> cprov_browser.getControl(name='field.subscriber').value = 'launchpad' | 98 | >>> cprov_browser.getControl(name='field.subscriber').value = 'launchpad' |
224 | 93 | >>> cprov_browser.getControl( | 99 | >>> cprov_browser.getControl( |
225 | 94 | ... name='field.date_expires').value = '2200-08-01' | 100 | ... name='field.date_expires').value = '2200-08-01' |
226 | @@ -108,7 +114,7 @@ | |||
227 | 108 | >>> for msg in get_feedback_messages(cprov_browser.contents): | 114 | >>> for msg in get_feedback_messages(cprov_browser.contents): |
228 | 109 | ... print msg | 115 | ... print msg |
229 | 110 | You have granted access for Launchpad Developers to install software | 116 | You have granted access for Launchpad Developers to install software |
231 | 111 | from PPA for Celso Providelo. Members of Launchpad Developers | 117 | from PPA named p3a for Celso Providelo. Members of Launchpad Developers |
232 | 112 | will be notified of the access via email. | 118 | will be notified of the access via email. |
233 | 113 | 119 | ||
234 | 114 | == Story 2: An owner edits a subscription for his private archive == | 120 | == Story 2: An owner edits a subscription for his private archive == |
235 | @@ -124,13 +130,13 @@ | |||
236 | 124 | navigated to the Manage Subscriptions page, | 130 | navigated to the Manage Subscriptions page, |
237 | 125 | 131 | ||
238 | 126 | >>> cprov_browser.open( | 132 | >>> cprov_browser.open( |
240 | 127 | ... "http://launchpad.dev/~cprov/+archive/ppa/+subscriptions") | 133 | ... "http://launchpad.dev/~cprov/+archive/p3a/+subscriptions") |
241 | 128 | 134 | ||
242 | 129 | when Celso clicks 'Edit/Cancel' for the Launchpad Developers subscription, | 135 | when Celso clicks 'Edit/Cancel' for the Launchpad Developers subscription, |
243 | 130 | modifies the description field and clicks Update, | 136 | modifies the description field and clicks Update, |
244 | 131 | 137 | ||
245 | 132 | >>> cprov_browser.getLink( | 138 | >>> cprov_browser.getLink( |
247 | 133 | ... url='/~cprov/+archive/ppa/+subscriptions/launchpad/+edit').click() | 139 | ... url='/~cprov/+archive/p3a/+subscriptions/launchpad/+edit').click() |
248 | 134 | >>> cprov_browser.getControl(name="field.description").value = ( | 140 | >>> cprov_browser.getControl(name="field.description").value = ( |
249 | 135 | ... "a different description") | 141 | ... "a different description") |
250 | 136 | >>> cprov_browser.getControl(name="field.actions.update").click() | 142 | >>> cprov_browser.getControl(name="field.actions.update").click() |
251 | @@ -139,7 +145,7 @@ | |||
252 | 139 | about the update. | 145 | about the update. |
253 | 140 | 146 | ||
254 | 141 | >>> print cprov_browser.url | 147 | >>> print cprov_browser.url |
256 | 142 | http://launchpad.dev/~cprov/+archive/ppa/+subscriptions | 148 | http://launchpad.dev/~cprov/+archive/p3a/+subscriptions |
257 | 143 | >>> print_archive_subscriptions(cprov_browser.contents) | 149 | >>> print_archive_subscriptions(cprov_browser.contents) |
258 | 144 | Name Expires Comment | 150 | Name Expires Comment |
259 | 145 | Launchpad Developers 2200-08-01 a different description | 151 | Launchpad Developers 2200-08-01 a different description |
260 | @@ -155,13 +161,13 @@ | |||
261 | 155 | to the Manage Subscriptions page, | 161 | to the Manage Subscriptions page, |
262 | 156 | 162 | ||
263 | 157 | >>> cprov_browser.open( | 163 | >>> cprov_browser.open( |
265 | 158 | ... "http://launchpad.dev/~cprov/+archive/ppa/+subscriptions") | 164 | ... "http://launchpad.dev/~cprov/+archive/p3a/+subscriptions") |
266 | 159 | 165 | ||
267 | 160 | when Celso clicks 'Edit/Cancel' for the Launchpad Developers subscription | 166 | when Celso clicks 'Edit/Cancel' for the Launchpad Developers subscription |
268 | 161 | and clicks Cancel, | 167 | and clicks Cancel, |
269 | 162 | 168 | ||
270 | 163 | >>> cprov_browser.getLink( | 169 | >>> cprov_browser.getLink( |
272 | 164 | ... url='/~cprov/+archive/ppa/+subscriptions/launchpad/+edit').click() | 170 | ... url='/~cprov/+archive/p3a/+subscriptions/launchpad/+edit').click() |
273 | 165 | >>> cprov_browser.getControl(name="field.actions.cancel").click() | 171 | >>> cprov_browser.getControl(name="field.actions.cancel").click() |
274 | 166 | 172 | ||
275 | 167 | then the browser is redirected back to the subscriptions page, the canceled | 173 | then the browser is redirected back to the subscriptions page, the canceled |
276 | @@ -169,7 +175,7 @@ | |||
277 | 169 | cancellation is displayed. | 175 | cancellation is displayed. |
278 | 170 | 176 | ||
279 | 171 | >>> print cprov_browser.url | 177 | >>> print cprov_browser.url |
281 | 172 | http://launchpad.dev/~cprov/+archive/ppa/+subscriptions | 178 | http://launchpad.dev/~cprov/+archive/p3a/+subscriptions |
282 | 173 | >>> print_archive_subscriptions(cprov_browser.contents) | 179 | >>> print_archive_subscriptions(cprov_browser.contents) |
283 | 174 | Name Expires Comment | 180 | Name Expires Comment |
284 | 175 | Joe Smith Joe is my friend Edit/Cancel | 181 | Joe Smith Joe is my friend Edit/Cancel |
285 | @@ -177,7 +183,7 @@ | |||
286 | 177 | >>> for msg in get_feedback_messages(cprov_browser.contents): | 183 | >>> for msg in get_feedback_messages(cprov_browser.contents): |
287 | 178 | ... print msg | 184 | ... print msg |
288 | 179 | You have revoked Launchpad Developers's access to PPA | 185 | You have revoked Launchpad Developers's access to PPA |
290 | 180 | for Celso Providelo. | 186 | named p3a for Celso Providelo. |
291 | 181 | 187 | ||
292 | 182 | 188 | ||
293 | 183 | == Story 3: A subscriber activates a subscription == | 189 | == Story 3: A subscriber activates a subscription == |
294 | @@ -197,8 +203,8 @@ | |||
295 | 197 | >>> joe_browser.open("http://launchpad.dev/~joesmith") | 203 | >>> joe_browser.open("http://launchpad.dev/~joesmith") |
296 | 198 | >>> joe_browser.getLink('View your private PPA subscriptions').click() | 204 | >>> joe_browser.getLink('View your private PPA subscriptions').click() |
297 | 199 | >>> print_subscriptions_for_person(joe_browser.contents) | 205 | >>> print_subscriptions_for_person(joe_browser.contents) |
300 | 200 | Archive Owner | 206 | Archive Owner |
301 | 201 | PPA for ... Celso Providelo View | 207 | PPA named ... Celso Providelo View |
302 | 202 | 208 | ||
303 | 203 | When Joe clicks on the View button for Celso's PPA then the | 209 | When Joe clicks on the View button for Celso's PPA then the |
304 | 204 | details of the subscription are displayed with the newly created | 210 | details of the subscription are displayed with the newly created |
305 | @@ -209,12 +215,12 @@ | |||
306 | 209 | >>> print(extract_text(sources_list)) | 215 | >>> print(extract_text(sources_list)) |
307 | 210 | Custom sources.list entries | 216 | Custom sources.list entries |
308 | 211 | ... | 217 | ... |
315 | 212 | deb http://joesmith:...@private-ppa.launchpad.dev/cprov/ppa/ubuntu | 218 | deb http://joesmith:...@private-ppa.launchpad.dev/cprov/p3a/ubuntu |
316 | 213 | YOUR_UBUNTU_VERSION_HERE main #Personal access of Joe Smith | 219 | hoary main #Personal access of Joe Smith |
317 | 214 | to PPA for Celso Providelo | 220 | to PPA named p3a for Celso Providelo |
318 | 215 | deb-src http://joesmith:...@private-ppa.launchpad.dev/cprov/ppa/ubuntu | 221 | deb-src http://joesmith:...@private-ppa.launchpad.dev/cprov/p3a/ubuntu |
319 | 216 | YOUR_UBUNTU_VERSION_HERE main #Personal access of Joe Smith | 222 | hoary main #Personal access of Joe Smith |
320 | 217 | to PPA for Celso Providelo | 223 | to PPA named p3a for Celso Providelo |
321 | 218 | 224 | ||
322 | 219 | When Joe navigates back to his current archive subscriptions then the list of | 225 | When Joe navigates back to his current archive subscriptions then the list of |
323 | 220 | subscriptions reflects the confirmed subscription, providing a normal | 226 | subscriptions reflects the confirmed subscription, providing a normal |
324 | @@ -223,12 +229,12 @@ | |||
325 | 223 | >>> joe_browser.open( | 229 | >>> joe_browser.open( |
326 | 224 | ... "http://launchpad.dev/~joesmith/+archivesubscriptions") | 230 | ... "http://launchpad.dev/~joesmith/+archivesubscriptions") |
327 | 225 | >>> print_subscriptions_for_person(joe_browser.contents) | 231 | >>> print_subscriptions_for_person(joe_browser.contents) |
330 | 226 | Archive Owner | 232 | Archive Owner |
331 | 227 | PPA for ... Celso Providelo View | 233 | PPA named ... Celso Providelo View |
332 | 228 | 234 | ||
333 | 229 | >>> joe_browser.getLink('View').click() | 235 | >>> joe_browser.getLink('View').click() |
334 | 230 | >>> print(extract_text(joe_browser.contents)) | 236 | >>> print(extract_text(joe_browser.contents)) |
336 | 231 | Access to PPA for Celso Providelo... | 237 | Access to PPA named p3a for Celso Providelo... |
337 | 232 | 238 | ||
338 | 233 | === Scenario 2: A user re-generates the token for a subscription === | 239 | === Scenario 2: A user re-generates the token for a subscription === |
339 | 234 | 240 | ||
340 | @@ -254,7 +260,7 @@ | |||
341 | 254 | >>> for msg in get_feedback_messages(joe_browser.contents): | 260 | >>> for msg in get_feedback_messages(joe_browser.contents): |
342 | 255 | ... print msg | 261 | ... print msg |
343 | 256 | Launchpad has generated the new password you requested for your | 262 | Launchpad has generated the new password you requested for your |
345 | 257 | access to the archive PPA for Celso Providelo. Please | 263 | access to the archive PPA named p3a for Celso Providelo. Please |
346 | 258 | follow the instructions below to update your custom "sources.list". | 264 | follow the instructions below to update your custom "sources.list". |
347 | 259 | 265 | ||
348 | 260 | 266 | ||
349 | @@ -268,7 +274,7 @@ | |||
350 | 268 | >>> from lp.registry.interfaces.person import IPersonSet | 274 | >>> from lp.registry.interfaces.person import IPersonSet |
351 | 269 | >>> cprov = getUtility(IPersonSet).getByName('cprov') | 275 | >>> cprov = getUtility(IPersonSet).getByName('cprov') |
352 | 270 | >>> launchpad = getUtility(IPersonSet).getByName('launchpad') | 276 | >>> launchpad = getUtility(IPersonSet).getByName('launchpad') |
354 | 271 | >>> ignore = cprov.archive.newSubscription(launchpad, cprov) | 277 | >>> ignore = private_ppa.newSubscription(launchpad, cprov) |
355 | 272 | >>> logout() | 278 | >>> logout() |
356 | 273 | >>> login('foo.bar@canonical.com') | 279 | >>> login('foo.bar@canonical.com') |
357 | 274 | >>> foobar = getUtility(IPersonSet).getByName('name16') | 280 | >>> foobar = getUtility(IPersonSet).getByName('name16') |
358 | @@ -288,8 +294,8 @@ | |||
359 | 288 | 294 | ||
360 | 289 | >>> mark_browser.getLink('View your private PPA subscriptions').click() | 295 | >>> mark_browser.getLink('View your private PPA subscriptions').click() |
361 | 290 | >>> print_subscriptions_for_person(mark_browser.contents) | 296 | >>> print_subscriptions_for_person(mark_browser.contents) |
364 | 291 | Archive Owner | 297 | Archive Owner |
365 | 292 | PPA for ... Celso Providelo View | 298 | PPA named ... Celso Providelo View |
366 | 293 | 299 | ||
367 | 294 | When Mark clicks on the view button, then he is taken to the page for | 300 | When Mark clicks on the view button, then he is taken to the page for |
368 | 295 | his personal subscription for Celso's private PPA and the newly-created | 301 | his personal subscription for Celso's private PPA and the newly-created |
369 | @@ -300,12 +306,12 @@ | |||
370 | 300 | >>> print(extract_text(sources_list)) | 306 | >>> print(extract_text(sources_list)) |
371 | 301 | Custom sources.list entries | 307 | Custom sources.list entries |
372 | 302 | ... | 308 | ... |
379 | 303 | deb http://mark:...@private-ppa.launchpad.dev/cprov/ppa/ubuntu | 309 | deb http://mark:...@private-ppa.launchpad.dev/cprov/p3a/ubuntu |
380 | 304 | YOUR_UBUNTU_VERSION_HERE main #Personal access of | 310 | hoary main #Personal access of |
381 | 305 | Mark Shuttleworth to PPA for Celso Providelo | 311 | Mark Shuttleworth to PPA named p3a for Celso Providelo |
382 | 306 | deb-src http://mark:...@private-ppa.launchpad.dev/cprov/ppa/ubuntu | 312 | deb-src http://mark:...@private-ppa.launchpad.dev/cprov/p3a/ubuntu |
383 | 307 | YOUR_UBUNTU_VERSION_HERE main #Personal access of | 313 | hoary main #Personal access of |
384 | 308 | Mark Shuttleworth to PPA for Celso Providelo | 314 | Mark Shuttleworth to PPA named p3a for Celso Providelo |
385 | 309 | 315 | ||
386 | 310 | When Mark navigates back to his current archive subscriptions then the list of | 316 | When Mark navigates back to his current archive subscriptions then the list of |
387 | 311 | subscriptions reflects the confirmed subscription, providing a normal | 317 | subscriptions reflects the confirmed subscription, providing a normal |
388 | @@ -314,12 +320,12 @@ | |||
389 | 314 | >>> mark_browser.open( | 320 | >>> mark_browser.open( |
390 | 315 | ... "http://launchpad.dev/~mark/+archivesubscriptions") | 321 | ... "http://launchpad.dev/~mark/+archivesubscriptions") |
391 | 316 | >>> print_subscriptions_for_person(mark_browser.contents) | 322 | >>> print_subscriptions_for_person(mark_browser.contents) |
394 | 317 | Archive Owner | 323 | Archive Owner |
395 | 318 | PPA for ... Celso Providelo View | 324 | PPA named ... Celso Providelo View |
396 | 319 | 325 | ||
397 | 320 | >>> mark_browser.getLink('View').click() | 326 | >>> mark_browser.getLink('View').click() |
398 | 321 | >>> print(extract_text(mark_browser.contents)) | 327 | >>> print(extract_text(mark_browser.contents)) |
400 | 322 | Access to PPA for Celso Providelo... | 328 | Access to PPA named p3a for Celso Providelo... |
401 | 323 | 329 | ||
402 | 324 | 330 | ||
403 | 325 | == Story 4: A user's subscription expires or is cancelled == | 331 | == Story 4: A user's subscription expires or is cancelled == |
404 | 326 | 332 | ||
405 | === modified file 'lib/lp/soyuz/stories/ppa/xx-private-ppa-subscriptions.txt' | |||
406 | --- lib/lp/soyuz/stories/ppa/xx-private-ppa-subscriptions.txt 2010-02-11 13:15:30 +0000 | |||
407 | +++ lib/lp/soyuz/stories/ppa/xx-private-ppa-subscriptions.txt 2010-02-26 15:48:21 +0000 | |||
408 | @@ -28,22 +28,24 @@ | |||
409 | 28 | ... print msg | 28 | ... print msg |
410 | 29 | Only private archives can have subscribers. | 29 | Only private archives can have subscribers. |
411 | 30 | 30 | ||
413 | 31 | Setup both cprov's and mark's PPAs as a private one: | 31 | Setup private PPAs for both Celso and Mark: |
414 | 32 | 32 | ||
425 | 33 | >>> admin_browser.open("http://launchpad.dev/~cprov/+archive/ppa") | 33 | >>> from zope.component import getUtility |
426 | 34 | >>> admin_browser.getLink("Administer archive").click() | 34 | >>> from lp.registry.interfaces.person import IPersonSet |
427 | 35 | >>> admin_browser.getControl(name="field.private").value = True | 35 | >>> login('admin@canonical.com') |
428 | 36 | >>> admin_browser.getControl(name="field.buildd_secret").value = "secret" | 36 | >>> cprov = getUtility(IPersonSet).getByName('cprov') |
429 | 37 | >>> admin_browser.getControl("Save").click() | 37 | >>> mark = getUtility(IPersonSet).getByName('mark') |
430 | 38 | >>> admin_browser.open("http://launchpad.dev/~mark/+archive/ppa") | 38 | >>> from lp.registry.interfaces.distribution import IDistributionSet |
431 | 39 | >>> admin_browser.getLink("Administer archive").click() | 39 | >>> ubuntu = getUtility(IDistributionSet).getByName('ubuntu') |
432 | 40 | >>> admin_browser.getControl(name="field.private").value = True | 40 | >>> cprov_private_ppa = factory.makeArchive( |
433 | 41 | >>> admin_browser.getControl(name="field.buildd_secret").value = "secret" | 41 | ... owner=cprov, name="p3a", distribution=ubuntu, private=True) |
434 | 42 | >>> admin_browser.getControl("Save").click() | 42 | >>> mark_private_ppa = factory.makeArchive( |
435 | 43 | ... owner=mark, name="p3a", distribution=ubuntu, private=True) | ||
436 | 44 | >>> logout() | ||
437 | 43 | 45 | ||
438 | 44 | The PPA page includes a link to manage subscriptions: | 46 | The PPA page includes a link to manage subscriptions: |
439 | 45 | 47 | ||
441 | 46 | >>> cprov_browser.open("http://launchpad.dev/~cprov/+archive/ppa") | 48 | >>> cprov_browser.open("http://launchpad.dev/~cprov/+archive/p3a") |
442 | 47 | >>> cprov_browser.getLink("Manage access").click() | 49 | >>> cprov_browser.getLink("Manage access").click() |
443 | 48 | 50 | ||
444 | 49 | The page includes the required dependencies for the yui2-based date | 51 | The page includes the required dependencies for the yui2-based date |
445 | @@ -62,7 +64,7 @@ | |||
446 | 62 | 64 | ||
447 | 63 | >>> main_content = find_main_content(cprov_browser.contents) | 65 | >>> main_content = find_main_content(cprov_browser.contents) |
448 | 64 | >>> print extract_text(main_content.find('h1')) | 66 | >>> print extract_text(main_content.find('h1')) |
450 | 65 | Manage access to PPA for Celso Providelo | 67 | Manage access to PPA named p3a for Celso Providelo |
451 | 66 | 68 | ||
452 | 67 | >>> print extract_text(find_tag_by_id(cprov_browser.contents, | 69 | >>> print extract_text(find_tag_by_id(cprov_browser.contents, |
453 | 68 | ... 'no-subscribers')) | 70 | ... 'no-subscribers')) |
454 | @@ -123,7 +125,7 @@ | |||
455 | 123 | 125 | ||
456 | 124 | >>> mark_browser = setupBrowser( | 126 | >>> mark_browser = setupBrowser( |
457 | 125 | ... auth="Basic mark@example.com:test") | 127 | ... auth="Basic mark@example.com:test") |
459 | 126 | >>> mark_browser.open("http://launchpad.dev/~mark/+archive/ppa/+subscriptions") | 128 | >>> mark_browser.open("http://launchpad.dev/~mark/+archive/p3a/+subscriptions") |
460 | 127 | >>> mark_browser.getControl(name='field.subscriber').value = 'joesmith' | 129 | >>> mark_browser.getControl(name='field.subscriber').value = 'joesmith' |
461 | 128 | >>> mark_browser.getControl( | 130 | >>> mark_browser.getControl( |
462 | 129 | ... name='field.description').value = "Joe is also my friend" | 131 | ... name='field.description').value = "Joe is also my friend" |
463 | @@ -138,9 +140,9 @@ | |||
464 | 138 | >>> for row in find_tags_by_class(joe_browser.contents, | 140 | >>> for row in find_tags_by_class(joe_browser.contents, |
465 | 139 | ... 'archive-subscription-row'): | 141 | ... 'archive-subscription-row'): |
466 | 140 | ... print extract_text(row) | 142 | ... print extract_text(row) |
470 | 141 | Archive Owner | 143 | Archive Owner |
471 | 142 | PPA for Mark Shuttleworth (ppa:mark/ppa) Mark Shuttleworth View | 144 | PPA named... (ppa:mark/p3a) Mark Shuttleworth View |
472 | 143 | PPA for Celso Providelo (ppa:cprov/ppa) Celso Providelo View | 145 | PPA named... (ppa:cprov/p3a) Celso Providelo View |
473 | 144 | 146 | ||
474 | 145 | == Confirming a subscription == | 147 | == Confirming a subscription == |
475 | 146 | 148 | ||
476 | @@ -153,12 +155,12 @@ | |||
477 | 153 | >>> print(extract_text(sources_list)) | 155 | >>> print(extract_text(sources_list)) |
478 | 154 | Custom sources.list entries | 156 | Custom sources.list entries |
479 | 155 | ... | 157 | ... |
486 | 156 | deb http://joesmith:...@private-ppa.launchpad.dev/mark/ppa/ubuntu | 158 | deb http://joesmith:...@private-ppa.launchpad.dev/mark/p3a/ubuntu |
487 | 157 | breezy-autotest main #Personal access of Joe Smith | 159 | hoary main #Personal access of Joe Smith |
488 | 158 | to PPA for Mark Shuttleworth | 160 | to PPA named p3a for Mark Shuttleworth |
489 | 159 | deb-src http://joesmith:...@private-ppa.launchpad.dev/mark/ppa/ubuntu | 161 | deb-src http://joesmith:...@private-ppa.launchpad.dev/mark/p3a/ubuntu |
490 | 160 | breezy-autotest main #Personal access of Joe Smith | 162 | hoary main #Personal access of Joe Smith |
491 | 161 | to PPA for Mark Shuttleworth | 163 | to PPA named p3a for Mark Shuttleworth |
492 | 162 | 164 | ||
493 | 163 | This page will include information about the signing key, if the archive | 165 | This page will include information about the signing key, if the archive |
494 | 164 | has a signing key: | 166 | has a signing key: |
495 | @@ -169,7 +171,7 @@ | |||
496 | 169 | >>> login('foo.bar@canonical.com') | 171 | >>> login('foo.bar@canonical.com') |
497 | 170 | >>> mark = getUtility(IPersonSet).getByName('mark') | 172 | >>> mark = getUtility(IPersonSet).getByName('mark') |
498 | 171 | >>> a_key = getUtility(IGPGKeySet).get(1) | 173 | >>> a_key = getUtility(IGPGKeySet).get(1) |
500 | 172 | >>> mark.archive.signing_key = a_key | 174 | >>> mark_private_ppa.signing_key = a_key |
501 | 173 | >>> logout() | 175 | >>> logout() |
502 | 174 | 176 | ||
503 | 175 | >>> joe_browser.reload() | 177 | >>> joe_browser.reload() |
504 | @@ -177,11 +179,11 @@ | |||
505 | 177 | >>> print(extract_text(sources_list)) | 179 | >>> print(extract_text(sources_list)) |
506 | 178 | Custom sources.list entries | 180 | Custom sources.list entries |
507 | 179 | ... | 181 | ... |
514 | 180 | deb http://joesmith:...@private-ppa.launchpad.dev/mark/ppa/ubuntu | 182 | deb http://joesmith:...@private-ppa.launchpad.dev/mark/p3a/ubuntu |
515 | 181 | breezy-autotest main #Personal access of Joe Smith | 183 | hoary main #Personal access of Joe Smith |
516 | 182 | to PPA for Mark Shuttleworth | 184 | to PPA named p3a for Mark Shuttleworth |
517 | 183 | deb-src http://joesmith:...@private-ppa.launchpad.dev/mark/ppa/ubuntu | 185 | deb-src http://joesmith:...@private-ppa.launchpad.dev/mark/p3a/ubuntu |
518 | 184 | breezy-autotest main #Personal access of Joe Smith | 186 | hoary main #Personal access of Joe Smith |
519 | 185 | to PPA for Mark Shuttleworth | 187 | to PPA named p3a for Mark Shuttleworth |
520 | 186 | This repository is signed ... | 188 | This repository is signed ... |
521 | 187 | 189 | ||
522 | 188 | 190 | ||
523 | === modified file 'lib/lp/soyuz/stories/ppa/xx-private-ppas.txt' | |||
524 | --- lib/lp/soyuz/stories/ppa/xx-private-ppas.txt 2009-09-16 22:57:42 +0000 | |||
525 | +++ lib/lp/soyuz/stories/ppa/xx-private-ppas.txt 2010-02-26 15:48:21 +0000 | |||
526 | @@ -16,15 +16,17 @@ | |||
527 | 16 | 16 | ||
528 | 17 | == Set Up a Private PPA == | 17 | == Set Up a Private PPA == |
529 | 18 | 18 | ||
539 | 19 | Let's make "cprov's" PPA private. To do this we need to be an | 19 | First we'll create a private PPA for Celso. |
540 | 20 | admin, and go to his admin page. | 20 | |
541 | 21 | 21 | >>> from zope.component import getUtility | |
542 | 22 | >>> admin_browser.open("http://launchpad.dev/~cprov/+archive") | 22 | >>> from lp.registry.interfaces.person import IPersonSet |
543 | 23 | >>> admin_browser.getLink("Administer archive").click() | 23 | >>> login('admin@canonical.com') |
544 | 24 | >>> admin_browser.getControl(name="field.private").value = True | 24 | >>> cprov = getUtility(IPersonSet).getByName('cprov') |
545 | 25 | >>> admin_browser.getControl(name="field.buildd_secret").value = "secret" | 25 | >>> from lp.registry.interfaces.distribution import IDistributionSet |
546 | 26 | >>> admin_browser.getControl("Save").click() | 26 | >>> ubuntu = getUtility(IDistributionSet).getByName('ubuntu') |
547 | 27 | 27 | >>> cprov_private_ppa = factory.makeArchive( | |
548 | 28 | ... owner=cprov, name="p3a", distribution=ubuntu, private=True) | ||
549 | 29 | >>> logout() | ||
550 | 28 | 30 | ||
551 | 29 | == PPA Listing Page == | 31 | == PPA Listing Page == |
552 | 30 | 32 | ||
553 | @@ -35,6 +37,7 @@ | |||
554 | 35 | >>> browser.getControl(name="show_inactive").value = True | 37 | >>> browser.getControl(name="show_inactive").value = True |
555 | 36 | >>> browser.getControl('Search', index=0).click() | 38 | >>> browser.getControl('Search', index=0).click() |
556 | 37 | >>> list_ppas_in_browser_page(browser) | 39 | >>> list_ppas_in_browser_page(browser) |
557 | 40 | PPA for Celso Providelo... | ||
558 | 38 | PPA for Mark Shuttleworth... | 41 | PPA for Mark Shuttleworth... |
559 | 39 | PPA for No Privileges Person... | 42 | PPA for No Privileges Person... |
560 | 40 | 43 | ||
561 | @@ -46,6 +49,7 @@ | |||
562 | 46 | >>> cprov_browser.getControl(name="show_inactive").value = True | 49 | >>> cprov_browser.getControl(name="show_inactive").value = True |
563 | 47 | >>> cprov_browser.getControl('Search', index=0).click() | 50 | >>> cprov_browser.getControl('Search', index=0).click() |
564 | 48 | >>> list_ppas_in_browser_page(cprov_browser) | 51 | >>> list_ppas_in_browser_page(cprov_browser) |
565 | 52 | PPA named p3a for Celso Providelo... | ||
566 | 49 | PPA for Celso Providelo... | 53 | PPA for Celso Providelo... |
567 | 50 | PPA for Mark Shuttleworth... | 54 | PPA for Mark Shuttleworth... |
568 | 51 | PPA for No Privileges Person... | 55 | PPA for No Privileges Person... |
569 | @@ -75,6 +79,7 @@ | |||
570 | 75 | >>> name12_browser.getControl(name="show_inactive").value = True | 79 | >>> name12_browser.getControl(name="show_inactive").value = True |
571 | 76 | >>> name12_browser.getControl('Search', index=0).click() | 80 | >>> name12_browser.getControl('Search', index=0).click() |
572 | 77 | >>> list_ppas_in_browser_page(name12_browser) | 81 | >>> list_ppas_in_browser_page(name12_browser) |
573 | 82 | PPA for Celso Providelo... | ||
574 | 78 | PPA for Landscape Developers... | 83 | PPA for Landscape Developers... |
575 | 79 | PPA for Mark Shuttleworth... | 84 | PPA for Mark Shuttleworth... |
576 | 80 | PPA for No Privileges Person... | 85 | PPA for No Privileges Person... |
577 | @@ -95,7 +100,7 @@ | |||
578 | 95 | 100 | ||
579 | 96 | A non-privileged user cannot access the private PPA pages. | 101 | A non-privileged user cannot access the private PPA pages. |
580 | 97 | 102 | ||
582 | 98 | >>> browser.open("http://launchpad.dev/~cprov/+archive") | 103 | >>> browser.open("http://launchpad.dev/~cprov/+archive/p3a") |
583 | 99 | Traceback (most recent call last): | 104 | Traceback (most recent call last): |
584 | 100 | ... | 105 | ... |
585 | 101 | Unauthorized... | 106 | Unauthorized... |
586 | @@ -111,13 +116,14 @@ | |||
587 | 111 | >>> cprov_browser.open("http://launchpad.dev/~cprov/") | 116 | >>> cprov_browser.open("http://launchpad.dev/~cprov/") |
588 | 112 | >>> print_tag_with_id(cprov_browser.contents, 'ppas') | 117 | >>> print_tag_with_id(cprov_browser.contents, 'ppas') |
589 | 113 | Personal package archives | 118 | Personal package archives |
590 | 119 | PPA named p3a for Celso Providelo | ||
591 | 114 | PPA for Celso Providelo | 120 | PPA for Celso Providelo |
592 | 115 | Create a new PPA | 121 | Create a new PPA |
593 | 116 | 122 | ||
595 | 117 | >>> cprov_browser.getLink("PPA for Celso Providelo").click() | 123 | >>> cprov_browser.getLink("PPA named p3a for Celso Providelo").click() |
596 | 118 | 124 | ||
597 | 119 | >>> print cprov_browser.title | 125 | >>> print cprov_browser.title |
599 | 120 | PPA for Celso Providelo : Celso Providelo | 126 | PPA named p3a for Celso Providelo : Celso Providelo |
600 | 121 | 127 | ||
601 | 122 | When a non-privileged user browses to a profile page for a person or | 128 | When a non-privileged user browses to a profile page for a person or |
602 | 123 | team that has a private PPA for which he is not authorised to see, the | 129 | team that has a private PPA for which he is not authorised to see, the |
603 | @@ -149,9 +155,9 @@ | |||
604 | 149 | Administrators can access all private PPAs. | 155 | Administrators can access all private PPAs. |
605 | 150 | 156 | ||
606 | 151 | >>> admin_browser.open("http://launchpad.dev/~cprov") | 157 | >>> admin_browser.open("http://launchpad.dev/~cprov") |
608 | 152 | >>> admin_browser.getLink("PPA for Celso Providelo").click() | 158 | >>> admin_browser.getLink("PPA named p3a for Celso Providelo").click() |
609 | 153 | >>> admin_browser.url | 159 | >>> admin_browser.url |
611 | 154 | 'http://launchpad.dev/~cprov/+archive/ppa' | 160 | 'http://launchpad.dev/~cprov/+archive/p3a' |
612 | 155 | 161 | ||
613 | 156 | >>> admin_browser.open("http://launchpad.dev/~landscape-developers") | 162 | >>> admin_browser.open("http://launchpad.dev/~landscape-developers") |
614 | 157 | >>> admin_browser.getLink("PPA for Landscape Developers").click() | 163 | >>> admin_browser.getLink("PPA for Landscape Developers").click() |
615 | 158 | 164 | ||
616 | === modified file 'lib/lp/soyuz/stories/soyuz/xx-person-packages.txt' | |||
617 | --- lib/lp/soyuz/stories/soyuz/xx-person-packages.txt 2009-11-09 17:08:21 +0000 | |||
618 | +++ lib/lp/soyuz/stories/soyuz/xx-person-packages.txt 2010-02-26 15:48:21 +0000 | |||
619 | @@ -169,15 +169,6 @@ | |||
620 | 169 | ... for row in rows: | 169 | ... for row in rows: |
621 | 170 | ... print extract_text(row) | 170 | ... print extract_text(row) |
622 | 171 | 171 | ||
623 | 172 | And another helper function to set the private flag on a PPA: | ||
624 | 173 | |||
625 | 174 | >>> def set_private(name, private=True): | ||
626 | 175 | ... admin_browser.open("http://launchpad.dev/~%s/+archive/ppa" % ( | ||
627 | 176 | ... name)) | ||
628 | 177 | ... admin_browser.getLink("Administer archive").click() | ||
629 | 178 | ... admin_browser.getControl(name="field.private").value = private | ||
630 | 179 | ... admin_browser.getControl(name="field.buildd_secret").value = "x" | ||
631 | 180 | ... admin_browser.getControl("Save").click() | ||
632 | 181 | 172 | ||
633 | 182 | Create some new source packages, source1 and source2, both created by cprov | 173 | Create some new source packages, source1 and source2, both created by cprov |
634 | 183 | so that they appear in his +packages page. | 174 | so that they appear in his +packages page. |
635 | @@ -186,6 +177,7 @@ | |||
636 | 186 | >>> from canonical.launchpad.ftests import login, logout | 177 | >>> from canonical.launchpad.ftests import login, logout |
637 | 187 | >>> from canonical.database.sqlbase import flush_database_updates | 178 | >>> from canonical.database.sqlbase import flush_database_updates |
638 | 188 | >>> from canonical.launchpad.interfaces import IPersonSet | 179 | >>> from canonical.launchpad.interfaces import IPersonSet |
639 | 180 | >>> from lp.registry.interfaces.distribution import IDistributionSet | ||
640 | 189 | >>> from lp.soyuz.tests.test_publishing import ( | 181 | >>> from lp.soyuz.tests.test_publishing import ( |
641 | 190 | ... SoyuzTestPublisher) | 182 | ... SoyuzTestPublisher) |
642 | 191 | >>> from lp.soyuz.interfaces.publishing import ( | 183 | >>> from lp.soyuz.interfaces.publishing import ( |
643 | @@ -194,6 +186,9 @@ | |||
644 | 194 | >>> login("foo.bar@canonical.com") | 186 | >>> login("foo.bar@canonical.com") |
645 | 195 | >>> cprov = getUtility(IPersonSet).getByName('cprov') | 187 | >>> cprov = getUtility(IPersonSet).getByName('cprov') |
646 | 196 | >>> nopriv = getUtility(IPersonSet).getByName('no-priv') | 188 | >>> nopriv = getUtility(IPersonSet).getByName('no-priv') |
647 | 189 | >>> ubuntu = getUtility(IDistributionSet).getByName('ubuntu') | ||
648 | 190 | >>> nopriv_private_ppa = factory.makeArchive( | ||
649 | 191 | ... owner=nopriv, name="p3a", distribution=ubuntu, private=True) | ||
650 | 197 | >>> mark = getUtility(IPersonSet).getByName('mark') | 192 | >>> mark = getUtility(IPersonSet).getByName('mark') |
651 | 198 | >>> test_publisher = SoyuzTestPublisher() | 193 | >>> test_publisher = SoyuzTestPublisher() |
652 | 199 | >>> test_publisher.prepareBreezyAutotest() | 194 | >>> test_publisher.prepareBreezyAutotest() |
653 | @@ -207,14 +202,14 @@ | |||
654 | 207 | >>> source2 = test_publisher.getPubSource( | 202 | >>> source2 = test_publisher.getPubSource( |
655 | 208 | ... status=PackagePublishingStatus.PUBLISHED, | 203 | ... status=PackagePublishingStatus.PUBLISHED, |
656 | 209 | ... sourcename='source2', | 204 | ... sourcename='source2', |
658 | 210 | ... archive=nopriv.archive) | 205 | ... archive=nopriv_private_ppa) |
659 | 211 | >>> source2.sourcepackagerelease.creator=cprov | 206 | >>> source2.sourcepackagerelease.creator=cprov |
660 | 212 | 207 | ||
661 | 213 | >>> flush_database_updates() | 208 | >>> flush_database_updates() |
662 | 214 | >>> logout() | 209 | >>> logout() |
663 | 215 | 210 | ||
664 | 216 | "source1" is now published in cprov and mark's PPA. "source2" is only | 211 | "source1" is now published in cprov and mark's PPA. "source2" is only |
666 | 217 | published in no-priv's PPA. | 212 | published in no-priv's Private PPA. |
667 | 218 | 213 | ||
668 | 219 | Make user_browser a known user that does not conflict with "no-priv": | 214 | Make user_browser a known user that does not conflict with "no-priv": |
669 | 220 | 215 | ||
670 | @@ -222,23 +217,14 @@ | |||
671 | 222 | 217 | ||
672 | 223 | === Cprov's +related-software page === | 218 | === Cprov's +related-software page === |
673 | 224 | 219 | ||
691 | 225 | So let's look at cprov's +related-software page which has two entries in | 220 | For unprivileged users, cprov's displayed PPA packages only display |
692 | 226 | the PPA section: | 221 | the one in his own public PPA because source2 is only published |
693 | 227 | 222 | in the private PPA of the "no-priv" user. | |
694 | 228 | >>> user_browser.open("http://launchpad.dev/~cprov/+related-software") | 223 | |
695 | 229 | >>> print_ppa_rows(user_browser) | 224 | XXX Michael Nelson 2010-02-26 bug=394276: The following should be |
696 | 230 | source1 PPA for Celso Providelo - Ubuntutest Breezy-autotest 666 | 225 | a view test of PersonPPAPAckagesView.filterPPAPackageList(). They |
697 | 231 | ...ago None - - | 226 | are not always testing what we think they are, as the lines match |
698 | 232 | source2 PPA for No Privileges Person - Ubuntutest Breezy-autotest 666 | 227 | more packages than intended. |
682 | 233 | ...ago None - - | ||
683 | 234 | |||
684 | 235 | Now, let's make the PPA for "No Privileges Person" private: | ||
685 | 236 | |||
686 | 237 | >>> set_private("no-priv") | ||
687 | 238 | |||
688 | 239 | For unprivileged users, cprov's displayed PPA packages are now reduced | ||
689 | 240 | to the one in his own PPA because the other iceweasel is only published | ||
690 | 241 | in the newly-private PPA of the "no-priv" user. | ||
699 | 242 | 228 | ||
700 | 243 | The logged-in user's case: | 229 | The logged-in user's case: |
701 | 244 | 230 | ||
702 | @@ -262,20 +248,26 @@ | |||
703 | 262 | >>> print_ppa_rows(nopriv_browser) | 248 | >>> print_ppa_rows(nopriv_browser) |
704 | 263 | source1 PPA for Celso Providelo - Ubuntutest Breezy-autotest 666 | 249 | source1 PPA for Celso Providelo - Ubuntutest Breezy-autotest 666 |
705 | 264 | ...ago None - - | 250 | ...ago None - - |
707 | 265 | source2 PPA for No Priv... Person - Ubuntutest Breezy-autotest 666 | 251 | source2 PPA named p3a for No Priv... Ubuntutest Breezy-autotest 666 |
708 | 266 | ...ago None - - | 252 | ...ago None - - |
709 | 267 | 253 | ||
710 | 268 | >>> admin_browser.open("http://launchpad.dev/~cprov/+related-software") | 254 | >>> admin_browser.open("http://launchpad.dev/~cprov/+related-software") |
711 | 269 | >>> print_ppa_rows(admin_browser) | 255 | >>> print_ppa_rows(admin_browser) |
712 | 270 | source1 PPA for Celso Providelo - Ubuntutest Breezy-autotest 666 | 256 | source1 PPA for Celso Providelo - Ubuntutest Breezy-autotest 666 |
713 | 271 | ...ago None - - | 257 | ...ago None - - |
715 | 272 | source2 PPA for No Priv... Person - Ubuntutest Breezy-autotest 666 | 258 | source2 PPA named p3a for No Priv... Ubuntutest Breezy-autotest 666 |
716 | 273 | ...ago None - - | 259 | ...ago None - - |
717 | 274 | 260 | ||
722 | 275 | Let's make mark's archive private and view the page again. | 261 | Let's move the publication of source1 from mark's public archive to his |
723 | 276 | 262 | private one and the view the page again. | |
724 | 277 | >>> set_private("mark") | 263 | |
725 | 278 | 264 | >>> login('admin@canonical.com') | |
726 | 265 | >>> mark_private_ppa = factory.makeArchive( | ||
727 | 266 | ... owner=mark, name="p3a", distribution=ubuntu, private=True) | ||
728 | 267 | >>> from zope.security.proxy import removeSecurityProxy | ||
729 | 268 | >>> removeSecurityProxy(source1_mark.secure_record).archive = ( | ||
730 | 269 | ... mark_private_ppa) | ||
731 | 270 | >>> logout() | ||
732 | 279 | >>> user_browser.open("http://launchpad.dev/~cprov/+related-software") | 271 | >>> user_browser.open("http://launchpad.dev/~cprov/+related-software") |
733 | 280 | >>> print_ppa_rows(user_browser) | 272 | >>> print_ppa_rows(user_browser) |
734 | 281 | source1 PPA for Celso Providelo - Ubuntutest Breezy-autotest 666 | 273 | source1 PPA for Celso Providelo - Ubuntutest Breezy-autotest 666 |
735 | @@ -286,13 +278,20 @@ | |||
736 | 286 | source1 PPA for Celso Providelo - Ubuntutest Breezy-autotest 666 | 278 | source1 PPA for Celso Providelo - Ubuntutest Breezy-autotest 666 |
737 | 287 | ...ago None - - | 279 | ...ago None - - |
738 | 288 | 280 | ||
746 | 289 | Notice that the source1 package in mark's PPA is still appearing | 281 | Notice that the source1 package is still appearing because it is also |
747 | 290 | because it is also published in some non-private archives, which | 282 | published in some non-private archives, which override the private nature |
748 | 291 | override the private nature of mark's archive. | 283 | of mark's archive. |
749 | 292 | 284 | ||
750 | 293 | Let's make cprov's archive private: | 285 | Let's move the publication of source1 from cprov's public archive to |
751 | 294 | 286 | his private one: | |
752 | 295 | >>> set_private("cprov") | 287 | |
753 | 288 | >>> login('admin@canonical.com') | ||
754 | 289 | >>> cprov_private_ppa = factory.makeArchive( | ||
755 | 290 | ... owner=cprov, name="p3a", distribution=ubuntu, private=True) | ||
756 | 291 | >>> removeSecurityProxy(source1.secure_record).archive = ( | ||
757 | 292 | ... cprov_private_ppa) | ||
758 | 293 | >>> source1.sourcepackagerelease.upload_archive = cprov_private_ppa | ||
759 | 294 | >>> logout() | ||
760 | 296 | 295 | ||
761 | 297 | It will now disppear from the listings because it's not published in any | 296 | It will now disppear from the listings because it's not published in any |
762 | 298 | public archives. | 297 | public archives. |
763 | @@ -320,12 +319,12 @@ | |||
764 | 320 | 319 | ||
765 | 321 | >>> user_browser.open("http://launchpad.dev/~cprov/+related-software") | 320 | >>> user_browser.open("http://launchpad.dev/~cprov/+related-software") |
766 | 322 | >>> print_ppa_rows(user_browser) | 321 | >>> print_ppa_rows(user_browser) |
768 | 323 | source1 PPA for Celso Providelo - Ubuntutest Breezy-autotest 666 | 322 | source1 PPA named p3a for Celso... - Ubuntutest Breezy-autotest 666 |
769 | 324 | ...ago None - - | 323 | ...ago None - - |
770 | 325 | 324 | ||
771 | 326 | >>> anon_browser.open("http://launchpad.dev/~cprov/+related-software") | 325 | >>> anon_browser.open("http://launchpad.dev/~cprov/+related-software") |
772 | 327 | >>> print_ppa_rows(anon_browser) | 326 | >>> print_ppa_rows(anon_browser) |
774 | 328 | source1 PPA for Celso Providelo - Ubuntutest Breezy-autotest 666 | 327 | source1 PPA named p3a for Celso... - Ubuntutest Breezy-autotest 666 |
775 | 329 | ...ago None - - | 328 | ...ago None - - |
776 | 330 | 329 | ||
777 | 331 | Even after the package is superseded, the package remains visibile in | 330 | Even after the package is superseded, the package remains visibile in |
778 | @@ -338,12 +337,12 @@ | |||
779 | 338 | 337 | ||
780 | 339 | >>> user_browser.open("http://launchpad.dev/~cprov/+related-software") | 338 | >>> user_browser.open("http://launchpad.dev/~cprov/+related-software") |
781 | 340 | >>> print_ppa_rows(user_browser) | 339 | >>> print_ppa_rows(user_browser) |
783 | 341 | source1 PPA for Celso Providelo - Ubuntutest Breezy-autotest 666 | 340 | source1 PPA named p3a for Celso... - Ubuntutest Breezy-autotest 666 |
784 | 342 | ...ago None - - | 341 | ...ago None - - |
785 | 343 | 342 | ||
786 | 344 | >>> anon_browser.open("http://launchpad.dev/~cprov/+related-software") | 343 | >>> anon_browser.open("http://launchpad.dev/~cprov/+related-software") |
787 | 345 | >>> print_ppa_rows(anon_browser) | 344 | >>> print_ppa_rows(anon_browser) |
789 | 346 | source1 PPA for Celso Providelo - Ubuntutest Breezy-autotest 666 | 345 | source1 PPA named p3a for Celso... - Ubuntutest Breezy-autotest 666 |
790 | 347 | ...ago None - - | 346 | ...ago None - - |
791 | 348 | 347 | ||
792 | 349 | 348 | ||
793 | @@ -358,15 +357,15 @@ | |||
794 | 358 | 357 | ||
795 | 359 | >>> admin_browser.open("http://launchpad.dev/~cprov/+related-software") | 358 | >>> admin_browser.open("http://launchpad.dev/~cprov/+related-software") |
796 | 360 | >>> print_ppa_rows(admin_browser) | 359 | >>> print_ppa_rows(admin_browser) |
798 | 361 | source1 PPA for Celso Providelo - Ubuntutest Breezy-autotest 666 | 360 | source1 PPA named p3a for Celso... - Ubuntutest Breezy-autotest 666 |
799 | 362 | ...ago None - - | 361 | ...ago None - - |
801 | 363 | source2 PPA for No Priv... Person - Ubuntutest Breezy-autotest 666 | 362 | source2 PPA named p3a for No Priv... - Ubuntutest Breezy-autotest 666 |
802 | 364 | ...ago None - - | 363 | ...ago None - - |
803 | 365 | 364 | ||
804 | 366 | Then delete the 'source2' package. | 365 | Then delete the 'source2' package. |
805 | 367 | 366 | ||
806 | 368 | >>> admin_browser.open( | 367 | >>> admin_browser.open( |
808 | 369 | ... "http://launchpad.dev/~no-priv/+archive/ppa/+delete-packages") | 368 | ... "http://launchpad.dev/~no-priv/+archive/p3a/+delete-packages") |
809 | 370 | >>> admin_browser.getControl( | 369 | >>> admin_browser.getControl( |
810 | 371 | ... name='field.selected_sources').value = ['%s' % source2.id] | 370 | ... name='field.selected_sources').value = ['%s' % source2.id] |
811 | 372 | >>> admin_browser.getControl( | 371 | >>> admin_browser.getControl( |
812 | @@ -394,8 +393,8 @@ | |||
813 | 394 | 393 | ||
814 | 395 | >>> admin_browser.open("http://launchpad.dev/~cprov/+related-software") | 394 | >>> admin_browser.open("http://launchpad.dev/~cprov/+related-software") |
815 | 396 | >>> print_ppa_rows(admin_browser) | 395 | >>> print_ppa_rows(admin_browser) |
817 | 397 | source1 PPA for Celso Providelo - Ubuntutest Breezy-autotest 666 | 396 | source1 PPA named p3a for Celso... - Ubuntutest Breezy-autotest 666 |
818 | 398 | ...ago None - - | 397 | ...ago None - - |
820 | 399 | source2 PPA for No Priv... Person - Ubuntutest Breezy-autotest 666 | 398 | source2 PPA named p3a for No Priv... - Ubuntutest Breezy-autotest 666 |
821 | 400 | ...ago None - - | 399 | ...ago None - - |
822 | 401 | 400 |
This is the fifth branch in a series to refactor soyuz tests after fixing bug 506203.
The MP for the branch that actually fixed the bug is at:
https:/ /code.edge. launchpad. net/~michael. nelson/ launchpad/ 506203- ppa-privatisati on-check/ +merge/ 19415
The original fix ensures that the privacy of a PPA cannot be altered once it has packages published. Unfortunately most of our test infrastructure does exactly that (switches the privacy to do a few tests and then switches it back).
The complete test breakages are as follows: pastebin. ubuntu. com/378292/
http://
This branch fixes:
bin/test -vv -t xx-ppa-packages -t xx-private- ppa-presentatio n.txt -t xx-private- ppa-subscriptio n-stories. txt -t xx-private- ppa-subscriptio ns.txt -t xx-private-ppas.txt -t xx-person- packages. txt
Thanks.