Coverage for manila/tests/fake_backup_driver.py: 72%

18 statements  

« prev     ^ index     » next       coverage.py v7.11.0, created at 2026-02-18 22:19 +0000

1# Copyright 2023 Cloudification GmbH. 

2# 

3# Licensed under the Apache License, Version 2.0 (the "License"); you may 

4# not use this file except in compliance with the License. You may obtain 

5# a copy of the License at 

6# 

7# http://www.apache.org/licenses/LICENSE-2.0 

8# 

9# Unless required by applicable law or agreed to in writing, software 

10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 

11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 

12# License for the specific language governing permissions and limitations 

13# under the License. 

14 

15from manila.data import backup_driver 

16 

17 

18class FakeBackupDriver(backup_driver.BackupDriver): 

19 """Fake Backup driver.""" 

20 

21 def __init__(self, *args, **kwargs): 

22 super(FakeBackupDriver, self).__init__(*args, **kwargs) 

23 pass 

24 

25 def backup(self, context, backup, share): 

26 """Start a backup of a specified share.""" 

27 pass 

28 

29 def restore(self, context, backup, share): 

30 """Restore a saved backup.""" 

31 pass 

32 

33 def delete(self, context, backup): 

34 """Delete a saved backup.""" 

35 pass 

36 

37 def get_backup_progress(self, context, backup, share): 

38 """Fetch the progress of a in progress backup""" 

39 return 

40 

41 def get_restore_progress(self, context, backup, share): 

42 """Fetch the progress of a in progress restore""" 

43 return 

44 

45 def get_backup_info(self, backup): 

46 """Get backup capabilities information of driver.""" 

47 backup_info = { 

48 'mount': 'mount -vt fake_proto /fake-export %(path)s', 

49 'unmount': 'umount -v %(path)s', 

50 } 

51 return backup_info