Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'lvm_snapname': lvm_snapname,
'container': storage_dir.path,
'storage': 'local',
'max_level': '6',
'max_segment_size': '67108864',
'backup_name': backup_name
}
restore_args = {
'action': 'restore',
'restore_abs_path': self.dest_tree.path,
'backup_name': copy(backup_args['backup_name']),
'storage': 'local',
'container': storage_dir.path
}
result = common.execute_freezerc(backup_args)
self.assertIsNotNone(result)
result = common.execute_freezerc(restore_args)
self.assertIsNotNone(result)
self.assertTreesMatch()
}
# --- backup
result = common.execute_freezerc(backup_args)
self.assertIsNotNone(result)
result = json.loads(result)
self.assertIn('backup_name', result)
self.assertEquals(result['backup_name'], backup_args['backup_name'])
self.assertIn('container', result)
self.assertEquals(result['container'], backup_args['container'])
# It may be reasonable to insert a check of the files in the
# swift container
# file_list = self.get_file_list_openstack(result['container'])
# --- restore
result = common.execute_freezerc(restore_args)
self.assertIsNotNone(result)
self.assertTreesMatch()
# --- remove backups and container
result = common.execute_freezerc(remove_args)
self.assertIsNotNone(result)
result = self.remove_swift_container(backup_args['container'])
self.assertIsNotNone(result)
'storage': 'local',
'max_level': '6',
'max_segment_size': '67108864',
'backup_name': uuid.uuid4().hex
}
restore_args = {
'action': 'restore',
'restore_abs_path': self.dest_tree.path,
'backup_name': copy(backup_args['backup_name']),
'storage': 'local',
'container': storage_dir.path
}
result = common.execute_freezerc(backup_args)
self.assertIsNotNone(result)
result = common.execute_freezerc(restore_args)
self.assertIsNotNone(result)
self.assertTreesMatch()
'action': 'restore',
'compression': 'bzip2',
'restore_abs_path': self.dest_tree.path,
'backup_name': copy(backup_args['backup_name']),
'storage': 'swift',
'container': copy(backup_args['container']),
}
remove_args = {
'action': 'admin',
'remove_older_than': 0,
'backup_name': copy(backup_args['backup_name']),
'storage': 'swift',
'container': copy(backup_args['container']),
}
# --- backup
result = common.execute_freezerc(backup_args)
self.assertIsNotNone(result)
result = json.loads(result)
self.assertIn('backup_name', result)
self.assertEquals(result['backup_name'], backup_args['backup_name'])
self.assertIn('container', result)
self.assertEquals(result['container'], backup_args['container'])
# It may be reasonable to insert a check of the files in the
# swift container
# file_list = self.get_file_list_openstack(result['container'])
# --- restore
result = common.execute_freezerc(restore_args)
self.assertIsNotNone(result)
self.assertTreesMatch()
# -- level 1
self.source_tree.add_random_data()
self.assertTreesMatchNot()
result = common.execute_freezerc(backup_args)
self.assertIsNotNone(result)
result = common.execute_freezerc(restore_args)
self.assertIsNotNone(result)
self.assertTreesMatch()
# -- level 2
self.source_tree.add_random_data()
self.assertTreesMatchNot()
result = common.execute_freezerc(backup_args)
self.assertIsNotNone(result)
result = common.execute_freezerc(restore_args)
self.assertIsNotNone(result)
self.assertTreesMatch()
'storage': 'local',
'max_level': '6',
'max_segment_size': '67108864',
'backup_name': backup_name
}
restore_args = {
'action': 'restore',
'restore_abs_path': self.dest_tree.path,
'backup_name': copy(backup_args['backup_name']),
'storage': 'local',
'container': storage_dir.path
}
result = common.execute_freezerc(backup_args)
self.assertIsNotNone(result)
result = common.execute_freezerc(restore_args)
self.assertIsNotNone(result)
self.assertTreesMatch()
self.assertIn('backup_name', result)
self.assertEquals(result['backup_name'], backup_args['backup_name'])
self.assertIn('container', result)
self.assertEquals(result['container'], backup_args['container'])
# It may be reasonable to insert a check of the files in the
# swift container
# file_list = self.get_file_list_openstack(result['container'])
# --- restore
result = common.execute_freezerc(restore_args)
self.assertIsNotNone(result)
self.assertTreesMatch()
# --- remove backups and container
result = common.execute_freezerc(remove_args)
self.assertIsNotNone(result)
result = self.remove_swift_container(backup_args['container'])
self.assertIsNotNone(result)
'path_to_backup': self.source_tree.path,
'container': storage_dir.path,
'storage': 'local',
'max_level': '6',
'max_segment_size': '67108864',
'backup_name': uuid.uuid4().hex
}
restore_args = {
'action': 'restore',
'restore_abs_path': self.dest_tree.path,
'backup_name': copy(backup_args['backup_name']),
'storage': 'local',
'container': storage_dir.path
}
result = common.execute_freezerc(backup_args)
self.assertIsNotNone(result)
result = common.execute_freezerc(restore_args)
self.assertIsNotNone(result)
self.assertTreesMatch()
self.assertIn('backup_name', result)
self.assertEquals(result['backup_name'], backup_args['backup_name'])
self.assertIn('container', result)
self.assertEquals(result['container'], backup_args['container'])
# It may be reasonable to insert a check of the files in the
# swift container
# file_list = self.get_file_list_openstack(result['container'])
# --- restore
result = common.execute_freezerc(restore_args)
self.assertIsNotNone(result)
self.assertTreesMatch()
# --- remove backups and container
result = common.execute_freezerc(remove_args)
self.assertIsNotNone(result)
result = self.remove_swift_container(backup_args['container'])
self.assertIsNotNone(result)
}
# --- backup
result = common.execute_freezerc(backup_args)
self.assertIsNotNone(result)
result = json.loads(result)
self.assertIn('backup_name', result)
self.assertEquals(result['backup_name'], backup_args['backup_name'])
self.assertIn('container', result)
self.assertEquals(result['container'], backup_args['container'])
# It may be reasonable to insert a check of the files in the
# swift container
# file_list = self.get_file_list_openstack(result['container'])
# --- restore
result = common.execute_freezerc(restore_args)
self.assertIsNotNone(result)
self.assertTreesMatch()
# --- remove backups and container
result = common.execute_freezerc(remove_args)
self.assertIsNotNone(result)
result = self.remove_swift_container(backup_args['container'])
self.assertIsNotNone(result)