Commit 4de726fb authored by Alain Takoudjou's avatar Alain Takoudjou

re6stnet test: update scripts with new parameters

parent 3205dfad
...@@ -32,6 +32,7 @@ class Re6stnetTest(unittest.TestCase): ...@@ -32,6 +32,7 @@ class Re6stnetTest(unittest.TestCase):
'config-file': config_file, 'config-file': config_file,
'ipv4': '127.0.0.1', 'ipv4': '127.0.0.1',
'port': '9201', 'port': '9201',
'pid-file': '/path/to/pid/file',
'db-path': '/path/to/db', 'db-path': '/path/to/db',
'command': '/path/to/command', 'command': '/path/to/command',
'manager-wrapper': os.path.join(self.base_dir, 'manager_wrapper'), 'manager-wrapper': os.path.join(self.base_dir, 'manager_wrapper'),
...@@ -98,6 +99,8 @@ class Re6stnetTest(unittest.TestCase): ...@@ -98,6 +99,8 @@ class Re6stnetTest(unittest.TestCase):
with open(path, 'r') as f: with open(path, 'r') as f:
content = f.read() content = f.read()
self.assertIn("@%s" % config_file, content) self.assertIn("@%s" % config_file, content)
self.assertIn("/path/to/pid/file", content)
self.assertIn("/path/to/command", content)
def fake_generateCertificates(self): def fake_generateCertificates(self):
return return
...@@ -138,10 +141,7 @@ class Re6stnetTest(unittest.TestCase): ...@@ -138,10 +141,7 @@ class Re6stnetTest(unittest.TestCase):
self.assertEqual(serial, '0x120010db80024') self.assertEqual(serial, '0x120010db80024')
def test_install(self): def test_install(self):
recipe = self.new_recipe() self.options.update({
recipe.generateCertificate = self.fake_generateCertificates
recipe.options.update({
'ipv6-prefix': '2001:db8:24::/48', 'ipv6-prefix': '2001:db8:24::/48',
'slave-instance-list': '''[ 'slave-instance-list': '''[
{"slave_reference":"SOFTINST-58770"}, {"slave_reference":"SOFTINST-58770"},
...@@ -150,6 +150,9 @@ class Re6stnetTest(unittest.TestCase): ...@@ -150,6 +150,9 @@ class Re6stnetTest(unittest.TestCase):
''' '''
}) })
recipe = self.new_recipe()
recipe.generateCertificate = self.fake_generateCertificates
try: try:
recipe.install() recipe.install()
except (NotFoundError, ConnectionError): except (NotFoundError, ConnectionError):
...@@ -185,9 +188,12 @@ class Re6stnetTest(unittest.TestCase): ...@@ -185,9 +188,12 @@ class Re6stnetTest(unittest.TestCase):
self.checkRegistryWrapper() self.checkRegistryWrapper()
# Remove one element # Remove one element
recipe.options.update({ self.options.update({
"slave-instance-list": """[{"slave_reference":"SOFTINST-58770"}]""" "slave-instance-list": """[{"slave_reference":"SOFTINST-58770"}]"""
}) })
recipe = self.new_recipe()
recipe.generateCertificate = self.fake_generateCertificates
try: try:
recipe.install() recipe.install()
except (NotFoundError, ConnectionError): except (NotFoundError, ConnectionError):
...@@ -204,12 +210,11 @@ class Re6stnetTest(unittest.TestCase): ...@@ -204,12 +210,11 @@ class Re6stnetTest(unittest.TestCase):
self.assertEqual(second_add, second_remove) self.assertEqual(second_add, second_remove)
def test_install_empty_slave(self): def test_install_empty_slave(self):
recipe = self.new_recipe() self.options.update({
recipe.generateCertificate = self.fake_generateCertificates
recipe.options.update({
'ipv6-prefix': '2001:db8:24::/48' 'ipv6-prefix': '2001:db8:24::/48'
}) })
recipe = self.new_recipe()
recipe.generateCertificate = self.fake_generateCertificates
recipe.install() recipe.install()
......
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