System test for file override from pool. #127

This commit is contained in:
Andrey Smirnov
2014-10-17 00:54:42 +04:00
parent 2a9871e2e9
commit 9fbe33b356
3 changed files with 10 additions and 7 deletions
+3 -2
View File
@@ -156,6 +156,7 @@ class BaseTest(object):
'files': os.path.join(os.path.dirname(inspect.getsourcefile(BaseTest)), "files"),
'udebs': os.path.join(os.path.dirname(inspect.getsourcefile(BaseTest)), "udebs"),
'testfiles': os.path.join(os.path.dirname(inspect.getsourcefile(self.__class__)), self.__class__.__name__),
'aptlyroot': os.path.join(os.environ["HOME"], ".aptly"),
}
if self.fixtureWebServer:
params['url'] = self.webServerUrl
@@ -259,8 +260,8 @@ class BaseTest(object):
raise Exception("path %s exists" % (path, ))
def check_file_not_empty(self, path):
if os.stat(path)[6] == 0:
raise Exception("file %s is empty" % (path, ))
if os.stat(os.path.join(os.environ["HOME"], ".aptly", path))[6] == 0:
raise Exception("file %s is empty" % (path, ))
def check_equal(self, a, b):
if a != b:
+2
View File
@@ -0,0 +1,2 @@
Loading packages...
[+] libboost-program-options-dev_1.49.0.1_i386 added
+5 -5
View File
@@ -268,18 +268,18 @@ class AddRepo13Test(BaseTest):
self.check_exists('pool/72/16/dmraid-udeb_1.0.0.rc16-4.1_amd64.udeb')
self.check_exists('pool/b7/2c/pyspi_0.6.1-1.3.dsc')
class AddRepo14Test(BaseTest):
"""
add same package to local repo twice and make sure the file doesn't get truncated.
"""
fixtureCmds = [
"aptly repo create -comment=Repo1 -distribution=squeeze repo1",
"aptly repo create -comment=Repo14 -distribution=squeeze repo14",
"aptly repo add repo14 ${files}/libboost-program-options-dev_1.49.0.1_i386.deb"
]
runCmd = "aptly repo add repo1 ${files}/libboost-program-options-dev_1.49.0.1_i386.deb;
aptly repo add repo1 pool/00/35/libboost-program-options-dev_1.49.0.1_i386.deb"
runCmd = "aptly repo add repo14 $aptlyroot/pool/00/35/libboost-program-options-dev_1.49.0.1_i386.deb"
def check(self):
super(AddRepo14Test, self).check()
# check pool
self.check_file_not_empty('pool/00/35/libboost-program-options-dev_1.49.0.1_i386.deb')