mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-07-20 12:47:35 +00:00
New upstream version 1.3.0
This commit is contained in:
+22
-2
@@ -6,8 +6,8 @@ import (
|
||||
"path/filepath"
|
||||
"syscall"
|
||||
|
||||
"github.com/smira/aptly/aptly"
|
||||
"github.com/smira/aptly/utils"
|
||||
"github.com/aptly-dev/aptly/aptly"
|
||||
"github.com/aptly-dev/aptly/utils"
|
||||
|
||||
. "gopkg.in/check.v1"
|
||||
)
|
||||
@@ -129,6 +129,10 @@ func (s *PublishedStorageSuite) TestSymLink(c *C) {
|
||||
|
||||
exists, _ := s.storage.FileExists("ppa/dists/squeeze/InRelease")
|
||||
c.Check(exists, Equals, true)
|
||||
|
||||
linkTarget, err := s.storage.ReadLink("ppa/dists/squeeze/InRelease")
|
||||
c.Assert(err, IsNil)
|
||||
c.Assert(linkTarget, Equals, "ppa/dists/squeeze/Release")
|
||||
}
|
||||
|
||||
func (s *PublishedStorageSuite) TestHardLink(c *C) {
|
||||
@@ -316,3 +320,19 @@ func (s *PublishedStorageSuite) TestLinkFromPool(c *C) {
|
||||
err = s.storageCopySize.LinkFromPool(filepath.Join("", "pool", "main", "m/mars-invaders"), "mars-invaders_1.03.deb", pool, srcPoolPath, sourceChecksum, false)
|
||||
c.Check(err, IsNil)
|
||||
}
|
||||
|
||||
func (s *PublishedStorageSuite) TestRootRemove(c *C) {
|
||||
// Prevent deletion of the root directory by passing empty subpaths.
|
||||
|
||||
pwd := c.MkDir()
|
||||
|
||||
// Symlink
|
||||
linkedDir := filepath.Join(pwd, "linkedDir")
|
||||
os.Symlink(s.root, linkedDir)
|
||||
linkStorage := NewPublishedStorage(linkedDir, "", "")
|
||||
c.Assert(func() { linkStorage.Remove("") }, PanicMatches, "trying to remove empty path")
|
||||
|
||||
// Actual dir
|
||||
dirStorage := NewPublishedStorage(pwd, "", "")
|
||||
c.Assert(func() { dirStorage.RemoveDirs("", nil) }, PanicMatches, "trying to remove the root directory")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user