Commit 3892d9e4 authored by Romain Courteaud's avatar Romain Courteaud

slapos_cloud:

* can not predicate test on aggregate
  Aggregate is not acquired from Supply to Cell
* Allocation Supply need an aggregated Node
* AllocationSupplyConstraint
parent f84b1c66
......@@ -4,6 +4,7 @@
</portal_type>
<portal_type id="Allocation Supply">
<item>AllocationSupply</item>
<item>AllocationSupplyConstraint</item>
<item>SlapOSVirtualMasterSourceProjectConstraint</item>
</portal_type>
<portal_type id="Allocation Supply Cell">
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Property Sheet" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>AllocationSupplyConstraint</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Property Sheet</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category Existence Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>constraint_portal_type</string> </key>
<value> <string>python: (\'Compute Node\', \'Remote Node\', \'Instance Node\')</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>aggregate_constraint</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Category Existence Constraint</string> </value>
</item>
<item>
<key> <string>use_acquisition</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -6,7 +6,7 @@ if (supply.getPortalType() != 'Allocation Supply') or (supply.getValidationState
if not context.isAllocable():
return None
base_category_tuple = ('resource', 'software_type', 'software_release', 'destination_project', 'aggregate')
base_category_tuple = ('resource', 'software_type', 'software_release', 'destination_project')
if supply.getDestination():
base_category_tuple += ('destination',)
......
......@@ -57,6 +57,11 @@ class TestSlapOSAllocationSupply(SlapOSTestCaseMixin):
person_1 = self.portal.person_module.newContent()
person_2 = self.portal.person_module.newContent()
# create 1 compute node
compute_node_1 = self.portal.compute_node_module.newContent(
portal_type="Compute Node"
)
# Create 2 allocation supplies
# - one for everybody (no destination)
# - one for one specific user
......@@ -64,12 +69,14 @@ class TestSlapOSAllocationSupply(SlapOSTestCaseMixin):
everybody_supply = self.portal.allocation_supply_module.newContent(
title="Everybody Supply",
start_date_range_min=now,
destination_project_value=project_1
destination_project_value=project_1,
aggregate_value=compute_node_1
)
person_1_supply = self.portal.allocation_supply_module.newContent(
title="Person 1 Supply",
start_date_range_min=now,
destination_project_value=project_1,
aggregate_value=compute_node_1,
destination_value=person_1
)
......
......@@ -2,6 +2,7 @@ Alarm Tool | SlapOSMasterUpgradeConstraint
Allocation Supply Cell | AllocationSupplyPath
Allocation Supply Line | AllocationSupplyPath
Allocation Supply | AllocationSupply
Allocation Supply | AllocationSupplyConstraint
Allocation Supply | SlapOSVirtualMasterSourceProjectConstraint
Assignment | SlaposAssignmentConstraint
Compute Node | ComputeNodeSlapOSMetadata
......
AllocationSupplyConstraint
SoftwareInstanceConstraint
SlapOSMasterUpgradeConstraint
SlaposInstanceNodeConstraint
......
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