Merge ~pappacena/launchpad:renaming-archive-signing-key into launchpad:master
- Git
- lp:~pappacena/launchpad
- renaming-archive-signing-key
- Merge into master
Proposed by
Thiago F. Pappacena
Status: | Merged |
---|---|
Approved by: | Thiago F. Pappacena |
Approved revision: | 3127948bdb7e32e06bbcc2113345439b6ef8bba3 |
Merge reported by: | Otto Co-Pilot |
Merged at revision: | not available |
Proposed branch: | ~pappacena/launchpad:renaming-archive-signing-key |
Merge into: | launchpad:master |
Diff against target: |
590 lines (+77/-75) 18 files modified
lib/lp/archivepublisher/archivegpgsigningkey.py (+11/-11) lib/lp/archivepublisher/configure.zcml (+5/-5) lib/lp/archivepublisher/customupload.py (+1/-1) lib/lp/archivepublisher/interfaces/archivegpgsigningkey.py (+4/-4) lib/lp/archivepublisher/publishing.py (+1/-1) lib/lp/archivepublisher/tests/archive-signing.txt (+12/-12) lib/lp/archivepublisher/tests/test_archivegpgsigningkey.py (+4/-4) lib/lp/archivepublisher/tests/test_customupload.py (+5/-4) lib/lp/archivepublisher/tests/test_publishdistro.py (+5/-5) lib/lp/archivepublisher/tests/test_publisher.py (+3/-3) lib/lp/archivepublisher/tests/test_signing.py (+5/-4) lib/lp/code/model/tests/test_recipebuilder.py (+3/-3) lib/lp/snappy/tests/test_snapbuildbehaviour.py (+3/-3) lib/lp/soyuz/adapters/tests/test_archivedependencies.py (+3/-3) lib/lp/soyuz/scripts/ppakeygenerator.py (+3/-3) lib/lp/soyuz/tests/test_archive.py (+3/-3) lib/lp/soyuz/tests/test_binarypackagebuildbehaviour.py (+3/-3) lib/lp/soyuz/tests/test_livefsbuildbehaviour.py (+3/-3) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Colin Watson (community) | Approve | ||
Review via email: mp+378826@code.launchpad.net |
Commit message
Renaming (I)ArchiveSigni
Description of the change
Currently, the class named ArchiveSigningKey only deals with GPG signing, wereas package signing mechanisms are done by another class.
As a path to migrate the signing to a new service, we are planning to have a database entity named ArchiveSigningKey. So, to make the code more readable, we are changing the current ArchiveSigningKey to a more specific name.
To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | diff --git a/lib/lp/archivepublisher/archivesigningkey.py b/lib/lp/archivepublisher/archivegpgsigningkey.py | |||
2 | 0 | similarity index 94% | 0 | similarity index 94% |
3 | 1 | rename from lib/lp/archivepublisher/archivesigningkey.py | 1 | rename from lib/lp/archivepublisher/archivesigningkey.py |
4 | 2 | rename to lib/lp/archivepublisher/archivegpgsigningkey.py | 2 | rename to lib/lp/archivepublisher/archivegpgsigningkey.py |
5 | index cb8737b..2b14365 100644 | |||
6 | --- a/lib/lp/archivepublisher/archivesigningkey.py | |||
7 | +++ b/lib/lp/archivepublisher/archivegpgsigningkey.py | |||
8 | @@ -1,12 +1,12 @@ | |||
9 | 1 | # Copyright 2009-2018 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2009-2018 Canonical Ltd. This software is licensed under the |
10 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
11 | 3 | 3 | ||
13 | 4 | """ArchiveSigningKey implementation.""" | 4 | """ArchiveGPGSigningKey implementation.""" |
14 | 5 | 5 | ||
15 | 6 | __metaclass__ = type | 6 | __metaclass__ = type |
16 | 7 | 7 | ||
17 | 8 | __all__ = [ | 8 | __all__ = [ |
19 | 9 | 'ArchiveSigningKey', | 9 | 'ArchiveGPGSigningKey', |
20 | 10 | 'SignableArchive', | 10 | 'SignableArchive', |
21 | 11 | 'SigningMode', | 11 | 'SigningMode', |
22 | 12 | ] | 12 | ] |
23 | @@ -29,9 +29,9 @@ from zope.security.proxy import ( | |||
24 | 29 | 29 | ||
25 | 30 | from lp.app.interfaces.launchpad import ILaunchpadCelebrities | 30 | from lp.app.interfaces.launchpad import ILaunchpadCelebrities |
26 | 31 | from lp.archivepublisher.config import getPubConfig | 31 | from lp.archivepublisher.config import getPubConfig |
28 | 32 | from lp.archivepublisher.interfaces.archivesigningkey import ( | 32 | from lp.archivepublisher.interfaces.archivegpgsigningkey import ( |
29 | 33 | CannotSignArchive, | 33 | CannotSignArchive, |
31 | 34 | IArchiveSigningKey, | 34 | IArchiveGPGSigningKey, |
32 | 35 | ISignableArchive, | 35 | ISignableArchive, |
33 | 36 | ) | 36 | ) |
34 | 37 | from lp.archivepublisher.run_parts import ( | 37 | from lp.archivepublisher.run_parts import ( |
35 | @@ -176,18 +176,18 @@ class SignableArchive: | |||
36 | 176 | [(path, "%s.gpg" % path, SigningMode.DETACHED, suite)], log=log) | 176 | [(path, "%s.gpg" % path, SigningMode.DETACHED, suite)], log=log) |
37 | 177 | 177 | ||
38 | 178 | 178 | ||
41 | 179 | @implementer(IArchiveSigningKey) | 179 | @implementer(IArchiveGPGSigningKey) |
42 | 180 | class ArchiveSigningKey(SignableArchive): | 180 | class ArchiveGPGSigningKey(SignableArchive): |
43 | 181 | """`IArchive` adapter for manipulating its GPG key.""" | 181 | """`IArchive` adapter for manipulating its GPG key.""" |
44 | 182 | 182 | ||
45 | 183 | def getPathForSecretKey(self, key): | 183 | def getPathForSecretKey(self, key): |
47 | 184 | """See `IArchiveSigningKey`.""" | 184 | """See `IArchiveGPGSigningKey`.""" |
48 | 185 | return os.path.join( | 185 | return os.path.join( |
49 | 186 | config.personalpackagearchive.signing_keys_root, | 186 | config.personalpackagearchive.signing_keys_root, |
50 | 187 | "%s.gpg" % key.fingerprint) | 187 | "%s.gpg" % key.fingerprint) |
51 | 188 | 188 | ||
52 | 189 | def exportSecretKey(self, key): | 189 | def exportSecretKey(self, key): |
54 | 190 | """See `IArchiveSigningKey`.""" | 190 | """See `IArchiveGPGSigningKey`.""" |
55 | 191 | assert key.secret, "Only secret keys should be exported." | 191 | assert key.secret, "Only secret keys should be exported." |
56 | 192 | export_path = self.getPathForSecretKey(key) | 192 | export_path = self.getPathForSecretKey(key) |
57 | 193 | 193 | ||
58 | @@ -198,7 +198,7 @@ class ArchiveSigningKey(SignableArchive): | |||
59 | 198 | export_file.write(key.export()) | 198 | export_file.write(key.export()) |
60 | 199 | 199 | ||
61 | 200 | def generateSigningKey(self): | 200 | def generateSigningKey(self): |
63 | 201 | """See `IArchiveSigningKey`.""" | 201 | """See `IArchiveGPGSigningKey`.""" |
64 | 202 | assert self.archive.signing_key is None, ( | 202 | assert self.archive.signing_key is None, ( |
65 | 203 | "Cannot override signing_keys.") | 203 | "Cannot override signing_keys.") |
66 | 204 | 204 | ||
67 | @@ -208,7 +208,7 @@ class ArchiveSigningKey(SignableArchive): | |||
68 | 208 | default_ppa = self.archive.owner.archive | 208 | default_ppa = self.archive.owner.archive |
69 | 209 | if self.archive != default_ppa: | 209 | if self.archive != default_ppa: |
70 | 210 | if default_ppa.signing_key is None: | 210 | if default_ppa.signing_key is None: |
72 | 211 | IArchiveSigningKey(default_ppa).generateSigningKey() | 211 | IArchiveGPGSigningKey(default_ppa).generateSigningKey() |
73 | 212 | key = default_ppa.signing_key | 212 | key = default_ppa.signing_key |
74 | 213 | self.archive.signing_key_owner = key.owner | 213 | self.archive.signing_key_owner = key.owner |
75 | 214 | self.archive.signing_key_fingerprint = key.fingerprint | 214 | self.archive.signing_key_fingerprint = key.fingerprint |
76 | @@ -221,7 +221,7 @@ class ArchiveSigningKey(SignableArchive): | |||
77 | 221 | self._setupSigningKey(secret_key) | 221 | self._setupSigningKey(secret_key) |
78 | 222 | 222 | ||
79 | 223 | def setSigningKey(self, key_path, async_keyserver=False): | 223 | def setSigningKey(self, key_path, async_keyserver=False): |
81 | 224 | """See `IArchiveSigningKey`.""" | 224 | """See `IArchiveGPGSigningKey`.""" |
82 | 225 | assert self.archive.signing_key is None, ( | 225 | assert self.archive.signing_key is None, ( |
83 | 226 | "Cannot override signing_keys.") | 226 | "Cannot override signing_keys.") |
84 | 227 | assert os.path.exists(key_path), ( | 227 | assert os.path.exists(key_path), ( |
85 | diff --git a/lib/lp/archivepublisher/configure.zcml b/lib/lp/archivepublisher/configure.zcml | |||
86 | index 99bdcb4..f52d4ff 100644 | |||
87 | --- a/lib/lp/archivepublisher/configure.zcml | |||
88 | +++ b/lib/lp/archivepublisher/configure.zcml | |||
89 | @@ -10,15 +10,15 @@ | |||
90 | 10 | xmlns:xmlrpc="http://namespaces.zope.org/xmlrpc" | 10 | xmlns:xmlrpc="http://namespaces.zope.org/xmlrpc" |
91 | 11 | i18n_domain="launchpad"> | 11 | i18n_domain="launchpad"> |
92 | 12 | 12 | ||
96 | 13 | <!-- ArchiveSigningKey --> | 13 | <!-- ArchiveGPGSigningKey --> |
97 | 14 | <class class="lp.archivepublisher.archivesigningkey.ArchiveSigningKey"> | 14 | <class class="lp.archivepublisher.archivegpgsigningkey.ArchiveGPGSigningKey"> |
98 | 15 | <allow interface="lp.archivepublisher.interfaces.archivesigningkey.IArchiveSigningKey"/> | 15 | <allow interface="lp.archivepublisher.interfaces.archivegpgsigningkey.IArchiveGPGSigningKey"/> |
99 | 16 | </class> | 16 | </class> |
100 | 17 | 17 | ||
101 | 18 | <adapter | 18 | <adapter |
102 | 19 | for="lp.soyuz.interfaces.archive.IArchive" | 19 | for="lp.soyuz.interfaces.archive.IArchive" |
105 | 20 | provides="lp.archivepublisher.interfaces.archivesigningkey.IArchiveSigningKey" | 20 | provides="lp.archivepublisher.interfaces.archivegpgsigningkey.IArchiveGPGSigningKey" |
106 | 21 | factory="lp.archivepublisher.archivesigningkey.ArchiveSigningKey" | 21 | factory="lp.archivepublisher.archivegpgsigningkey.ArchiveGPGSigningKey" |
107 | 22 | /> | 22 | /> |
108 | 23 | 23 | ||
109 | 24 | <!-- PublisherConfig --> | 24 | <!-- PublisherConfig --> |
110 | diff --git a/lib/lp/archivepublisher/customupload.py b/lib/lp/archivepublisher/customupload.py | |||
111 | index 7db20cb..0c6a2c9 100644 | |||
112 | --- a/lib/lp/archivepublisher/customupload.py | |||
113 | +++ b/lib/lp/archivepublisher/customupload.py | |||
114 | @@ -27,7 +27,7 @@ from lp.archivepublisher.debversion import ( | |||
115 | 27 | Version as make_version, | 27 | Version as make_version, |
116 | 28 | VersionError, | 28 | VersionError, |
117 | 29 | ) | 29 | ) |
119 | 30 | from lp.archivepublisher.interfaces.archivesigningkey import ISignableArchive | 30 | from lp.archivepublisher.interfaces.archivegpgsigningkey import ISignableArchive |
120 | 31 | from lp.services.librarian.utils import copy_and_close | 31 | from lp.services.librarian.utils import copy_and_close |
121 | 32 | from lp.soyuz.interfaces.queue import ( | 32 | from lp.soyuz.interfaces.queue import ( |
122 | 33 | CustomUploadError, | 33 | CustomUploadError, |
123 | diff --git a/lib/lp/archivepublisher/interfaces/archivesigningkey.py b/lib/lp/archivepublisher/interfaces/archivegpgsigningkey.py | |||
124 | 34 | similarity index 95% | 34 | similarity index 95% |
125 | 35 | rename from lib/lp/archivepublisher/interfaces/archivesigningkey.py | 35 | rename from lib/lp/archivepublisher/interfaces/archivesigningkey.py |
126 | 36 | rename to lib/lp/archivepublisher/interfaces/archivegpgsigningkey.py | 36 | rename to lib/lp/archivepublisher/interfaces/archivegpgsigningkey.py |
127 | index 01e4a50..85d3bfb 100644 | |||
128 | --- a/lib/lp/archivepublisher/interfaces/archivesigningkey.py | |||
129 | +++ b/lib/lp/archivepublisher/interfaces/archivegpgsigningkey.py | |||
130 | @@ -1,13 +1,13 @@ | |||
131 | 1 | # Copyright 2009-2018 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2009-2018 Canonical Ltd. This software is licensed under the |
132 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
133 | 3 | 3 | ||
135 | 4 | """ArchiveSigningKey interface.""" | 4 | """ArchiveGPGSigningKey interface.""" |
136 | 5 | 5 | ||
137 | 6 | __metaclass__ = type | 6 | __metaclass__ = type |
138 | 7 | 7 | ||
139 | 8 | __all__ = [ | 8 | __all__ = [ |
140 | 9 | 'CannotSignArchive', | 9 | 'CannotSignArchive', |
142 | 10 | 'IArchiveSigningKey', | 10 | 'IArchiveGPGSigningKey', |
143 | 11 | 'ISignableArchive', | 11 | 'ISignableArchive', |
144 | 12 | ] | 12 | ] |
145 | 13 | 13 | ||
146 | @@ -67,8 +67,8 @@ class ISignableArchive(Interface): | |||
147 | 67 | """ | 67 | """ |
148 | 68 | 68 | ||
149 | 69 | 69 | ||
152 | 70 | class IArchiveSigningKey(ISignableArchive): | 70 | class IArchiveGPGSigningKey(ISignableArchive): |
153 | 71 | """`ArchiveSigningKey` interface. | 71 | """`ArchiveGPGSigningKey` interface. |
154 | 72 | 72 | ||
155 | 73 | `IArchive` adapter for operations using its 'signing_key'. | 73 | `IArchive` adapter for operations using its 'signing_key'. |
156 | 74 | 74 | ||
157 | diff --git a/lib/lp/archivepublisher/publishing.py b/lib/lp/archivepublisher/publishing.py | |||
158 | index 523c51c..3365c68 100644 | |||
159 | --- a/lib/lp/archivepublisher/publishing.py | |||
160 | +++ b/lib/lp/archivepublisher/publishing.py | |||
161 | @@ -63,7 +63,7 @@ from lp.archivepublisher.indices import ( | |||
162 | 63 | build_source_stanza_fields, | 63 | build_source_stanza_fields, |
163 | 64 | build_translations_stanza_fields, | 64 | build_translations_stanza_fields, |
164 | 65 | ) | 65 | ) |
166 | 66 | from lp.archivepublisher.interfaces.archivesigningkey import ISignableArchive | 66 | from lp.archivepublisher.interfaces.archivegpgsigningkey import ISignableArchive |
167 | 67 | from lp.archivepublisher.model.ftparchive import FTPArchiveHandler | 67 | from lp.archivepublisher.model.ftparchive import FTPArchiveHandler |
168 | 68 | from lp.archivepublisher.utils import ( | 68 | from lp.archivepublisher.utils import ( |
169 | 69 | get_ppa_reference, | 69 | get_ppa_reference, |
170 | diff --git a/lib/lp/archivepublisher/tests/archive-signing.txt b/lib/lp/archivepublisher/tests/archive-signing.txt | |||
171 | index 853398e..f2dfca9 100644 | |||
172 | --- a/lib/lp/archivepublisher/tests/archive-signing.txt | |||
173 | +++ b/lib/lp/archivepublisher/tests/archive-signing.txt | |||
174 | @@ -127,10 +127,10 @@ location defined by the system configuration. | |||
175 | 127 | /var/tmp/ppa-signing-keys.test | 127 | /var/tmp/ppa-signing-keys.test |
176 | 128 | 128 | ||
177 | 129 | In order to manipulate 'signing_keys' securily the target archive | 129 | In order to manipulate 'signing_keys' securily the target archive |
179 | 130 | object has to be adapted to `IArchiveSigningKey`. | 130 | object has to be adapted to `IArchiveGPGSigningKey`. |
180 | 131 | 131 | ||
183 | 132 | >>> from lp.archivepublisher.interfaces.archivesigningkey import ( | 132 | >>> from lp.archivepublisher.interfaces.archivegpgsigningkey import ( |
184 | 133 | ... IArchiveSigningKey) | 133 | ... IArchiveGPGSigningKey) |
185 | 134 | 134 | ||
186 | 135 | We will adapt Celso's PPA after modifing its distribution to allow | 135 | We will adapt Celso's PPA after modifing its distribution to allow |
187 | 136 | proper publish configuration based on the sampledata. | 136 | proper publish configuration based on the sampledata. |
188 | @@ -142,15 +142,15 @@ proper publish configuration based on the sampledata. | |||
189 | 142 | >>> cprov.archive.distribution = getUtility( | 142 | >>> cprov.archive.distribution = getUtility( |
190 | 143 | ... IDistributionSet).getByName('ubuntutest') | 143 | ... IDistributionSet).getByName('ubuntutest') |
191 | 144 | 144 | ||
193 | 145 | >>> archive_signing_key = IArchiveSigningKey(cprov.archive) | 145 | >>> archive_signing_key = IArchiveGPGSigningKey(cprov.archive) |
194 | 146 | 146 | ||
196 | 147 | Once adapted `IArchiveSigningKey` is properly implemented. | 147 | Once adapted `IArchiveGPGSigningKey` is properly implemented. |
197 | 148 | 148 | ||
198 | 149 | >>> from zope.interface.verify import verifyObject | 149 | >>> from zope.interface.verify import verifyObject |
200 | 150 | >>> verifyObject(IArchiveSigningKey, archive_signing_key) | 150 | >>> verifyObject(IArchiveGPGSigningKey, archive_signing_key) |
201 | 151 | True | 151 | True |
202 | 152 | 152 | ||
204 | 153 | `IArchiveSigningKey` object contain the corresponding IArchive | 153 | `IArchiveGPGSigningKey` object contain the corresponding IArchive |
205 | 154 | object. | 154 | object. |
206 | 155 | 155 | ||
207 | 156 | >>> print archive_signing_key.archive.displayname | 156 | >>> print archive_signing_key.archive.displayname |
208 | @@ -185,7 +185,7 @@ in the expected path. | |||
209 | 185 | ... archive_signing_key.getPathForSecretKey(mock_key)).read() | 185 | ... archive_signing_key.getPathForSecretKey(mock_key)).read() |
210 | 186 | Secret True | 186 | Secret True |
211 | 187 | 187 | ||
213 | 188 | At this point we can use the `IArchiveSigningKey` to generate and | 188 | At this point we can use the `IArchiveGPGSigningKey` to generate and |
214 | 189 | assign a real signing_key, although this procedure depends heavily on | 189 | assign a real signing_key, although this procedure depends heavily on |
215 | 190 | machine entropy and ends up being very slow in our test machine. | 190 | machine entropy and ends up being very slow in our test machine. |
216 | 191 | 191 | ||
217 | @@ -193,7 +193,7 @@ machine entropy and ends up being very slow in our test machine. | |||
218 | 193 | 193 | ||
219 | 194 | We will use a pre-existing key in our tree which is virtually | 194 | We will use a pre-existing key in our tree which is virtually |
220 | 195 | identical to the one that would be generated. The key will be 'set' by | 195 | identical to the one that would be generated. The key will be 'set' by |
222 | 196 | using a method `IArchiveSigningKey` skips the key generation but uses | 196 | using a method `IArchiveGPGSigningKey` skips the key generation but uses |
223 | 197 | exactly the same procedure for setting the signing_key information. | 197 | exactly the same procedure for setting the signing_key information. |
224 | 198 | 198 | ||
225 | 199 | >>> import os | 199 | >>> import os |
226 | @@ -300,7 +300,7 @@ Default PPAs are always created first and thus get their keys generated | |||
227 | 300 | before the named-ppa for the same owner. We submit the named-ppa to | 300 | before the named-ppa for the same owner. We submit the named-ppa to |
228 | 301 | the key generation procedure, as it would be normally in production. | 301 | the key generation procedure, as it would be normally in production. |
229 | 302 | 302 | ||
231 | 303 | >>> named_ppa_signing_key = IArchiveSigningKey(named_ppa) | 303 | >>> named_ppa_signing_key = IArchiveGPGSigningKey(named_ppa) |
232 | 304 | >>> named_ppa_signing_key.generateSigningKey() | 304 | >>> named_ppa_signing_key.generateSigningKey() |
233 | 305 | 305 | ||
234 | 306 | Instead of generating a new key, the signing key from the default ppa | 306 | Instead of generating a new key, the signing key from the default ppa |
235 | @@ -348,7 +348,7 @@ in the default PPA context then propagated to the named-ppa. The key is | |||
236 | 348 | named after the user, even if the default PPA name is something different. | 348 | named after the user, even if the default PPA name is something different. |
237 | 349 | 349 | ||
238 | 350 | >>> cprov.display_name = "Not Celso Providelo" | 350 | >>> cprov.display_name = "Not Celso Providelo" |
240 | 351 | >>> named_ppa_signing_key = IArchiveSigningKey(named_ppa) | 351 | >>> named_ppa_signing_key = IArchiveGPGSigningKey(named_ppa) |
241 | 352 | >>> named_ppa_signing_key.generateSigningKey() | 352 | >>> named_ppa_signing_key.generateSigningKey() |
242 | 353 | Generating: Launchpad PPA for Not Celso Providelo | 353 | Generating: Launchpad PPA for Not Celso Providelo |
243 | 354 | 354 | ||
244 | @@ -366,7 +366,7 @@ Restore the original functionality of GPGHandler. | |||
245 | 366 | Signing PPA repository | 366 | Signing PPA repository |
246 | 367 | ---------------------- | 367 | ---------------------- |
247 | 368 | 368 | ||
249 | 369 | `IArchiveSigningKey.signRepository` can be user to sign repositories | 369 | `IArchiveGPGSigningKey.signRepository` can be user to sign repositories |
250 | 370 | for archive which already contains a 'signing_key'. | 370 | for archive which already contains a 'signing_key'. |
251 | 371 | 371 | ||
252 | 372 | Celso's default PPA will uses the testing signing key. | 372 | Celso's default PPA will uses the testing signing key. |
253 | diff --git a/lib/lp/archivepublisher/tests/test_archivesigningkey.py b/lib/lp/archivepublisher/tests/test_archivegpgsigningkey.py | |||
254 | 373 | similarity index 95% | 373 | similarity index 95% |
255 | 374 | rename from lib/lp/archivepublisher/tests/test_archivesigningkey.py | 374 | rename from lib/lp/archivepublisher/tests/test_archivesigningkey.py |
256 | 375 | rename to lib/lp/archivepublisher/tests/test_archivegpgsigningkey.py | 375 | rename to lib/lp/archivepublisher/tests/test_archivegpgsigningkey.py |
257 | index a394823..47600b6 100644 | |||
258 | --- a/lib/lp/archivepublisher/tests/test_archivesigningkey.py | |||
259 | +++ b/lib/lp/archivepublisher/tests/test_archivegpgsigningkey.py | |||
260 | @@ -1,7 +1,7 @@ | |||
261 | 1 | # Copyright 2016-2019 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2016-2019 Canonical Ltd. This software is licensed under the |
262 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
263 | 3 | 3 | ||
265 | 4 | """Test ArchiveSigningKey.""" | 4 | """Test ArchiveGPGSigningKey.""" |
266 | 5 | 5 | ||
267 | 6 | from __future__ import absolute_import, print_function, unicode_literals | 6 | from __future__ import absolute_import, print_function, unicode_literals |
268 | 7 | 7 | ||
269 | @@ -16,8 +16,8 @@ from twisted.internet import defer | |||
270 | 16 | from zope.component import getUtility | 16 | from zope.component import getUtility |
271 | 17 | 17 | ||
272 | 18 | from lp.archivepublisher.config import getPubConfig | 18 | from lp.archivepublisher.config import getPubConfig |
275 | 19 | from lp.archivepublisher.interfaces.archivesigningkey import ( | 19 | from lp.archivepublisher.interfaces.archivegpgsigningkey import ( |
276 | 20 | IArchiveSigningKey, | 20 | IArchiveGPGSigningKey, |
277 | 21 | ISignableArchive, | 21 | ISignableArchive, |
278 | 22 | ) | 22 | ) |
279 | 23 | from lp.archivepublisher.interfaces.publisherconfig import IPublisherConfigSet | 23 | from lp.archivepublisher.interfaces.publisherconfig import IPublisherConfigSet |
280 | @@ -51,7 +51,7 @@ class TestSignableArchiveWithSigningKey(TestCaseWithFactory): | |||
281 | 51 | with InProcessKeyServerFixture() as keyserver: | 51 | with InProcessKeyServerFixture() as keyserver: |
282 | 52 | yield keyserver.start() | 52 | yield keyserver.start() |
283 | 53 | key_path = os.path.join(gpgkeysdir, 'ppa-sample@canonical.com.sec') | 53 | key_path = os.path.join(gpgkeysdir, 'ppa-sample@canonical.com.sec') |
285 | 54 | yield IArchiveSigningKey(self.archive).setSigningKey( | 54 | yield IArchiveGPGSigningKey(self.archive).setSigningKey( |
286 | 55 | key_path, async_keyserver=True) | 55 | key_path, async_keyserver=True) |
287 | 56 | 56 | ||
288 | 57 | def test_signFile_absolute_within_archive(self): | 57 | def test_signFile_absolute_within_archive(self): |
289 | diff --git a/lib/lp/archivepublisher/tests/test_customupload.py b/lib/lp/archivepublisher/tests/test_customupload.py | |||
290 | index a5f8a89..43a88db 100644 | |||
291 | --- a/lib/lp/archivepublisher/tests/test_customupload.py | |||
292 | +++ b/lib/lp/archivepublisher/tests/test_customupload.py | |||
293 | @@ -33,8 +33,8 @@ from lp.archivepublisher.customupload import ( | |||
294 | 33 | CustomUploadTarballBadSymLink, | 33 | CustomUploadTarballBadSymLink, |
295 | 34 | CustomUploadTarballInvalidFileType, | 34 | CustomUploadTarballInvalidFileType, |
296 | 35 | ) | 35 | ) |
299 | 36 | from lp.archivepublisher.interfaces.archivesigningkey import ( | 36 | from lp.archivepublisher.interfaces.archivegpgsigningkey import ( |
300 | 37 | IArchiveSigningKey, | 37 | IArchiveGPGSigningKey, |
301 | 38 | ) | 38 | ) |
302 | 39 | from lp.archivepublisher.interfaces.publisherconfig import IPublisherConfigSet | 39 | from lp.archivepublisher.interfaces.publisherconfig import IPublisherConfigSet |
303 | 40 | from lp.archivepublisher.tests.test_run_parts import RunPartsMixin | 40 | from lp.archivepublisher.tests.test_run_parts import RunPartsMixin |
304 | @@ -260,7 +260,7 @@ class TestSigning(TestCaseWithFactory, RunPartsMixin): | |||
305 | 260 | self.assertIsNone(self.archive.signing_key) | 260 | self.assertIsNone(self.archive.signing_key) |
306 | 261 | self.useFixture(InProcessKeyServerFixture()).start() | 261 | self.useFixture(InProcessKeyServerFixture()).start() |
307 | 262 | key_path = os.path.join(gpgkeysdir, 'ppa-sample@canonical.com.sec') | 262 | key_path = os.path.join(gpgkeysdir, 'ppa-sample@canonical.com.sec') |
309 | 263 | yield IArchiveSigningKey(self.archive).setSigningKey( | 263 | yield IArchiveGPGSigningKey(self.archive).setSigningKey( |
310 | 264 | key_path, async_keyserver=True) | 264 | key_path, async_keyserver=True) |
311 | 265 | self.assertIsNotNone(self.archive.signing_key) | 265 | self.assertIsNotNone(self.archive.signing_key) |
312 | 266 | custom_processor = CustomUpload() | 266 | custom_processor = CustomUpload() |
313 | @@ -280,7 +280,8 @@ class TestSigning(TestCaseWithFactory, RunPartsMixin): | |||
314 | 280 | write_file(filename, b"contents") | 280 | write_file(filename, b"contents") |
315 | 281 | self.assertIsNone(self.archive.signing_key) | 281 | self.assertIsNone(self.archive.signing_key) |
316 | 282 | run_parts_fixture = self.useFixture(MonkeyPatch( | 282 | run_parts_fixture = self.useFixture(MonkeyPatch( |
318 | 283 | "lp.archivepublisher.archivesigningkey.run_parts", FakeMethod())) | 283 | "lp.archivepublisher.archivegpgsigningkey.run_parts", |
319 | 284 | FakeMethod())) | ||
320 | 284 | custom_processor = CustomUpload() | 285 | custom_processor = CustomUpload() |
321 | 285 | custom_processor.sign(self.archive, "suite", filename) | 286 | custom_processor.sign(self.archive, "suite", filename) |
322 | 286 | args, kwargs = run_parts_fixture.new_value.calls[0] | 287 | args, kwargs = run_parts_fixture.new_value.calls[0] |
323 | diff --git a/lib/lp/archivepublisher/tests/test_publishdistro.py b/lib/lp/archivepublisher/tests/test_publishdistro.py | |||
324 | index d81421e..3d6d699 100644 | |||
325 | --- a/lib/lp/archivepublisher/tests/test_publishdistro.py | |||
326 | +++ b/lib/lp/archivepublisher/tests/test_publishdistro.py | |||
327 | @@ -24,8 +24,8 @@ from zope.security.proxy import removeSecurityProxy | |||
328 | 24 | 24 | ||
329 | 25 | from lp.app.interfaces.launchpad import ILaunchpadCelebrities | 25 | from lp.app.interfaces.launchpad import ILaunchpadCelebrities |
330 | 26 | from lp.archivepublisher.config import getPubConfig | 26 | from lp.archivepublisher.config import getPubConfig |
333 | 27 | from lp.archivepublisher.interfaces.archivesigningkey import ( | 27 | from lp.archivepublisher.interfaces.archivegpgsigningkey import ( |
334 | 28 | IArchiveSigningKey, | 28 | IArchiveGPGSigningKey, |
335 | 29 | ) | 29 | ) |
336 | 30 | from lp.archivepublisher.interfaces.publisherconfig import IPublisherConfigSet | 30 | from lp.archivepublisher.interfaces.publisherconfig import IPublisherConfigSet |
337 | 31 | from lp.archivepublisher.publishing import Publisher | 31 | from lp.archivepublisher.publishing import Publisher |
338 | @@ -256,7 +256,7 @@ class TestPublishDistro(TestNativePublishingBase): | |||
339 | 256 | self.setUpRequireSigningKeys() | 256 | self.setUpRequireSigningKeys() |
340 | 257 | yield self.useFixture(InProcessKeyServerFixture()).start() | 257 | yield self.useFixture(InProcessKeyServerFixture()).start() |
341 | 258 | key_path = os.path.join(gpgkeysdir, 'ppa-sample@canonical.com.sec') | 258 | key_path = os.path.join(gpgkeysdir, 'ppa-sample@canonical.com.sec') |
343 | 259 | yield IArchiveSigningKey(cprov.archive).setSigningKey( | 259 | yield IArchiveGPGSigningKey(cprov.archive).setSigningKey( |
344 | 260 | key_path, async_keyserver=True) | 260 | key_path, async_keyserver=True) |
345 | 261 | name16.archive.signing_key_owner = cprov.archive.signing_key_owner | 261 | name16.archive.signing_key_owner = cprov.archive.signing_key_owner |
346 | 262 | name16.archive.signing_key_fingerprint = ( | 262 | name16.archive.signing_key_fingerprint = ( |
347 | @@ -308,7 +308,7 @@ class TestPublishDistro(TestNativePublishingBase): | |||
348 | 308 | self.setUpRequireSigningKeys() | 308 | self.setUpRequireSigningKeys() |
349 | 309 | yield self.useFixture(InProcessKeyServerFixture()).start() | 309 | yield self.useFixture(InProcessKeyServerFixture()).start() |
350 | 310 | key_path = os.path.join(gpgkeysdir, 'ppa-sample@canonical.com.sec') | 310 | key_path = os.path.join(gpgkeysdir, 'ppa-sample@canonical.com.sec') |
352 | 311 | yield IArchiveSigningKey(private_ppa).setSigningKey( | 311 | yield IArchiveGPGSigningKey(private_ppa).setSigningKey( |
353 | 312 | key_path, async_keyserver=True) | 312 | key_path, async_keyserver=True) |
354 | 313 | 313 | ||
355 | 314 | # Try a plain PPA run, to ensure the private one is NOT published. | 314 | # Try a plain PPA run, to ensure the private one is NOT published. |
356 | @@ -413,7 +413,7 @@ class TestPublishDistro(TestNativePublishingBase): | |||
357 | 413 | self.setUpRequireSigningKeys() | 413 | self.setUpRequireSigningKeys() |
358 | 414 | yield self.useFixture(InProcessKeyServerFixture()).start() | 414 | yield self.useFixture(InProcessKeyServerFixture()).start() |
359 | 415 | key_path = os.path.join(gpgkeysdir, 'ppa-sample@canonical.com.sec') | 415 | key_path = os.path.join(gpgkeysdir, 'ppa-sample@canonical.com.sec') |
361 | 416 | yield IArchiveSigningKey(archive).setSigningKey( | 416 | yield IArchiveGPGSigningKey(archive).setSigningKey( |
362 | 417 | key_path, async_keyserver=True) | 417 | key_path, async_keyserver=True) |
363 | 418 | 418 | ||
364 | 419 | self.layer.txn.commit() | 419 | self.layer.txn.commit() |
365 | diff --git a/lib/lp/archivepublisher/tests/test_publisher.py b/lib/lp/archivepublisher/tests/test_publisher.py | |||
366 | index ec60e1f..8fd5616 100644 | |||
367 | --- a/lib/lp/archivepublisher/tests/test_publisher.py | |||
368 | +++ b/lib/lp/archivepublisher/tests/test_publisher.py | |||
369 | @@ -67,8 +67,8 @@ from zope.security.proxy import removeSecurityProxy | |||
370 | 67 | 67 | ||
371 | 68 | from lp.archivepublisher.config import getPubConfig | 68 | from lp.archivepublisher.config import getPubConfig |
372 | 69 | from lp.archivepublisher.diskpool import DiskPool | 69 | from lp.archivepublisher.diskpool import DiskPool |
375 | 70 | from lp.archivepublisher.interfaces.archivesigningkey import ( | 70 | from lp.archivepublisher.interfaces.archivegpgsigningkey import ( |
376 | 71 | IArchiveSigningKey, | 71 | IArchiveGPGSigningKey, |
377 | 72 | ) | 72 | ) |
378 | 73 | from lp.archivepublisher.publishing import ( | 73 | from lp.archivepublisher.publishing import ( |
379 | 74 | BY_HASH_STAY_OF_EXECUTION, | 74 | BY_HASH_STAY_OF_EXECUTION, |
380 | @@ -3211,7 +3211,7 @@ class TestPublisherRepositorySignatures( | |||
381 | 3211 | 3211 | ||
382 | 3212 | # Set a signing key for Celso's PPA. | 3212 | # Set a signing key for Celso's PPA. |
383 | 3213 | key_path = os.path.join(gpgkeysdir, 'ppa-sample@canonical.com.sec') | 3213 | key_path = os.path.join(gpgkeysdir, 'ppa-sample@canonical.com.sec') |
385 | 3214 | yield IArchiveSigningKey(cprov.archive).setSigningKey( | 3214 | yield IArchiveGPGSigningKey(cprov.archive).setSigningKey( |
386 | 3215 | key_path, async_keyserver=True) | 3215 | key_path, async_keyserver=True) |
387 | 3216 | self.assertTrue(cprov.archive.signing_key is not None) | 3216 | self.assertTrue(cprov.archive.signing_key is not None) |
388 | 3217 | 3217 | ||
389 | diff --git a/lib/lp/archivepublisher/tests/test_signing.py b/lib/lp/archivepublisher/tests/test_signing.py | |||
390 | index 3966362..efe4ae6 100644 | |||
391 | --- a/lib/lp/archivepublisher/tests/test_signing.py | |||
392 | +++ b/lib/lp/archivepublisher/tests/test_signing.py | |||
393 | @@ -34,8 +34,8 @@ from lp.archivepublisher.customupload import ( | |||
394 | 34 | CustomUploadAlreadyExists, | 34 | CustomUploadAlreadyExists, |
395 | 35 | CustomUploadBadUmask, | 35 | CustomUploadBadUmask, |
396 | 36 | ) | 36 | ) |
399 | 37 | from lp.archivepublisher.interfaces.archivesigningkey import ( | 37 | from lp.archivepublisher.interfaces.archivegpgsigningkey import ( |
400 | 38 | IArchiveSigningKey, | 38 | IArchiveGPGSigningKey, |
401 | 39 | ) | 39 | ) |
402 | 40 | from lp.archivepublisher.interfaces.publisherconfig import IPublisherConfigSet | 40 | from lp.archivepublisher.interfaces.publisherconfig import IPublisherConfigSet |
403 | 41 | from lp.archivepublisher.signing import ( | 41 | from lp.archivepublisher.signing import ( |
404 | @@ -212,7 +212,7 @@ class TestSigningHelpers(TestCaseWithFactory): | |||
405 | 212 | with InProcessKeyServerFixture() as keyserver: | 212 | with InProcessKeyServerFixture() as keyserver: |
406 | 213 | yield keyserver.start() | 213 | yield keyserver.start() |
407 | 214 | key_path = os.path.join(gpgkeysdir, 'ppa-sample@canonical.com.sec') | 214 | key_path = os.path.join(gpgkeysdir, 'ppa-sample@canonical.com.sec') |
409 | 215 | yield IArchiveSigningKey(self.archive).setSigningKey( | 215 | yield IArchiveGPGSigningKey(self.archive).setSigningKey( |
410 | 216 | key_path, async_keyserver=True) | 216 | key_path, async_keyserver=True) |
411 | 217 | 217 | ||
412 | 218 | def setUpUefiKeys(self, create=True, series=None): | 218 | def setUpUefiKeys(self, create=True, series=None): |
413 | @@ -1356,7 +1356,8 @@ class TestSigning(RunPartsMixin, TestSigningHelpers): | |||
414 | 1356 | # run_parts is called. | 1356 | # run_parts is called. |
415 | 1357 | self.enableRunParts(distribution_name=self.distro.name) | 1357 | self.enableRunParts(distribution_name=self.distro.name) |
416 | 1358 | run_parts_fixture = self.useFixture(MonkeyPatch( | 1358 | run_parts_fixture = self.useFixture(MonkeyPatch( |
418 | 1359 | "lp.archivepublisher.archivesigningkey.run_parts", FakeMethod())) | 1359 | "lp.archivepublisher.archivegpgsigningkey.run_parts", |
419 | 1360 | FakeMethod())) | ||
420 | 1360 | self.setUpUefiKeys() | 1361 | self.setUpUefiKeys() |
421 | 1361 | self.setUpKmodKeys() | 1362 | self.setUpKmodKeys() |
422 | 1362 | self.setUpOpalKeys() | 1363 | self.setUpOpalKeys() |
423 | diff --git a/lib/lp/code/model/tests/test_recipebuilder.py b/lib/lp/code/model/tests/test_recipebuilder.py | |||
424 | index fd96be5..c07fce7 100644 | |||
425 | --- a/lib/lp/code/model/tests/test_recipebuilder.py | |||
426 | +++ b/lib/lp/code/model/tests/test_recipebuilder.py | |||
427 | @@ -19,8 +19,8 @@ from twisted.trial.unittest import TestCase as TrialTestCase | |||
428 | 19 | from zope.component import getUtility | 19 | from zope.component import getUtility |
429 | 20 | from zope.security.proxy import removeSecurityProxy | 20 | from zope.security.proxy import removeSecurityProxy |
430 | 21 | 21 | ||
433 | 22 | from lp.archivepublisher.interfaces.archivesigningkey import ( | 22 | from lp.archivepublisher.interfaces.archivegpgsigningkey import ( |
434 | 23 | IArchiveSigningKey, | 23 | IArchiveGPGSigningKey, |
435 | 24 | ) | 24 | ) |
436 | 25 | from lp.buildmaster.enums import BuildStatus | 25 | from lp.buildmaster.enums import BuildStatus |
437 | 26 | from lp.buildmaster.interactor import BuilderInteractor | 26 | from lp.buildmaster.interactor import BuilderInteractor |
438 | @@ -347,7 +347,7 @@ class TestAsyncRecipeBuilder(TestRecipeBuilderBase): | |||
439 | 347 | yield self.useFixture(InProcessKeyServerFixture()).start() | 347 | yield self.useFixture(InProcessKeyServerFixture()).start() |
440 | 348 | archive = self.factory.makeArchive() | 348 | archive = self.factory.makeArchive() |
441 | 349 | key_path = os.path.join(gpgkeysdir, "ppa-sample@canonical.com.sec") | 349 | key_path = os.path.join(gpgkeysdir, "ppa-sample@canonical.com.sec") |
443 | 350 | yield IArchiveSigningKey(archive).setSigningKey( | 350 | yield IArchiveGPGSigningKey(archive).setSigningKey( |
444 | 351 | key_path, async_keyserver=True) | 351 | key_path, async_keyserver=True) |
445 | 352 | job = self.makeJob(archive=archive, with_builder=True) | 352 | job = self.makeJob(archive=archive, with_builder=True) |
446 | 353 | distroarchseries = job.build.distroseries.architectures[0] | 353 | distroarchseries = job.build.distroseries.architectures[0] |
447 | diff --git a/lib/lp/snappy/tests/test_snapbuildbehaviour.py b/lib/lp/snappy/tests/test_snapbuildbehaviour.py | |||
448 | index 3a506c5..b397bba 100644 | |||
449 | --- a/lib/lp/snappy/tests/test_snapbuildbehaviour.py | |||
450 | +++ b/lib/lp/snappy/tests/test_snapbuildbehaviour.py | |||
451 | @@ -54,8 +54,8 @@ from zope.publisher.xmlrpc import TestRequest | |||
452 | 54 | from zope.security.proxy import removeSecurityProxy | 54 | from zope.security.proxy import removeSecurityProxy |
453 | 55 | 55 | ||
454 | 56 | from lp.app.enums import InformationType | 56 | from lp.app.enums import InformationType |
457 | 57 | from lp.archivepublisher.interfaces.archivesigningkey import ( | 57 | from lp.archivepublisher.interfaces.archivegpgsigningkey import ( |
458 | 58 | IArchiveSigningKey, | 58 | IArchiveGPGSigningKey, |
459 | 59 | ) | 59 | ) |
460 | 60 | from lp.buildmaster.enums import ( | 60 | from lp.buildmaster.enums import ( |
461 | 61 | BuildBaseImageType, | 61 | BuildBaseImageType, |
462 | @@ -649,7 +649,7 @@ class TestAsyncSnapBuildBehaviour(TestSnapBuildBehaviourBase): | |||
463 | 649 | yield self.useFixture(InProcessKeyServerFixture()).start() | 649 | yield self.useFixture(InProcessKeyServerFixture()).start() |
464 | 650 | archive = self.factory.makeArchive() | 650 | archive = self.factory.makeArchive() |
465 | 651 | key_path = os.path.join(gpgkeysdir, "ppa-sample@canonical.com.sec") | 651 | key_path = os.path.join(gpgkeysdir, "ppa-sample@canonical.com.sec") |
467 | 652 | yield IArchiveSigningKey(archive).setSigningKey( | 652 | yield IArchiveGPGSigningKey(archive).setSigningKey( |
468 | 653 | key_path, async_keyserver=True) | 653 | key_path, async_keyserver=True) |
469 | 654 | job = self.makeJob(archive=archive) | 654 | job = self.makeJob(archive=archive) |
470 | 655 | self.factory.makeBinaryPackagePublishingHistory( | 655 | self.factory.makeBinaryPackagePublishingHistory( |
471 | diff --git a/lib/lp/soyuz/adapters/tests/test_archivedependencies.py b/lib/lp/soyuz/adapters/tests/test_archivedependencies.py | |||
472 | index dbb2343..7cd3cad 100644 | |||
473 | --- a/lib/lp/soyuz/adapters/tests/test_archivedependencies.py | |||
474 | +++ b/lib/lp/soyuz/adapters/tests/test_archivedependencies.py | |||
475 | @@ -20,8 +20,8 @@ from twisted.internet.threads import deferToThread | |||
476 | 20 | from zope.component import getUtility | 20 | from zope.component import getUtility |
477 | 21 | from zope.security.proxy import removeSecurityProxy | 21 | from zope.security.proxy import removeSecurityProxy |
478 | 22 | 22 | ||
481 | 23 | from lp.archivepublisher.interfaces.archivesigningkey import ( | 23 | from lp.archivepublisher.interfaces.archivegpgsigningkey import ( |
482 | 24 | IArchiveSigningKey, | 24 | IArchiveGPGSigningKey, |
483 | 25 | ) | 25 | ) |
484 | 26 | from lp.registry.interfaces.distribution import IDistributionSet | 26 | from lp.registry.interfaces.distribution import IDistributionSet |
485 | 27 | from lp.registry.interfaces.pocket import PackagePublishingPocket | 27 | from lp.registry.interfaces.pocket import PackagePublishingPocket |
486 | @@ -174,7 +174,7 @@ class TestSourcesList(TestCaseWithFactory): | |||
487 | 174 | archive = self.factory.makeArchive(distribution=self.ubuntu, **kwargs) | 174 | archive = self.factory.makeArchive(distribution=self.ubuntu, **kwargs) |
488 | 175 | if signing_key_name is not None: | 175 | if signing_key_name is not None: |
489 | 176 | key_path = os.path.join(gpgkeysdir, "%s.sec" % signing_key_name) | 176 | key_path = os.path.join(gpgkeysdir, "%s.sec" % signing_key_name) |
491 | 177 | yield IArchiveSigningKey(archive).setSigningKey( | 177 | yield IArchiveGPGSigningKey(archive).setSigningKey( |
492 | 178 | key_path, async_keyserver=True) | 178 | key_path, async_keyserver=True) |
493 | 179 | if publish_binary: | 179 | if publish_binary: |
494 | 180 | self.publisher.getPubBinaries( | 180 | self.publisher.getPubBinaries( |
495 | diff --git a/lib/lp/soyuz/scripts/ppakeygenerator.py b/lib/lp/soyuz/scripts/ppakeygenerator.py | |||
496 | index 00bebac..c1aa3f6 100644 | |||
497 | --- a/lib/lp/soyuz/scripts/ppakeygenerator.py | |||
498 | +++ b/lib/lp/soyuz/scripts/ppakeygenerator.py | |||
499 | @@ -7,8 +7,8 @@ __all__ = [ | |||
500 | 7 | 7 | ||
501 | 8 | from zope.component import getUtility | 8 | from zope.component import getUtility |
502 | 9 | 9 | ||
505 | 10 | from lp.archivepublisher.interfaces.archivesigningkey import ( | 10 | from lp.archivepublisher.interfaces.archivegpgsigningkey import ( |
506 | 11 | IArchiveSigningKey, | 11 | IArchiveGPGSigningKey, |
507 | 12 | ) | 12 | ) |
508 | 13 | from lp.services.scripts.base import ( | 13 | from lp.services.scripts.base import ( |
509 | 14 | LaunchpadCronScript, | 14 | LaunchpadCronScript, |
510 | @@ -32,7 +32,7 @@ class PPAKeyGenerator(LaunchpadCronScript): | |||
511 | 32 | self.logger.info( | 32 | self.logger.info( |
512 | 33 | "Generating signing key for %s (%s)" % | 33 | "Generating signing key for %s (%s)" % |
513 | 34 | (archive.reference, archive.displayname)) | 34 | (archive.reference, archive.displayname)) |
515 | 35 | archive_signing_key = IArchiveSigningKey(archive) | 35 | archive_signing_key = IArchiveGPGSigningKey(archive) |
516 | 36 | archive_signing_key.generateSigningKey() | 36 | archive_signing_key.generateSigningKey() |
517 | 37 | self.logger.info("Key %s" % archive.signing_key.fingerprint) | 37 | self.logger.info("Key %s" % archive.signing_key.fingerprint) |
518 | 38 | 38 | ||
519 | diff --git a/lib/lp/soyuz/tests/test_archive.py b/lib/lp/soyuz/tests/test_archive.py | |||
520 | index 20b7b2f..8660e70 100644 | |||
521 | --- a/lib/lp/soyuz/tests/test_archive.py | |||
522 | +++ b/lib/lp/soyuz/tests/test_archive.py | |||
523 | @@ -37,8 +37,8 @@ from zope.security.proxy import removeSecurityProxy | |||
524 | 37 | 37 | ||
525 | 38 | from lp.app.errors import NotFoundError | 38 | from lp.app.errors import NotFoundError |
526 | 39 | from lp.app.interfaces.launchpad import ILaunchpadCelebrities | 39 | from lp.app.interfaces.launchpad import ILaunchpadCelebrities |
529 | 40 | from lp.archivepublisher.interfaces.archivesigningkey import ( | 40 | from lp.archivepublisher.interfaces.archivegpgsigningkey import ( |
530 | 41 | IArchiveSigningKey, | 41 | IArchiveGPGSigningKey, |
531 | 42 | ) | 42 | ) |
532 | 43 | from lp.buildmaster.enums import ( | 43 | from lp.buildmaster.enums import ( |
533 | 44 | BuildQueueStatus, | 44 | BuildQueueStatus, |
534 | @@ -1827,7 +1827,7 @@ class TestArchiveDependencies(TestCaseWithFactory): | |||
535 | 1827 | with InProcessKeyServerFixture() as keyserver: | 1827 | with InProcessKeyServerFixture() as keyserver: |
536 | 1828 | yield keyserver.start() | 1828 | yield keyserver.start() |
537 | 1829 | key_path = os.path.join(gpgkeysdir, 'ppa-sample@canonical.com.sec') | 1829 | key_path = os.path.join(gpgkeysdir, 'ppa-sample@canonical.com.sec') |
539 | 1830 | yield IArchiveSigningKey(p3a).setSigningKey( | 1830 | yield IArchiveGPGSigningKey(p3a).setSigningKey( |
540 | 1831 | key_path, async_keyserver=True) | 1831 | key_path, async_keyserver=True) |
541 | 1832 | dependency = self.factory.makeArchive( | 1832 | dependency = self.factory.makeArchive( |
542 | 1833 | name='dependency', private=True, owner=p3a.owner) | 1833 | name='dependency', private=True, owner=p3a.owner) |
543 | diff --git a/lib/lp/soyuz/tests/test_binarypackagebuildbehaviour.py b/lib/lp/soyuz/tests/test_binarypackagebuildbehaviour.py | |||
544 | index 61e4847..cc08bc5 100644 | |||
545 | --- a/lib/lp/soyuz/tests/test_binarypackagebuildbehaviour.py | |||
546 | +++ b/lib/lp/soyuz/tests/test_binarypackagebuildbehaviour.py | |||
547 | @@ -22,8 +22,8 @@ from zope.component import getUtility | |||
548 | 22 | from zope.security.proxy import removeSecurityProxy | 22 | from zope.security.proxy import removeSecurityProxy |
549 | 23 | 23 | ||
550 | 24 | from lp.archivepublisher.diskpool import poolify | 24 | from lp.archivepublisher.diskpool import poolify |
553 | 25 | from lp.archivepublisher.interfaces.archivesigningkey import ( | 25 | from lp.archivepublisher.interfaces.archivegpgsigningkey import ( |
554 | 26 | IArchiveSigningKey, | 26 | IArchiveGPGSigningKey, |
555 | 27 | ) | 27 | ) |
556 | 28 | from lp.buildmaster.enums import ( | 28 | from lp.buildmaster.enums import ( |
557 | 29 | BuilderCleanStatus, | 29 | BuilderCleanStatus, |
558 | @@ -354,7 +354,7 @@ class TestBinaryBuildPackageBehaviour(TestCaseWithFactory): | |||
559 | 354 | archive = self.factory.makeArchive() | 354 | archive = self.factory.makeArchive() |
560 | 355 | builder = self.factory.makeBuilder() | 355 | builder = self.factory.makeBuilder() |
561 | 356 | key_path = os.path.join(gpgkeysdir, "ppa-sample@canonical.com.sec") | 356 | key_path = os.path.join(gpgkeysdir, "ppa-sample@canonical.com.sec") |
563 | 357 | yield IArchiveSigningKey(archive).setSigningKey( | 357 | yield IArchiveGPGSigningKey(archive).setSigningKey( |
564 | 358 | key_path, async_keyserver=True) | 358 | key_path, async_keyserver=True) |
565 | 359 | build = self.factory.makeBinaryPackageBuild(archive=archive) | 359 | build = self.factory.makeBinaryPackageBuild(archive=archive) |
566 | 360 | self.factory.makeBinaryPackagePublishingHistory( | 360 | self.factory.makeBinaryPackagePublishingHistory( |
567 | diff --git a/lib/lp/soyuz/tests/test_livefsbuildbehaviour.py b/lib/lp/soyuz/tests/test_livefsbuildbehaviour.py | |||
568 | index 29e697e..95e9694 100644 | |||
569 | --- a/lib/lp/soyuz/tests/test_livefsbuildbehaviour.py | |||
570 | +++ b/lib/lp/soyuz/tests/test_livefsbuildbehaviour.py | |||
571 | @@ -20,8 +20,8 @@ from twisted.trial.unittest import TestCase as TrialTestCase | |||
572 | 20 | from zope.component import getUtility | 20 | from zope.component import getUtility |
573 | 21 | from zope.security.proxy import Proxy | 21 | from zope.security.proxy import Proxy |
574 | 22 | 22 | ||
577 | 23 | from lp.archivepublisher.interfaces.archivesigningkey import ( | 23 | from lp.archivepublisher.interfaces.archivegpgsigningkey import ( |
578 | 24 | IArchiveSigningKey, | 24 | IArchiveGPGSigningKey, |
579 | 25 | ) | 25 | ) |
580 | 26 | from lp.buildmaster.enums import ( | 26 | from lp.buildmaster.enums import ( |
581 | 27 | BuildBaseImageType, | 27 | BuildBaseImageType, |
582 | @@ -247,7 +247,7 @@ class TestAsyncLiveFSBuildBehaviour(TestLiveFSBuildBehaviourBase): | |||
583 | 247 | yield self.useFixture(InProcessKeyServerFixture()).start() | 247 | yield self.useFixture(InProcessKeyServerFixture()).start() |
584 | 248 | archive = self.factory.makeArchive() | 248 | archive = self.factory.makeArchive() |
585 | 249 | key_path = os.path.join(gpgkeysdir, "ppa-sample@canonical.com.sec") | 249 | key_path = os.path.join(gpgkeysdir, "ppa-sample@canonical.com.sec") |
587 | 250 | yield IArchiveSigningKey(archive).setSigningKey( | 250 | yield IArchiveGPGSigningKey(archive).setSigningKey( |
588 | 251 | key_path, async_keyserver=True) | 251 | key_path, async_keyserver=True) |
589 | 252 | job = self.makeJob(archive=archive, with_builder=True) | 252 | job = self.makeJob(archive=archive, with_builder=True) |
590 | 253 | self.factory.makeBinaryPackagePublishingHistory( | 253 | self.factory.makeBinaryPackagePublishingHistory( |