mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-01-11 03:11:50 +00:00
Implemented filesystem endpoint with support for hardlinks, symlinks and copy.
This commit is contained in:
@@ -42,8 +42,8 @@ type PublishedStorage interface {
|
||||
RenameFile(oldName, newName string) error
|
||||
}
|
||||
|
||||
// LocalPublishedStorage is published storage on local filesystem
|
||||
type LocalPublishedStorage interface {
|
||||
// FileSystemPublishedStorage is published storage on filesystem
|
||||
type FileSystemPublishedStorage interface {
|
||||
// PublicPath returns root of public part
|
||||
PublicPath() string
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ func aptlyPublishSnapshotOrRepo(cmd *commander.Command, args []string) error {
|
||||
|
||||
context.Progress().Printf("\n%s been successfully published.\n", message)
|
||||
|
||||
if localStorage, ok := context.GetPublishedStorage(storage).(aptly.LocalPublishedStorage); ok {
|
||||
if localStorage, ok := context.GetPublishedStorage(storage).(aptly.FileSystemPublishedStorage); ok {
|
||||
context.Progress().Printf("Please setup your webserver to serve directory '%s' with autoindexing.\n",
|
||||
localStorage.PublicPath())
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ func aptlyServe(cmd *commander.Command, args []string) error {
|
||||
}
|
||||
}
|
||||
|
||||
publicPath := context.GetPublishedStorage("").(aptly.LocalPublishedStorage).PublicPath()
|
||||
publicPath := context.GetPublishedStorage("").(aptly.FileSystemPublishedStorage).PublicPath()
|
||||
ShutdownContext()
|
||||
|
||||
fmt.Printf("\nStarting web server at: %s (press Ctrl+C to quit)...\n", listen)
|
||||
|
||||
@@ -317,7 +317,14 @@ func (context *AptlyContext) GetPublishedStorage(name string) aptly.PublishedSto
|
||||
publishedStorage, ok := context.publishedStorages[name]
|
||||
if !ok {
|
||||
if name == "" {
|
||||
publishedStorage = files.NewPublishedStorage(context.config().RootDir)
|
||||
publishedStorage = files.NewPublishedStorage(filepath.Join(context.config().RootDir, "public"), "hardlink", "")
|
||||
} else if strings.HasPrefix(name, "filesystem:") {
|
||||
params, ok := context.config().FileSystemPublishRoots[name[11:]]
|
||||
if !ok {
|
||||
Fatal(fmt.Errorf("published local storage %v not configured", name[6:]))
|
||||
}
|
||||
|
||||
publishedStorage = files.NewPublishedStorage(params.RootDir, params.LinkMethod, params.VerifyMethod)
|
||||
} else if strings.HasPrefix(name, "s3:") {
|
||||
params, ok := context.config().S3PublishRoots[name[3:]]
|
||||
if !ok {
|
||||
|
||||
@@ -364,7 +364,7 @@ func (s *PackageSuite) TestPoolDirectory(c *C) {
|
||||
|
||||
func (s *PackageSuite) TestLinkFromPool(c *C) {
|
||||
packagePool := files.NewPackagePool(c.MkDir())
|
||||
publishedStorage := files.NewPublishedStorage(c.MkDir())
|
||||
publishedStorage := files.NewPublishedStorage(c.MkDir(), "", "")
|
||||
p := NewPackageFromControlFile(s.stanza)
|
||||
|
||||
poolPath, _ := packagePool.Path(p.Files()[0].Filename, p.Files()[0].Checksums)
|
||||
|
||||
@@ -90,9 +90,9 @@ func (s *PublishedRepoSuite) SetUpTest(c *C) {
|
||||
s.factory = NewCollectionFactory(s.db)
|
||||
|
||||
s.root = c.MkDir()
|
||||
s.publishedStorage = files.NewPublishedStorage(s.root)
|
||||
s.publishedStorage = files.NewPublishedStorage(s.root, "", "")
|
||||
s.root2 = c.MkDir()
|
||||
s.publishedStorage2 = files.NewPublishedStorage(s.root2)
|
||||
s.publishedStorage2 = files.NewPublishedStorage(s.root2, "", "")
|
||||
s.provider = &FakeStorageProvider{map[string]aptly.PublishedStorage{
|
||||
"": s.publishedStorage,
|
||||
"files:other": s.publishedStorage2}}
|
||||
@@ -653,7 +653,7 @@ func (s *PublishedRepoRemoveSuite) SetUpTest(c *C) {
|
||||
s.collection.Add(s.repo5)
|
||||
|
||||
s.root = c.MkDir()
|
||||
s.publishedStorage = files.NewPublishedStorage(s.root)
|
||||
s.publishedStorage = files.NewPublishedStorage(s.root, "", "")
|
||||
s.publishedStorage.MkDir("ppa/dists/anaconda")
|
||||
s.publishedStorage.MkDir("ppa/dists/meduza")
|
||||
s.publishedStorage.MkDir("ppa/dists/osminog")
|
||||
@@ -663,7 +663,7 @@ func (s *PublishedRepoRemoveSuite) SetUpTest(c *C) {
|
||||
s.publishedStorage.MkDir("pool/main")
|
||||
|
||||
s.root2 = c.MkDir()
|
||||
s.publishedStorage2 = files.NewPublishedStorage(s.root2)
|
||||
s.publishedStorage2 = files.NewPublishedStorage(s.root2, "", "")
|
||||
s.publishedStorage2.MkDir("ppa/dists/osminog")
|
||||
s.publishedStorage2.MkDir("ppa/pool/contrib")
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
"io"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"syscall"
|
||||
|
||||
"github.com/smira/aptly/aptly"
|
||||
@@ -13,18 +14,53 @@ import (
|
||||
|
||||
// PublishedStorage abstract file system with public dirs (published repos)
|
||||
type PublishedStorage struct {
|
||||
rootPath string
|
||||
rootPath string
|
||||
linkMethod uint
|
||||
verifyMethod uint
|
||||
}
|
||||
|
||||
// Check interfaces
|
||||
var (
|
||||
_ aptly.PublishedStorage = (*PublishedStorage)(nil)
|
||||
_ aptly.LocalPublishedStorage = (*PublishedStorage)(nil)
|
||||
_ aptly.PublishedStorage = (*PublishedStorage)(nil)
|
||||
_ aptly.FileSystemPublishedStorage = (*PublishedStorage)(nil)
|
||||
)
|
||||
|
||||
// Constants defining the type of creating links
|
||||
const (
|
||||
LinkMethodHardLink uint = iota
|
||||
LinkMethodSymLink
|
||||
LinkMethodCopy
|
||||
)
|
||||
|
||||
// Constants defining the type of file verification for LinkMethodCopy
|
||||
const (
|
||||
VerificationMethodChecksum uint = iota
|
||||
VerificationMethodFileSize
|
||||
)
|
||||
|
||||
// NewPublishedStorage creates new instance of PublishedStorage which specified root
|
||||
func NewPublishedStorage(root string) *PublishedStorage {
|
||||
return &PublishedStorage{rootPath: filepath.Join(root, "public")}
|
||||
func NewPublishedStorage(root string, linkMethod string, verifyMethod string) *PublishedStorage {
|
||||
// Ensure linkMethod is one of 'hardlink', 'symlink', 'copy'
|
||||
var verifiedLinkMethod uint
|
||||
|
||||
if strings.EqualFold(linkMethod, "copy") {
|
||||
verifiedLinkMethod = LinkMethodCopy
|
||||
} else if strings.EqualFold(linkMethod, "symlink") {
|
||||
verifiedLinkMethod = LinkMethodSymLink
|
||||
} else {
|
||||
verifiedLinkMethod = LinkMethodHardLink
|
||||
}
|
||||
|
||||
var verifiedVerifyMethod uint
|
||||
|
||||
if strings.EqualFold(verifyMethod, "size") {
|
||||
verifiedVerifyMethod = VerificationMethodFileSize
|
||||
} else {
|
||||
verifiedVerifyMethod = VerificationMethodChecksum
|
||||
}
|
||||
|
||||
return &PublishedStorage{rootPath: root, linkMethod: verifiedLinkMethod,
|
||||
verifyMethod: verifiedVerifyMethod}
|
||||
}
|
||||
|
||||
// PublicPath returns root of public part
|
||||
@@ -105,12 +141,35 @@ func (storage *PublishedStorage) LinkFromPool(publishedDirectory string, sourceP
|
||||
return err
|
||||
}
|
||||
|
||||
srcSys := srcStat.Sys().(*syscall.Stat_t)
|
||||
dstSys := dstStat.Sys().(*syscall.Stat_t)
|
||||
if storage.linkMethod == LinkMethodCopy {
|
||||
if storage.verifyMethod == VerificationMethodFileSize {
|
||||
// if source and destination have the same size, no need to copy
|
||||
if srcStat.Size() == dstStat.Size() {
|
||||
return nil
|
||||
}
|
||||
} else {
|
||||
// if source and destination have the same checksums, no need to copy
|
||||
dstMD5, err := utils.MD5ChecksumForFile(filepath.Join(poolPath, baseName))
|
||||
|
||||
// source and destination inodes match, no need to link
|
||||
if srcSys.Ino == dstSys.Ino {
|
||||
return nil
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if dstMD5 == sourceChecksums.MD5 {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
} else {
|
||||
srcSys := srcStat.Sys().(*syscall.Stat_t)
|
||||
dstSys := dstStat.Sys().(*syscall.Stat_t)
|
||||
|
||||
// if source and destination inodes match, no need to link
|
||||
|
||||
// Symlink can point to different filesystem with identical inodes
|
||||
// so we have to check the device as well.
|
||||
if srcSys.Ino == dstSys.Ino && srcSys.Dev == dstSys.Dev {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// source and destination have different inodes, if !forced, this is fatal error
|
||||
@@ -126,7 +185,15 @@ func (storage *PublishedStorage) LinkFromPool(publishedDirectory string, sourceP
|
||||
}
|
||||
|
||||
// destination doesn't exist (or forced), create link
|
||||
return os.Link(sourcePath, filepath.Join(poolPath, baseName))
|
||||
if storage.linkMethod == LinkMethodCopy {
|
||||
err = utils.CopyFile(sourcePath, filepath.Join(poolPath, baseName))
|
||||
} else if storage.linkMethod == LinkMethodSymLink {
|
||||
err = os.Symlink(sourcePath, filepath.Join(poolPath, baseName))
|
||||
} else {
|
||||
err = os.Link(sourcePath, filepath.Join(poolPath, baseName))
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// Filelist returns list of files under prefix
|
||||
|
||||
@@ -12,19 +12,40 @@ import (
|
||||
)
|
||||
|
||||
type PublishedStorageSuite struct {
|
||||
root string
|
||||
storage *PublishedStorage
|
||||
root string
|
||||
storage *PublishedStorage
|
||||
storageSymlink *PublishedStorage
|
||||
storageCopy *PublishedStorage
|
||||
storageCopySize *PublishedStorage
|
||||
}
|
||||
|
||||
var _ = Suite(&PublishedStorageSuite{})
|
||||
|
||||
func (s *PublishedStorageSuite) SetUpTest(c *C) {
|
||||
s.root = c.MkDir()
|
||||
s.storage = NewPublishedStorage(s.root)
|
||||
s.storage = NewPublishedStorage(filepath.Join(s.root, "public"), "", "")
|
||||
s.storageSymlink = NewPublishedStorage(filepath.Join(s.root, "public_symlink"), "symlink", "")
|
||||
s.storageCopy = NewPublishedStorage(filepath.Join(s.root, "public_copy"), "copy", "")
|
||||
s.storageCopySize = NewPublishedStorage(filepath.Join(s.root, "public_copysize"), "copy", "size")
|
||||
}
|
||||
|
||||
func (s *PublishedStorageSuite) TestLinkMethodField(c *C) {
|
||||
c.Assert(s.storage.linkMethod, Equals, LinkMethodHardLink)
|
||||
c.Assert(s.storageSymlink.linkMethod, Equals, LinkMethodSymLink)
|
||||
c.Assert(s.storageCopy.linkMethod, Equals, LinkMethodCopy)
|
||||
c.Assert(s.storageCopySize.linkMethod, Equals, LinkMethodCopy)
|
||||
}
|
||||
|
||||
func (s *PublishedStorageSuite) TestVerifyMethodField(c *C) {
|
||||
c.Assert(s.storageCopy.verifyMethod, Equals, VerificationMethodChecksum)
|
||||
c.Assert(s.storageCopySize.verifyMethod, Equals, VerificationMethodFileSize)
|
||||
}
|
||||
|
||||
func (s *PublishedStorageSuite) TestPublicPath(c *C) {
|
||||
c.Assert(s.storage.PublicPath(), Equals, filepath.Join(s.root, "public"))
|
||||
c.Assert(s.storageSymlink.PublicPath(), Equals, filepath.Join(s.root, "public_symlink"))
|
||||
c.Assert(s.storageCopy.PublicPath(), Equals, filepath.Join(s.root, "public_copy"))
|
||||
c.Assert(s.storageCopySize.PublicPath(), Equals, filepath.Join(s.root, "public_copysize"))
|
||||
}
|
||||
|
||||
func (s *PublishedStorageSuite) TestMkDir(c *C) {
|
||||
@@ -35,7 +56,7 @@ func (s *PublishedStorageSuite) TestMkDir(c *C) {
|
||||
c.Assert(err, IsNil)
|
||||
}
|
||||
|
||||
func (s *PublishedStorageSuite) TesPutFile(c *C) {
|
||||
func (s *PublishedStorageSuite) TestPutFile(c *C) {
|
||||
err := s.storage.MkDir("ppa/dists/squeeze/")
|
||||
c.Assert(err, IsNil)
|
||||
|
||||
@@ -156,7 +177,10 @@ func (s *PublishedStorageSuite) TestLinkFromPool(c *C) {
|
||||
err = ioutil.WriteFile(t.sourcePath, []byte("Contents"), 0644)
|
||||
c.Assert(err, IsNil)
|
||||
|
||||
err = s.storage.LinkFromPool(filepath.Join(t.prefix, "pool", t.component, t.poolDirectory), pool, t.sourcePath, utils.ChecksumInfo{}, false)
|
||||
sourceChecksum, err := utils.ChecksumsForFile(t.sourcePath)
|
||||
c.Assert(err, IsNil)
|
||||
|
||||
err = s.storage.LinkFromPool(filepath.Join(t.prefix, "pool", t.component, t.poolDirectory), pool, t.sourcePath, sourceChecksum, false)
|
||||
c.Assert(err, IsNil)
|
||||
|
||||
st, err := os.Stat(filepath.Join(s.storage.rootPath, t.prefix, t.expectedFilename))
|
||||
@@ -164,6 +188,36 @@ func (s *PublishedStorageSuite) TestLinkFromPool(c *C) {
|
||||
|
||||
info := st.Sys().(*syscall.Stat_t)
|
||||
c.Check(int(info.Nlink), Equals, 2)
|
||||
|
||||
// Test using symlinks
|
||||
err = s.storageSymlink.LinkFromPool(filepath.Join(t.prefix, "pool", t.component, t.poolDirectory), pool, t.sourcePath, sourceChecksum, false)
|
||||
c.Assert(err, IsNil)
|
||||
|
||||
st, err = os.Stat(filepath.Join(s.storageSymlink.rootPath, t.prefix, t.expectedFilename))
|
||||
c.Assert(err, IsNil)
|
||||
|
||||
info = st.Sys().(*syscall.Stat_t)
|
||||
c.Check(int(info.Nlink), Equals, 2)
|
||||
|
||||
// Test using copy with checksum verification
|
||||
err = s.storageCopy.LinkFromPool(filepath.Join(t.prefix, "pool", t.component, t.poolDirectory), pool, t.sourcePath, sourceChecksum, false)
|
||||
c.Assert(err, IsNil)
|
||||
|
||||
st, err = os.Stat(filepath.Join(s.storageCopy.rootPath, t.prefix, t.expectedFilename))
|
||||
c.Assert(err, IsNil)
|
||||
|
||||
info = st.Sys().(*syscall.Stat_t)
|
||||
c.Check(int(info.Nlink), Equals, 1)
|
||||
|
||||
// Test using copy with size verification
|
||||
err = s.storageCopySize.LinkFromPool(filepath.Join(t.prefix, "pool", t.component, t.poolDirectory), pool, t.sourcePath, sourceChecksum, false)
|
||||
c.Assert(err, IsNil)
|
||||
|
||||
st, err = os.Stat(filepath.Join(s.storageCopySize.rootPath, t.prefix, t.expectedFilename))
|
||||
c.Assert(err, IsNil)
|
||||
|
||||
info = st.Sys().(*syscall.Stat_t)
|
||||
c.Check(int(info.Nlink), Equals, 1)
|
||||
}
|
||||
|
||||
// test linking files to duplicate final name
|
||||
@@ -171,10 +225,14 @@ func (s *PublishedStorageSuite) TestLinkFromPool(c *C) {
|
||||
err := os.MkdirAll(filepath.Dir(sourcePath), 0755)
|
||||
c.Assert(err, IsNil)
|
||||
|
||||
err = ioutil.WriteFile(sourcePath, []byte("Contents"), 0644)
|
||||
// use same size to ensure copy with size check will fail on this one
|
||||
err = ioutil.WriteFile(sourcePath, []byte("cONTENTS"), 0644)
|
||||
c.Assert(err, IsNil)
|
||||
|
||||
err = s.storage.LinkFromPool(filepath.Join("", "pool", "main", "m/mars-invaders"), pool, sourcePath, utils.ChecksumInfo{}, false)
|
||||
sourceChecksum, err := utils.ChecksumsForFile(sourcePath)
|
||||
c.Assert(err, IsNil)
|
||||
|
||||
err = s.storage.LinkFromPool(filepath.Join("", "pool", "main", "m/mars-invaders"), pool, sourcePath, sourceChecksum, false)
|
||||
c.Check(err, ErrorMatches, ".*file already exists and is different")
|
||||
|
||||
st, err := os.Stat(sourcePath)
|
||||
@@ -184,7 +242,7 @@ func (s *PublishedStorageSuite) TestLinkFromPool(c *C) {
|
||||
c.Check(int(info.Nlink), Equals, 1)
|
||||
|
||||
// linking with force
|
||||
err = s.storage.LinkFromPool(filepath.Join("", "pool", "main", "m/mars-invaders"), pool, sourcePath, utils.ChecksumInfo{}, true)
|
||||
err = s.storage.LinkFromPool(filepath.Join("", "pool", "main", "m/mars-invaders"), pool, sourcePath, sourceChecksum, true)
|
||||
c.Check(err, IsNil)
|
||||
|
||||
st, err = os.Stat(sourcePath)
|
||||
@@ -192,4 +250,22 @@ func (s *PublishedStorageSuite) TestLinkFromPool(c *C) {
|
||||
|
||||
info = st.Sys().(*syscall.Stat_t)
|
||||
c.Check(int(info.Nlink), Equals, 2)
|
||||
|
||||
// Test using symlinks
|
||||
err = s.storageSymlink.LinkFromPool(filepath.Join("", "pool", "main", "m/mars-invaders"), pool, sourcePath, sourceChecksum, false)
|
||||
c.Check(err, ErrorMatches, ".*file already exists and is different")
|
||||
|
||||
err = s.storageSymlink.LinkFromPool(filepath.Join("", "pool", "main", "m/mars-invaders"), pool, sourcePath, sourceChecksum, true)
|
||||
c.Check(err, IsNil)
|
||||
|
||||
// Test using copy with checksum verification
|
||||
err = s.storageCopy.LinkFromPool(filepath.Join("", "pool", "main", "m/mars-invaders"), pool, sourcePath, sourceChecksum, false)
|
||||
c.Check(err, ErrorMatches, ".*file already exists and is different")
|
||||
|
||||
err = s.storageCopy.LinkFromPool(filepath.Join("", "pool", "main", "m/mars-invaders"), pool, sourcePath, sourceChecksum, true)
|
||||
c.Check(err, IsNil)
|
||||
|
||||
// Test using copy with size verification (this will NOT detect the difference)
|
||||
err = s.storageCopySize.LinkFromPool(filepath.Join("", "pool", "main", "m/mars-invaders"), pool, sourcePath, sourceChecksum, false)
|
||||
c.Check(err, IsNil)
|
||||
}
|
||||
|
||||
40
man/aptly.1
40
man/aptly.1
@@ -1,7 +1,7 @@
|
||||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "APTLY" "1" "March 2017" "" ""
|
||||
.TH "APTLY" "1" "April 2017" "" ""
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBaptly\fR \- Debian repository management tool
|
||||
@@ -50,6 +50,21 @@ Configuration file is stored in JSON format (default values shown below):
|
||||
"ppaDistributorID": "ubuntu",
|
||||
"ppaCodename": "",
|
||||
"skipContentsPublishing": false,
|
||||
"FileSystemPublishEndpoints": {
|
||||
"test1": {
|
||||
"rootDir": "/opt/srv1/aptly_public",
|
||||
"linkMethod": "symlink"
|
||||
},
|
||||
"test2": {
|
||||
"rootDir": "/opt/srv2/aptly_public",
|
||||
"linkMethod": "copy",
|
||||
"verifyMethod": "md5"
|
||||
},
|
||||
"test3": {
|
||||
"rootDir": "/opt/srv3/aptly_public",
|
||||
"linkMethod": "hardlink"
|
||||
}
|
||||
},
|
||||
"S3PublishEndpoints": {
|
||||
"test": {
|
||||
"region": "us\-east\-1",
|
||||
@@ -89,7 +104,7 @@ Options:
|
||||
.
|
||||
.TP
|
||||
\fBrootDir\fR
|
||||
is root of directory storage to store database (\fBrootDir\fR/db), downloaded packages (\fBrootDir\fR/pool) and published repositories (\fBrootDir\fR/public)
|
||||
is root of directory storage to store database (\fBrootDir\fR/db), downloaded packages (\fBrootDir\fR/pool) and the default for published repositories (\fBrootDir\fR/public)
|
||||
.
|
||||
.TP
|
||||
\fBdownloadConcurrency\fR
|
||||
@@ -147,6 +162,27 @@ configuration of Amazon S3 publishing endpoints (see below)
|
||||
\fBSwiftPublishEndpoints\fR
|
||||
configuration of OpenStack Swift publishing endpoints (see below)
|
||||
.
|
||||
.SH "FILESYSTEM PUBLISHING ENDPOINTS"
|
||||
aptly defaults to publish to a single publish directory under \fBrootDir\fR/public\. For a more advanced publishing strategy, you can define one or more filesystem endpoints in the \fBFileSystemPublishEndpoints\fR list of the aptly configuration file\. Each endpoint has a name and the following associated settings:
|
||||
.
|
||||
.TP
|
||||
\fBrootDir\fR
|
||||
The publish directory, e\.g\., \fB/opt/srv/aptly_public\fR\.
|
||||
.
|
||||
.TP
|
||||
\fBlinkMethod\fR
|
||||
This is one of \fBhardlink\fR, \fBsymlink\fR or \fBcopy\fR\. It specifies how aptly links the files from the internal pool to the published directory\. If not specified, empty or wrong, this defaults to \fBhardlink\fR\.
|
||||
.
|
||||
.TP
|
||||
\fBverifyMethod\fR
|
||||
This is used only when setting the \fBlinkMethod\fR to \fBcopy\fR\. Possible values are \fBmd5\fR and \fBsize\fR\. It specifies how aptly compares existing links from the internal pool to the published directory\. The \fBsize\fR method compares only the file sizes, whereas the \fBmd5\fR method calculates the md5 checksum of the found file and compares it to the desired one\. If not specified, empty or wrong, this defaults to \fBmd5\fR\.
|
||||
.
|
||||
.P
|
||||
In order to publish to such an endpoint, specify the endpoint as \fBfilesystem:endpoint\-name\fR with \fBendpoint\-name\fR as the name given in the aptly configuration file\. For example:
|
||||
.
|
||||
.P
|
||||
\fBaptly publish snapshot wheezy\-main filesystem:test1:wheezy/daily\fR
|
||||
.
|
||||
.SH "S3 PUBLISHING ENDPOINTS"
|
||||
aptly could be configured to publish repository directly to Amazon S3 (or S3\-compatible cloud storage)\. First, publishing endpoints should be described in aptly configuration file\. Each endpoint has name and associated settings:
|
||||
.
|
||||
|
||||
@@ -42,6 +42,21 @@ Configuration file is stored in JSON format (default values shown below):
|
||||
"ppaDistributorID": "ubuntu",
|
||||
"ppaCodename": "",
|
||||
"skipContentsPublishing": false,
|
||||
"FileSystemPublishEndpoints": {
|
||||
"test1": {
|
||||
"rootDir": "/opt/srv1/aptly_public",
|
||||
"linkMethod": "symlink"
|
||||
},
|
||||
"test2": {
|
||||
"rootDir": "/opt/srv2/aptly_public",
|
||||
"linkMethod": "copy",
|
||||
"verifyMethod": "md5"
|
||||
},
|
||||
"test3": {
|
||||
"rootDir": "/opt/srv3/aptly_public",
|
||||
"linkMethod": "hardlink"
|
||||
}
|
||||
},
|
||||
"S3PublishEndpoints": {
|
||||
"test": {
|
||||
"region": "us-east-1",
|
||||
@@ -76,7 +91,7 @@ Options:
|
||||
|
||||
* `rootDir`:
|
||||
is root of directory storage to store database (`rootDir`/db), downloaded packages (`rootDir`/pool) and
|
||||
published repositories (`rootDir`/public)
|
||||
the default for published repositories (`rootDir`/public)
|
||||
|
||||
* `downloadConcurrency`:
|
||||
is a number of parallel download threads to use when downloading packages
|
||||
@@ -125,6 +140,32 @@ Options:
|
||||
* `SwiftPublishEndpoints`:
|
||||
configuration of OpenStack Swift publishing endpoints (see below)
|
||||
|
||||
## FILESYSTEM PUBLISHING ENDPOINTS
|
||||
|
||||
aptly defaults to publish to a single publish directory under `rootDir`/public. For
|
||||
a more advanced publishing strategy, you can define one or more filesystem endpoints in the
|
||||
`FileSystemPublishEndpoints` list of the aptly configuration file. Each endpoint has a name
|
||||
and the following associated settings:
|
||||
|
||||
* `rootDir`:
|
||||
The publish directory, e.g., `/opt/srv/aptly_public`.
|
||||
* `linkMethod`:
|
||||
This is one of `hardlink`, `symlink` or `copy`. It specifies how aptly links the
|
||||
files from the internal pool to the published directory.
|
||||
If not specified, empty or wrong, this defaults to `hardlink`.
|
||||
* `verifyMethod`:
|
||||
This is used only when setting the `linkMethod` to `copy`. Possible values are
|
||||
`md5` and `size`. It specifies how aptly compares existing links from the
|
||||
internal pool to the published directory. The `size` method compares only the
|
||||
file sizes, whereas the `md5` method calculates the md5 checksum of the found
|
||||
file and compares it to the desired one.
|
||||
If not specified, empty or wrong, this defaults to `md5`.
|
||||
|
||||
In order to publish to such an endpoint, specify the endpoint as `filesystem:endpoint-name`
|
||||
with `endpoint-name` as the name given in the aptly configuration file. For example:
|
||||
|
||||
`aptly publish snapshot wheezy-main filesystem:test1:wheezy/daily`
|
||||
|
||||
## S3 PUBLISHING ENDPOINTS
|
||||
|
||||
aptly could be configured to publish repository directly to Amazon S3 (or S3-compatible
|
||||
|
||||
48
system/fs_endpoint_lib.py
Normal file
48
system/fs_endpoint_lib.py
Normal file
@@ -0,0 +1,48 @@
|
||||
import os
|
||||
from lib import BaseTest
|
||||
|
||||
class FileSystemEndpointTest(BaseTest):
|
||||
"""
|
||||
BaseTest + support for filesystem endpoints
|
||||
"""
|
||||
|
||||
def prepare(self):
|
||||
self.configOverride = { "FileSystemPublishEndpoints": {
|
||||
"symlink": {
|
||||
"rootDir": os.path.join(os.environ["HOME"], ".aptly", "public_symlink"),
|
||||
"linkMethod": "symlink"
|
||||
},
|
||||
"hardlink": {
|
||||
"rootDir": os.path.join(os.environ["HOME"], ".aptly", "public_hardlink"),
|
||||
"linkMethod": "hardlink"
|
||||
},
|
||||
"copy": {
|
||||
"rootDir": os.path.join(os.environ["HOME"], ".aptly", "public_copy"),
|
||||
"linkMethod": "copy",
|
||||
"verifyMethod": "md5"
|
||||
},
|
||||
"copysize": {
|
||||
"rootDir": os.path.join(os.environ["HOME"], ".aptly", "public_copysize"),
|
||||
"linkMethod": "copy",
|
||||
"verifyMethod": "size"
|
||||
}
|
||||
}}
|
||||
super(FileSystemEndpointTest, self).prepare()
|
||||
|
||||
|
||||
def check_is_regular(self, path):
|
||||
if not os.path.isfile(os.path.join(os.environ["HOME"], ".aptly", path)):
|
||||
raise Exception("path %s is not a regular file" % (path, ))
|
||||
|
||||
def check_is_symlink(self, path):
|
||||
if not os.path.islink(os.path.join(os.environ["HOME"], ".aptly", path)):
|
||||
raise Exception("path %s is not a symlink" % (path, ))
|
||||
|
||||
def check_is_hardlink(self, path):
|
||||
if os.stat(os.path.join(os.environ["HOME"], ".aptly", path)) <= 1:
|
||||
raise Exception("path %s is not a hardlink" % (path, ))
|
||||
|
||||
def check_is_copy(self, path):
|
||||
fullpath = os.path.join(os.environ["HOME"], ".aptly", path)
|
||||
if not ( os.path.isfile(fullpath) and not self.check_is_hardlink(path) ):
|
||||
raise Exception("path %s is not a copy" % (path, ))
|
||||
@@ -13,6 +13,7 @@ from lib import BaseTest
|
||||
from s3_lib import S3Test
|
||||
from swift_lib import SwiftTest
|
||||
from api_lib import APITest
|
||||
from fs_endpoint_lib import FileSystemEndpointTest
|
||||
|
||||
try:
|
||||
from termcolor import colored
|
||||
@@ -39,7 +40,7 @@ def run(include_long_tests=False, capture_results=False, tests=None, filters=Non
|
||||
o = getattr(testModule, name)
|
||||
|
||||
if not (inspect.isclass(o) and issubclass(o, BaseTest) and o is not BaseTest and
|
||||
o is not SwiftTest and o is not S3Test and o is not APITest):
|
||||
o is not SwiftTest and o is not S3Test and o is not APITest and o is not FileSystemEndpointTest):
|
||||
continue
|
||||
|
||||
newBase = o.__bases__[0]
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
"ppaDistributorID": "ubuntu",
|
||||
"ppaCodename": "",
|
||||
"skipContentsPublishing": false,
|
||||
"FileSystemPublishEndpoints": {},
|
||||
"S3PublishEndpoints": {},
|
||||
"SwiftPublishEndpoints": {}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
"ppaDistributorID": "ubuntu",
|
||||
"ppaCodename": "",
|
||||
"skipContentsPublishing": false,
|
||||
"FileSystemPublishEndpoints": {},
|
||||
"S3PublishEndpoints": {},
|
||||
"SwiftPublishEndpoints": {}
|
||||
}
|
||||
3
system/t06_publish/FSEndpointPublishSnapshot10Test_gold
Normal file
3
system/t06_publish/FSEndpointPublishSnapshot10Test_gold
Normal file
@@ -0,0 +1,3 @@
|
||||
filesystem:copy:. maverick
|
||||
filesystem:hardlink:. maverick
|
||||
filesystem:symlink:snap_symlink/daily maverick
|
||||
@@ -0,0 +1,12 @@
|
||||
Format: 1.0
|
||||
Source: pyspi
|
||||
Binary: python-at-spi
|
||||
Architecture: any
|
||||
Version: 0.6.1-1.5
|
||||
Maintainer: Jose Carlos Garcia Sogo <jsogo@debian.org>
|
||||
Homepage: http://people.redhat.com/zcerza/dogtail
|
||||
Standards-Version: 3.7.3
|
||||
Vcs-Svn: svn://svn.tribulaciones.org/srv/svn/pyspi/trunk
|
||||
Build-Depends: debhelper (>= 5), cdbs, libatspi-dev, python-pyrex, python-support (>= 0.4), python-all-dev, libx11-dev
|
||||
Files:
|
||||
68ba00eb6995aeecb19773a27bf81b3d 9 pyspi_0.6.1.orig.tar.gz
|
||||
@@ -0,0 +1 @@
|
||||
Contents
|
||||
3
system/t06_publish/FSEndpointPublishSnapshot11Test_gold
Normal file
3
system/t06_publish/FSEndpointPublishSnapshot11Test_gold
Normal file
@@ -0,0 +1,3 @@
|
||||
Loading packages...
|
||||
Generating metadata files and linking package files...
|
||||
ERROR: unable to publish: unable to process packages: error linking file to ${HOME}/.aptly/public_symlink/pool/main/p/pyspi/pyspi_0.6.1.orig.tar.gz: file already exists and is different
|
||||
@@ -0,0 +1,12 @@
|
||||
Format: 1.0
|
||||
Source: pyspi
|
||||
Binary: python-at-spi
|
||||
Architecture: any
|
||||
Version: 0.6.1-1.5
|
||||
Maintainer: Jose Carlos Garcia Sogo <jsogo@debian.org>
|
||||
Homepage: http://people.redhat.com/zcerza/dogtail
|
||||
Standards-Version: 3.7.3
|
||||
Vcs-Svn: svn://svn.tribulaciones.org/srv/svn/pyspi/trunk
|
||||
Build-Depends: debhelper (>= 5), cdbs, libatspi-dev, python-pyrex, python-support (>= 0.4), python-all-dev, libx11-dev
|
||||
Files:
|
||||
68ba00eb6995aeecb19773a27bf81b3d 9 pyspi_0.6.1.orig.tar.gz
|
||||
@@ -0,0 +1 @@
|
||||
Contents
|
||||
1
system/t06_publish/FSEndpointPublishSnapshot12Test_file
Normal file
1
system/t06_publish/FSEndpointPublishSnapshot12Test_file
Normal file
@@ -0,0 +1 @@
|
||||
Contents
|
||||
16
system/t06_publish/FSEndpointPublishSnapshot12Test_gold
Normal file
16
system/t06_publish/FSEndpointPublishSnapshot12Test_gold
Normal file
@@ -0,0 +1,16 @@
|
||||
WARNING: force overwrite mode enabled, aptly might corrupt other published repositories sharing the same package pool.
|
||||
|
||||
Loading packages...
|
||||
Generating metadata files and linking package files...
|
||||
Finalizing metadata files...
|
||||
Signing file 'Release' with gpg, please enter your passphrase when prompted:
|
||||
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
|
||||
|
||||
Snapshot snap2 has been successfully published.
|
||||
Please setup your webserver to serve directory '${HOME}/.aptly/public_symlink' with autoindexing.
|
||||
Now you can add following line to apt sources:
|
||||
deb http://your-server/ squeeze main
|
||||
deb-src http://your-server/ squeeze main
|
||||
Don't forget to add your GPG key to apt with apt-key.
|
||||
|
||||
You can also use `aptly serve` to publish your repositories over HTTP quickly.
|
||||
@@ -0,0 +1,12 @@
|
||||
Format: 1.0
|
||||
Source: pyspi
|
||||
Binary: python-at-spi
|
||||
Architecture: any
|
||||
Version: 0.6.1-1.5
|
||||
Maintainer: Jose Carlos Garcia Sogo <jsogo@debian.org>
|
||||
Homepage: http://people.redhat.com/zcerza/dogtail
|
||||
Standards-Version: 3.7.3
|
||||
Vcs-Svn: svn://svn.tribulaciones.org/srv/svn/pyspi/trunk
|
||||
Build-Depends: debhelper (>= 5), cdbs, libatspi-dev, python-pyrex, python-support (>= 0.4), python-all-dev, libx11-dev
|
||||
Files:
|
||||
68ba00eb6995aeecb19773a27bf81b3d 9 pyspi_0.6.1.orig.tar.gz
|
||||
@@ -0,0 +1 @@
|
||||
Contents
|
||||
3
system/t06_publish/FSEndpointPublishSnapshot13Test_gold
Normal file
3
system/t06_publish/FSEndpointPublishSnapshot13Test_gold
Normal file
@@ -0,0 +1,3 @@
|
||||
Loading packages...
|
||||
Generating metadata files and linking package files...
|
||||
ERROR: unable to publish: unable to process packages: error linking file to ${HOME}/.aptly/public_copy/pool/main/p/pyspi/pyspi_0.6.1.orig.tar.gz: file already exists and is different
|
||||
@@ -0,0 +1,12 @@
|
||||
Format: 1.0
|
||||
Source: pyspi
|
||||
Binary: python-at-spi
|
||||
Architecture: any
|
||||
Version: 0.6.1-1.5
|
||||
Maintainer: Jose Carlos Garcia Sogo <jsogo@debian.org>
|
||||
Homepage: http://people.redhat.com/zcerza/dogtail
|
||||
Standards-Version: 3.7.3
|
||||
Vcs-Svn: svn://svn.tribulaciones.org/srv/svn/pyspi/trunk
|
||||
Build-Depends: debhelper (>= 5), cdbs, libatspi-dev, python-pyrex, python-support (>= 0.4), python-all-dev, libx11-dev
|
||||
Files:
|
||||
68ba00eb6995aeecb19773a27bf81b3d 9 pyspi_0.6.1.orig.tar.gz
|
||||
@@ -0,0 +1 @@
|
||||
Contents
|
||||
1
system/t06_publish/FSEndpointPublishSnapshot14Test_file
Normal file
1
system/t06_publish/FSEndpointPublishSnapshot14Test_file
Normal file
@@ -0,0 +1 @@
|
||||
Contents
|
||||
16
system/t06_publish/FSEndpointPublishSnapshot14Test_gold
Normal file
16
system/t06_publish/FSEndpointPublishSnapshot14Test_gold
Normal file
@@ -0,0 +1,16 @@
|
||||
WARNING: force overwrite mode enabled, aptly might corrupt other published repositories sharing the same package pool.
|
||||
|
||||
Loading packages...
|
||||
Generating metadata files and linking package files...
|
||||
Finalizing metadata files...
|
||||
Signing file 'Release' with gpg, please enter your passphrase when prompted:
|
||||
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
|
||||
|
||||
Snapshot snap2 has been successfully published.
|
||||
Please setup your webserver to serve directory '${HOME}/.aptly/public_copy' with autoindexing.
|
||||
Now you can add following line to apt sources:
|
||||
deb http://your-server/ squeeze main
|
||||
deb-src http://your-server/ squeeze main
|
||||
Don't forget to add your GPG key to apt with apt-key.
|
||||
|
||||
You can also use `aptly serve` to publish your repositories over HTTP quickly.
|
||||
@@ -0,0 +1,12 @@
|
||||
Format: 1.0
|
||||
Source: pyspi
|
||||
Binary: python-at-spi
|
||||
Architecture: any
|
||||
Version: 0.6.1-1.5
|
||||
Maintainer: Jose Carlos Garcia Sogo <jsogo@debian.org>
|
||||
Homepage: http://people.redhat.com/zcerza/dogtail
|
||||
Standards-Version: 3.7.3
|
||||
Vcs-Svn: svn://svn.tribulaciones.org/srv/svn/pyspi/trunk
|
||||
Build-Depends: debhelper (>= 5), cdbs, libatspi-dev, python-pyrex, python-support (>= 0.4), python-all-dev, libx11-dev
|
||||
Files:
|
||||
68ba00eb6995aeecb19773a27bf81b3d 9 pyspi_0.6.1.orig.tar.gz
|
||||
@@ -0,0 +1 @@
|
||||
Contents
|
||||
3
system/t06_publish/FSEndpointPublishSnapshot15Test_gold
Normal file
3
system/t06_publish/FSEndpointPublishSnapshot15Test_gold
Normal file
@@ -0,0 +1,3 @@
|
||||
Loading packages...
|
||||
Generating metadata files and linking package files...
|
||||
ERROR: unable to publish: unable to process packages: error linking file to ${HOME}/.aptly/public_copysize/pool/main/p/pyspi/pyspi_0.6.1.orig.tar.gz: file already exists and is different
|
||||
@@ -0,0 +1,12 @@
|
||||
Format: 1.0
|
||||
Source: pyspi
|
||||
Binary: python-at-spi
|
||||
Architecture: any
|
||||
Version: 0.6.1-1.5
|
||||
Maintainer: Jose Carlos Garcia Sogo <jsogo@debian.org>
|
||||
Homepage: http://people.redhat.com/zcerza/dogtail
|
||||
Standards-Version: 3.7.3
|
||||
Vcs-Svn: svn://svn.tribulaciones.org/srv/svn/pyspi/trunk
|
||||
Build-Depends: debhelper (>= 5), cdbs, libatspi-dev, python-pyrex, python-support (>= 0.4), python-all-dev, libx11-dev
|
||||
Files:
|
||||
68ba00eb6995aeecb19773a27bf81b3d 9 pyspi_0.6.1.orig.tar.gz
|
||||
@@ -0,0 +1 @@
|
||||
Contents
|
||||
1
system/t06_publish/FSEndpointPublishSnapshot16Test_file
Normal file
1
system/t06_publish/FSEndpointPublishSnapshot16Test_file
Normal file
@@ -0,0 +1 @@
|
||||
Contents
|
||||
16
system/t06_publish/FSEndpointPublishSnapshot16Test_gold
Normal file
16
system/t06_publish/FSEndpointPublishSnapshot16Test_gold
Normal file
@@ -0,0 +1,16 @@
|
||||
WARNING: force overwrite mode enabled, aptly might corrupt other published repositories sharing the same package pool.
|
||||
|
||||
Loading packages...
|
||||
Generating metadata files and linking package files...
|
||||
Finalizing metadata files...
|
||||
Signing file 'Release' with gpg, please enter your passphrase when prompted:
|
||||
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
|
||||
|
||||
Snapshot snap2 has been successfully published.
|
||||
Please setup your webserver to serve directory '${HOME}/.aptly/public_copysize' with autoindexing.
|
||||
Now you can add following line to apt sources:
|
||||
deb http://your-server/ squeeze main
|
||||
deb-src http://your-server/ squeeze main
|
||||
Don't forget to add your GPG key to apt with apt-key.
|
||||
|
||||
You can also use `aptly serve` to publish your repositories over HTTP quickly.
|
||||
Binary file not shown.
Binary file not shown.
3
system/t06_publish/FSEndpointPublishSnapshot17Test_gold
Normal file
3
system/t06_publish/FSEndpointPublishSnapshot17Test_gold
Normal file
@@ -0,0 +1,3 @@
|
||||
Loading packages...
|
||||
Generating metadata files and linking package files...
|
||||
ERROR: unable to publish: unable to process packages: error linking file to ${HOME}/.aptly/public_copy/pool/main/b/boost-defaults/libboost-broken-program-options-dev_1.49.0.1_i386.deb: file already exists and is different
|
||||
Binary file not shown.
Binary file not shown.
14
system/t06_publish/FSEndpointPublishSnapshot18Test_gold
Normal file
14
system/t06_publish/FSEndpointPublishSnapshot18Test_gold
Normal file
@@ -0,0 +1,14 @@
|
||||
Loading packages...
|
||||
Generating metadata files and linking package files...
|
||||
[!] Failed to generate package contents: unable to read .tar archive from ${HOME}/.aptly/pool/a5/d5/libboost-broken-program-options-dev_1.49.0.1_i386.deb: unexpected EOF
|
||||
Finalizing metadata files...
|
||||
Signing file 'Release' with gpg, please enter your passphrase when prompted:
|
||||
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
|
||||
|
||||
Snapshot snap2 has been successfully published.
|
||||
Please setup your webserver to serve directory '${HOME}/.aptly/public_copysize' with autoindexing.
|
||||
Now you can add following line to apt sources:
|
||||
deb http://your-server/ squeeze main
|
||||
Don't forget to add your GPG key to apt with apt-key.
|
||||
|
||||
You can also use `aptly serve` to publish your repositories over HTTP quickly.
|
||||
13
system/t06_publish/FSEndpointPublishSnapshot1Test_gold
Normal file
13
system/t06_publish/FSEndpointPublishSnapshot1Test_gold
Normal file
@@ -0,0 +1,13 @@
|
||||
Loading packages...
|
||||
Generating metadata files and linking package files...
|
||||
Finalizing metadata files...
|
||||
Signing file 'Release' with gpg, please enter your passphrase when prompted:
|
||||
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
|
||||
|
||||
Snapshot snap1 has been successfully published.
|
||||
Please setup your webserver to serve directory '${HOME}/.aptly/public_symlink' with autoindexing.
|
||||
Now you can add following line to apt sources:
|
||||
deb http://your-server/ maverick main
|
||||
Don't forget to add your GPG key to apt with apt-key.
|
||||
|
||||
You can also use `aptly serve` to publish your repositories over HTTP quickly.
|
||||
13
system/t06_publish/FSEndpointPublishSnapshot2Test_gold
Normal file
13
system/t06_publish/FSEndpointPublishSnapshot2Test_gold
Normal file
@@ -0,0 +1,13 @@
|
||||
Loading packages...
|
||||
Generating metadata files and linking package files...
|
||||
Finalizing metadata files...
|
||||
Signing file 'Release' with gpg, please enter your passphrase when prompted:
|
||||
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
|
||||
|
||||
Snapshot snap1 has been successfully published.
|
||||
Please setup your webserver to serve directory '${HOME}/.aptly/public_hardlink' with autoindexing.
|
||||
Now you can add following line to apt sources:
|
||||
deb http://your-server/ maverick main
|
||||
Don't forget to add your GPG key to apt with apt-key.
|
||||
|
||||
You can also use `aptly serve` to publish your repositories over HTTP quickly.
|
||||
13
system/t06_publish/FSEndpointPublishSnapshot3Test_gold
Normal file
13
system/t06_publish/FSEndpointPublishSnapshot3Test_gold
Normal file
@@ -0,0 +1,13 @@
|
||||
Loading packages...
|
||||
Generating metadata files and linking package files...
|
||||
Finalizing metadata files...
|
||||
Signing file 'Release' with gpg, please enter your passphrase when prompted:
|
||||
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
|
||||
|
||||
Snapshot snap1 has been successfully published.
|
||||
Please setup your webserver to serve directory '${HOME}/.aptly/public_copy' with autoindexing.
|
||||
Now you can add following line to apt sources:
|
||||
deb http://your-server/ maverick main
|
||||
Don't forget to add your GPG key to apt with apt-key.
|
||||
|
||||
You can also use `aptly serve` to publish your repositories over HTTP quickly.
|
||||
13
system/t06_publish/FSEndpointPublishSnapshot4Test_gold
Normal file
13
system/t06_publish/FSEndpointPublishSnapshot4Test_gold
Normal file
@@ -0,0 +1,13 @@
|
||||
Loading packages...
|
||||
Generating metadata files and linking package files...
|
||||
Finalizing metadata files...
|
||||
Signing file 'Release' with gpg, please enter your passphrase when prompted:
|
||||
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
|
||||
|
||||
Snapshot snap1 has been successfully published.
|
||||
Please setup your webserver to serve directory '${HOME}/.aptly/public_hardlink' with autoindexing.
|
||||
Now you can add following line to apt sources:
|
||||
deb http://your-server/ maverick main
|
||||
Don't forget to add your GPG key to apt with apt-key.
|
||||
|
||||
You can also use `aptly serve` to publish your repositories over HTTP quickly.
|
||||
13
system/t06_publish/FSEndpointPublishSnapshot5Test_gold
Normal file
13
system/t06_publish/FSEndpointPublishSnapshot5Test_gold
Normal file
@@ -0,0 +1,13 @@
|
||||
Loading packages...
|
||||
Generating metadata files and linking package files...
|
||||
Finalizing metadata files...
|
||||
Signing file 'Release' with gpg, please enter your passphrase when prompted:
|
||||
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
|
||||
|
||||
Snapshot snap1 has been successfully published.
|
||||
Please setup your webserver to serve directory '${HOME}/.aptly/public_hardlink' with autoindexing.
|
||||
Now you can add following line to apt sources:
|
||||
deb http://your-server/snap_hardlink/daily/ maverick main
|
||||
Don't forget to add your GPG key to apt with apt-key.
|
||||
|
||||
You can also use `aptly serve` to publish your repositories over HTTP quickly.
|
||||
4
system/t06_publish/FSEndpointPublishSnapshot6Test_gold
Normal file
4
system/t06_publish/FSEndpointPublishSnapshot6Test_gold
Normal file
@@ -0,0 +1,4 @@
|
||||
Removing ${HOME}/.aptly/public_copy/dists...
|
||||
Removing ${HOME}/.aptly/public_copy/pool...
|
||||
|
||||
Published repository has been removed successfully.
|
||||
4
system/t06_publish/FSEndpointPublishSnapshot7Test_gold
Normal file
4
system/t06_publish/FSEndpointPublishSnapshot7Test_gold
Normal file
@@ -0,0 +1,4 @@
|
||||
Removing ${HOME}/.aptly/public_hardlink/dists...
|
||||
Removing ${HOME}/.aptly/public_hardlink/pool...
|
||||
|
||||
Published repository has been removed successfully.
|
||||
1
system/t06_publish/FSEndpointPublishSnapshot8Test_gold
Normal file
1
system/t06_publish/FSEndpointPublishSnapshot8Test_gold
Normal file
@@ -0,0 +1 @@
|
||||
Snapshot `snap1` has been dropped.
|
||||
4
system/t06_publish/FSEndpointPublishSnapshot9Test_gold
Normal file
4
system/t06_publish/FSEndpointPublishSnapshot9Test_gold
Normal file
@@ -0,0 +1,4 @@
|
||||
Snapshot `snap1` is published currently:
|
||||
* filesystem:hardlink:./maverick [amd64, i386] publishes {main: [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick}
|
||||
* filesystem:symlink:./maverick [amd64, i386] publishes {main: [snap1]: Snapshot from mirror [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick}
|
||||
ERROR: unable to drop: snapshot is published
|
||||
@@ -2,6 +2,7 @@
|
||||
Testing publishing snapshots
|
||||
"""
|
||||
|
||||
from .fs_endpoint import *
|
||||
from .drop import *
|
||||
from .show import *
|
||||
from .list import *
|
||||
|
||||
569
system/t06_publish/fs_endpoint.py
Normal file
569
system/t06_publish/fs_endpoint.py
Normal file
@@ -0,0 +1,569 @@
|
||||
from fs_endpoint_lib import FileSystemEndpointTest
|
||||
|
||||
|
||||
class FSEndpointPublishSnapshot1Test(FileSystemEndpointTest):
|
||||
"""
|
||||
publish snapshot: using symlinks
|
||||
"""
|
||||
fixtureDB = True
|
||||
fixturePool = True
|
||||
fixtureCmds = [
|
||||
"aptly snapshot create snap1 from mirror gnuplot-maverick",
|
||||
]
|
||||
runCmd = "aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec snap1 filesystem:symlink:"
|
||||
gold_processor = FileSystemEndpointTest.expand_environ
|
||||
|
||||
def check(self):
|
||||
super(FSEndpointPublishSnapshot1Test, self).check()
|
||||
|
||||
self.check_is_regular('public_symlink/dists/maverick/InRelease')
|
||||
self.check_is_regular('public_symlink/dists/maverick/Release')
|
||||
self.check_is_regular('public_symlink/dists/maverick/Release.gpg')
|
||||
|
||||
self.check_is_regular('public_symlink/dists/maverick/main/binary-i386/Release')
|
||||
self.check_is_regular('public_symlink/dists/maverick/main/binary-i386/Packages')
|
||||
self.check_is_regular('public_symlink/dists/maverick/main/binary-i386/Packages.gz')
|
||||
self.check_is_regular('public_symlink/dists/maverick/main/binary-i386/Packages.bz2')
|
||||
self.check_is_regular('public_symlink/dists/maverick/main/Contents-i386.gz')
|
||||
self.check_is_regular('public_symlink/dists/maverick/main/binary-amd64/Release')
|
||||
self.check_is_regular('public_symlink/dists/maverick/main/binary-amd64/Packages')
|
||||
self.check_is_regular('public_symlink/dists/maverick/main/binary-amd64/Packages.gz')
|
||||
self.check_is_regular('public_symlink/dists/maverick/main/binary-amd64/Packages.bz2')
|
||||
self.check_is_regular('public_symlink/dists/maverick/main/Contents-amd64.gz')
|
||||
self.check_not_exists('public_symlink/dists/maverick/main/debian-installer/binary-i386/Packages')
|
||||
self.check_not_exists('public_symlink/dists/maverick/main/debian-installer/binary-amd64/Packages')
|
||||
|
||||
self.check_is_symlink('public_symlink/pool/main/g/gnuplot/gnuplot-doc_4.6.1-1~maverick2_all.deb')
|
||||
|
||||
|
||||
class FSEndpointPublishSnapshot2Test(FileSystemEndpointTest):
|
||||
"""
|
||||
publish snapshot: using hardlinks
|
||||
"""
|
||||
fixtureDB = True
|
||||
fixturePool = True
|
||||
fixtureCmds = [
|
||||
"aptly snapshot create snap1 from mirror gnuplot-maverick",
|
||||
]
|
||||
runCmd = "aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec snap1 filesystem:hardlink:"
|
||||
gold_processor = FileSystemEndpointTest.expand_environ
|
||||
|
||||
def check(self):
|
||||
super(FSEndpointPublishSnapshot2Test, self).check()
|
||||
|
||||
self.check_is_regular('public_hardlink/dists/maverick/InRelease')
|
||||
self.check_is_regular('public_hardlink/dists/maverick/Release')
|
||||
self.check_is_regular('public_hardlink/dists/maverick/Release.gpg')
|
||||
|
||||
self.check_is_regular('public_hardlink/dists/maverick/main/binary-i386/Release')
|
||||
self.check_is_regular('public_hardlink/dists/maverick/main/binary-i386/Packages')
|
||||
self.check_is_regular('public_hardlink/dists/maverick/main/binary-i386/Packages.gz')
|
||||
self.check_is_regular('public_hardlink/dists/maverick/main/binary-i386/Packages.bz2')
|
||||
self.check_is_regular('public_hardlink/dists/maverick/main/Contents-i386.gz')
|
||||
self.check_is_regular('public_hardlink/dists/maverick/main/binary-amd64/Release')
|
||||
self.check_is_regular('public_hardlink/dists/maverick/main/binary-amd64/Packages')
|
||||
self.check_is_regular('public_hardlink/dists/maverick/main/binary-amd64/Packages.gz')
|
||||
self.check_is_regular('public_hardlink/dists/maverick/main/binary-amd64/Packages.bz2')
|
||||
self.check_is_regular('public_hardlink/dists/maverick/main/Contents-amd64.gz')
|
||||
self.check_not_exists('public_hardlink/dists/maverick/main/debian-installer/binary-i386/Packages')
|
||||
self.check_not_exists('public_hardlink/dists/maverick/main/debian-installer/binary-amd64/Packages')
|
||||
|
||||
self.check_is_hardlink('public_hardlink/pool/main/g/gnuplot/gnuplot-doc_4.6.1-1~maverick2_all.deb')
|
||||
|
||||
|
||||
class FSEndpointPublishSnapshot3Test(FileSystemEndpointTest):
|
||||
"""
|
||||
publish snapshot: using copy
|
||||
"""
|
||||
fixtureDB = True
|
||||
fixturePool = True
|
||||
fixtureCmds = [
|
||||
"aptly snapshot create snap1 from mirror gnuplot-maverick",
|
||||
]
|
||||
runCmd = "aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec snap1 filesystem:copy:"
|
||||
gold_processor = FileSystemEndpointTest.expand_environ
|
||||
|
||||
def check(self):
|
||||
super(FSEndpointPublishSnapshot3Test, self).check()
|
||||
|
||||
self.check_is_regular('public_copy/dists/maverick/InRelease')
|
||||
self.check_is_regular('public_copy/dists/maverick/Release')
|
||||
self.check_is_regular('public_copy/dists/maverick/Release.gpg')
|
||||
|
||||
self.check_is_regular('public_copy/dists/maverick/main/binary-i386/Release')
|
||||
self.check_is_regular('public_copy/dists/maverick/main/binary-i386/Packages')
|
||||
self.check_is_regular('public_copy/dists/maverick/main/binary-i386/Packages.gz')
|
||||
self.check_is_regular('public_copy/dists/maverick/main/binary-i386/Packages.bz2')
|
||||
self.check_is_regular('public_copy/dists/maverick/main/Contents-i386.gz')
|
||||
self.check_is_regular('public_copy/dists/maverick/main/binary-amd64/Release')
|
||||
self.check_is_regular('public_copy/dists/maverick/main/binary-amd64/Packages')
|
||||
self.check_is_regular('public_copy/dists/maverick/main/binary-amd64/Packages.gz')
|
||||
self.check_is_regular('public_copy/dists/maverick/main/binary-amd64/Packages.bz2')
|
||||
self.check_is_regular('public_copy/dists/maverick/main/Contents-amd64.gz')
|
||||
self.check_not_exists('public_copy/dists/maverick/main/debian-installer/binary-i386/Packages')
|
||||
self.check_not_exists('public_copy/dists/maverick/main/debian-installer/binary-amd64/Packages')
|
||||
|
||||
self.check_is_copy('public_copy/pool/main/g/gnuplot/gnuplot-doc_4.6.1-1~maverick2_all.deb')
|
||||
|
||||
|
||||
|
||||
class FSEndpointPublishSnapshot4Test(FileSystemEndpointTest):
|
||||
"""
|
||||
publish snapshot: using copy, symlink and hardlink variants
|
||||
"""
|
||||
fixtureDB = True
|
||||
fixturePool = True
|
||||
fixtureCmds = [
|
||||
"aptly snapshot create snap1 from mirror gnuplot-maverick",
|
||||
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec snap1 filesystem:copy:",
|
||||
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec snap1 filesystem:symlink:",
|
||||
]
|
||||
runCmd = "aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec snap1 filesystem:hardlink:"
|
||||
gold_processor = FileSystemEndpointTest.expand_environ
|
||||
|
||||
def check(self):
|
||||
super(FSEndpointPublishSnapshot4Test, self).check()
|
||||
|
||||
self.check_is_regular('public_copy/dists/maverick/InRelease')
|
||||
self.check_is_regular('public_copy/dists/maverick/Release')
|
||||
self.check_is_regular('public_copy/dists/maverick/Release.gpg')
|
||||
|
||||
self.check_is_regular('public_copy/dists/maverick/main/binary-i386/Release')
|
||||
self.check_is_regular('public_copy/dists/maverick/main/binary-i386/Packages')
|
||||
self.check_is_regular('public_copy/dists/maverick/main/binary-i386/Packages.gz')
|
||||
self.check_is_regular('public_copy/dists/maverick/main/binary-i386/Packages.bz2')
|
||||
self.check_is_regular('public_copy/dists/maverick/main/Contents-i386.gz')
|
||||
self.check_is_regular('public_copy/dists/maverick/main/binary-amd64/Release')
|
||||
self.check_is_regular('public_copy/dists/maverick/main/binary-amd64/Packages')
|
||||
self.check_is_regular('public_copy/dists/maverick/main/binary-amd64/Packages.gz')
|
||||
self.check_is_regular('public_copy/dists/maverick/main/binary-amd64/Packages.bz2')
|
||||
self.check_is_regular('public_copy/dists/maverick/main/Contents-amd64.gz')
|
||||
self.check_not_exists('public_copy/dists/maverick/main/debian-installer/binary-i386/Packages')
|
||||
self.check_not_exists('public_copy/dists/maverick/main/debian-installer/binary-amd64/Packages')
|
||||
|
||||
self.check_is_copy('public_copy/pool/main/g/gnuplot/gnuplot-doc_4.6.1-1~maverick2_all.deb')
|
||||
|
||||
self.check_is_regular('public_symlink/dists/maverick/InRelease')
|
||||
self.check_is_regular('public_symlink/dists/maverick/Release')
|
||||
self.check_is_regular('public_symlink/dists/maverick/Release.gpg')
|
||||
|
||||
self.check_is_regular('public_symlink/dists/maverick/main/binary-i386/Release')
|
||||
self.check_is_regular('public_symlink/dists/maverick/main/binary-i386/Packages')
|
||||
self.check_is_regular('public_symlink/dists/maverick/main/binary-i386/Packages.gz')
|
||||
self.check_is_regular('public_symlink/dists/maverick/main/binary-i386/Packages.bz2')
|
||||
self.check_is_regular('public_symlink/dists/maverick/main/Contents-i386.gz')
|
||||
self.check_is_regular('public_symlink/dists/maverick/main/binary-amd64/Release')
|
||||
self.check_is_regular('public_symlink/dists/maverick/main/binary-amd64/Packages')
|
||||
self.check_is_regular('public_symlink/dists/maverick/main/binary-amd64/Packages.gz')
|
||||
self.check_is_regular('public_symlink/dists/maverick/main/binary-amd64/Packages.bz2')
|
||||
self.check_is_regular('public_symlink/dists/maverick/main/Contents-amd64.gz')
|
||||
self.check_not_exists('public_symlink/dists/maverick/main/debian-installer/binary-i386/Packages')
|
||||
self.check_not_exists('public_symlink/dists/maverick/main/debian-installer/binary-amd64/Packages')
|
||||
|
||||
self.check_is_symlink('public_symlink/pool/main/g/gnuplot/gnuplot-doc_4.6.1-1~maverick2_all.deb')
|
||||
|
||||
self.check_is_regular('public_hardlink/dists/maverick/InRelease')
|
||||
self.check_is_regular('public_hardlink/dists/maverick/Release')
|
||||
self.check_is_regular('public_hardlink/dists/maverick/Release.gpg')
|
||||
|
||||
self.check_is_regular('public_hardlink/dists/maverick/main/binary-i386/Release')
|
||||
self.check_is_regular('public_hardlink/dists/maverick/main/binary-i386/Packages')
|
||||
self.check_is_regular('public_hardlink/dists/maverick/main/binary-i386/Packages.gz')
|
||||
self.check_is_regular('public_hardlink/dists/maverick/main/binary-i386/Packages.bz2')
|
||||
self.check_is_regular('public_hardlink/dists/maverick/main/Contents-i386.gz')
|
||||
self.check_is_regular('public_hardlink/dists/maverick/main/binary-amd64/Release')
|
||||
self.check_is_regular('public_hardlink/dists/maverick/main/binary-amd64/Packages')
|
||||
self.check_is_regular('public_hardlink/dists/maverick/main/binary-amd64/Packages.gz')
|
||||
self.check_is_regular('public_hardlink/dists/maverick/main/binary-amd64/Packages.bz2')
|
||||
self.check_is_regular('public_hardlink/dists/maverick/main/Contents-amd64.gz')
|
||||
self.check_not_exists('public_hardlink/dists/maverick/main/debian-installer/binary-i386/Packages')
|
||||
self.check_not_exists('public_hardlink/dists/maverick/main/debian-installer/binary-amd64/Packages')
|
||||
|
||||
self.check_is_hardlink('public_hardlink/pool/main/g/gnuplot/gnuplot-doc_4.6.1-1~maverick2_all.deb')
|
||||
|
||||
|
||||
class FSEndpointPublishSnapshot5Test(FileSystemEndpointTest):
|
||||
"""
|
||||
publish snapshot: using copy, symlink and hardlink variants under prefixes
|
||||
"""
|
||||
fixtureDB = True
|
||||
fixturePool = True
|
||||
fixtureCmds = [
|
||||
"aptly snapshot create snap1 from mirror gnuplot-maverick",
|
||||
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec snap1 filesystem:copy:snap_copy/daily",
|
||||
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec snap1 filesystem:symlink:snap_symlink/daily",
|
||||
]
|
||||
runCmd = "aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec snap1 filesystem:hardlink:snap_hardlink/daily"
|
||||
gold_processor = FileSystemEndpointTest.expand_environ
|
||||
|
||||
def check(self):
|
||||
super(FSEndpointPublishSnapshot5Test, self).check()
|
||||
|
||||
self.check_is_regular('public_copy/snap_copy/daily/dists/maverick/InRelease')
|
||||
self.check_is_regular('public_copy/snap_copy/daily/dists/maverick/Release')
|
||||
self.check_is_regular('public_copy/snap_copy/daily/dists/maverick/Release.gpg')
|
||||
|
||||
self.check_is_regular('public_copy/snap_copy/daily/dists/maverick/main/binary-i386/Release')
|
||||
self.check_is_regular('public_copy/snap_copy/daily/dists/maverick/main/binary-i386/Packages')
|
||||
self.check_is_regular('public_copy/snap_copy/daily/dists/maverick/main/binary-i386/Packages.gz')
|
||||
self.check_is_regular('public_copy/snap_copy/daily/dists/maverick/main/binary-i386/Packages.bz2')
|
||||
self.check_is_regular('public_copy/snap_copy/daily/dists/maverick/main/Contents-i386.gz')
|
||||
self.check_is_regular('public_copy/snap_copy/daily/dists/maverick/main/binary-amd64/Release')
|
||||
self.check_is_regular('public_copy/snap_copy/daily/dists/maverick/main/binary-amd64/Packages')
|
||||
self.check_is_regular('public_copy/snap_copy/daily/dists/maverick/main/binary-amd64/Packages.gz')
|
||||
self.check_is_regular('public_copy/snap_copy/daily/dists/maverick/main/binary-amd64/Packages.bz2')
|
||||
self.check_is_regular('public_copy/snap_copy/daily/dists/maverick/main/Contents-amd64.gz')
|
||||
self.check_not_exists('public_copy/snap_copy/daily/dists/maverick/main/debian-installer/binary-i386/Packages')
|
||||
self.check_not_exists('public_copy/snap_copy/daily/dists/maverick/main/debian-installer/binary-amd64/Packages')
|
||||
|
||||
self.check_is_copy('public_copy/snap_copy/daily/pool/main/g/gnuplot/gnuplot-doc_4.6.1-1~maverick2_all.deb')
|
||||
|
||||
self.check_is_regular('public_symlink/snap_symlink/daily/dists/maverick/InRelease')
|
||||
self.check_is_regular('public_symlink/snap_symlink/daily/dists/maverick/Release')
|
||||
self.check_is_regular('public_symlink/snap_symlink/daily/dists/maverick/Release.gpg')
|
||||
|
||||
self.check_is_regular('public_symlink/snap_symlink/daily/dists/maverick/main/binary-i386/Release')
|
||||
self.check_is_regular('public_symlink/snap_symlink/daily/dists/maverick/main/binary-i386/Packages')
|
||||
self.check_is_regular('public_symlink/snap_symlink/daily/dists/maverick/main/binary-i386/Packages.gz')
|
||||
self.check_is_regular('public_symlink/snap_symlink/daily/dists/maverick/main/binary-i386/Packages.bz2')
|
||||
self.check_is_regular('public_symlink/snap_symlink/daily/dists/maverick/main/Contents-i386.gz')
|
||||
self.check_is_regular('public_symlink/snap_symlink/daily/dists/maverick/main/binary-amd64/Release')
|
||||
self.check_is_regular('public_symlink/snap_symlink/daily/dists/maverick/main/binary-amd64/Packages')
|
||||
self.check_is_regular('public_symlink/snap_symlink/daily/dists/maverick/main/binary-amd64/Packages.gz')
|
||||
self.check_is_regular('public_symlink/snap_symlink/daily/dists/maverick/main/binary-amd64/Packages.bz2')
|
||||
self.check_is_regular('public_symlink/snap_symlink/daily/dists/maverick/main/Contents-amd64.gz')
|
||||
self.check_not_exists('public_symlink/snap_symlink/daily/dists/maverick/main/debian-installer/binary-i386/Packages')
|
||||
self.check_not_exists('public_symlink/snap_symlink/daily/dists/maverick/main/debian-installer/binary-amd64/Packages')
|
||||
|
||||
self.check_is_symlink('public_symlink/snap_symlink/daily/pool/main/g/gnuplot/gnuplot-doc_4.6.1-1~maverick2_all.deb')
|
||||
|
||||
self.check_is_regular('public_hardlink/snap_hardlink/daily/dists/maverick/InRelease')
|
||||
self.check_is_regular('public_hardlink/snap_hardlink/daily/dists/maverick/Release')
|
||||
self.check_is_regular('public_hardlink/snap_hardlink/daily/dists/maverick/Release.gpg')
|
||||
|
||||
self.check_is_regular('public_hardlink/snap_hardlink/daily/dists/maverick/main/binary-i386/Release')
|
||||
self.check_is_regular('public_hardlink/snap_hardlink/daily/dists/maverick/main/binary-i386/Packages')
|
||||
self.check_is_regular('public_hardlink/snap_hardlink/daily/dists/maverick/main/binary-i386/Packages.gz')
|
||||
self.check_is_regular('public_hardlink/snap_hardlink/daily/dists/maverick/main/binary-i386/Packages.bz2')
|
||||
self.check_is_regular('public_hardlink/snap_hardlink/daily/dists/maverick/main/Contents-i386.gz')
|
||||
self.check_is_regular('public_hardlink/snap_hardlink/daily/dists/maverick/main/binary-amd64/Release')
|
||||
self.check_is_regular('public_hardlink/snap_hardlink/daily/dists/maverick/main/binary-amd64/Packages')
|
||||
self.check_is_regular('public_hardlink/snap_hardlink/daily/dists/maverick/main/binary-amd64/Packages.gz')
|
||||
self.check_is_regular('public_hardlink/snap_hardlink/daily/dists/maverick/main/binary-amd64/Packages.bz2')
|
||||
self.check_is_regular('public_hardlink/snap_hardlink/daily/dists/maverick/main/Contents-amd64.gz')
|
||||
self.check_not_exists('public_hardlink/snap_hardlink/daily/dists/maverick/main/debian-installer/binary-i386/Packages')
|
||||
self.check_not_exists('public_hardlink/snap_hardlink/daily/dists/maverick/main/debian-installer/binary-amd64/Packages')
|
||||
|
||||
self.check_is_hardlink('public_hardlink/snap_hardlink/daily/pool/main/g/gnuplot/gnuplot-doc_4.6.1-1~maverick2_all.deb')
|
||||
|
||||
|
||||
class FSEndpointPublishSnapshot6Test(FileSystemEndpointTest):
|
||||
"""
|
||||
publish snapshot: drop one
|
||||
"""
|
||||
fixtureDB = True
|
||||
fixturePool = True
|
||||
fixtureCmds = [
|
||||
"aptly snapshot create snap1 from mirror gnuplot-maverick",
|
||||
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec snap1 filesystem:copy:",
|
||||
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec snap1 filesystem:symlink:",
|
||||
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec snap1 filesystem:hardlink:"
|
||||
]
|
||||
runCmd = "aptly publish drop maverick filesystem:copy:"
|
||||
gold_processor = FileSystemEndpointTest.expand_environ
|
||||
|
||||
def check(self):
|
||||
super(FSEndpointPublishSnapshot6Test, self).check()
|
||||
|
||||
self.check_not_exists('public_copy/dists/')
|
||||
self.check_not_exists('public_copy/pool/')
|
||||
|
||||
self.check_is_regular('public_symlink/dists/maverick/InRelease')
|
||||
self.check_is_regular('public_symlink/dists/maverick/Release')
|
||||
self.check_is_regular('public_symlink/dists/maverick/Release.gpg')
|
||||
|
||||
self.check_is_regular('public_symlink/dists/maverick/main/binary-i386/Release')
|
||||
self.check_is_regular('public_symlink/dists/maverick/main/binary-i386/Packages')
|
||||
self.check_is_regular('public_symlink/dists/maverick/main/binary-i386/Packages.gz')
|
||||
self.check_is_regular('public_symlink/dists/maverick/main/binary-i386/Packages.bz2')
|
||||
self.check_is_regular('public_symlink/dists/maverick/main/Contents-i386.gz')
|
||||
self.check_is_regular('public_symlink/dists/maverick/main/binary-amd64/Release')
|
||||
self.check_is_regular('public_symlink/dists/maverick/main/binary-amd64/Packages')
|
||||
self.check_is_regular('public_symlink/dists/maverick/main/binary-amd64/Packages.gz')
|
||||
self.check_is_regular('public_symlink/dists/maverick/main/binary-amd64/Packages.bz2')
|
||||
self.check_is_regular('public_symlink/dists/maverick/main/Contents-amd64.gz')
|
||||
self.check_not_exists('public_symlink/dists/maverick/main/debian-installer/binary-i386/Packages')
|
||||
self.check_not_exists('public_symlink/dists/maverick/main/debian-installer/binary-amd64/Packages')
|
||||
|
||||
self.check_is_symlink('public_symlink/pool/main/g/gnuplot/gnuplot-doc_4.6.1-1~maverick2_all.deb')
|
||||
|
||||
self.check_is_regular('public_hardlink/dists/maverick/InRelease')
|
||||
self.check_is_regular('public_hardlink/dists/maverick/Release')
|
||||
self.check_is_regular('public_hardlink/dists/maverick/Release.gpg')
|
||||
|
||||
self.check_is_regular('public_hardlink/dists/maverick/main/binary-i386/Release')
|
||||
self.check_is_regular('public_hardlink/dists/maverick/main/binary-i386/Packages')
|
||||
self.check_is_regular('public_hardlink/dists/maverick/main/binary-i386/Packages.gz')
|
||||
self.check_is_regular('public_hardlink/dists/maverick/main/binary-i386/Packages.bz2')
|
||||
self.check_is_regular('public_hardlink/dists/maverick/main/Contents-i386.gz')
|
||||
self.check_is_regular('public_hardlink/dists/maverick/main/binary-amd64/Release')
|
||||
self.check_is_regular('public_hardlink/dists/maverick/main/binary-amd64/Packages')
|
||||
self.check_is_regular('public_hardlink/dists/maverick/main/binary-amd64/Packages.gz')
|
||||
self.check_is_regular('public_hardlink/dists/maverick/main/binary-amd64/Packages.bz2')
|
||||
self.check_is_regular('public_hardlink/dists/maverick/main/Contents-amd64.gz')
|
||||
self.check_not_exists('public_hardlink/dists/maverick/main/debian-installer/binary-i386/Packages')
|
||||
self.check_not_exists('public_hardlink/dists/maverick/main/debian-installer/binary-amd64/Packages')
|
||||
|
||||
self.check_is_hardlink('public_hardlink/pool/main/g/gnuplot/gnuplot-doc_4.6.1-1~maverick2_all.deb')
|
||||
|
||||
|
||||
class FSEndpointPublishSnapshot7Test(FileSystemEndpointTest):
|
||||
"""
|
||||
publish snapshot: drop two
|
||||
"""
|
||||
fixtureDB = True
|
||||
fixturePool = True
|
||||
fixtureCmds = [
|
||||
"aptly snapshot create snap1 from mirror gnuplot-maverick",
|
||||
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec snap1 filesystem:copy:",
|
||||
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec snap1 filesystem:symlink:",
|
||||
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec snap1 filesystem:hardlink:",
|
||||
"aptly publish drop maverick filesystem:copy:"
|
||||
]
|
||||
runCmd = "aptly publish drop maverick filesystem:hardlink:"
|
||||
gold_processor = FileSystemEndpointTest.expand_environ
|
||||
|
||||
def check(self):
|
||||
super(FSEndpointPublishSnapshot7Test, self).check()
|
||||
|
||||
self.check_not_exists('public_copy/dists/')
|
||||
self.check_not_exists('public_copy/pool/')
|
||||
|
||||
self.check_is_regular('public_symlink/dists/maverick/InRelease')
|
||||
self.check_is_regular('public_symlink/dists/maverick/Release')
|
||||
self.check_is_regular('public_symlink/dists/maverick/Release.gpg')
|
||||
|
||||
self.check_is_regular('public_symlink/dists/maverick/main/binary-i386/Release')
|
||||
self.check_is_regular('public_symlink/dists/maverick/main/binary-i386/Packages')
|
||||
self.check_is_regular('public_symlink/dists/maverick/main/binary-i386/Packages.gz')
|
||||
self.check_is_regular('public_symlink/dists/maverick/main/binary-i386/Packages.bz2')
|
||||
self.check_is_regular('public_symlink/dists/maverick/main/Contents-i386.gz')
|
||||
self.check_is_regular('public_symlink/dists/maverick/main/binary-amd64/Release')
|
||||
self.check_is_regular('public_symlink/dists/maverick/main/binary-amd64/Packages')
|
||||
self.check_is_regular('public_symlink/dists/maverick/main/binary-amd64/Packages.gz')
|
||||
self.check_is_regular('public_symlink/dists/maverick/main/binary-amd64/Packages.bz2')
|
||||
self.check_is_regular('public_symlink/dists/maverick/main/Contents-amd64.gz')
|
||||
self.check_not_exists('public_symlink/dists/maverick/main/debian-installer/binary-i386/Packages')
|
||||
self.check_not_exists('public_symlink/dists/maverick/main/debian-installer/binary-amd64/Packages')
|
||||
|
||||
self.check_is_symlink('public_symlink/pool/main/g/gnuplot/gnuplot-doc_4.6.1-1~maverick2_all.deb')
|
||||
|
||||
self.check_not_exists('public_hardlink/dists/')
|
||||
self.check_not_exists('public_hardlink/pool/')
|
||||
|
||||
|
||||
class FSEndpointPublishSnapshot8Test(FileSystemEndpointTest):
|
||||
"""
|
||||
publish snapshot: remove snapshot
|
||||
"""
|
||||
fixtureDB = True
|
||||
fixturePool = True
|
||||
fixtureCmds = [
|
||||
"aptly snapshot create snap1 from mirror gnuplot-maverick",
|
||||
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec snap1 filesystem:copy:",
|
||||
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec snap1 filesystem:symlink:",
|
||||
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec snap1 filesystem:hardlink:",
|
||||
"aptly publish drop maverick filesystem:copy:",
|
||||
"aptly publish drop maverick filesystem:symlink:",
|
||||
"aptly publish drop maverick filesystem:hardlink:",
|
||||
]
|
||||
runCmd = "aptly snapshot drop snap1"
|
||||
gold_processor = FileSystemEndpointTest.expand_environ
|
||||
|
||||
|
||||
class FSEndpointPublishSnapshot9Test(FileSystemEndpointTest):
|
||||
"""
|
||||
publish snapshot: remove snapshot error
|
||||
"""
|
||||
fixtureDB = True
|
||||
fixturePool = True
|
||||
fixtureCmds = [
|
||||
"aptly snapshot create snap1 from mirror gnuplot-maverick",
|
||||
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec snap1 filesystem:copy:",
|
||||
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec snap1 filesystem:symlink:",
|
||||
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec snap1 filesystem:hardlink:",
|
||||
"aptly publish drop maverick filesystem:copy:",
|
||||
]
|
||||
runCmd = "aptly snapshot drop snap1"
|
||||
expectedCode = 1
|
||||
|
||||
|
||||
class FSEndpointPublishSnapshot10Test(FileSystemEndpointTest):
|
||||
"""
|
||||
publish list: several repos list
|
||||
"""
|
||||
fixtureDB = True
|
||||
fixturePool = True
|
||||
fixtureCmds = [
|
||||
"aptly snapshot create snap1 from mirror gnuplot-maverick",
|
||||
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec snap1 filesystem:copy:",
|
||||
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec snap1 filesystem:symlink:snap_symlink/daily",
|
||||
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec snap1 filesystem:hardlink:"
|
||||
]
|
||||
runCmd = "aptly publish list -raw"
|
||||
|
||||
|
||||
class FSEndpointPublishSnapshot11Test(FileSystemEndpointTest):
|
||||
"""
|
||||
publish snapshot: conflicting files in the snapshot using symlink method
|
||||
"""
|
||||
fixtureCmds = [
|
||||
"aptly repo create local-repo1",
|
||||
"aptly repo add local-repo1 ${files}",
|
||||
"aptly snapshot create snap1 from repo local-repo1",
|
||||
"aptly repo create local-repo2",
|
||||
"aptly repo add local-repo2 ${testfiles}",
|
||||
"aptly snapshot create snap2 from repo local-repo2",
|
||||
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=maverick snap1 filesystem:symlink:"
|
||||
]
|
||||
runCmd = "aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=squeeze snap2 filesystem:symlink:"
|
||||
expectedCode = 1
|
||||
gold_processor = FileSystemEndpointTest.expand_environ
|
||||
|
||||
|
||||
class FSEndpointPublishSnapshot12Test(FileSystemEndpointTest):
|
||||
"""
|
||||
publish snapshot: conflicting files in the snapshot using symlink method. -force-overwrite
|
||||
"""
|
||||
fixtureCmds = [
|
||||
"aptly repo create local-repo1",
|
||||
"aptly repo add local-repo1 ${files}",
|
||||
"aptly snapshot create snap1 from repo local-repo1",
|
||||
"aptly repo create local-repo2",
|
||||
"aptly repo add local-repo2 ${testfiles}",
|
||||
"aptly snapshot create snap2 from repo local-repo2",
|
||||
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=maverick snap1 filesystem:symlink:"
|
||||
]
|
||||
runCmd = "aptly publish snapshot -force-overwrite -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=squeeze snap2 filesystem:symlink:"
|
||||
gold_processor = FileSystemEndpointTest.expand_environ
|
||||
|
||||
def check(self):
|
||||
super(FSEndpointPublishSnapshot12Test, self).check()
|
||||
|
||||
self.check_file_contents("public_symlink/pool/main/p/pyspi/pyspi_0.6.1.orig.tar.gz", "file")
|
||||
|
||||
|
||||
class FSEndpointPublishSnapshot13Test(FileSystemEndpointTest):
|
||||
"""
|
||||
publish snapshot: conflicting files in the snapshot using copy method with md5 verification
|
||||
"""
|
||||
fixtureCmds = [
|
||||
"aptly repo create local-repo1",
|
||||
"aptly repo add local-repo1 ${files}",
|
||||
"aptly snapshot create snap1 from repo local-repo1",
|
||||
"aptly repo create local-repo2",
|
||||
"aptly repo add local-repo2 ${testfiles}",
|
||||
"aptly snapshot create snap2 from repo local-repo2",
|
||||
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=maverick snap1 filesystem:copy:"
|
||||
]
|
||||
runCmd = "aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=squeeze snap2 filesystem:copy:"
|
||||
expectedCode = 1
|
||||
gold_processor = FileSystemEndpointTest.expand_environ
|
||||
|
||||
|
||||
class FSEndpointPublishSnapshot14Test(FileSystemEndpointTest):
|
||||
"""
|
||||
publish snapshot: conflicting files in the snapshot using copy method with md5 verification. -force-overwrite
|
||||
"""
|
||||
fixtureCmds = [
|
||||
"aptly repo create local-repo1",
|
||||
"aptly repo add local-repo1 ${files}",
|
||||
"aptly snapshot create snap1 from repo local-repo1",
|
||||
"aptly repo create local-repo2",
|
||||
"aptly repo add local-repo2 ${testfiles}",
|
||||
"aptly snapshot create snap2 from repo local-repo2",
|
||||
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=maverick snap1 filesystem:copy:"
|
||||
]
|
||||
runCmd = "aptly publish snapshot -force-overwrite -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=squeeze snap2 filesystem:copy:"
|
||||
gold_processor = FileSystemEndpointTest.expand_environ
|
||||
|
||||
def check(self):
|
||||
super(FSEndpointPublishSnapshot14Test, self).check()
|
||||
|
||||
self.check_file_contents("public_copy/pool/main/p/pyspi/pyspi_0.6.1.orig.tar.gz", "file")
|
||||
|
||||
|
||||
class FSEndpointPublishSnapshot15Test(FileSystemEndpointTest):
|
||||
"""
|
||||
publish snapshot: conflicting files in the snapshot using copy method with size verification
|
||||
"""
|
||||
fixtureCmds = [
|
||||
"aptly repo create local-repo1",
|
||||
"aptly repo add local-repo1 ${files}",
|
||||
"aptly snapshot create snap1 from repo local-repo1",
|
||||
"aptly repo create local-repo2",
|
||||
"aptly repo add local-repo2 ${testfiles}",
|
||||
"aptly snapshot create snap2 from repo local-repo2",
|
||||
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=maverick snap1 filesystem:copysize:"
|
||||
]
|
||||
runCmd = "aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=squeeze snap2 filesystem:copysize:"
|
||||
expectedCode = 1
|
||||
gold_processor = FileSystemEndpointTest.expand_environ
|
||||
|
||||
|
||||
class FSEndpointPublishSnapshot16Test(FileSystemEndpointTest):
|
||||
"""
|
||||
publish snapshot: conflicting files in the snapshot using copy method with size verification. -force-overwrite
|
||||
"""
|
||||
fixtureCmds = [
|
||||
"aptly repo create local-repo1",
|
||||
"aptly repo add local-repo1 ${files}",
|
||||
"aptly snapshot create snap1 from repo local-repo1",
|
||||
"aptly repo create local-repo2",
|
||||
"aptly repo add local-repo2 ${testfiles}",
|
||||
"aptly snapshot create snap2 from repo local-repo2",
|
||||
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=maverick snap1 filesystem:copysize:"
|
||||
]
|
||||
runCmd = "aptly publish snapshot -force-overwrite -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=squeeze snap2 filesystem:copysize:"
|
||||
gold_processor = FileSystemEndpointTest.expand_environ
|
||||
|
||||
def check(self):
|
||||
super(FSEndpointPublishSnapshot16Test, self).check()
|
||||
|
||||
self.check_file_contents("public_copysize/pool/main/p/pyspi/pyspi_0.6.1.orig.tar.gz", "file")
|
||||
|
||||
|
||||
class FSEndpointPublishSnapshot17Test(FileSystemEndpointTest):
|
||||
"""
|
||||
publish snapshot: conflicting files in the snapshot using copy method with md5 verification
|
||||
"""
|
||||
fixtureCmds = [
|
||||
"aptly repo create local-repo1",
|
||||
"aptly repo add local-repo1 ${testfiles}/1",
|
||||
"aptly snapshot create snap1 from repo local-repo1",
|
||||
"aptly repo create local-repo2",
|
||||
"aptly repo add local-repo2 ${testfiles}/2",
|
||||
"aptly snapshot create snap2 from repo local-repo2",
|
||||
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=maverick snap1 filesystem:copy:"
|
||||
]
|
||||
runCmd = "aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=squeeze snap2 filesystem:copy:"
|
||||
expectedCode = 1
|
||||
gold_processor = FileSystemEndpointTest.expand_environ
|
||||
|
||||
|
||||
class FSEndpointPublishSnapshot18Test(FileSystemEndpointTest):
|
||||
"""
|
||||
publish snapshot: conflicting files in the snapshot using copy method with size verification (not detected!)
|
||||
"""
|
||||
fixtureCmds = [
|
||||
"aptly repo create local-repo1",
|
||||
"aptly repo add local-repo1 ${testfiles}/1",
|
||||
"aptly snapshot create snap1 from repo local-repo1",
|
||||
"aptly repo create local-repo2",
|
||||
"aptly repo add local-repo2 ${testfiles}/2",
|
||||
"aptly snapshot create snap2 from repo local-repo2",
|
||||
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=maverick snap1 filesystem:copysize:"
|
||||
]
|
||||
runCmd = "aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=squeeze snap2 filesystem:copysize:"
|
||||
gold_processor = FileSystemEndpointTest.expand_environ
|
||||
|
||||
@@ -11,6 +11,23 @@ import (
|
||||
"os"
|
||||
)
|
||||
|
||||
// MD5ChecksumForFile computes just the MD5 hash and not all the others
|
||||
func MD5ChecksumForFile(path string) (string, error) {
|
||||
file, err := os.Open(path)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
defer file.Close()
|
||||
|
||||
hash := md5.New()
|
||||
_, err = io.Copy(hash, file)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return fmt.Sprintf("%x", hash.Sum(nil)), nil
|
||||
}
|
||||
|
||||
// ChecksumInfo represents checksums for a single file
|
||||
type ChecksumInfo struct {
|
||||
Size int64
|
||||
|
||||
@@ -31,3 +31,10 @@ func (s *ChecksumSuite) TestChecksumsForFile(c *C) {
|
||||
c.Check(info.SHA1, Equals, "1743f8408261b4f1eff88e0fca15a7077223fa79")
|
||||
c.Check(info.SHA256, Equals, "f2775692fd3b70bd0faa4054b7afa92d427bf994cd8629741710c4864ee4dc95")
|
||||
}
|
||||
|
||||
func (s *ChecksumSuite) TestMD5ChecksumForFile(c *C) {
|
||||
md5sum, err := MD5ChecksumForFile(s.tempfile.Name())
|
||||
|
||||
c.Assert(err, IsNil)
|
||||
c.Check(md5sum, Equals, "43470766afbfdca292440eecdceb80fb")
|
||||
}
|
||||
|
||||
@@ -8,23 +8,31 @@ import (
|
||||
|
||||
// ConfigStructure is structure of main configuration
|
||||
type ConfigStructure struct {
|
||||
RootDir string `json:"rootDir"`
|
||||
DownloadConcurrency int `json:"downloadConcurrency"`
|
||||
DownloadLimit int64 `json:"downloadSpeedLimit"`
|
||||
Architectures []string `json:"architectures"`
|
||||
DepFollowSuggests bool `json:"dependencyFollowSuggests"`
|
||||
DepFollowRecommends bool `json:"dependencyFollowRecommends"`
|
||||
DepFollowAllVariants bool `json:"dependencyFollowAllVariants"`
|
||||
DepFollowSource bool `json:"dependencyFollowSource"`
|
||||
DepVerboseResolve bool `json:"dependencyVerboseResolve"`
|
||||
GpgDisableSign bool `json:"gpgDisableSign"`
|
||||
GpgDisableVerify bool `json:"gpgDisableVerify"`
|
||||
DownloadSourcePackages bool `json:"downloadSourcePackages"`
|
||||
PpaDistributorID string `json:"ppaDistributorID"`
|
||||
PpaCodename string `json:"ppaCodename"`
|
||||
SkipContentsPublishing bool `json:"skipContentsPublishing"`
|
||||
S3PublishRoots map[string]S3PublishRoot `json:"S3PublishEndpoints"`
|
||||
SwiftPublishRoots map[string]SwiftPublishRoot `json:"SwiftPublishEndpoints"`
|
||||
RootDir string `json:"rootDir"`
|
||||
DownloadConcurrency int `json:"downloadConcurrency"`
|
||||
DownloadLimit int64 `json:"downloadSpeedLimit"`
|
||||
Architectures []string `json:"architectures"`
|
||||
DepFollowSuggests bool `json:"dependencyFollowSuggests"`
|
||||
DepFollowRecommends bool `json:"dependencyFollowRecommends"`
|
||||
DepFollowAllVariants bool `json:"dependencyFollowAllVariants"`
|
||||
DepFollowSource bool `json:"dependencyFollowSource"`
|
||||
DepVerboseResolve bool `json:"dependencyVerboseResolve"`
|
||||
GpgDisableSign bool `json:"gpgDisableSign"`
|
||||
GpgDisableVerify bool `json:"gpgDisableVerify"`
|
||||
DownloadSourcePackages bool `json:"downloadSourcePackages"`
|
||||
PpaDistributorID string `json:"ppaDistributorID"`
|
||||
PpaCodename string `json:"ppaCodename"`
|
||||
SkipContentsPublishing bool `json:"skipContentsPublishing"`
|
||||
FileSystemPublishRoots map[string]FileSystemPublishRoot `json:"FileSystemPublishEndpoints"`
|
||||
S3PublishRoots map[string]S3PublishRoot `json:"S3PublishEndpoints"`
|
||||
SwiftPublishRoots map[string]SwiftPublishRoot `json:"SwiftPublishEndpoints"`
|
||||
}
|
||||
|
||||
// FileSystemPublishRoot describes single filesystem publishing entry point
|
||||
type FileSystemPublishRoot struct {
|
||||
RootDir string `json:"rootDir"`
|
||||
LinkMethod string `json:"linkMethod"`
|
||||
VerifyMethod string `json:"verifyMethod"`
|
||||
}
|
||||
|
||||
// S3PublishRoot describes single S3 publishing entry point
|
||||
@@ -75,6 +83,7 @@ var Config = ConfigStructure{
|
||||
DownloadSourcePackages: false,
|
||||
PpaDistributorID: "ubuntu",
|
||||
PpaCodename: "",
|
||||
FileSystemPublishRoots: map[string]FileSystemPublishRoot{},
|
||||
S3PublishRoots: map[string]S3PublishRoot{},
|
||||
SwiftPublishRoots: map[string]SwiftPublishRoot{},
|
||||
}
|
||||
|
||||
@@ -30,6 +30,10 @@ func (s *ConfigSuite) TestSaveConfig(c *C) {
|
||||
|
||||
s.config.RootDir = "/tmp/aptly"
|
||||
s.config.DownloadConcurrency = 5
|
||||
|
||||
s.config.FileSystemPublishRoots = map[string]FileSystemPublishRoot{"test": {
|
||||
RootDir: "/opt/aptly-publish"}}
|
||||
|
||||
s.config.S3PublishRoots = map[string]S3PublishRoot{"test": {
|
||||
Region: "us-east-1",
|
||||
Bucket: "repo"}}
|
||||
@@ -64,6 +68,13 @@ func (s *ConfigSuite) TestSaveConfig(c *C) {
|
||||
" \"ppaDistributorID\": \"\",\n"+
|
||||
" \"ppaCodename\": \"\",\n"+
|
||||
" \"skipContentsPublishing\": false,\n"+
|
||||
" \"FileSystemPublishEndpoints\": {\n"+
|
||||
" \"test\": {\n"+
|
||||
" \"rootDir\": \"/opt/aptly-publish\",\n"+
|
||||
" \"linkMethod\": \"\",\n"+
|
||||
" \"verifyMethod\": \"\"\n"+
|
||||
" }\n"+
|
||||
" },\n"+
|
||||
" \"S3PublishEndpoints\": {\n"+
|
||||
" \"test\": {\n"+
|
||||
" \"region\": \"us-east-1\",\n"+
|
||||
|
||||
Reference in New Issue
Block a user