Commit f881902b authored by Rafael Monnerat's avatar Rafael Monnerat

slapos/test: follow up changes on re6stnet recipe

  * db-path was removed from command parameter
  * Only a single command is generated now, instead several wrappers.
  * Wrapper to registry is not generated from recipe anymore, it is geneated by a normal section.
parent 84fc84dd
...@@ -33,7 +33,6 @@ class Re6stnetTest(unittest.TestCase): ...@@ -33,7 +33,6 @@ class Re6stnetTest(unittest.TestCase):
'ipv4': '127.0.0.1', 'ipv4': '127.0.0.1',
'port': '9201', 'port': '9201',
'pid-file': '/path/to/pid/file', 'pid-file': '/path/to/pid/file',
'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'),
'drop-service-wrapper': os.path.join(self.base_dir, 'drop_wrapper'), 'drop-service-wrapper': os.path.join(self.base_dir, 'drop_wrapper'),
...@@ -86,22 +85,10 @@ class Re6stnetTest(unittest.TestCase): ...@@ -86,22 +85,10 @@ class Re6stnetTest(unittest.TestCase):
self.assertIn("'key_file': '/path/to/key'", content) self.assertIn("'key_file': '/path/to/key'", content)
self.assertIn("'cert_file': '/path/to/cert'", content) self.assertIn("'cert_file': '/path/to/cert'", content)
self.assertIn("'server_url': 'http://server.com'", content) self.assertIn("'server_url': 'http://server.com'", content)
self.assertIn("'db': '%s'" % self.options['db-path'], content)
self.assertIn("'token_base_path': '%s'" % self.token_dir, content) self.assertIn("'token_base_path': '%s'" % self.token_dir, content)
self.assertIn("'registry_url': 'http://%s:%s/'" % (self.options['ipv4'], self.assertIn("'registry_url': 'http://%s:%s/'" % (self.options['ipv4'],
self.options['port']), content) self.options['port']), content)
def checkRegistryWrapper(self):
path = os.path.join(self.base_dir, 'wrapper')
self.assertTrue(os.path.exists(path))
content = ""
config_file = os.path.join(self.base_dir, 'config')
with open(path, 'r') as f:
content = f.read()
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
...@@ -182,10 +169,6 @@ class Re6stnetTest(unittest.TestCase): ...@@ -182,10 +169,6 @@ class Re6stnetTest(unittest.TestCase):
self.assertEqual(token_dict['SOFTINST-58778'], second_add) self.assertEqual(token_dict['SOFTINST-58778'], second_add)
self.checkWrapper(os.path.join(self.base_dir, 'manager_wrapper')) self.checkWrapper(os.path.join(self.base_dir, 'manager_wrapper'))
self.checkWrapper(os.path.join(self.base_dir, 'drop_wrapper'))
self.checkWrapper(os.path.join(self.base_dir, 'check_wrapper'))
self.checkWrapper(os.path.join(self.base_dir, 'revoke_wrapper'))
self.checkRegistryWrapper()
# Remove one element # Remove one element
self.options.update({ self.options.update({
...@@ -226,8 +209,4 @@ class Re6stnetTest(unittest.TestCase): ...@@ -226,8 +209,4 @@ class Re6stnetTest(unittest.TestCase):
self.assertItemsEqual(os.listdir(self.options['token-dir']), []) self.assertItemsEqual(os.listdir(self.options['token-dir']), [])
self.checkWrapper(os.path.join(self.base_dir, 'manager_wrapper')) self.checkWrapper(os.path.join(self.base_dir, 'manager_wrapper'))
self.checkWrapper(os.path.join(self.base_dir, 'drop_wrapper'))
self.checkWrapper(os.path.join(self.base_dir, 'check_wrapper'))
self.checkWrapper(os.path.join(self.base_dir, 'revoke_wrapper'))
self.checkRegistryWrapper()
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