Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Carlos Ramos Carreño
slapos.core
Commits
3a49e5b5
Commit
3a49e5b5
authored
Oct 31, 2012
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move Computer Partition constraint
parent
c1ad9a6a
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
24 additions
and
134 deletions
+24
-134
master/bt5/slapos_cloud/PortalTypePropertySheetTemplateItem/property_sheet_list.xml
...rtalTypePropertySheetTemplateItem/property_sheet_list.xml
+3
-0
master/bt5/slapos_cloud/PropertySheetTemplateItem/portal_property_sheets/SlaposComputerPartitionConstraint.xml
...tal_property_sheets/SlaposComputerPartitionConstraint.xml
+1
-1
master/bt5/slapos_cloud/PropertySheetTemplateItem/portal_property_sheets/SlaposComputerPartitionConstraint/non_busy_partition_has_no_related_instance_constraint.xml
...non_busy_partition_has_no_related_instance_constraint.xml
+0
-0
master/bt5/slapos_cloud/TestTemplateItem/testSlapOSCoreComputerSlapInterfaceWorkflow.py
...mplateItem/testSlapOSCoreComputerSlapInterfaceWorkflow.py
+16
-126
master/bt5/slapos_cloud/bt/revision
master/bt5/slapos_cloud/bt/revision
+1
-1
master/bt5/slapos_cloud/bt/template_portal_type_property_sheet_list
.../slapos_cloud/bt/template_portal_type_property_sheet_list
+1
-0
master/bt5/slapos_cloud/bt/template_property_sheet_id_list
master/bt5/slapos_cloud/bt/template_property_sheet_id_list
+1
-0
master/bt5/vifib_erp5/PortalTypePropertySheetTemplateItem/property_sheet_list.xml
...rtalTypePropertySheetTemplateItem/property_sheet_list.xml
+0
-3
master/bt5/vifib_erp5/bt/revision
master/bt5/vifib_erp5/bt/revision
+1
-1
master/bt5/vifib_erp5/bt/template_portal_type_property_sheet_list
...t5/vifib_erp5/bt/template_portal_type_property_sheet_list
+0
-1
master/bt5/vifib_erp5/bt/template_property_sheet_id_list
master/bt5/vifib_erp5/bt/template_property_sheet_id_list
+0
-1
No files found.
master/bt5/slapos_cloud/PortalTypePropertySheetTemplateItem/property_sheet_list.xml
View file @
3a49e5b5
...
...
@@ -5,6 +5,9 @@
<portal_type
id=
"Computer"
>
<item>
SlaposCapacity
</item>
</portal_type>
<portal_type
id=
"Computer Partition"
>
<item>
SlaposComputerPartitionConstraint
</item>
</portal_type>
<portal_type
id=
"Hosting Subscription"
>
<item>
HostingSubscription
</item>
<item>
SoftwareInstance
</item>
...
...
master/bt5/
vifib_erp5/PropertySheetTemplateItem/portal_property_sheets/Vifib
ComputerPartitionConstraint.xml
→
master/bt5/
slapos_cloud/PropertySheetTemplateItem/portal_property_sheets/Slapos
ComputerPartitionConstraint.xml
View file @
3a49e5b5
...
...
@@ -32,7 +32,7 @@
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Vifib
ComputerPartitionConstraint
</string>
</value>
<value>
<string>
Slapos
ComputerPartitionConstraint
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
...
...
master/bt5/
vifib_erp5/PropertySheetTemplateItem/portal_property_sheets/Vifib
ComputerPartitionConstraint/non_busy_partition_has_no_related_instance_constraint.xml
→
master/bt5/
slapos_cloud/PropertySheetTemplateItem/portal_property_sheets/Slapos
ComputerPartitionConstraint/non_busy_partition_has_no_related_instance_constraint.xml
View file @
3a49e5b5
File moved
master/bt5/slapos_cloud/TestTemplateItem/testSlapOSCoreComputerSlapInterfaceWorkflow.py
View file @
3a49e5b5
# Copyright (c) 2002-2012 Nexedi SA and Contributors. All Rights Reserved.
from
Products.SlapOS.tests.testSlapOSMixin
import
\
testSlapOSMixin
import
transaction
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
class
TestSlapOSCoreComputerSlapInterfaceWorkflow
(
testSlapOSMixin
):
def
afterSetUp
(
self
):
...
...
@@ -18,21 +16,6 @@ class TestSlapOSCoreComputerSlapInterfaceWorkflow(testSlapOSMixin):
self
.
computer
.
validate
()
self
.
tic
()
def
_makePerson
(
self
):
new_id
=
self
.
generateNewId
()
self
.
person_user
=
self
.
portal
.
person_module
.
template_member
.
\
Base_createCloneDocument
(
batch_mode
=
1
)
self
.
person_user
.
edit
(
title
=
"live_test_%s"
%
new_id
,
reference
=
"live_test_%s"
%
new_id
,
default_email_text
=
"live_test_%s@example.org"
%
new_id
,
)
self
.
person_user
.
validate
()
for
assignment
in
self
.
person_user
.
contentValues
(
portal_type
=
"Assignment"
):
assignment
.
open
()
self
.
tic
()
def
beforeTearDown
(
self
):
super
(
TestSlapOSCoreComputerSlapInterfaceWorkflow
,
self
).
beforeTearDown
()
self
.
portal
.
REQUEST
[
'computer_key'
]
=
None
...
...
@@ -61,16 +44,28 @@ class TestSlapOSCoreComputerSlapInterfaceWorkflow(testSlapOSMixin):
self
.
assertEqual
(
None
,
self
.
portal
.
REQUEST
.
get
(
'computer_certificate'
))
def
test_approveComputerRegistration
(
self
):
self
.
_makePerson
()
self
.
login
(
self
.
person_user
.
getReference
())
# Clone person document
new_id
=
self
.
generateNewId
()
person_user
=
self
.
portal
.
person_module
.
template_member
.
\
Base_createCloneDocument
(
batch_mode
=
1
)
person_user
.
edit
(
title
=
"live_test_%s"
%
new_id
,
reference
=
"live_test_%s"
%
new_id
,
default_email_text
=
"live_test_%s@example.org"
%
new_id
,
)
person_user
.
validate
()
for
assignment
in
person_user
.
contentValues
(
portal_type
=
"Assignment"
):
assignment
.
open
()
self
.
tic
()
self
.
login
(
person_user
.
getReference
())
computer
=
self
.
portal
.
computer_module
.
newContent
(
portal_type
=
'Computer'
,
title
=
"Computer %s for %s"
%
(
new_id
,
self
.
person_user
.
getReference
()),
title
=
"Computer %s for %s"
%
(
new_id
,
person_user
.
getReference
()),
reference
=
"TESTCOMP-%s"
%
new_id
)
computer
.
requestComputerRegistration
()
computer
.
approveComputerRegistration
()
self
.
assertEqual
(
'open/personal'
,
computer
.
getAllocationScope
())
self
.
assertEqual
(
self
.
person_user
.
getRelativeUrl
(),
self
.
assertEqual
(
person_user
.
getRelativeUrl
(),
computer
.
getSourceAdministration
())
self
.
assertEqual
(
'validated'
,
computer
.
getValidationState
())
...
...
@@ -127,108 +122,3 @@ class TestSlapOSCoreComputerSlapInterfaceWorkflow(testSlapOSMixin):
self
.
_countInstanceBang
(
destroyed_instance1
,
comment
))
self
.
assertEqual
(
destroyed_instance2_bang_count
,
self
.
_countInstanceBang
(
destroyed_instance2
,
comment
))
def
test_requestSoftwareRelease_software_release_url_required
(
self
):
self
.
_makePerson
()
self
.
computer
.
edit
(
source_administration
=
self
.
person_user
.
getRelativeUrl
())
self
.
tic
()
self
.
login
(
self
.
person_user
.
getReference
())
self
.
assertRaises
(
TypeError
,
self
.
computer
.
requestSoftwareRelease
,
state
=
'available'
)
transaction
.
abort
()
def
test_requestSoftwareRelease_state_required
(
self
):
self
.
_makePerson
()
self
.
computer
.
edit
(
source_administration
=
self
.
person_user
.
getRelativeUrl
())
self
.
tic
()
self
.
login
(
self
.
person_user
.
getReference
())
url
=
self
.
generateNewSoftwareReleaseUrl
()
self
.
assertRaises
(
TypeError
,
self
.
computer
.
requestSoftwareRelease
,
software_release_url
=
url
)
transaction
.
abort
()
def
test_requestSoftwareRelease_available
(
self
):
self
.
_makePerson
()
self
.
computer
.
edit
(
source_administration
=
self
.
person_user
.
getRelativeUrl
())
self
.
tic
()
self
.
login
(
self
.
person_user
.
getReference
())
url
=
self
.
generateNewSoftwareReleaseUrl
()
self
.
computer
.
requestSoftwareRelease
(
software_release_url
=
url
,
state
=
'available'
)
self
.
tic
()
self
.
login
()
software_installation
=
self
.
computer
.
getAggregateRelatedValue
(
portal_type
=
'Software Installation'
)
self
.
assertEqual
(
'start_requested'
,
software_installation
.
getSlapState
())
self
.
assertEqual
(
url
,
software_installation
.
getUrlString
())
self
.
assertEqual
(
'validated'
,
software_installation
.
getValidationState
())
def
test_requestSoftwareRelease_destroyed
(
self
):
self
.
_makePerson
()
self
.
computer
.
edit
(
source_administration
=
self
.
person_user
.
getRelativeUrl
())
self
.
tic
()
self
.
login
(
self
.
person_user
.
getReference
())
url
=
self
.
generateNewSoftwareReleaseUrl
()
self
.
computer
.
requestSoftwareRelease
(
software_release_url
=
url
,
state
=
'destroyed'
)
self
.
tic
()
self
.
login
()
software_installation
=
self
.
computer
.
getAggregateRelatedValue
(
portal_type
=
'Software Installation'
)
self
.
assertEqual
(
None
,
software_installation
)
def
test_requestSoftwareRelease_available_destroyed
(
self
):
self
.
_makePerson
()
self
.
computer
.
edit
(
source_administration
=
self
.
person_user
.
getRelativeUrl
())
self
.
tic
()
self
.
login
(
self
.
person_user
.
getReference
())
url
=
self
.
generateNewSoftwareReleaseUrl
()
self
.
computer
.
requestSoftwareRelease
(
software_release_url
=
url
,
state
=
'available'
)
self
.
tic
()
self
.
login
()
software_installation
=
self
.
computer
.
getAggregateRelatedValue
(
portal_type
=
'Software Installation'
)
self
.
assertEqual
(
'start_requested'
,
software_installation
.
getSlapState
())
self
.
assertEqual
(
url
,
software_installation
.
getUrlString
())
self
.
assertEqual
(
'validated'
,
software_installation
.
getValidationState
())
self
.
login
(
self
.
person_user
.
getReference
())
self
.
computer
.
requestSoftwareRelease
(
software_release_url
=
url
,
state
=
'destroyed'
)
self
.
tic
()
self
.
login
()
software_installation
=
self
.
computer
.
getAggregateRelatedValue
(
portal_type
=
'Software Installation'
)
self
.
assertEqual
(
'destroy_requested'
,
software_installation
.
getSlapState
())
self
.
assertEqual
(
url
,
software_installation
.
getUrlString
())
self
.
assertEqual
(
'validated'
,
software_installation
.
getValidationState
())
def
test_requestSoftwareRelease_not_indexed
(
self
):
self
.
_makePerson
()
self
.
computer
.
edit
(
source_administration
=
self
.
person_user
.
getRelativeUrl
())
self
.
tic
()
self
.
login
(
self
.
person_user
.
getReference
())
url
=
self
.
generateNewSoftwareReleaseUrl
()
self
.
computer
.
requestSoftwareRelease
(
software_release_url
=
url
,
state
=
'available'
)
transaction
.
commit
()
self
.
assertRaises
(
NotImplementedError
,
self
.
computer
.
requestSoftwareRelease
,
software_release_url
=
url
,
state
=
'available'
)
transaction
.
abort
()
@
expectedFailure
def
test_requestSoftwareRelease_same_transaction
(
self
):
self
.
_makePerson
()
self
.
computer
.
edit
(
source_administration
=
self
.
person_user
.
getRelativeUrl
())
self
.
tic
()
self
.
login
(
self
.
person_user
.
getReference
())
url
=
self
.
generateNewSoftwareReleaseUrl
()
self
.
computer
.
requestSoftwareRelease
(
software_release_url
=
url
,
state
=
'available'
)
self
.
assertRaises
(
NotImplementedError
,
self
.
computer
.
requestSoftwareRelease
,
software_release_url
=
url
,
state
=
'available'
)
transaction
.
abort
()
master/bt5/slapos_cloud/bt/revision
View file @
3a49e5b5
161
\ No newline at end of file
162
\ No newline at end of file
master/bt5/slapos_cloud/bt/template_portal_type_property_sheet_list
View file @
3a49e5b5
Assignment | SlaposAssignmentConstraint
Computer Partition | SlaposComputerPartitionConstraint
Computer | SlaposCapacity
Hosting Subscription | HostingSubscription
Hosting Subscription | SoftwareInstance
...
...
master/bt5/slapos_cloud/bt/template_property_sheet_id_list
View file @
3a49e5b5
SoftwareInstanceConstraint
SlaposComputerPartitionConstraint
SlaveInstanceConstraint
SoftwareInstance
HostingSubscription
...
...
master/bt5/vifib_erp5/PortalTypePropertySheetTemplateItem/property_sheet_list.xml
View file @
3a49e5b5
...
...
@@ -2,9 +2,6 @@
<portal_type
id=
"Computer"
>
<item>
VifibComputerConstraint
</item>
</portal_type>
<portal_type
id=
"Computer Partition"
>
<item>
VifibComputerPartitionConstraint
</item>
</portal_type>
<portal_type
id=
"Email"
>
<item>
VifibEmailConstraint
</item>
</portal_type>
...
...
master/bt5/vifib_erp5/bt/revision
View file @
3a49e5b5
544
\ No newline at end of file
545
\ No newline at end of file
master/bt5/vifib_erp5/bt/template_portal_type_property_sheet_list
View file @
3a49e5b5
Computer Partition | VifibComputerPartitionConstraint
Computer | VifibComputerConstraint
Email | VifibEmailConstraint
Hosting Subscription | VifibHostingSubscriptionConstraint
...
...
master/bt5/vifib_erp5/bt/template_property_sheet_id_list
View file @
3a49e5b5
VifibPersonConstraint
VifibComputerPartitionConstraint
VifibEmailConstraint
VifibComputerConstraint
VifibInternalPackingListConstraint
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment