Commit 3ec46cb3 authored by Romain Courteaud's avatar Romain Courteaud

slapos_erp5: test: use fixed date to check the movement quantity

parent 86918ead
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
############################################################################## ##############################################################################
from erp5.component.test.testSlapOSERP5VirtualMasterScenario import TestSlapOSVirtualMasterScenarioMixin from erp5.component.test.testSlapOSERP5VirtualMasterScenario import TestSlapOSVirtualMasterScenarioMixin
from erp5.component.test.SlapOSTestCaseMixin import PinnedDateTime
from DateTime import DateTime
class TestSlapOSSubscriptionChangeRequestScenarioMixin(TestSlapOSVirtualMasterScenarioMixin): class TestSlapOSSubscriptionChangeRequestScenarioMixin(TestSlapOSVirtualMasterScenarioMixin):
...@@ -20,6 +22,8 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe ...@@ -20,6 +22,8 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe
self.tic() self.tic()
self.logout() self.logout()
with PinnedDateTime(self, DateTime('2024/01/25')):
# lets join as slapos administrator, which will own few compute_nodes # lets join as slapos administrator, which will own few compute_nodes
owner_reference = 'owner-%s' % self.generateNewId() owner_reference = 'owner-%s' % self.generateNewId()
self.joinSlapOS(self.web_site, owner_reference) self.joinSlapOS(self.web_site, owner_reference)
...@@ -55,47 +59,23 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe ...@@ -55,47 +59,23 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe
self.logout() self.logout()
self.login(owner_person.getUserId()) self.login(owner_person.getUserId())
"""
public_server_title = 'Public Server for %s' % owner_reference
public_server_id = self.requestComputeNode(public_server_title, project.getReference())
public_server = self.portal.portal_catalog.getResultValue(
portal_type='Compute Node', reference=public_server_id)
self.setAccessToMemcached(public_server)
self.assertNotEqual(None, public_server)
self.setServerOpenPublic(public_server)
public_server.generateCertificate()
"""
# and install some software on them # and install some software on them
public_server_software = self.generateNewSoftwareReleaseUrl() public_server_software = self.generateNewSoftwareReleaseUrl()
public_instance_type = 'public type' public_instance_type = 'public type'
"""
self.supplySoftware(public_server, public_server_software)
# format the compute_nodes
self.formatComputeNode(public_server)
software_product, release_variation, type_variation = self.addSoftwareProduct(
"""
self.addSoftwareProduct( self.addSoftwareProduct(
"instance product", project, public_server_software, public_instance_type "instance product", project, public_server_software, public_instance_type
) )
"""
self.addAllocationSupply("for compute node", public_server, software_product,
release_variation, type_variation)
self.tic()
self.logout()
"""
"""
self.login()
self.checkServiceSubscriptionRequest(public_server)
"""
# join as the another visitor and request software instance on public # join as the another visitor and request software instance on public
# compute_node # compute_node
self.logout() self.logout()
with PinnedDateTime(self, DateTime('2024/01/29')):
public_reference = 'public-%s' % self.generateNewId() public_reference = 'public-%s' % self.generateNewId()
self.joinSlapOS(self.web_site, public_reference) self.joinSlapOS(self.web_site, public_reference)
with PinnedDateTime(self, DateTime('2024/01/31')):
public_reference2 = 'public2-%s' % self.generateNewId() public_reference2 = 'public2-%s' % self.generateNewId()
self.joinSlapOS(self.web_site, public_reference2) self.joinSlapOS(self.web_site, public_reference2)
...@@ -115,6 +95,7 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe ...@@ -115,6 +95,7 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe
public_instance_title = 'Public title %s' % self.generateNewId() public_instance_title = 'Public title %s' % self.generateNewId()
self.login(person_user_id) self.login(person_user_id)
with PinnedDateTime(self, DateTime('2024/02/03')):
self.personRequestInstanceNotReady( self.personRequestInstanceNotReady(
software_release=software_release, software_release=software_release,
software_type=software_type, software_type=software_type,
...@@ -132,7 +113,7 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe ...@@ -132,7 +113,7 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe
self.checkServiceSubscriptionRequest(instance_tree) self.checkServiceSubscriptionRequest(instance_tree)
self.tic() self.tic()
with PinnedDateTime(self, DateTime('2024/02/10')):
self.login(sale_person.getUserId()) self.login(sale_person.getUserId())
subscription_change_request = public_person2.Person_claimSlaposItemSubscription( subscription_change_request = public_person2.Person_claimSlaposItemSubscription(
instance_tree.getReference(), instance_tree.getReference(),
...@@ -199,5 +180,6 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe ...@@ -199,5 +180,6 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe
# 2 subscription request # 2 subscription request
self.assertRelatedObjectCount(project, 28) self.assertRelatedObjectCount(project, 28)
with PinnedDateTime(self, DateTime('2024/02/15')):
self.checkERP5StateBeforeExit() self.checkERP5StateBeforeExit()
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