Module tests.test_system_backup_restore
Functions
def test_system_backup_and_restore(client, set_random_backupstore)
-
Scenario: test system backup and restore
Issue: https://github.com/longhorn/longhorn/issues/1455
Given setup backup target When create system backup Then system backup should be in state Ready
When restore system backup Then system restore should be in state Completed
def test_system_backup_and_restore_volume_with_backingimage(client, core_api, volume_name, set_random_backupstore)
-
Scenario: test system backup and restore volume with backingimage
Noted that for volume data integrity check, we have "test_system_backup_and_restore_volume_with_data" to cover it. BackingImage uses checksum to verified the data during backup/restore. If it is inconsistent, BackingImage will be failed and so is the test. Thus, we don't need to do data integrity check in this test.
Issue: https://github.com/longhorn/longhorn/issues/5085
Given a backingimage And a volume created with the backingimage And a PVC for the volume And a PV for the volume When system backup created Then system backup in state Ready
When volume deleted And backingimage deleted And restore system backup Then system restore should be in state Completed And wait for backingimage restoration to complete And wait for volume restoration to complete And wait for PVC restoration to complete And wait for PV restoration to complete And volume should be detached
When attach volume Then volume should be healthy
def test_system_backup_and_restore_volume_with_data(client, volume_name, set_random_backupstore)
-
Scenario: test system backup and restore volume with data
Issue: https://github.com/longhorn/longhorn/issues/1455
Given volume created And data written to volume And volume backup created And system backup created And system backup in state Ready And volume deleted
When restore system backup Then system restore should be in state Completed
When wait for volume restoration to complete And volume detached
Then attach volume And volume should be healthy And volume data should exist
def test_system_backup_delete_when_other_system_backup_using_name_as_prefix(client, set_random_backupstore)
-
Scenario: test deleting system backup when there are other system backups using the name as prefix
Issue: https://github.com/longhorn/longhorn/issues/6045
Given setup backup target. And setting (backupstore-poll-interval) is (10 seconds). When create 3 system backups (aa, aaa, aaaa) Then system backups should be in state Ready
When delete system backup (aa) And wait 60 seconds Then system backups should exists (aaa, aaaa)
def test_system_backup_with_volume_backup_policy_always(client, volume_name, set_random_backupstore)
-
Scenario: system backup with volume backup policy (always) should always create volume backup, regardless of their existing backups.
Issue: https://github.com/longhorn/longhorn/issues/5011
Given a volume is created. And volume has backup count (1). And create a DR volume from backup And wait for DR volume to restore from backup
When system backup (system-backup) has volume backup policy (always). And system backup (system-backup) created. Then system backup is in state (Ready). And volume has backup count (2). And system backup (system-backup) deleted.
When system backup (system-backup) has volume backup policy (always). And system backup (system-backup) created. Then system backup is in state (Ready). And volume has backup count (3).
def test_system_backup_with_volume_backup_policy_disabled(client, volume_name, set_random_backupstore)
-
Scenario: system backup with volume backup policy (disabled) should not create volume backup.
Issue: https://github.com/longhorn/longhorn/issues/5011
Given a volume is created.
When system backup (system-backup) has volume backup policy (disabled). And system backup (system-backup) created. Then system backup is in state (Ready). And volume has backup count (0).
def test_system_backup_with_volume_backup_policy_if_not_present(client, volume_name, set_random_backupstore)
-
Scenario: system backup with volume backup policy (if-not-present) should create volume backup when no backup exists for the volume or when the last backup is outdated.
Issue: https://github.com/longhorn/longhorn/issues/5011 https://github.com/longhorn/longhorn/issues/6027
Given a volume is created.
When system backup (system-backup-1) has no volume backup policy. And system backup (system-backup-1) created. Then system backup has volume backup policy (if-not-present). And system backup is in state (Ready). And volume has backup count (1).
When system backup (system-backup-2) has volume backup policy (if-not-present). And system backup (system-backup-2) created. Then system backup is in state (Ready). And volume has backup count (1).
When system backup (system-backup-3) has volume backup policy (if-not-present). And write data to volume. And system backup (system-backup-3) created. Then system backup is in state (Ready). And volume has backup count (2).