Skip to content

Commit

Permalink
Check number of files backed up in tests.
Browse files Browse the repository at this point in the history
This verifies that backup that includes certificates is indeed backing
them up.
  • Loading branch information
draghuram committed Feb 8, 2020
1 parent 26e0bfd commit 91a5ac6
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions tests/src/test_backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ def do_backup(globalconfig, resources, backup_name, backup_spec):
backup_pod = globalconfig.pod_api.read(pod_name)

assert backup_pod.status.phase == "Succeeded"
policy = globalconfig.mbp_api.get(backup_name)
pprint.pprint(policy)

return policy

@pytest.mark.dependency(depends=["test_creating_backuplocation"])
def test_backup_without_certificates(globalconfig, resources):
Expand All @@ -132,7 +136,11 @@ def test_backup_without_certificates(globalconfig, resources):
"schedule": "*/1 * * * *"
}

do_backup(globalconfig, resources, backup_name, backup_spec)
policy = do_backup(globalconfig, resources, backup_name, backup_spec)

status = policy["status"]
files_total = status["filesChanged"] + status["filesNew"]
assert files_total == 1

@pytest.mark.dependency(depends=["test_creating_backuplocation"])
def test_backup_with_certificates(globalconfig, resources):
Expand All @@ -157,6 +165,9 @@ def test_backup_with_certificates(globalconfig, resources):
"schedule": "*/1 * * * *"
}

do_backup(globalconfig, resources, backup_name, backup_spec)
policy = do_backup(globalconfig, resources, backup_name, backup_spec)

status = policy["status"]
files_total = status["filesChanged"] + status["filesNew"]
assert files_total > 1

0 comments on commit 91a5ac6

Please sign in to comment.