Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Fix expected files for backup #255

Merged
merged 2 commits into from
Oct 1, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 4 additions & 25 deletions tests/test_backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,20 @@
NODIR_MSG = "ERROR: parameter 'BACKUP_DIR': no value provided"
NOPREV_MSG = "ERROR: option '--incremental': Previous backup " "directory does not exist"

OFFLINE_CAPS_FILES = [

OFFLINE_BACKUP_FILES = [
"config_files.tar.gz",
".config.snar",
"metadata.yml",
"mongo_data.tar.gz",
".mongo.snar",
]

OFFLINE_SAT_FILES = [
"pgsql_data.tar.gz",
".postgres.snar",
]

OFFLINE_BACKUP_FILES = OFFLINE_CAPS_FILES + OFFLINE_SAT_FILES

ONLINE_CAPS_FILES = [
"config_files.tar.gz",
".config.snar",
"metadata.yml",
"mongo_dump",
"pulpcore.dump",
]

ONLINE_SAT_FILES = [
Expand Down Expand Up @@ -351,9 +345,6 @@ def test_positive_backup_offline(setup_backup_tests, ansible_module):
files_list = contacted.values()[0]["stdout_lines"]
expected_files = OFFLINE_BACKUP_FILES

# capsule-specific file list
if server() == "capsule":
expected_files = OFFLINE_CAPS_FILES
assert set(files_list).issuperset(expected_files + CONTENT_FILES), assert_msg


Expand Down Expand Up @@ -389,9 +380,6 @@ def test_positive_backup_offline_skip_pulp_content(setup_backup_tests, ansible_m
files_list = contacted.values()[0]["stdout_lines"]
expected_files = OFFLINE_BACKUP_FILES

# capsule-specific file list
if server() == "capsule":
expected_files = OFFLINE_CAPS_FILES
assert set(files_list).issuperset(expected_files), assert_msg
assert CONTENT_FILES not in files_list, "content not skipped"

Expand Down Expand Up @@ -429,9 +417,6 @@ def test_positive_backup_offline_preserve_directory(setup_backup_tests, ansible_
files_list = contacted.values()[0]["stdout_lines"]
expected_files = OFFLINE_BACKUP_FILES

# capsule-specific file list
if server() == "capsule":
expected_files = OFFLINE_CAPS_FILES
assert set(files_list).issuperset(expected_files + CONTENT_FILES), assert_msg


Expand Down Expand Up @@ -467,9 +452,6 @@ def test_positive_backup_offline_split_pulp_tar(setup_backup_tests, ansible_modu
files_list = contacted.values()[0]["stdout_lines"]
expected_files = OFFLINE_BACKUP_FILES

# capsule-specific file list
if server() == "capsule":
expected_files = OFFLINE_CAPS_FILES
assert set(files_list).issuperset(expected_files + CONTENT_FILES), assert_msg


Expand Down Expand Up @@ -549,9 +531,6 @@ def test_positive_backup_offline_capsule_features(setup_backup_tests, ansible_mo
files_list = contacted.values()[0]["stdout_lines"]
expected_files = OFFLINE_BACKUP_FILES

# capsule-specific file list
if server() == "capsule":
expected_files = OFFLINE_CAPS_FILES
assert set(files_list).issuperset(expected_files + CONTENT_FILES), assert_msg


Expand Down Expand Up @@ -588,7 +567,7 @@ def test_positive_backup_offline_logical(setup_backup_tests, ansible_module):

# capsule-specific file list
if server() == "capsule":
expected_files = OFFLINE_CAPS_FILES + ONLINE_CAPS_FILES
expected_files = OFFLINE_BACKUP_FILES + ONLINE_CAPS_FILES
assert set(files_list).issuperset(expected_files + CONTENT_FILES), assert_msg


Expand Down