backend: Use th backup URL in backup-cli and add snapshot type to FileBackend

This commit is contained in:
Christian Decker
2020-04-04 16:20:46 +02:00
parent c58e675877
commit 4c146bf2a4
3 changed files with 31 additions and 31 deletions

View File

@@ -12,20 +12,13 @@ cli_path = os.path.join(os.path.dirname(__file__), "backup-cli")
def test_start(node_factory, directory):
bdest = os.path.join(directory, 'lightning-1', 'backup.dbak')
opts = {
'plugin': plugin_path,
'backup-destination': 'file://' + bdest,
}
subprocess.check_call([cli_path, "init", directory, directory])
bpath = os.path.join(directory, 'lightning-1', 'regtest')
bdest = os.path.join(bpath, 'backup.dbak')
bdest = 'file://' + os.path.join(bpath, 'backup.dbak')
os.makedirs(bpath)
subprocess.check_call([cli_path, "init", bpath, bpath])
subprocess.check_call([cli_path, "init", bpath, bdest])
opts = {
'plugin': plugin_path,
'backup-destination': 'file://' + bdest,
'backup-destination': bdest,
}
l1 = node_factory.get_node(options=opts, cleandir=False)
@@ -48,12 +41,12 @@ def test_tx_abort(node_factory, directory):
"""
bpath = os.path.join(directory, 'lightning-1', 'regtest')
bdest = os.path.join(bpath, 'backup.dbak')
bdest = 'file://' + os.path.join(bpath, 'backup.dbak')
os.makedirs(bpath)
subprocess.check_call([cli_path, "init", bpath, bpath])
subprocess.check_call([cli_path, "init", bpath, bdest])
opts = {
'plugin': plugin_path,
'backup-destination': 'file://' + bdest,
'backup-destination': bdest,
}
l1 = node_factory.get_node(options=opts, cleandir=False)
l1.stop()
@@ -78,12 +71,12 @@ def test_failing_restore(nf, directory):
"""
bpath = os.path.join(directory, 'lightning-1', 'regtest')
bdest = os.path.join(bpath, 'backup.dbak')
bdest = 'file://' + os.path.join(bpath, 'backup.dbak')
os.makedirs(bpath)
subprocess.check_call([cli_path, "init", bpath, bpath])
subprocess.check_call([cli_path, "init", bpath, bdest])
opts = {
'plugin': plugin_path,
'backup-destination': 'file://' + bdest,
'backup-destination': bdest,
}
l1 = node_factory.get_node(options=opts, cleandir=False)
l1.stop()
@@ -103,12 +96,12 @@ def test_intermittent_backup(node_factory, directory):
"""
bpath = os.path.join(directory, 'lightning-1', 'regtest')
bdest = os.path.join(bpath, 'backup.dbak')
bdest = 'file://' + os.path.join(bpath, 'backup.dbak')
os.makedirs(bpath)
subprocess.check_call([cli_path, "init", bpath, bpath])
subprocess.check_call([cli_path, "init", bpath, bdest])
opts = {
'plugin': plugin_path,
'backup-destination': 'file://' + bdest,
'backup-destination': bdest,
}
l1 = node_factory.get_node(options=opts, cleandir=False)