mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-01-12 03:21:33 +00:00
Snapshot merge tests.
This commit is contained in:
1
system/t05_snapshot/DiffSnapshot6Test_gold
Normal file
1
system/t05_snapshot/DiffSnapshot6Test_gold
Normal file
@@ -0,0 +1 @@
|
||||
Snapshots are identical.
|
||||
3
system/t05_snapshot/MergeSnapshot1Test_gold
Normal file
3
system/t05_snapshot/MergeSnapshot1Test_gold
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
Snapshot snap3 successfully created.
|
||||
You can run 'aptly publish snapshot snap3' to publish snapshot as Debian repository.
|
||||
56835
system/t05_snapshot/MergeSnapshot1Test_snapshot_show
Normal file
56835
system/t05_snapshot/MergeSnapshot1Test_snapshot_show
Normal file
File diff suppressed because it is too large
Load Diff
3
system/t05_snapshot/MergeSnapshot2Test_gold
Normal file
3
system/t05_snapshot/MergeSnapshot2Test_gold
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
Snapshot snap2 successfully created.
|
||||
You can run 'aptly publish snapshot snap2' to publish snapshot as Debian repository.
|
||||
1
system/t05_snapshot/MergeSnapshot2Test_snapshot_diff
Normal file
1
system/t05_snapshot/MergeSnapshot2Test_snapshot_diff
Normal file
@@ -0,0 +1 @@
|
||||
Snapshots are identical.
|
||||
3
system/t05_snapshot/MergeSnapshot3Test_gold
Normal file
3
system/t05_snapshot/MergeSnapshot3Test_gold
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
Snapshot snap4 successfully created.
|
||||
You can run 'aptly publish snapshot snap4' to publish snapshot as Debian repository.
|
||||
57869
system/t05_snapshot/MergeSnapshot3Test_snapshot_show
Normal file
57869
system/t05_snapshot/MergeSnapshot3Test_snapshot_show
Normal file
File diff suppressed because it is too large
Load Diff
1
system/t05_snapshot/MergeSnapshot4Test_gold
Normal file
1
system/t05_snapshot/MergeSnapshot4Test_gold
Normal file
@@ -0,0 +1 @@
|
||||
ERROR: unable to load snapshot: snapshot with name snap2 not found
|
||||
1
system/t05_snapshot/MergeSnapshot5Test_gold
Normal file
1
system/t05_snapshot/MergeSnapshot5Test_gold
Normal file
@@ -0,0 +1 @@
|
||||
ERROR: unable to create snapshot: snapshot with name snap1 already exists
|
||||
@@ -8,3 +8,4 @@ from .list import *
|
||||
from .verify import *
|
||||
from .pull import *
|
||||
from .diff import *
|
||||
from .merge import *
|
||||
|
||||
@@ -60,3 +60,15 @@ class DiffSnapshot5Test(BaseTest):
|
||||
]
|
||||
runCmd = "aptly snapshot diff -only-matching snap-no snap2"
|
||||
expectedCode = 1
|
||||
|
||||
|
||||
class DiffSnapshot6Test(BaseTest):
|
||||
"""
|
||||
diff two snapshots: identical snapshots
|
||||
"""
|
||||
fixtureDB = True
|
||||
fixtureCmds = [
|
||||
"aptly snapshot create snap1 from mirror wheezy-main",
|
||||
"aptly snapshot create snap2 from mirror wheezy-main",
|
||||
]
|
||||
runCmd = "aptly snapshot diff snap1 snap2"
|
||||
|
||||
80
system/t05_snapshot/merge.py
Normal file
80
system/t05_snapshot/merge.py
Normal file
@@ -0,0 +1,80 @@
|
||||
from lib import BaseTest
|
||||
import re
|
||||
|
||||
|
||||
class MergeSnapshot1Test(BaseTest):
|
||||
"""
|
||||
merge snapshots: two snapshots
|
||||
"""
|
||||
fixtureDB = True
|
||||
fixtureCmds = [
|
||||
"aptly snapshot create snap1 from mirror wheezy-main",
|
||||
"aptly snapshot create snap2 from mirror wheezy-non-free",
|
||||
]
|
||||
runCmd = "aptly snapshot merge snap3 snap1 snap2"
|
||||
|
||||
def check(self):
|
||||
def remove_created_at(s):
|
||||
return re.sub(r"Created At: [0-9:A-Za-z -]+\n", "", s)
|
||||
|
||||
self.check_output()
|
||||
self.check_cmd_output("aptly snapshot show snap3", "snapshot_show", match_prepare=remove_created_at)
|
||||
|
||||
|
||||
class MergeSnapshot2Test(BaseTest):
|
||||
"""
|
||||
merge snapshots: one snapshot
|
||||
"""
|
||||
fixtureDB = True
|
||||
fixtureCmds = [
|
||||
"aptly snapshot create snap1 from mirror wheezy-main",
|
||||
]
|
||||
runCmd = "aptly snapshot merge snap2 snap1"
|
||||
|
||||
def check(self):
|
||||
self.check_output()
|
||||
self.check_cmd_output("aptly snapshot diff snap1 snap2", "snapshot_diff")
|
||||
|
||||
|
||||
class MergeSnapshot3Test(BaseTest):
|
||||
"""
|
||||
merge snapshots: three snapshots
|
||||
"""
|
||||
fixtureDB = True
|
||||
fixtureCmds = [
|
||||
"aptly snapshot create snap1 from mirror wheezy-main",
|
||||
"aptly snapshot create snap2 from mirror wheezy-non-free",
|
||||
"aptly snapshot create snap3 from mirror wheezy-backports",
|
||||
]
|
||||
runCmd = "aptly snapshot merge snap4 snap1 snap2 snap3"
|
||||
|
||||
def check(self):
|
||||
def remove_created_at(s):
|
||||
return re.sub(r"Created At: [0-9:A-Za-z -]+\n", "", s)
|
||||
|
||||
self.check_output()
|
||||
self.check_cmd_output("aptly snapshot show snap4", "snapshot_show", match_prepare=remove_created_at)
|
||||
|
||||
|
||||
class MergeSnapshot4Test(BaseTest):
|
||||
"""
|
||||
merge snapshots: no such snapshot
|
||||
"""
|
||||
fixtureDB = True
|
||||
fixtureCmds = [
|
||||
"aptly snapshot create snap1 from mirror wheezy-main",
|
||||
]
|
||||
runCmd = "aptly snapshot merge snap3 snap1 snap2"
|
||||
expectedCode = 1
|
||||
|
||||
|
||||
class MergeSnapshot5Test(BaseTest):
|
||||
"""
|
||||
merge snapshots: duplicate snapshot
|
||||
"""
|
||||
fixtureDB = True
|
||||
fixtureCmds = [
|
||||
"aptly snapshot create snap1 from mirror wheezy-main",
|
||||
]
|
||||
runCmd = "aptly snapshot merge snap1 snap1"
|
||||
expectedCode = 1
|
||||
Reference in New Issue
Block a user