Commit 80ab4e0f authored by Cédric de Saint Martin's avatar Cédric de Saint Martin Committed by Rafael Monnerat

slapproxy: give computer reference to partition network.

Also make sure we test adding addresses to partitions.
parent d1e40c8c
......@@ -296,6 +296,7 @@ def loadComputerConfigurationFromXML():
for address in partition['address_list']:
address['reference'] = partition['tap']['name']
address['partition_reference'] = partition['reference']
address['computer_reference'] = partition['computer_reference']
execute_db('partition_network', 'INSERT OR REPLACE INTO %s (reference, partition_reference, computer_reference, address, netmask) values(:reference, :partition_reference, :computer_reference, :addr, :netmask)', address)
return 'done'
......
......@@ -124,7 +124,11 @@ database_uri = %(tempdir)s/lib/proxy.db
for i in range(partition_amount):
partition_example = {
'reference': 'slappart%s' % i,
'address_list': [],
'address_list': [
{'addr': '1.2.3.4', 'netmask': '255.255.255.255'},
{'addr': '4.3.2.1', 'netmask': '255.255.255.255'}
],
'tap': {'name': 'tap0'},
}
computer_dict['partition_list'].append(partition_example)
......@@ -132,8 +136,9 @@ database_uri = %(tempdir)s/lib/proxy.db
'computer_id': self.computer_id,
'xml': xml_marshaller.xml_marshaller.dumps(computer_dict),
}
self.app.post('/loadComputerConfigurationFromXML',
rv = self.app.post('/loadComputerConfigurationFromXML',
data=request_dict)
self.assertEqual(rv._status_code, 200)
def tearDown(self):
"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment