Changeset 40893
- Timestamp:
- Sep 24, 2019, 9:51:49 AM (7 years ago)
- Location:
- branches/ipp-132_automate_jira_conf_backups/backups
- Files:
-
- 3 added
- 3 edited
-
atlassian_backups.config (added)
-
backup_atlassian_applications.py (modified) (17 diffs)
-
backup_atlassian_applications_test.py (modified) (19 diffs)
-
full_atlassian_backup_test.py (modified) (2 diffs)
-
testing (added)
-
testing/test.config (added)
Legend:
- Unmodified
- Added
- Removed
-
branches/ipp-132_automate_jira_conf_backups/backups/backup_atlassian_applications.py
r40892 r40893 1 1 import argparse 2 import configparser 2 3 import datetime 3 4 import glob 4 import operator5 5 import os 6 6 import os.path as path … … 16 16 17 17 18 DEFAULT_ATLASSIAN_HOST = "ippops4" 19 DEFAULT_BACKUP_MACHINE_1 = "ippops3" 20 DEFAULT_BACKUP_MACHINE_2 = "ippops5" 21 DEFAULT_BACKUP_HOST = "/export/{0}.0/atlassian_backups".format(DEFAULT_ATLASSIAN_HOST) 22 DEFAULT_BACKUP_1_DIR = "/data/{0}.0/atlassian_backups".format(DEFAULT_BACKUP_MACHINE_1) 23 DEFAULT_BACKUP_2_DIR = "/data/{0}.0/atlassian_backups".format(DEFAULT_BACKUP_MACHINE_2) 24 25 DEFAULT_ATLASSIAN_HOME_DIR = "/var/atlassian/application-data/" 26 DEFAULT_JIRA_BACKUP_DIR = path.join(DEFAULT_ATLASSIAN_HOME_DIR, "jira/export") 27 DEFAULT_CONF_BACKUP_DIR = path.join(DEFAULT_ATLASSIAN_HOME_DIR, "confluence/backups") 28 DEFAULT_JIRA_ATTACHMENTS_DIR = path.join(DEFAULT_ATLASSIAN_HOME_DIR, "jira/data") 29 DEFAULT_CONF_ATTACHMENTS_DIR = path.join(DEFAULT_ATLASSIAN_HOME_DIR, "confluence/attachments") 30 31 DEFAULT_VERBOSITY = False 32 33 34 class SubprocessError(Exception): 35 """Errors in Popen stderr subprocess""" 36 37 38 def _move_dir_contents_to_dir(source_dirs: [str], destination_dirs: [str]): 18 DEFAULT_CONFIG_FILE = path.abspath('./atlassian_backups.config') 19 20 21 class ConfigError(Exception): 22 """Error in loading the config file""" 23 24 def __init__(self, config_item, message): 25 self.config_item = config_item 26 self.message = message 27 28 29 def _move_dir_contents_to_dir(source_dirs: [str], destination_dirs: [str], verbose: bool=False): 39 30 """ Moves all files from inside source paths to the destination dits. 40 31 It's important to note that it moves index to index … … 64 55 try: 65 56 for fp in filepaths: 66 print("Moving: {0} -> {1}".format(fp, destination_dirs[i])) 57 if verbose: 58 print("Moving: {0} -> {1}".format(fp, destination_dirs[i])) 67 59 command_and_args = ["mv", fp, destination_dirs[i]] 68 60 # shutil.move(fp, destination_dirs[i]) … … 77 69 class AtlassianBackups(): 78 70 79 def __init__(self, 80 host_backup_path=None, 81 backup_1_path=None, 82 backup_2_path=None, 83 jira_backup_path=None, 84 conf_backup_path=None, 85 jira_attachments_path=None, 86 conf_attachments_path=None, 87 verbose=None): 88 89 self.host_backup_path = DEFAULT_BACKUP_HOST if host_backup_path is None else host_backup_path 90 self.backup_1_path = DEFAULT_BACKUP_1_DIR if backup_1_path is None else backup_1_path 91 self.backup_2_path = DEFAULT_BACKUP_2_DIR if backup_2_path is None else backup_2_path 92 self.jira_backup_path = DEFAULT_JIRA_BACKUP_DIR if jira_backup_path is None else jira_backup_path 93 self.conf_backup_path = DEFAULT_CONF_BACKUP_DIR if conf_backup_path is None else conf_backup_path 94 self.jira_attachments_path = DEFAULT_JIRA_ATTACHMENTS_DIR if jira_attachments_path is None else jira_attachments_path 95 self.conf_attachments_path = DEFAULT_CONF_ATTACHMENTS_DIR if conf_attachments_path is None else conf_attachments_path 96 self.verbose = DEFAULT_VERBOSITY if verbose is None else verbose 97 98 host_backup_path = property(operator.attrgetter('_host_backup_path')) 99 100 @host_backup_path.setter 101 def host_backup_path(self, value): 102 self._host_backup_path = value 103 104 backup_1_path = property(operator.attrgetter('_backup_1_path')) 105 106 @backup_1_path.setter 107 def backup_1_path(self, value): 108 self._backup_1_path = value 109 110 backup_2_path = property(operator.attrgetter('_backup_2_path')) 111 112 @backup_2_path.setter 113 def backup_2_path(self, value): 114 self._backup_2_path = value 115 116 jira_backup_path = property(operator.attrgetter('_jira_backup_path')) 117 118 @jira_backup_path.setter 119 def jira_backup_path(self, value): 120 self._jira_backup_path = value 121 122 conf_backup_path = property(operator.attrgetter('_conf_backup_path')) 123 124 @conf_backup_path.setter 125 def conf_backup_path(self, value): 126 self._conf_backup_path = value 127 128 jira_attachments_path = property(operator.attrgetter('_jira_attachments_path')) 129 130 @jira_attachments_path.setter 131 def jira_attachments_path(self, value): 132 self._jira_attachments_path = value 133 134 conf_attachments_path = property(operator.attrgetter('_conf_attachments_path')) 135 136 @conf_attachments_path.setter 137 def conf_attachments_path(self, value): 138 self._conf_attachments_path = value 139 140 verbose = property(operator.attrgetter('_verbose')) 141 142 @verbose.setter 143 def verbose(self, home_dir): 144 self._verbose = home_dir 71 def __init__(self, config_file=None): 72 self.config_file = DEFAULT_CONFIG_FILE if config_file is None else config_file 73 self.load_config(self.config_file) 74 75 def load_config(self, config_class_or_filepath): 76 """Accepts a filepath to a config file, or """ 77 78 config = configparser.ConfigParser() 79 if config_class_or_filepath is None: 80 raise ConfigError(config_class_or_filepath, "Neither config settings or filepath of config given") 81 elif isinstance(config_class_or_filepath, configparser.ConfigParser): 82 config = config_class_or_filepath 83 elif path.exists(config_class_or_filepath): 84 config.read(config_class_or_filepath) 85 86 def _get_str_key_from_section(config, section, key): 87 if config.has_option(section, key): 88 return config[section][key] 89 raise ConfigError(config, "ConfigError: KeyError: no key found for {0}".format(key)) 90 91 section = 'atlassian_backups' 92 self.host_backup_path = _get_str_key_from_section(config, section, 'host_backup_path') 93 self.backup_1_path = _get_str_key_from_section(config, section, 'backup_1_path') 94 self.backup_2_path = _get_str_key_from_section(config, section, 'backup_2_path') 95 self.jira_backup_path = _get_str_key_from_section(config, section, 'jira_backup_path') 96 self.conf_backup_path = _get_str_key_from_section(config, section, 'conf_backup_path') 97 self.jira_attachments_path = _get_str_key_from_section(config, section, 'jira_attachments_path') 98 self.conf_attachments_path = _get_str_key_from_section(config, section, 'conf_attachments_path') 99 self.verbose = config.getboolean('atlassian_backups', 'verbose') 145 100 146 101 def target_backup_paths_ok(self) -> bool: … … 184 139 185 140 # Move latest to tmp (and delete if move ok) 186 _move_dir_contents_to_dir(latest_paths, tmp_paths )141 _move_dir_contents_to_dir(latest_paths, tmp_paths, self.verbose) 187 142 188 143 # copy jira 189 jira_return = self._copy_jira_backup( )144 jira_return = self._copy_jira_backup(self.verbose) 190 145 191 146 # copy confluence 192 conf_return = self._copy_confluence_backup( )147 conf_return = self._copy_confluence_backup(self.verbose) 193 148 194 149 # tarfiles: 195 150 tar_return = self._tar_attachments() 196 151 197 # make mysql dump198 199 152 # If successful: move tmp to old 200 153 if jira_return == 0 and conf_return == 0 and tar_return == 0: 201 _move_dir_contents_to_dir(tmp_paths, old_paths )154 _move_dir_contents_to_dir(tmp_paths, old_paths, self.verbose) 202 155 else: 203 156 # If any failed: delete latest, move tmp back 204 _move_dir_contents_to_dir(tmp_paths, latest_paths )157 _move_dir_contents_to_dir(tmp_paths, latest_paths, self.verbose) 205 158 return 5 206 159 … … 216 169 return datetime.date.today().strftime(jira_format) 217 170 218 def _copy_jira_backup(self ):171 def _copy_jira_backup(self, verbose=False): 219 172 if not self.target_backup_paths_ok(): 220 173 return 2 … … 222 175 jira_wildcard_search = "{0}/{1}*".format(self.jira_backup_path, self.get_jira_backup_date_format()) 223 176 jira_xml_filepaths = glob.glob(jira_wildcard_search) 224 print(len(jira_xml_filepaths))225 177 if len(jira_xml_filepaths) == 0: 226 178 print("Copy Failure: No jira backups found at: ", jira_wildcard_search) … … 233 185 return 2 234 186 try: 235 print("Copying: {0} to {1}".format(jfile, tpath)) 187 if verbose: 188 print("Copying: {0} to {1}".format(jfile, tpath)) 236 189 shutil.copy2(jfile, tpath) 190 sub_utils.chmod_wrapper(['774', os.path.join(tpath, os.path.basename(jfile))]) 237 191 except IOError as e: 238 192 print("Error: copying jira backup.\n copying: {0}\n to: {1}".format(e.filename, e.filename2)) … … 248 202 return datetime.date.today().strftime(conf_format) 249 203 250 def _copy_confluence_backup(self ):204 def _copy_confluence_backup(self, verbose=False): 251 205 if not self.target_backup_paths_ok(): 252 206 print("Copy Failure: target path failure") … … 255 209 conf_wildcard_search = "{0}/*{1}*.zip".format(self.conf_backup_path, self.get_confluence_backup_date_format()) 256 210 conf_xml_filepaths = glob.glob(conf_wildcard_search) 257 print(len(conf_xml_filepaths))258 211 if len(conf_xml_filepaths) == 0: 259 212 print("Copy Failure: No confluence backups found at: ", conf_wildcard_search) … … 263 216 for tpath in target_paths: 264 217 try: 265 print("using cp wrapper")266 218 sub_utils.cp_wrapper([cfile, tpath]) 219 sub_utils.chmod_wrapper(['774', os.path.join(tpath, os.path.basename(cfile))]) 267 220 except Exception as e: 268 221 print(e) … … 279 232 jira_tar_filepath = path.join(latest_paths[0], jira_tar_name) 280 233 jira_tar_args = ["-cf", jira_tar_filepath, self.jira_attachments_path] 281 print(jira_tar_args)282 234 sub_utils.tar_wrapper(jira_tar_args) 235 sub_utils.chmod_wrapper(['774', jira_tar_filepath]) 283 236 # copy to backups 284 237 sub_utils.cp_wrapper([ jira_tar_filepath, latest_paths[1]]) … … 289 242 confluence_tar_filepath = path.join(latest_paths[0], confluence_tar_name) 290 243 confluence_tar_args = ["-cf", confluence_tar_filepath, self.conf_attachments_path] 291 print(confluence_tar_args)292 244 sub_utils.tar_wrapper(confluence_tar_args) 245 sub_utils.chmod_wrapper(['774', confluence_tar_filepath]) 293 246 # copy to backups 294 247 sub_utils.cp_wrapper([ confluence_tar_filepath, latest_paths[1]]) … … 326 279 decoded_stderr = stde.decode() 327 280 if decoded_stderr.casefold().find('error'.casefold()) > -1: 328 raise SubprocessError()281 raise sub_utils.SubprocessError() 329 282 330 283 # move the dump file to the correct locations … … 343 296 344 297 def run(self): 345 self.perform_atlassian_backups() 346 return 0 298 return self.perform_atlassian_backups() 347 299 348 300 … … 351 303 args_dict = vars(args) 352 304 ab = AtlassianBackups(**args_dict) 353 ab.run()305 return ab.run() 354 306 355 307 … … 359 311 description='Performs backup of atlassian applications\nYou should run this on the machine hosting the atlassian applications') 360 312 361 parser.add_argument('-- host_backup_path',313 parser.add_argument('--config_file', 362 314 nargs='?', 363 help='absolute path of where the backups should be copied to on the host', 364 default=DEFAULT_BACKUP_HOST) 365 parser.add_argument('--backup_1_dir', 366 nargs='?', 367 help='directory of where backups should be copied to', 368 default=DEFAULT_BACKUP_1_DIR) 369 parser.add_argument('--backup_2_dir', 370 nargs='?', 371 help='second directory of where backups should be copied to', 372 default=DEFAULT_BACKUP_1_DIR) 373 parser.add_argument('--jira_backup_dir', 374 nargs='?', 375 help='directory where the zipped xml backups are located', 376 default=DEFAULT_JIRA_BACKUP_DIR) 377 parser.add_argument('--conf_backup_dir', 378 nargs='?', 379 help='directory where the confluence xml backups are located', 380 default=DEFAULT_CONF_BACKUP_DIR) 381 parser.add_argument('--jira_attachments_dir', 382 nargs='?', 383 help='direcory of where the jira attachments are located', 384 default=DEFAULT_JIRA_ATTACHMENTS_DIR) 385 parser.add_argument('--conf_attachments_dir', 386 nargs='?', 387 help='directory of where the confluence attachments are located', 388 default=DEFAULT_CONF_ATTACHMENTS_DIR) 389 parser.add_argument('--verbose', '-v', 390 action='store_true', 391 help='will print some verbose messages') 315 help='contains config for all paths and mysqldump details', 316 default=DEFAULT_CONFIG_FILE) 392 317 393 318 return parser.parse_args() -
branches/ipp-132_automate_jira_conf_backups/backups/backup_atlassian_applications_test.py
r40892 r40893 1 1 import backup_atlassian_applications as baa 2 import configparser 2 3 import datetime 3 4 import os … … 7 8 8 9 import full_atlassian_backup_test as fab_test 10 import utils.subprocess_utils as sub_utils 9 11 10 12 from backup_atlassian_applications import AtlassianBackups 11 13 14 TEST_DEFAULT_CONFIG_FILE = "./testing/test.config" 15 16 17 def make_config(tmpdir) -> configparser.ConfigParser: 18 config = configparser.ConfigParser() 19 config['atlassian_backups'] = \ 20 { 21 'host_backup_path' : os.path.join(tmpdir, 'host_backup_path'), 22 'backup_1_path' : os.path.join(tmpdir, 'backup_1_path'), 23 'backup_2_path' : os.path.join(tmpdir, 'backup_2_path'), 24 'jira_backup_path' : os.path.join(tmpdir, 'jira_backup_path'), 25 'conf_backup_path' : os.path.join(tmpdir, 'conf_backup_path'), 26 'jira_attachments_path' : os.path.join(tmpdir, 'jira_attachments_path'), 27 'conf_attachments_path' : os.path.join(tmpdir, 'conf_attachments_path') 28 } 29 12 30 13 31 class TestArguments(object): 14 32 15 def test_default_arguments(self): 16 33 def test_load_from_config_file(self): 34 35 ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE) 36 37 assert ab.host_backup_path == "/export/ippops4.0/atlassian_backups" 38 assert ab.backup_1_path == "/data/ippops3.0/atlassian_backups" 39 assert ab.backup_2_path == "/data/ippops5.0/atlassian_backups" 40 assert ab.jira_backup_path == "/var/atlassian/application-data/jira/export" 41 assert ab.conf_backup_path == "/var/atlassian/application-data/confluence/backups" 42 assert ab.jira_attachments_path == "/var/atlassian/application-data/jira/data" 43 assert ab.conf_attachments_path == "/var/atlassian/application-data/confluence/attachments" 44 assert ab.verbose is True 45 46 def test_default_config_loads_with_no_args(self): 47 assert os.path.exists("./atlassian_backups.config") 17 48 ab = AtlassianBackups() 18 49 assert ab.host_backup_path == "/export/ippops4.0/atlassian_backups" … … 24 55 assert ab.conf_attachments_path == "/var/atlassian/application-data/confluence/attachments" 25 56 26 def test_providing_args(self): 27 ab = AtlassianBackups(host_backup_path="/host/backup/path", 28 backup_1_path="/backup/1/path", 29 backup_2_path="/backup/2/path", 30 jira_backup_path="/jira/backup/path", 31 conf_backup_path="/conf/backup/path", 32 jira_attachments_path="/jira/attachments/path", 33 conf_attachments_path="/conf/attachments/path", 34 verbose=True) 35 36 assert ab.host_backup_path == "/host/backup/path" 37 assert ab.backup_1_path == "/backup/1/path" 38 assert ab.backup_2_path == "/backup/2/path" 39 assert ab.jira_backup_path == "/jira/backup/path" 40 assert ab.conf_backup_path == "/conf/backup/path" 41 assert ab.jira_attachments_path == "/jira/attachments/path" 42 assert ab.conf_attachments_path == "/conf/attachments/path" 57 def test_default_arguments(self): 58 59 ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE) 60 assert ab.host_backup_path == "/export/ippops4.0/atlassian_backups" 61 assert ab.backup_1_path == "/data/ippops3.0/atlassian_backups" 62 assert ab.backup_2_path == "/data/ippops5.0/atlassian_backups" 63 assert ab.jira_backup_path == "/var/atlassian/application-data/jira/export" 64 assert ab.conf_backup_path == "/var/atlassian/application-data/confluence/backups" 65 assert ab.jira_attachments_path == "/var/atlassian/application-data/jira/data" 66 assert ab.conf_attachments_path == "/var/atlassian/application-data/confluence/attachments" 67 68 def test_providing_config_directly(self): 69 config = configparser.ConfigParser() 70 config.add_section("atlassian_backups") 71 config.set('atlassian_backups', 'host_backup_path', 'custom_config1') 72 config.set('atlassian_backups', 'backup_1_path', 'custom_config2') 73 config.set('atlassian_backups', 'backup_2_path', 'custom_config3') 74 config.set('atlassian_backups', 'jira_backup_path', 'custom_config4') 75 config.set('atlassian_backups', 'conf_backup_path', 'custom_config5') 76 config.set('atlassian_backups', 'jira_attachments_path', 'custom_config6') 77 config.set('atlassian_backups', 'conf_attachments_path', 'custom_config7') 78 config.set('atlassian_backups', 'verbose', 'False') 79 80 ab = AtlassianBackups(config_file=config) 81 82 assert ab.host_backup_path == 'custom_config1' 83 assert ab.backup_1_path == 'custom_config2' 84 assert ab.backup_2_path == 'custom_config3' 85 assert ab.jira_backup_path == 'custom_config4' 86 assert ab.conf_backup_path == 'custom_config5' 87 assert ab.jira_attachments_path == 'custom_config6' 88 assert ab.conf_attachments_path == 'custom_config7' 89 assert ab.verbose is False 90 91 def test_nonexistant_config_file_raises_error(self): 92 with pytest.raises(baa.ConfigError): 93 AtlassianBackups("not a real file path") 94 95 def test_default_config_loads_from_main_call(self): 96 try: 97 baa.main() 98 except Exception: 99 pytest.fail("An error was raised when it should not") 43 100 44 101 … … 46 103 47 104 def test_default_target_paths_do_not_exists_in_testing(self): 48 ab = AtlassianBackups( )105 ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE) 49 106 assert ab.target_backup_paths_ok() is False 50 107 51 108 def test_an_incorrect_path_then_correct_path(self, tmpdir): 52 ab = AtlassianBackups( )109 ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE) 53 110 54 111 assert os.path.exists(ab.jira_backup_path) is False … … 57 114 58 115 def test_each_path_individually(self, tmpdir): 59 ab = AtlassianBackups( )116 ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE) 60 117 61 118 assert os.path.exists(ab.host_backup_path) is False … … 92 149 93 150 def test_backup_subdirs_are_created_if_missing(self, tmpdir): 94 ab = AtlassianBackups( )151 ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE) 95 152 ab.jira_path = tmpdir 96 153 ab.conf_path = tmpdir … … 126 183 127 184 def test_target_paths_with_defaults_function(self): 128 ab = AtlassianBackups( )185 ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE) 129 186 130 187 default = ab.target_paths('default_paths') … … 135 192 136 193 def test_target_paths_function_after_changing_paths(self): 137 ab = AtlassianBackups( )194 ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE) 138 195 139 196 ab.host_backup_path = "/different_path/for_host" … … 232 289 233 290 def test_get_jira_backup_date_format(self): 234 ab = AtlassianBackups( )291 ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE) 235 292 today = datetime.date.today() 236 293 expected_format = today.strftime("%Y-%b-%d") … … 238 295 239 296 def test_copying_fails_if_paths_not_present(self): 240 ab = AtlassianBackups( )297 ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE) 241 298 return_value = ab._copy_jira_backup() 242 299 assert return_value != 0 … … 246 303 247 304 def test_jira_copy(self, tmpdir): 248 ab = AtlassianBackups( )305 ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE) 249 306 ab = fab_test.create_all_paths_and_folders(ab, tmpdir) 250 307 … … 253 310 254 311 def test_get_confluence_backup_date_format(self): 255 ab = AtlassianBackups( )312 ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE) 256 313 today = datetime.date.today() 257 314 expected_format = today.strftime("%Y_%m_%d") … … 259 316 260 317 def test_confluence_copy(self, tmpdir): 261 ab = AtlassianBackups( )318 ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE) 262 319 ab = fab_test.create_all_paths_and_folders(ab, tmpdir) 263 320 … … 266 323 267 324 def test_full_copy(self, tmpdir): 268 ab = AtlassianBackups( )325 ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE) 269 326 ab = fab_test.create_all_paths_and_folders(ab, tmpdir) 270 327 … … 274 331 275 332 def test_atlsssian_copying_fails_when_paths_do_not_exist(self, tmpdir): 276 ab = AtlassianBackups( )333 ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE) 277 334 fake_path = "/not/a/real/path" 278 335 ab.jira_backup_path = fake_path … … 295 352 def test_attachments_tar(self, tmpdir): 296 353 297 ab = AtlassianBackups( )354 ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE) 298 355 ab = fab_test.create_all_paths_and_folders(ab, tmpdir) 299 356 … … 340 397 341 398 def test_mysql_dump_is_ok(self, tmpdir): 342 ab = AtlassianBackups( )399 ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE) 343 400 ab = fab_test.create_all_paths_and_folders(ab, tmpdir) 344 401 … … 354 411 355 412 def test_mysql_dump_is_ok_to_custom_file(self, tmpdir): 356 ab = AtlassianBackups( )413 ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE) 357 414 ab = fab_test.create_all_paths_and_folders(ab, tmpdir) 358 415 … … 367 424 368 425 def test_mysql_dump_fails_with_incorrect_password(self, tmpdir): 369 ab = AtlassianBackups( )370 ab = fab_test.create_all_paths_and_folders(ab, tmpdir) 371 372 with pytest.raises( baa.SubprocessError):426 ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE) 427 ab = fab_test.create_all_paths_and_folders(ab, tmpdir) 428 429 with pytest.raises(sub_utils.SubprocessError): 373 430 ab.make_mysql_dump("Not the correct password") 374 375 # class TestTidyingOfFiles(object):376 377 # def test_tidying(self):378 # assert False is True -
branches/ipp-132_automate_jira_conf_backups/backups/full_atlassian_backup_test.py
r40892 r40893 1 1 import datetime 2 2 import os 3 import backup_atlassian_applications as baa 3 4 4 5 from pathlib import Path 5 6 6 7 from backup_atlassian_applications import AtlassianBackups 8 9 TEST_DEFAULT_CONFIG_FILE = "./testing/test.config" 7 10 8 11 … … 137 140 138 141 def test_entire_process(self, tmpdir): 139 ab = AtlassianBackups( )142 ab = AtlassianBackups(config_file=TEST_DEFAULT_CONFIG_FILE) 140 143 ab = create_all_paths_and_folders(ab, tmpdir) 141 144
Note:
See TracChangeset
for help on using the changeset viewer.
