mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-07-16 12:08:04 +00:00
System tests for snapshots verification with sources.
This commit is contained in:
@@ -13,6 +13,7 @@ import shutil
|
|||||||
import string
|
import string
|
||||||
import threading
|
import threading
|
||||||
import urllib
|
import urllib
|
||||||
|
#import time
|
||||||
import SocketServer
|
import SocketServer
|
||||||
import SimpleHTTPServer
|
import SimpleHTTPServer
|
||||||
|
|
||||||
@@ -110,15 +111,19 @@ class BaseTest(object):
|
|||||||
|
|
||||||
def prepare_fixture(self):
|
def prepare_fixture(self):
|
||||||
if self.fixturePool:
|
if self.fixturePool:
|
||||||
|
#start = time.time()
|
||||||
os.makedirs(os.path.join(os.environ["HOME"], ".aptly"), 0755)
|
os.makedirs(os.path.join(os.environ["HOME"], ".aptly"), 0755)
|
||||||
os.symlink(self.fixturePoolDir, os.path.join(os.environ["HOME"], ".aptly", "pool"))
|
os.symlink(self.fixturePoolDir, os.path.join(os.environ["HOME"], ".aptly", "pool"))
|
||||||
|
#print "FIXTURE POOL: %.2f" % (time.time()-start)
|
||||||
|
|
||||||
if self.fixturePoolCopy:
|
if self.fixturePoolCopy:
|
||||||
os.makedirs(os.path.join(os.environ["HOME"], ".aptly"), 0755)
|
os.makedirs(os.path.join(os.environ["HOME"], ".aptly"), 0755)
|
||||||
shutil.copytree(self.fixturePoolDir, os.path.join(os.environ["HOME"], ".aptly", "pool"), ignore=shutil.ignore_patterns(".git"))
|
shutil.copytree(self.fixturePoolDir, os.path.join(os.environ["HOME"], ".aptly", "pool"), ignore=shutil.ignore_patterns(".git"))
|
||||||
|
|
||||||
if self.fixtureDB:
|
if self.fixtureDB:
|
||||||
|
#start = time.time()
|
||||||
shutil.copytree(self.fixtureDBDir, os.path.join(os.environ["HOME"], ".aptly", "db"))
|
shutil.copytree(self.fixtureDBDir, os.path.join(os.environ["HOME"], ".aptly", "db"))
|
||||||
|
#print "FIXTURE DB: %.2f" % (time.time()-start)
|
||||||
|
|
||||||
if self.fixtureWebServer:
|
if self.fixtureWebServer:
|
||||||
self.webServerUrl = self.start_webserver(os.path.join(os.path.dirname(inspect.getsourcefile(self.__class__)),
|
self.webServerUrl = self.start_webserver(os.path.join(os.path.dirname(inspect.getsourcefile(self.__class__)),
|
||||||
@@ -139,6 +144,7 @@ class BaseTest(object):
|
|||||||
|
|
||||||
def run_cmd(self, command, expected_code=0):
|
def run_cmd(self, command, expected_code=0):
|
||||||
try:
|
try:
|
||||||
|
#start = time.time()
|
||||||
if not hasattr(command, "__iter__"):
|
if not hasattr(command, "__iter__"):
|
||||||
params = {'files': os.path.join(os.path.dirname(inspect.getsourcefile(BaseTest)), "files")}
|
params = {'files': os.path.join(os.path.dirname(inspect.getsourcefile(BaseTest)), "files")}
|
||||||
if self.fixtureWebServer:
|
if self.fixtureWebServer:
|
||||||
@@ -151,6 +157,7 @@ class BaseTest(object):
|
|||||||
environ["LC_ALL"] = "C"
|
environ["LC_ALL"] = "C"
|
||||||
proc = subprocess.Popen(command, stderr=subprocess.STDOUT, stdout=subprocess.PIPE, env=environ)
|
proc = subprocess.Popen(command, stderr=subprocess.STDOUT, stdout=subprocess.PIPE, env=environ)
|
||||||
output, _ = proc.communicate()
|
output, _ = proc.communicate()
|
||||||
|
#print "CMD %s: %.2f" % (" ".join(command), time.time()-start)
|
||||||
if proc.returncode != expected_code:
|
if proc.returncode != expected_code:
|
||||||
raise Exception("exit code %d != %d (output: %s)" % (proc.returncode, expected_code, output))
|
raise Exception("exit code %d != %d (output: %s)" % (proc.returncode, expected_code, output))
|
||||||
return output
|
return output
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
Missing dependencies (11):
|
||||||
|
fenix [amd64]
|
||||||
|
fenix-plugins-system [amd64]
|
||||||
|
ia32-libs-gtk-i386 [amd64]
|
||||||
|
ia32-libs-i386 [amd64]
|
||||||
|
kbdcontrol [amd64]
|
||||||
|
kbdcontrol [i386]
|
||||||
|
mozart (>= 1.4.0) [amd64]
|
||||||
|
scsh-0.6 (>= 0.6.6) [amd64]
|
||||||
|
scsh-0.6 [amd64]
|
||||||
|
vidcontrol [amd64]
|
||||||
|
vidcontrol [i386]
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
Missing dependencies (32):
|
||||||
|
dpkg (>= 1.15.4) [amd64]
|
||||||
|
dpkg (>= 1.15.4) [i386]
|
||||||
|
gnuplot (= 4.6.1-1~maverick2) [source]
|
||||||
|
gnuplot (= 4.6.1-1~maverick2) [source]
|
||||||
|
install-info [amd64]
|
||||||
|
install-info [i386]
|
||||||
|
libc6 (>= 2.11) [amd64]
|
||||||
|
libc6 (>= 2.11) [i386]
|
||||||
|
libcairo2 (>= 1.6.0) [amd64]
|
||||||
|
libcairo2 (>= 1.6.0) [i386]
|
||||||
|
libedit2 (>= 2.5.cvs.20010821-1) [amd64]
|
||||||
|
libedit2 (>= 2.5.cvs.20010821-1) [i386]
|
||||||
|
libgcc1 (>= 1:4.1.1) [amd64]
|
||||||
|
libgcc1 (>= 1:4.1.1) [i386]
|
||||||
|
libgd2-noxpm (>= 2.0.36~rc1~dfsg) [amd64]
|
||||||
|
libgd2-noxpm (>= 2.0.36~rc1~dfsg) [i386]
|
||||||
|
libgd2-xpm (>= 2.0.36~rc1~dfsg) [amd64]
|
||||||
|
libgd2-xpm (>= 2.0.36~rc1~dfsg) [i386]
|
||||||
|
libglib2.0-0 (>= 2.12.0) [amd64]
|
||||||
|
libglib2.0-0 (>= 2.12.0) [i386]
|
||||||
|
liblua5.1-0 [amd64]
|
||||||
|
liblua5.1-0 [i386]
|
||||||
|
libpango1.0-0 (>= 1.14.0) [amd64]
|
||||||
|
libpango1.0-0 (>= 1.14.0) [i386]
|
||||||
|
libstdc++6 (>= 4.1.1) [amd64]
|
||||||
|
libstdc++6 (>= 4.1.1) [i386]
|
||||||
|
libwxbase2.8-0 (>= 2.8.11.0) [amd64]
|
||||||
|
libwxbase2.8-0 (>= 2.8.11.0) [i386]
|
||||||
|
libwxgtk2.8-0 (>= 2.8.11.0) [amd64]
|
||||||
|
libwxgtk2.8-0 (>= 2.8.11.0) [i386]
|
||||||
|
libx11-6 [amd64]
|
||||||
|
libx11-6 [i386]
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
Missing dependencies (30):
|
||||||
|
dpkg (>= 1.15.4) [amd64]
|
||||||
|
dpkg (>= 1.15.4) [i386]
|
||||||
|
install-info [amd64]
|
||||||
|
install-info [i386]
|
||||||
|
libc6 (>= 2.11) [amd64]
|
||||||
|
libc6 (>= 2.11) [i386]
|
||||||
|
libcairo2 (>= 1.6.0) [amd64]
|
||||||
|
libcairo2 (>= 1.6.0) [i386]
|
||||||
|
libedit2 (>= 2.5.cvs.20010821-1) [amd64]
|
||||||
|
libedit2 (>= 2.5.cvs.20010821-1) [i386]
|
||||||
|
libgcc1 (>= 1:4.1.1) [amd64]
|
||||||
|
libgcc1 (>= 1:4.1.1) [i386]
|
||||||
|
libgd2-noxpm (>= 2.0.36~rc1~dfsg) [amd64]
|
||||||
|
libgd2-noxpm (>= 2.0.36~rc1~dfsg) [i386]
|
||||||
|
libgd2-xpm (>= 2.0.36~rc1~dfsg) [amd64]
|
||||||
|
libgd2-xpm (>= 2.0.36~rc1~dfsg) [i386]
|
||||||
|
libglib2.0-0 (>= 2.12.0) [amd64]
|
||||||
|
libglib2.0-0 (>= 2.12.0) [i386]
|
||||||
|
liblua5.1-0 [amd64]
|
||||||
|
liblua5.1-0 [i386]
|
||||||
|
libpango1.0-0 (>= 1.14.0) [amd64]
|
||||||
|
libpango1.0-0 (>= 1.14.0) [i386]
|
||||||
|
libstdc++6 (>= 4.1.1) [amd64]
|
||||||
|
libstdc++6 (>= 4.1.1) [i386]
|
||||||
|
libwxbase2.8-0 (>= 2.8.11.0) [amd64]
|
||||||
|
libwxbase2.8-0 (>= 2.8.11.0) [i386]
|
||||||
|
libwxgtk2.8-0 (>= 2.8.11.0) [amd64]
|
||||||
|
libwxgtk2.8-0 (>= 2.8.11.0) [i386]
|
||||||
|
libx11-6 [amd64]
|
||||||
|
libx11-6 [i386]
|
||||||
@@ -66,3 +66,34 @@ class VerifySnapshot7Test(BaseTest):
|
|||||||
fixtureDB = True
|
fixtureDB = True
|
||||||
fixtureCmds = ["aptly snapshot create snap1 from mirror wheezy-main"]
|
fixtureCmds = ["aptly snapshot create snap1 from mirror wheezy-main"]
|
||||||
runCmd = "aptly -dep-follow-all-variants snapshot verify snap1"
|
runCmd = "aptly -dep-follow-all-variants snapshot verify snap1"
|
||||||
|
|
||||||
|
|
||||||
|
class VerifySnapshot8Test(BaseTest):
|
||||||
|
"""
|
||||||
|
verify snapshot: follow-source w/o sources
|
||||||
|
"""
|
||||||
|
fixtureDB = True
|
||||||
|
fixtureCmds = ["aptly snapshot create snap1 from mirror gnuplot-maverick"]
|
||||||
|
runCmd = "aptly -dep-follow-source snapshot verify snap1"
|
||||||
|
|
||||||
|
|
||||||
|
class VerifySnapshot9Test(BaseTest):
|
||||||
|
"""
|
||||||
|
verify snapshot: follow-source w sources
|
||||||
|
"""
|
||||||
|
fixtureDB = True
|
||||||
|
fixtureCmds = ["aptly snapshot create snap1 from mirror gnuplot-maverick-src"]
|
||||||
|
runCmd = "aptly -dep-follow-source snapshot verify snap1"
|
||||||
|
|
||||||
|
|
||||||
|
class VerifySnapshot10Test(BaseTest):
|
||||||
|
"""
|
||||||
|
verify snapshot: follow-source on whole wheezy
|
||||||
|
"""
|
||||||
|
fixtureDB = True
|
||||||
|
fixtureCmds = [
|
||||||
|
"aptly snapshot create snap1 from mirror wheezy-main-src",
|
||||||
|
"aptly snapshot create snap2 from mirror wheezy-contrib-src",
|
||||||
|
"aptly snapshot create snap3 from mirror wheezy-non-free-src",
|
||||||
|
]
|
||||||
|
runCmd = "aptly -dep-follow-source snapshot verify snap1 snap2 snap3"
|
||||||
|
|||||||
Reference in New Issue
Block a user