Commit 7b5a54a1 authored by Łukasz Nowak's avatar Łukasz Nowak

Assert software hash existince.

parent 9619e425
...@@ -137,8 +137,8 @@ class TestSlapgridCPWithMaster(MasterMixin, unittest.TestCase): ...@@ -137,8 +137,8 @@ class TestSlapgridCPWithMaster(MasterMixin, unittest.TestCase):
os.mkdir(self.instance_root) os.mkdir(self.instance_root)
partition_path = os.path.join(self.instance_root, '0') partition_path = os.path.join(self.instance_root, '0')
os.mkdir(partition_path, 0750) os.mkdir(partition_path, 0750)
srdir = os.path.join(self.software_root, software_hash = slapos.grid.utils.getSoftwareUrlHash('http://sr/')
slapos.grid.utils.getSoftwareUrlHash('http://sr/')) srdir = os.path.join(self.software_root, software_hash)
os.mkdir(srdir) os.mkdir(srdir)
open(os.path.join(srdir, 'template.cfg'), 'w').write( open(os.path.join(srdir, 'template.cfg'), 'w').write(
"""[buildout]""") """[buildout]""")
...@@ -148,5 +148,7 @@ class TestSlapgridCPWithMaster(MasterMixin, unittest.TestCase): ...@@ -148,5 +148,7 @@ class TestSlapgridCPWithMaster(MasterMixin, unittest.TestCase):
touch worked""") touch worked""")
os.chmod(os.path.join(srbindir, 'buildout'), 0755) os.chmod(os.path.join(srbindir, 'buildout'), 0755)
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',
self.assertSortedListEqual(os.listdir(self.software_root), []) 'var'])
self.assertSortedListEqual(os.listdir(self.software_root),
[software_hash])
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