Commit 9b920c16 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_cloud: Update tests on Certificate Renew

parent 5fbda526
...@@ -307,7 +307,9 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin): ...@@ -307,7 +307,9 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
self.assertTrue(serial in compute_node_certificate) self.assertTrue(serial in compute_node_certificate)
self.assertTrue(self.compute_node.getReference() in compute_node_certificate.decode('string_escape')) self.assertTrue(self.compute_node.getReference() in compute_node_certificate.decode('string_escape'))
self.compute_node.renewCertificate() self.compute_node.revokeCertificate()
self.compute_node.generateCertificate()
self.assertNotEqual(None, self.portal.REQUEST.get('compute_node_key')) self.assertNotEqual(None, self.portal.REQUEST.get('compute_node_key'))
self.assertNotEqual(None, self.portal.REQUEST.get('compute_node_certificate')) self.assertNotEqual(None, self.portal.REQUEST.get('compute_node_certificate'))
self.assertNotEqual(None, self.compute_node.getDestinationReference()) self.assertNotEqual(None, self.compute_node.getDestinationReference())
...@@ -316,14 +318,6 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin): ...@@ -316,14 +318,6 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
self.assertNotEqual(compute_node_certificate, self.portal.REQUEST.get('compute_node_certificate')) self.assertNotEqual(compute_node_certificate, self.portal.REQUEST.get('compute_node_certificate'))
self.assertNotEqual(destination_reference, self.compute_node.getDestinationReference()) self.assertNotEqual(destination_reference, self.compute_node.getDestinationReference())
def test_renewCertificateNoCertificate(self):
self.login(self.compute_node.getUserId())
self.assertRaises(ValueError, self.compute_node.renewCertificate)
self.assertEqual(None, self.portal.REQUEST.get('compute_node_key'))
self.assertEqual(None, self.portal.REQUEST.get('compute_node_certificate'))
self.assertEqual(None, self.compute_node.getDestinationReference())
def test_renewCertificate_twice(self): def test_renewCertificate_twice(self):
self.login(self.compute_node.getUserId()) self.login(self.compute_node.getUserId())
self.compute_node.generateCertificate() self.compute_node.generateCertificate()
...@@ -338,7 +332,8 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin): ...@@ -338,7 +332,8 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
self.assertTrue(serial in compute_node_certificate) self.assertTrue(serial in compute_node_certificate)
self.assertTrue(self.compute_node.getReference() in compute_node_certificate.decode('string_escape')) self.assertTrue(self.compute_node.getReference() in compute_node_certificate.decode('string_escape'))
self.compute_node.renewCertificate() self.compute_node.revokeCertificate()
self.compute_node.generateCertificate()
self.assertNotEqual(None, self.portal.REQUEST.get('compute_node_key')) self.assertNotEqual(None, self.portal.REQUEST.get('compute_node_key'))
self.assertNotEqual(None, self.portal.REQUEST.get('compute_node_certificate')) self.assertNotEqual(None, self.portal.REQUEST.get('compute_node_certificate'))
self.assertNotEqual(None, self.compute_node.getDestinationReference()) self.assertNotEqual(None, self.compute_node.getDestinationReference())
...@@ -351,7 +346,8 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin): ...@@ -351,7 +346,8 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
compute_node_certificate = self.portal.REQUEST.get('compute_node_certificate') compute_node_certificate = self.portal.REQUEST.get('compute_node_certificate')
destination_reference = self.compute_node.getDestinationReference() destination_reference = self.compute_node.getDestinationReference()
self.compute_node.renewCertificate() self.compute_node.revokeCertificate()
self.compute_node.generateCertificate()
self.assertNotEqual(None, self.portal.REQUEST.get('compute_node_key')) self.assertNotEqual(None, self.portal.REQUEST.get('compute_node_key'))
self.assertNotEqual(None, self.portal.REQUEST.get('compute_node_certificate')) self.assertNotEqual(None, self.portal.REQUEST.get('compute_node_certificate'))
self.assertNotEqual(None, self.compute_node.getDestinationReference()) self.assertNotEqual(None, self.compute_node.getDestinationReference())
......
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