MCPcopy Create free account
hub / github.com/aptly-dev/aptly / TestMultiDistPool

Method TestMultiDistPool

deb/publish_test.go:197–247  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

195}
196
197func (s *PublishedRepoSuite) TestMultiDistPool(c *C) {
198 repo, err := NewPublishedRepo("", "ppa", "squeeze", nil, []string{"main"}, []interface{}{s.snapshot}, s.factory, true)
199 c.Assert(err, IsNil)
200 err = repo.Publish(s.packagePool, s.provider, s.factory, &NullSigner{}, nil, false, "")
201 c.Assert(err, IsNil)
202
203 publishedStorage := files.NewPublishedStorage(s.root, "", "")
204
205 c.Check(repo.Architectures, DeepEquals, []string{"i386"})
206
207 rf, err := os.Open(filepath.Join(publishedStorage.PublicPath(), "ppa/dists/squeeze/Release"))
208 c.Assert(err, IsNil)
209
210 cfr := NewControlFileReader(rf, true, false)
211 st, err := cfr.ReadStanza()
212 c.Assert(err, IsNil)
213
214 c.Check(st["Origin"], Equals, "ppa squeeze")
215 c.Check(st["Components"], Equals, "main")
216 c.Check(st["Architectures"], Equals, "i386")
217
218 pf, err := os.Open(filepath.Join(publishedStorage.PublicPath(), "ppa/dists/squeeze/main/binary-i386/Packages"))
219 c.Assert(err, IsNil)
220
221 cfr = NewControlFileReader(pf, false, false)
222
223 for i := 0; i < 3; i++ {
224 st, err = cfr.ReadStanza()
225 c.Assert(err, IsNil)
226
227 c.Check(st["Filename"], Equals, "pool/squeeze/main/a/alien-arena/alien-arena-common_7.40-2_i386.deb")
228 }
229
230 st, err = cfr.ReadStanza()
231 c.Assert(err, IsNil)
232 c.Assert(st, IsNil)
233
234 drf, err := os.Open(filepath.Join(publishedStorage.PublicPath(), "ppa/dists/squeeze/main/binary-i386/Release"))
235 c.Assert(err, IsNil)
236
237 cfr = NewControlFileReader(drf, true, false)
238 st, err = cfr.ReadStanza()
239 c.Assert(err, IsNil)
240
241 c.Check(st["Archive"], Equals, "squeeze")
242 c.Check(st["Architecture"], Equals, "i386")
243
244 _, err = os.Stat(filepath.Join(publishedStorage.PublicPath(), "ppa/pool/squeeze/main/a/alien-arena/alien-arena-common_7.40-2_i386.deb"))
245 c.Assert(err, IsNil)
246
247}
248
249func (s *PublishedRepoSuite) TestPrefixNormalization(c *C) {
250

Callers

nothing calls this directly

Calls 9

PublishMethod · 0.95
PublicPathMethod · 0.95
ReadStanzaMethod · 0.95
NewPublishedStorageFunction · 0.92
NewPublishedRepoFunction · 0.85
NewControlFileReaderFunction · 0.85
OpenMethod · 0.65
StatMethod · 0.65
CheckMethod · 0.45

Tested by

no test coverage detected