1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
|
from lib import BaseTest
class DropSnapshot1Test(BaseTest):
"""
drop snapshot: just drop
"""
fixtureDB = True
fixtureCmds = ["aptly snapshot create snap1 from mirror wheezy-non-free"]
runCmd = "aptly snapshot drop snap1"
def check(self):
self.check_output()
self.check_cmd_output("aptly snapshot show snap1", "snapshot_show", expected_code=1)
class DropSnapshot2Test(BaseTest):
"""
drop snapshot: used as source
"""
fixtureDB = True
fixtureCmds = [
"aptly snapshot create snap1 from mirror wheezy-non-free",
"aptly snapshot merge snap2 snap1",
]
runCmd = "aptly snapshot drop snap1"
expectedCode = 1
class DropSnapshot3Test(BaseTest):
"""
drop snapshot: -force
"""
fixtureDB = True
fixtureCmds = [
"aptly snapshot create snap1 from mirror wheezy-non-free",
"aptly snapshot merge snap2 snap1",
]
runCmd = "aptly snapshot drop -force snap1"
def check(self):
self.check_output()
self.check_cmd_output("aptly snapshot show snap1", "snapshot_show", expected_code=1)
class DropSnapshot4Test(BaseTest):
"""
drop snapshot: already published
"""
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"
]
runCmd = "aptly snapshot drop snap1"
expectedCode = 1
class DropSnapshot5Test(BaseTest):
"""
drop snapshot: already published with -force
"""
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"
]
runCmd = "aptly snapshot drop --force snap1"
expectedCode = 1
class DropSnapshot6Test(BaseTest):
"""
drop snapshot: no such snapshot
"""
fixtureDB = True
runCmd = "aptly snapshot drop no-such-snapshot"
expectedCode = 1
class DropSnapshot7Test(BaseTest):
"""
drop snapshot: publish, drop publish, drop 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",
"aptly publish drop maverick",
]
runCmd = "aptly snapshot drop snap1"
|