Commit a12084e3 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_erp5: Since capacity scope is updated after allocation, the computer...

slapos_erp5: Since capacity scope is updated after allocation, the computer should have access on mememcached
parent a9236b9e
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
from erp5.component.test.testSlapOSCloudSecurityGroup import TestSlapOSSecurityMixin from erp5.component.test.testSlapOSCloudSecurityGroup import TestSlapOSSecurityMixin
from erp5.component.test.SlapOSTestCaseMixin import changeSkin from erp5.component.test.SlapOSTestCaseMixin import changeSkin
import re import re
import json
import xml_marshaller import xml_marshaller
from AccessControl.SecurityManagement import getSecurityManager, \ from AccessControl.SecurityManagement import getSecurityManager, \
setSecurityManager setSecurityManager
...@@ -99,6 +100,16 @@ class DefaultScenarioMixin(TestSlapOSSecurityMixin): ...@@ -99,6 +100,16 @@ class DefaultScenarioMixin(TestSlapOSSecurityMixin):
class TestSlapOSDefaultScenario(DefaultScenarioMixin): class TestSlapOSDefaultScenario(DefaultScenarioMixin):
def setAccessToMemcached(self, agent):
memcached_dict = self.portal.portal_memcached.getMemcachedDict(
key_prefix='slap_tool',
plugin_path='portal_memcached/default_memcached_plugin')
access_date = DateTime()
memcached_dict[agent.getReference()] = json.dumps(
{"created_at":"%s" % access_date, "text": "#access "}
)
def requestComputer(self, title): def requestComputer(self, title):
requestXml = self.portal.portal_slap.requestComputer(title) requestXml = self.portal.portal_slap.requestComputer(title)
self.tic() self.tic()
...@@ -668,6 +679,7 @@ class TestSlapOSDefaultScenario(DefaultScenarioMixin): ...@@ -668,6 +679,7 @@ class TestSlapOSDefaultScenario(DefaultScenarioMixin):
public_server_id = self.requestComputer(public_server_title) public_server_id = self.requestComputer(public_server_title)
public_server = self.portal.portal_catalog.getResultValue( public_server = self.portal.portal_catalog.getResultValue(
portal_type='Computer', reference=public_server_id) portal_type='Computer', reference=public_server_id)
self.setAccessToMemcached(public_server)
self.assertNotEqual(None, public_server) self.assertNotEqual(None, public_server)
self.setServerOpenPublic(public_server) self.setServerOpenPublic(public_server)
......
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