test_mariadb.py 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720
  1. import logging
  2. import pytest
  3. from flexmock import flexmock
  4. from borgmatic.hooks import mariadb as module
  5. def test_database_names_to_dump_passes_through_name():
  6. extra_environment = flexmock()
  7. log_prefix = ''
  8. names = module.database_names_to_dump(
  9. {'name': 'foo'}, extra_environment, log_prefix, dry_run=False
  10. )
  11. assert names == ('foo',)
  12. def test_database_names_to_dump_bails_for_dry_run():
  13. extra_environment = flexmock()
  14. log_prefix = ''
  15. flexmock(module).should_receive('execute_command_and_capture_output').never()
  16. names = module.database_names_to_dump(
  17. {'name': 'all'}, extra_environment, log_prefix, dry_run=True
  18. )
  19. assert names == ()
  20. def test_database_names_to_dump_queries_mariadb_for_database_names():
  21. extra_environment = flexmock()
  22. log_prefix = ''
  23. flexmock(module).should_receive('execute_command_and_capture_output').with_args(
  24. ('mariadb', '--skip-column-names', '--batch', '--execute', 'show schemas'),
  25. extra_environment=extra_environment,
  26. ).and_return('foo\nbar\nmysql\n').once()
  27. names = module.database_names_to_dump(
  28. {'name': 'all'}, extra_environment, log_prefix, dry_run=False
  29. )
  30. assert names == ('foo', 'bar')
  31. def test_use_streaming_true_for_any_databases():
  32. assert module.use_streaming(
  33. databases=[flexmock(), flexmock()], config=flexmock(), log_prefix=flexmock()
  34. )
  35. def test_use_streaming_false_for_no_databases():
  36. assert not module.use_streaming(databases=[], config=flexmock(), log_prefix=flexmock())
  37. def test_dump_data_sources_dumps_each_database():
  38. databases = [{'name': 'foo'}, {'name': 'bar'}]
  39. processes = [flexmock(), flexmock()]
  40. flexmock(module).should_receive('make_dump_path').and_return('')
  41. flexmock(module).should_receive('database_names_to_dump').and_return(('foo',)).and_return(
  42. ('bar',)
  43. )
  44. for name, process in zip(('foo', 'bar'), processes):
  45. flexmock(module).should_receive('execute_dump_command').with_args(
  46. database={'name': name},
  47. log_prefix=object,
  48. dump_path=object,
  49. database_names=(name,),
  50. extra_environment=object,
  51. dry_run=object,
  52. dry_run_label=object,
  53. ).and_return(process).once()
  54. assert module.dump_data_sources(databases, {}, 'test.yaml', dry_run=False) == processes
  55. def test_dump_data_sources_dumps_with_password():
  56. database = {'name': 'foo', 'username': 'root', 'password': 'trustsome1'}
  57. process = flexmock()
  58. flexmock(module).should_receive('make_dump_path').and_return('')
  59. flexmock(module).should_receive('database_names_to_dump').and_return(('foo',)).and_return(
  60. ('bar',)
  61. )
  62. flexmock(module).should_receive('execute_dump_command').with_args(
  63. database=database,
  64. log_prefix=object,
  65. dump_path=object,
  66. database_names=('foo',),
  67. extra_environment={'MYSQL_PWD': 'trustsome1'},
  68. dry_run=object,
  69. dry_run_label=object,
  70. ).and_return(process).once()
  71. assert module.dump_data_sources([database], {}, 'test.yaml', dry_run=False) == [process]
  72. def test_dump_data_sources_dumps_all_databases_at_once():
  73. databases = [{'name': 'all'}]
  74. process = flexmock()
  75. flexmock(module).should_receive('make_dump_path').and_return('')
  76. flexmock(module).should_receive('database_names_to_dump').and_return(('foo', 'bar'))
  77. flexmock(module).should_receive('execute_dump_command').with_args(
  78. database={'name': 'all'},
  79. log_prefix=object,
  80. dump_path=object,
  81. database_names=('foo', 'bar'),
  82. extra_environment=object,
  83. dry_run=object,
  84. dry_run_label=object,
  85. ).and_return(process).once()
  86. assert module.dump_data_sources(databases, {}, 'test.yaml', dry_run=False) == [process]
  87. def test_dump_data_sources_dumps_all_databases_separately_when_format_configured():
  88. databases = [{'name': 'all', 'format': 'sql'}]
  89. processes = [flexmock(), flexmock()]
  90. flexmock(module).should_receive('make_dump_path').and_return('')
  91. flexmock(module).should_receive('database_names_to_dump').and_return(('foo', 'bar'))
  92. for name, process in zip(('foo', 'bar'), processes):
  93. flexmock(module).should_receive('execute_dump_command').with_args(
  94. database={'name': name, 'format': 'sql'},
  95. log_prefix=object,
  96. dump_path=object,
  97. database_names=(name,),
  98. extra_environment=object,
  99. dry_run=object,
  100. dry_run_label=object,
  101. ).and_return(process).once()
  102. assert module.dump_data_sources(databases, {}, 'test.yaml', dry_run=False) == processes
  103. def test_database_names_to_dump_runs_mariadb_with_list_options():
  104. database = {'name': 'all', 'list_options': '--defaults-extra-file=mariadb.cnf'}
  105. flexmock(module).should_receive('execute_command_and_capture_output').with_args(
  106. (
  107. 'mariadb',
  108. '--defaults-extra-file=mariadb.cnf',
  109. '--skip-column-names',
  110. '--batch',
  111. '--execute',
  112. 'show schemas',
  113. ),
  114. extra_environment=None,
  115. ).and_return(('foo\nbar')).once()
  116. assert module.database_names_to_dump(database, None, 'test.yaml', '') == ('foo', 'bar')
  117. def test_database_names_to_dump_runs_non_default_mariadb_with_list_options():
  118. database = {
  119. 'name': 'all',
  120. 'list_options': '--defaults-extra-file=mariadb.cnf',
  121. 'mariadb_command': 'custom_mariadb',
  122. }
  123. flexmock(module).should_receive('execute_command_and_capture_output').with_args(
  124. extra_environment=None,
  125. full_command=(
  126. 'custom_mariadb', # Custom MariaDB command
  127. '--defaults-extra-file=mariadb.cnf',
  128. '--skip-column-names',
  129. '--batch',
  130. '--execute',
  131. 'show schemas',
  132. ),
  133. ).and_return(('foo\nbar')).once()
  134. assert module.database_names_to_dump(database, None, 'test.yaml', '') == ('foo', 'bar')
  135. def test_execute_dump_command_runs_mariadb_dump():
  136. process = flexmock()
  137. flexmock(module.dump).should_receive('make_data_source_dump_filename').and_return('dump')
  138. flexmock(module.os.path).should_receive('exists').and_return(False)
  139. flexmock(module.dump).should_receive('create_named_pipe_for_dump')
  140. flexmock(module).should_receive('execute_command').with_args(
  141. (
  142. 'mariadb-dump',
  143. '--add-drop-database',
  144. '--databases',
  145. 'foo',
  146. '--result-file',
  147. 'dump',
  148. ),
  149. extra_environment=None,
  150. run_to_completion=False,
  151. ).and_return(process).once()
  152. assert (
  153. module.execute_dump_command(
  154. database={'name': 'foo'},
  155. log_prefix='log',
  156. dump_path=flexmock(),
  157. database_names=('foo',),
  158. extra_environment=None,
  159. dry_run=False,
  160. dry_run_label='',
  161. )
  162. == process
  163. )
  164. def test_execute_dump_command_runs_mariadb_dump_without_add_drop_database():
  165. process = flexmock()
  166. flexmock(module.dump).should_receive('make_data_source_dump_filename').and_return('dump')
  167. flexmock(module.os.path).should_receive('exists').and_return(False)
  168. flexmock(module.dump).should_receive('create_named_pipe_for_dump')
  169. flexmock(module).should_receive('execute_command').with_args(
  170. (
  171. 'mariadb-dump',
  172. '--databases',
  173. 'foo',
  174. '--result-file',
  175. 'dump',
  176. ),
  177. extra_environment=None,
  178. run_to_completion=False,
  179. ).and_return(process).once()
  180. assert (
  181. module.execute_dump_command(
  182. database={'name': 'foo', 'add_drop_database': False},
  183. log_prefix='log',
  184. dump_path=flexmock(),
  185. database_names=('foo',),
  186. extra_environment=None,
  187. dry_run=False,
  188. dry_run_label='',
  189. )
  190. == process
  191. )
  192. def test_execute_dump_command_runs_mariadb_dump_with_hostname_and_port():
  193. process = flexmock()
  194. flexmock(module.dump).should_receive('make_data_source_dump_filename').and_return('dump')
  195. flexmock(module.os.path).should_receive('exists').and_return(False)
  196. flexmock(module.dump).should_receive('create_named_pipe_for_dump')
  197. flexmock(module).should_receive('execute_command').with_args(
  198. (
  199. 'mariadb-dump',
  200. '--add-drop-database',
  201. '--host',
  202. 'database.example.org',
  203. '--port',
  204. '5433',
  205. '--protocol',
  206. 'tcp',
  207. '--databases',
  208. 'foo',
  209. '--result-file',
  210. 'dump',
  211. ),
  212. extra_environment=None,
  213. run_to_completion=False,
  214. ).and_return(process).once()
  215. assert (
  216. module.execute_dump_command(
  217. database={'name': 'foo', 'hostname': 'database.example.org', 'port': 5433},
  218. log_prefix='log',
  219. dump_path=flexmock(),
  220. database_names=('foo',),
  221. extra_environment=None,
  222. dry_run=False,
  223. dry_run_label='',
  224. )
  225. == process
  226. )
  227. def test_execute_dump_command_runs_mariadb_dump_with_username_and_password():
  228. process = flexmock()
  229. flexmock(module.dump).should_receive('make_data_source_dump_filename').and_return('dump')
  230. flexmock(module.os.path).should_receive('exists').and_return(False)
  231. flexmock(module.dump).should_receive('create_named_pipe_for_dump')
  232. flexmock(module).should_receive('execute_command').with_args(
  233. (
  234. 'mariadb-dump',
  235. '--add-drop-database',
  236. '--user',
  237. 'root',
  238. '--databases',
  239. 'foo',
  240. '--result-file',
  241. 'dump',
  242. ),
  243. extra_environment={'MYSQL_PWD': 'trustsome1'},
  244. run_to_completion=False,
  245. ).and_return(process).once()
  246. assert (
  247. module.execute_dump_command(
  248. database={'name': 'foo', 'username': 'root', 'password': 'trustsome1'},
  249. log_prefix='log',
  250. dump_path=flexmock(),
  251. database_names=('foo',),
  252. extra_environment={'MYSQL_PWD': 'trustsome1'},
  253. dry_run=False,
  254. dry_run_label='',
  255. )
  256. == process
  257. )
  258. def test_execute_dump_command_runs_mariadb_dump_with_options():
  259. process = flexmock()
  260. flexmock(module.dump).should_receive('make_data_source_dump_filename').and_return('dump')
  261. flexmock(module.os.path).should_receive('exists').and_return(False)
  262. flexmock(module.dump).should_receive('create_named_pipe_for_dump')
  263. flexmock(module).should_receive('execute_command').with_args(
  264. (
  265. 'mariadb-dump',
  266. '--stuff=such',
  267. '--add-drop-database',
  268. '--databases',
  269. 'foo',
  270. '--result-file',
  271. 'dump',
  272. ),
  273. extra_environment=None,
  274. run_to_completion=False,
  275. ).and_return(process).once()
  276. assert (
  277. module.execute_dump_command(
  278. database={'name': 'foo', 'options': '--stuff=such'},
  279. log_prefix='log',
  280. dump_path=flexmock(),
  281. database_names=('foo',),
  282. extra_environment=None,
  283. dry_run=False,
  284. dry_run_label='',
  285. )
  286. == process
  287. )
  288. def test_execute_dump_command_runs_non_default_mariadb_dump_with_options():
  289. process = flexmock()
  290. flexmock(module.dump).should_receive('make_data_source_dump_filename').and_return('dump')
  291. flexmock(module.os.path).should_receive('exists').and_return(False)
  292. flexmock(module.dump).should_receive('create_named_pipe_for_dump')
  293. flexmock(module).should_receive('execute_command').with_args(
  294. (
  295. 'custom_mariadb_dump', # Custom MariaDB dump command
  296. '--stuff=such',
  297. '--add-drop-database',
  298. '--databases',
  299. 'foo',
  300. '--result-file',
  301. 'dump',
  302. ),
  303. extra_environment=None,
  304. run_to_completion=False,
  305. ).and_return(process).once()
  306. assert (
  307. module.execute_dump_command(
  308. database={
  309. 'name': 'foo',
  310. 'mariadb_dump_command': 'custom_mariadb_dump',
  311. 'options': '--stuff=such',
  312. }, # Custom MariaDB dump command specified
  313. log_prefix='log',
  314. dump_path=flexmock(),
  315. database_names=('foo',),
  316. extra_environment=None,
  317. dry_run=False,
  318. dry_run_label='',
  319. )
  320. == process
  321. )
  322. def test_execute_dump_command_with_duplicate_dump_skips_mariadb_dump():
  323. flexmock(module.dump).should_receive('make_data_source_dump_filename').and_return('dump')
  324. flexmock(module.os.path).should_receive('exists').and_return(True)
  325. flexmock(module.dump).should_receive('create_named_pipe_for_dump').never()
  326. flexmock(module).should_receive('execute_command').never()
  327. assert (
  328. module.execute_dump_command(
  329. database={'name': 'foo'},
  330. log_prefix='log',
  331. dump_path=flexmock(),
  332. database_names=('foo',),
  333. extra_environment=None,
  334. dry_run=True,
  335. dry_run_label='SO DRY',
  336. )
  337. is None
  338. )
  339. def test_execute_dump_command_with_dry_run_skips_mariadb_dump():
  340. flexmock(module.dump).should_receive('make_data_source_dump_filename').and_return('dump')
  341. flexmock(module.os.path).should_receive('exists').and_return(False)
  342. flexmock(module.dump).should_receive('create_named_pipe_for_dump')
  343. flexmock(module).should_receive('execute_command').never()
  344. assert (
  345. module.execute_dump_command(
  346. database={'name': 'foo'},
  347. log_prefix='log',
  348. dump_path=flexmock(),
  349. database_names=('foo',),
  350. extra_environment=None,
  351. dry_run=True,
  352. dry_run_label='SO DRY',
  353. )
  354. is None
  355. )
  356. def test_dump_data_sources_errors_for_missing_all_databases():
  357. databases = [{'name': 'all'}]
  358. flexmock(module).should_receive('make_dump_path').and_return('')
  359. flexmock(module.dump).should_receive('make_data_source_dump_filename').and_return(
  360. 'databases/localhost/all'
  361. )
  362. flexmock(module).should_receive('database_names_to_dump').and_return(())
  363. with pytest.raises(ValueError):
  364. assert module.dump_data_sources(databases, {}, 'test.yaml', dry_run=False)
  365. def test_dump_data_sources_does_not_error_for_missing_all_databases_with_dry_run():
  366. databases = [{'name': 'all'}]
  367. flexmock(module).should_receive('make_dump_path').and_return('')
  368. flexmock(module.dump).should_receive('make_data_source_dump_filename').and_return(
  369. 'databases/localhost/all'
  370. )
  371. flexmock(module).should_receive('database_names_to_dump').and_return(())
  372. assert module.dump_data_sources(databases, {}, 'test.yaml', dry_run=True) == []
  373. def test_restore_data_source_dump_runs_mariadb_to_restore():
  374. hook_config = [{'name': 'foo'}, {'name': 'bar'}]
  375. extract_process = flexmock(stdout=flexmock())
  376. flexmock(module).should_receive('execute_command_with_processes').with_args(
  377. ('mariadb', '--batch'),
  378. processes=[extract_process],
  379. output_log_level=logging.DEBUG,
  380. input_file=extract_process.stdout,
  381. extra_environment=None,
  382. ).once()
  383. module.restore_data_source_dump(
  384. hook_config,
  385. {},
  386. 'test.yaml',
  387. data_source={'name': 'foo'},
  388. dry_run=False,
  389. extract_process=extract_process,
  390. connection_params={
  391. 'hostname': None,
  392. 'port': None,
  393. 'username': None,
  394. 'password': None,
  395. },
  396. )
  397. def test_restore_data_source_dump_runs_mariadb_with_options():
  398. hook_config = [{'name': 'foo', 'restore_options': '--harder'}]
  399. extract_process = flexmock(stdout=flexmock())
  400. flexmock(module).should_receive('execute_command_with_processes').with_args(
  401. ('mariadb', '--batch', '--harder'),
  402. processes=[extract_process],
  403. output_log_level=logging.DEBUG,
  404. input_file=extract_process.stdout,
  405. extra_environment=None,
  406. ).once()
  407. module.restore_data_source_dump(
  408. hook_config,
  409. {},
  410. 'test.yaml',
  411. data_source=hook_config[0],
  412. dry_run=False,
  413. extract_process=extract_process,
  414. connection_params={
  415. 'hostname': None,
  416. 'port': None,
  417. 'username': None,
  418. 'password': None,
  419. },
  420. )
  421. def test_restore_data_source_dump_runs_non_default_mariadb_with_options():
  422. hook_config = [
  423. {'name': 'foo', 'restore_options': '--harder', 'mariadb_command': 'custom_mariadb'}
  424. ]
  425. extract_process = flexmock(stdout=flexmock())
  426. flexmock(module).should_receive('execute_command_with_processes').with_args(
  427. ('custom_mariadb', '--batch', '--harder'),
  428. processes=[extract_process],
  429. output_log_level=logging.DEBUG,
  430. input_file=extract_process.stdout,
  431. extra_environment=None,
  432. ).once()
  433. module.restore_data_source_dump(
  434. hook_config,
  435. {},
  436. 'test.yaml',
  437. data_source=hook_config[0],
  438. dry_run=False,
  439. extract_process=extract_process,
  440. connection_params={
  441. 'hostname': None,
  442. 'port': None,
  443. 'username': None,
  444. 'password': None,
  445. },
  446. )
  447. def test_restore_data_source_dump_runs_mariadb_with_hostname_and_port():
  448. hook_config = [{'name': 'foo', 'hostname': 'database.example.org', 'port': 5433}]
  449. extract_process = flexmock(stdout=flexmock())
  450. flexmock(module).should_receive('execute_command_with_processes').with_args(
  451. (
  452. 'mariadb',
  453. '--batch',
  454. '--host',
  455. 'database.example.org',
  456. '--port',
  457. '5433',
  458. '--protocol',
  459. 'tcp',
  460. ),
  461. processes=[extract_process],
  462. output_log_level=logging.DEBUG,
  463. input_file=extract_process.stdout,
  464. extra_environment=None,
  465. ).once()
  466. module.restore_data_source_dump(
  467. hook_config,
  468. {},
  469. 'test.yaml',
  470. data_source=hook_config[0],
  471. dry_run=False,
  472. extract_process=extract_process,
  473. connection_params={
  474. 'hostname': None,
  475. 'port': None,
  476. 'username': None,
  477. 'password': None,
  478. },
  479. )
  480. def test_restore_data_source_dump_runs_mariadb_with_username_and_password():
  481. hook_config = [{'name': 'foo', 'username': 'root', 'password': 'trustsome1'}]
  482. extract_process = flexmock(stdout=flexmock())
  483. flexmock(module).should_receive('execute_command_with_processes').with_args(
  484. ('mariadb', '--batch', '--user', 'root'),
  485. processes=[extract_process],
  486. output_log_level=logging.DEBUG,
  487. input_file=extract_process.stdout,
  488. extra_environment={'MYSQL_PWD': 'trustsome1'},
  489. ).once()
  490. module.restore_data_source_dump(
  491. hook_config,
  492. {},
  493. 'test.yaml',
  494. data_source=hook_config[0],
  495. dry_run=False,
  496. extract_process=extract_process,
  497. connection_params={
  498. 'hostname': None,
  499. 'port': None,
  500. 'username': None,
  501. 'password': None,
  502. },
  503. )
  504. def test_restore_data_source_dump_with_connection_params_uses_connection_params_for_restore():
  505. hook_config = [
  506. {
  507. 'name': 'foo',
  508. 'username': 'root',
  509. 'password': 'trustsome1',
  510. 'restore_hostname': 'restorehost',
  511. 'restore_port': 'restoreport',
  512. 'restore_username': 'restoreusername',
  513. 'restore_password': 'restorepassword',
  514. }
  515. ]
  516. extract_process = flexmock(stdout=flexmock())
  517. flexmock(module).should_receive('execute_command_with_processes').with_args(
  518. (
  519. 'mariadb',
  520. '--batch',
  521. '--host',
  522. 'clihost',
  523. '--port',
  524. 'cliport',
  525. '--protocol',
  526. 'tcp',
  527. '--user',
  528. 'cliusername',
  529. ),
  530. processes=[extract_process],
  531. output_log_level=logging.DEBUG,
  532. input_file=extract_process.stdout,
  533. extra_environment={'MYSQL_PWD': 'clipassword'},
  534. ).once()
  535. module.restore_data_source_dump(
  536. hook_config,
  537. {},
  538. 'test.yaml',
  539. data_source=hook_config[0],
  540. dry_run=False,
  541. extract_process=extract_process,
  542. connection_params={
  543. 'hostname': 'clihost',
  544. 'port': 'cliport',
  545. 'username': 'cliusername',
  546. 'password': 'clipassword',
  547. },
  548. )
  549. def test_restore_data_source_dump_without_connection_params_uses_restore_params_in_config_for_restore():
  550. hook_config = [
  551. {
  552. 'name': 'foo',
  553. 'username': 'root',
  554. 'password': 'trustsome1',
  555. 'hostname': 'dbhost',
  556. 'port': 'dbport',
  557. 'restore_username': 'restoreuser',
  558. 'restore_password': 'restorepass',
  559. 'restore_hostname': 'restorehost',
  560. 'restore_port': 'restoreport',
  561. }
  562. ]
  563. extract_process = flexmock(stdout=flexmock())
  564. flexmock(module).should_receive('execute_command_with_processes').with_args(
  565. (
  566. 'mariadb',
  567. '--batch',
  568. '--host',
  569. 'restorehost',
  570. '--port',
  571. 'restoreport',
  572. '--protocol',
  573. 'tcp',
  574. '--user',
  575. 'restoreuser',
  576. ),
  577. processes=[extract_process],
  578. output_log_level=logging.DEBUG,
  579. input_file=extract_process.stdout,
  580. extra_environment={'MYSQL_PWD': 'restorepass'},
  581. ).once()
  582. module.restore_data_source_dump(
  583. hook_config,
  584. {},
  585. 'test.yaml',
  586. data_source=hook_config[0],
  587. dry_run=False,
  588. extract_process=extract_process,
  589. connection_params={
  590. 'hostname': None,
  591. 'port': None,
  592. 'username': None,
  593. 'password': None,
  594. },
  595. )
  596. def test_restore_data_source_dump_with_dry_run_skips_restore():
  597. hook_config = [{'name': 'foo'}]
  598. flexmock(module).should_receive('execute_command_with_processes').never()
  599. module.restore_data_source_dump(
  600. hook_config,
  601. {},
  602. 'test.yaml',
  603. data_source={'name': 'foo'},
  604. dry_run=True,
  605. extract_process=flexmock(),
  606. connection_params={
  607. 'hostname': None,
  608. 'port': None,
  609. 'username': None,
  610. 'password': None,
  611. },
  612. )