def test_convert_all_supported_items(self): self.assertEqual( [ config_structure.ConfigItem("authfile", "/path/to/auth.file"), config_structure.ConfigItem("site", "1.1.1.1"), config_structure.ConfigItem("site", "2.2.2.2"), config_structure.ConfigItem("arbitrator", "3.3.3.3"), config_structure.ConfigItem("ticket", "TA"), config_structure.ConfigItem("ticket", "TB", [ config_structure.ConfigItem("expire", "10") ]), ], config_exchange.from_exchange_format([ { "key": "authfile", "value": "/path/to/auth.file", "details": [], }, {"key": "site", "value": "1.1.1.1", "details": []}, {"key": "site", "value": "2.2.2.2", "details": []}, {"key": "arbitrator", "value": "3.3.3.3", "details": []}, {"key": "ticket", "value": "TA", "details": []}, {"key": "ticket", "value": "TB", "details": [ {"key": "expire", "value": "10", "details": []} ]}, ]) )
def config_setup(env, booth_configuration, overwrite_existing=False): """ create boot configuration list site_list contains site adresses of multisite list arbitrator_list contains arbitrator adresses of multisite """ config_content = config_exchange.from_exchange_format(booth_configuration) config_structure.validate_peers( *config_structure.take_peers(config_content)) env.booth.create_key(config_files.generate_key(), overwrite_existing) config_content = config_structure.set_authfile(config_content, env.booth.key_path) env.booth.create_config(build(config_content), overwrite_existing)
def test_convert_all_supported_items(self): self.assertEqual([ config_structure.ConfigItem("authfile", "/path/to/auth.file"), config_structure.ConfigItem("site", "1.1.1.1"), config_structure.ConfigItem("site", "2.2.2.2"), config_structure.ConfigItem("arbitrator", "3.3.3.3"), config_structure.ConfigItem("ticket", "TA"), config_structure.ConfigItem( "ticket", "TB", [config_structure.ConfigItem("expire", "10")]), ], config_exchange.from_exchange_format([ { "key": "authfile", "value": "/path/to/auth.file", "details": [] }, { "key": "site", "value": "1.1.1.1", "details": [] }, { "key": "site", "value": "2.2.2.2", "details": [] }, { "key": "arbitrator", "value": "3.3.3.3", "details": [] }, { "key": "ticket", "value": "TA", "details": [] }, { "key": "ticket", "value": "TB", "details": [{ "key": "expire", "value": "10", "details": [] }] }, ]))
def config_setup(env, booth_configuration, overwrite_existing=False): """ create boot configuration list site_list contains site adresses of multisite list arbitrator_list contains arbitrator adresses of multisite """ config_content = config_exchange.from_exchange_format(booth_configuration) config_structure.validate_peers( *config_structure.take_peers(config_content) ) env.booth.create_key(config_files.generate_key(), overwrite_existing) config_content = config_structure.set_authfile( config_content, env.booth.key_path ) env.booth.create_config(build(config_content), overwrite_existing)
def test_convert_all_supported_items(self): self.assertEqual( [ config_structure.ConfigItem("authfile", "/path/to/auth.file"), config_structure.ConfigItem("site", "1.1.1.1"), config_structure.ConfigItem("site", "2.2.2.2"), config_structure.ConfigItem("arbitrator", "3.3.3.3"), config_structure.ConfigItem("ticket", "TA"), config_structure.ConfigItem("ticket", "TB"), ], config_exchange.from_exchange_format( { "sites": ["1.1.1.1", "2.2.2.2"], "arbitrators": ["3.3.3.3"], "tickets": ["TA", "TB"], "authfile": "/path/to/auth.file", }, ) )