mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-01-12 03:21:33 +00:00
Tests for aptly db recover. #25
This commit is contained in:
@@ -192,6 +192,9 @@ class BaseTest(object):
|
||||
with open(os.path.join(os.environ["HOME"], ".aptly", path), "r") as f:
|
||||
return f.read()
|
||||
|
||||
def delete_file(self, path):
|
||||
os.unlink(os.path.join(os.environ["HOME"], ".aptly", path))
|
||||
|
||||
def check_file_contents(self, path, gold_name, match_prepare=None):
|
||||
contents = self.read_file(path)
|
||||
|
||||
|
||||
1
system/t08_db/RecoverDB2Test_gold
Normal file
1
system/t08_db/RecoverDB2Test_gold
Normal file
@@ -0,0 +1 @@
|
||||
Recovering database...
|
||||
15
system/t08_db/RecoverDB2Test_mirror_list
Normal file
15
system/t08_db/RecoverDB2Test_mirror_list
Normal file
@@ -0,0 +1,15 @@
|
||||
List of mirrors:
|
||||
* [gnuplot-maverick-src]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick [src]
|
||||
* [gnuplot-maverick]: http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick
|
||||
* [wheezy-backports-src]: http://mirror.yandex.ru/debian/ wheezy-backports [src]
|
||||
* [wheezy-backports]: http://mirror.yandex.ru/debian/ wheezy-backports
|
||||
* [wheezy-contrib-src]: http://mirror.yandex.ru/debian/ wheezy [src]
|
||||
* [wheezy-contrib]: http://mirror.yandex.ru/debian/ wheezy
|
||||
* [wheezy-main-src]: http://mirror.yandex.ru/debian/ wheezy [src]
|
||||
* [wheezy-main]: http://mirror.yandex.ru/debian/ wheezy
|
||||
* [wheezy-non-free-src]: http://mirror.yandex.ru/debian/ wheezy [src]
|
||||
* [wheezy-non-free]: http://mirror.yandex.ru/debian/ wheezy
|
||||
* [wheezy-updates-src]: http://mirror.yandex.ru/debian/ wheezy-updates [src]
|
||||
* [wheezy-updates]: http://mirror.yandex.ru/debian/ wheezy-updates
|
||||
|
||||
To get more information about mirror, run `aptly mirror show <name>`.
|
||||
@@ -3,3 +3,4 @@ Testing DB operations
|
||||
"""
|
||||
|
||||
from .cleanup import *
|
||||
from .recover import *
|
||||
|
||||
26
system/t08_db/recover.py
Normal file
26
system/t08_db/recover.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from lib import BaseTest
|
||||
|
||||
|
||||
# Waiting for PR
|
||||
# class RecoverDB1Test(BaseTest):
|
||||
# """
|
||||
# recover db: no DB
|
||||
# """
|
||||
# runCmd = "aptly db recover"
|
||||
|
||||
|
||||
class RecoverDB2Test(BaseTest):
|
||||
"""
|
||||
recover db: without CURRENT files
|
||||
"""
|
||||
fixtureDB = True
|
||||
runCmd = "aptly db recover"
|
||||
|
||||
def prepare(self):
|
||||
super(RecoverDB2Test, self).prepare()
|
||||
|
||||
self.delete_file("db/CURRENT")
|
||||
|
||||
def check(self):
|
||||
self.check_output()
|
||||
self.check_cmd_output("aptly mirror list", "mirror_list")
|
||||
Reference in New Issue
Block a user