Update tests data about free partition for slapgrid

parent bd68b88c
...@@ -306,6 +306,9 @@ touch worked""") ...@@ -306,6 +306,9 @@ touch worked""")
""" """
Test if slapgrid don't process "free" partition Test if slapgrid don't process "free" partition
""" """
self.sequence = []
partition_name = '0'
partition_path = os.path.join(self.instance_root, partition_name)
def server_response(self, path, method, body, header): def server_response(self, path, method, body, header):
parsed_url = urlparse.urlparse(path.lstrip('/')) parsed_url = urlparse.urlparse(path.lstrip('/'))
parsed_qs = urlparse.parse_qs(parsed_url.query) parsed_qs = urlparse.parse_qs(parsed_url.query)
...@@ -315,7 +318,8 @@ touch worked""") ...@@ -315,7 +318,8 @@ touch worked""")
slap_computer._software_release_list = [] slap_computer._software_release_list = []
slap_computer._computer_partition_list = [] slap_computer._computer_partition_list = []
partition = slapos.slap.ComputerPartition(parsed_qs['computer_id'][0], partition = slapos.slap.ComputerPartition(parsed_qs['computer_id'][0],
'0') partition_name)
partition._requested_state = 'destroyed'
partition._software_release_document = None partition._software_release_document = None
slap_computer._computer_partition_list = [partition] slap_computer._computer_partition_list = [partition]
return (200, {}, xml_marshaller.xml_marshaller.dumps(slap_computer)) return (200, {}, xml_marshaller.xml_marshaller.dumps(slap_computer))
...@@ -325,9 +329,13 @@ touch worked""") ...@@ -325,9 +329,13 @@ touch worked""")
os.mkdir(self.software_root) os.mkdir(self.software_root)
os.mkdir(self.instance_root) os.mkdir(self.instance_root)
os.mkdir(partition_path)
self.assertTrue(self.grid.processComputerPartitionList()) self.assertTrue(self.grid.processComputerPartitionList())
self.assertSortedListEqual(os.listdir(self.instance_root), ['etc', 'var']) self.assertSortedListEqual(os.listdir(self.instance_root),
['0', 'etc', 'var'])
self.assertSortedListEqual(os.listdir(partition_path), [])
self.assertSortedListEqual(os.listdir(self.software_root), []) self.assertSortedListEqual(os.listdir(self.software_root), [])
self.assertEqual(self.sequence, [])
def test_one_partition_started(self): def test_one_partition_started(self):
self.sequence = [] self.sequence = []
......
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