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
1
Merge Requests
1
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
Romain Courteaud
slapos.core
Commits
3ab3a576
Commit
3ab3a576
authored
Jan 05, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_slap_tool: _makeComplexComputeNode need a project
parent
b6da6ee4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
37 deletions
+39
-37
master/bt5/slapos_slap_tool/TestTemplateItem/portal_components/test.erp5.testSlapOSSlapTool.py
...ateItem/portal_components/test.erp5.testSlapOSSlapTool.py
+39
-37
No files found.
master/bt5/slapos_slap_tool/TestTemplateItem/portal_components/test.erp5.testSlapOSSlapTool.py
View file @
3ab3a576
...
@@ -45,6 +45,8 @@ class TestSlapOSSlapToolMixin(SlapOSTestCaseMixin):
...
@@ -45,6 +45,8 @@ class TestSlapOSSlapToolMixin(SlapOSTestCaseMixin):
SlapOSTestCaseMixin
.
afterSetUp
(
self
)
SlapOSTestCaseMixin
.
afterSetUp
(
self
)
self
.
portal_slap
=
self
.
portal
.
portal_slap
self
.
portal_slap
=
self
.
portal
.
portal_slap
self
.
project
=
self
.
addProject
()
# Prepare compute_node
# Prepare compute_node
self
.
compute_node
=
self
.
portal
.
compute_node_module
.
template_compute_node
\
self
.
compute_node
=
self
.
portal
.
compute_node_module
.
template_compute_node
\
.
Base_createCloneDocument
(
batch_mode
=
1
)
.
Base_createCloneDocument
(
batch_mode
=
1
)
...
@@ -72,7 +74,7 @@ class TestSlapOSSlapToolMixin(SlapOSTestCaseMixin):
...
@@ -72,7 +74,7 @@ class TestSlapOSSlapToolMixin(SlapOSTestCaseMixin):
class
TestSlapOSSlapToolgetFullComputerInformation
(
TestSlapOSSlapToolMixin
):
class
TestSlapOSSlapToolgetFullComputerInformation
(
TestSlapOSSlapToolMixin
):
def
test_activate_getFullComputerInformation_first_access
(
self
):
def
test_activate_getFullComputerInformation_first_access
(
self
):
self
.
_makeComplexComputeNode
(
with_slave
=
True
)
self
.
_makeComplexComputeNode
(
self
.
project
,
with_slave
=
True
)
self
.
portal
.
REQUEST
[
'disable_isTestRun'
]
=
True
self
.
portal
.
REQUEST
[
'disable_isTestRun'
]
=
True
self
.
login
(
self
.
compute_node_user_id
)
self
.
login
(
self
.
compute_node_user_id
)
...
@@ -242,7 +244,7 @@ class TestSlapOSSlapToolgetFullComputerInformation(TestSlapOSSlapToolMixin):
...
@@ -242,7 +244,7 @@ class TestSlapOSSlapToolgetFullComputerInformation(TestSlapOSSlapToolMixin):
class
TestSlapOSSlapToolComputeNodeAccess
(
TestSlapOSSlapToolMixin
):
class
TestSlapOSSlapToolComputeNodeAccess
(
TestSlapOSSlapToolMixin
):
def
test_getFullComputerInformation
(
self
):
def
test_getFullComputerInformation
(
self
):
self
.
_makeComplexComputeNode
(
with_slave
=
True
)
self
.
_makeComplexComputeNode
(
self
.
project
,
with_slave
=
True
)
partition_1_root_instance_title
=
self
.
compute_node
.
partition1
.
getAggregateRelatedValue
(
partition_1_root_instance_title
=
self
.
compute_node
.
partition1
.
getAggregateRelatedValue
(
portal_type
=
'Software Instance'
).
getSpecialiseValue
().
getTitle
()
portal_type
=
'Software Instance'
).
getSpecialiseValue
().
getTitle
()
...
@@ -733,7 +735,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSSlapToolMixin):
...
@@ -733,7 +735,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSSlapToolMixin):
'recmethod'
:
'reportComputeNodeBang'
}])
'recmethod'
:
'reportComputeNodeBang'
}])
def
test_computerBang
(
self
):
def
test_computerBang
(
self
):
self
.
_makeComplexComputeNode
()
self
.
_makeComplexComputeNode
(
self
.
project
)
self
.
compute_node_bang_simulator
=
tempfile
.
mkstemp
()[
1
]
self
.
compute_node_bang_simulator
=
tempfile
.
mkstemp
()[
1
]
try
:
try
:
self
.
login
(
self
.
compute_node_user_id
)
self
.
login
(
self
.
compute_node_user_id
)
...
@@ -785,7 +787,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSSlapToolMixin):
...
@@ -785,7 +787,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSSlapToolMixin):
os
.
unlink
(
self
.
compute_node_load_configuration_simulator
)
os
.
unlink
(
self
.
compute_node_load_configuration_simulator
)
def
test_not_accessed_getSoftwareInstallationStatus
(
self
):
def
test_not_accessed_getSoftwareInstallationStatus
(
self
):
self
.
_makeComplexComputeNode
()
self
.
_makeComplexComputeNode
(
self
.
project
)
self
.
compute_node_bang_simulator
=
tempfile
.
mkstemp
()[
1
]
self
.
compute_node_bang_simulator
=
tempfile
.
mkstemp
()[
1
]
self
.
login
(
self
.
compute_node_user_id
)
self
.
login
(
self
.
compute_node_user_id
)
created_at
=
rfc1123_date
(
DateTime
())
created_at
=
rfc1123_date
(
DateTime
())
...
@@ -844,7 +846,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSSlapToolMixin):
...
@@ -844,7 +846,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSSlapToolMixin):
"http://example.org/foo"
,
self
.
compute_node_id
)
"http://example.org/foo"
,
self
.
compute_node_id
)
def
test_destroyedSoftwareRelease_noDestroyRequested
(
self
):
def
test_destroyedSoftwareRelease_noDestroyRequested
(
self
):
self
.
_makeComplexComputeNode
()
self
.
_makeComplexComputeNode
(
self
.
project
)
self
.
login
(
self
.
compute_node_user_id
)
self
.
login
(
self
.
compute_node_user_id
)
self
.
assertRaises
(
NotFound
,
self
.
assertRaises
(
NotFound
,
self
.
portal_slap
.
destroyedSoftwareRelease
,
self
.
portal_slap
.
destroyedSoftwareRelease
,
...
@@ -852,7 +854,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSSlapToolMixin):
...
@@ -852,7 +854,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSSlapToolMixin):
self
.
compute_node_id
)
self
.
compute_node_id
)
def
test_destroyedSoftwareRelease_destroyRequested
(
self
):
def
test_destroyedSoftwareRelease_destroyRequested
(
self
):
self
.
_makeComplexComputeNode
()
self
.
_makeComplexComputeNode
(
self
.
project
)
self
.
login
(
self
.
compute_node_user_id
)
self
.
login
(
self
.
compute_node_user_id
)
destroy_requested
=
self
.
destroy_requested_software_installation
destroy_requested
=
self
.
destroy_requested_software_installation
self
.
assertEqual
(
destroy_requested
.
getValidationState
(),
"validated"
)
self
.
assertEqual
(
destroy_requested
.
getValidationState
(),
"validated"
)
...
@@ -861,7 +863,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSSlapToolMixin):
...
@@ -861,7 +863,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSSlapToolMixin):
self
.
assertEqual
(
destroy_requested
.
getValidationState
(),
"invalidated"
)
self
.
assertEqual
(
destroy_requested
.
getValidationState
(),
"invalidated"
)
def
test_availableSoftwareRelease
(
self
):
def
test_availableSoftwareRelease
(
self
):
self
.
_makeComplexComputeNode
()
self
.
_makeComplexComputeNode
(
self
.
project
)
self
.
compute_node_bang_simulator
=
tempfile
.
mkstemp
()[
1
]
self
.
compute_node_bang_simulator
=
tempfile
.
mkstemp
()[
1
]
self
.
login
(
self
.
compute_node_user_id
)
self
.
login
(
self
.
compute_node_user_id
)
software_installation
=
self
.
start_requested_software_installation
software_installation
=
self
.
start_requested_software_installation
...
@@ -911,7 +913,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSSlapToolMixin):
...
@@ -911,7 +913,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSSlapToolMixin):
'
\
n
'
.
join
([
q
for
q
in
difflib
.
unified_diff
(
expected_xml
.
split
(
'
\
n
'
),
got_xml
.
split
(
'
\
n
'
))]))
'
\
n
'
.
join
([
q
for
q
in
difflib
.
unified_diff
(
expected_xml
.
split
(
'
\
n
'
),
got_xml
.
split
(
'
\
n
'
))]))
def
test_buildingSoftwareRelease
(
self
):
def
test_buildingSoftwareRelease
(
self
):
self
.
_makeComplexComputeNode
()
self
.
_makeComplexComputeNode
(
self
.
project
)
self
.
compute_node_bang_simulator
=
tempfile
.
mkstemp
()[
1
]
self
.
compute_node_bang_simulator
=
tempfile
.
mkstemp
()[
1
]
self
.
login
(
self
.
compute_node_user_id
)
self
.
login
(
self
.
compute_node_user_id
)
software_installation
=
self
.
start_requested_software_installation
software_installation
=
self
.
start_requested_software_installation
...
@@ -961,7 +963,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSSlapToolMixin):
...
@@ -961,7 +963,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSSlapToolMixin):
'
\
n
'
.
join
([
q
for
q
in
difflib
.
unified_diff
(
expected_xml
.
split
(
'
\
n
'
),
got_xml
.
split
(
'
\
n
'
))]))
'
\
n
'
.
join
([
q
for
q
in
difflib
.
unified_diff
(
expected_xml
.
split
(
'
\
n
'
),
got_xml
.
split
(
'
\
n
'
))]))
def
test_softwareReleaseError
(
self
):
def
test_softwareReleaseError
(
self
):
self
.
_makeComplexComputeNode
()
self
.
_makeComplexComputeNode
(
self
.
project
)
self
.
compute_node_bang_simulator
=
tempfile
.
mkstemp
()[
1
]
self
.
compute_node_bang_simulator
=
tempfile
.
mkstemp
()[
1
]
self
.
login
(
self
.
compute_node_user_id
)
self
.
login
(
self
.
compute_node_user_id
)
software_installation
=
self
.
start_requested_software_installation
software_installation
=
self
.
start_requested_software_installation
...
@@ -1115,7 +1117,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSSlapToolMixin):
...
@@ -1115,7 +1117,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSSlapToolMixin):
class
TestSlapOSSlapToolInstanceAccess
(
TestSlapOSSlapToolMixin
):
class
TestSlapOSSlapToolInstanceAccess
(
TestSlapOSSlapToolMixin
):
def
test_getComputerPartitionCertificate
(
self
):
def
test_getComputerPartitionCertificate
(
self
):
self
.
_makeComplexComputeNode
()
self
.
_makeComplexComputeNode
(
self
.
project
)
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
portal_type
=
'Compute Partition'
).
getReference
()
portal_type
=
'Compute Partition'
).
getReference
()
self
.
login
(
self
.
start_requested_software_instance
.
getUserId
())
self
.
login
(
self
.
start_requested_software_instance
.
getUserId
())
...
@@ -1150,7 +1152,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
...
@@ -1150,7 +1152,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
'
\
n
'
.
join
([
q
for
q
in
difflib
.
unified_diff
(
expected_xml
.
split
(
'
\
n
'
),
got_xml
.
split
(
'
\
n
'
))]))
'
\
n
'
.
join
([
q
for
q
in
difflib
.
unified_diff
(
expected_xml
.
split
(
'
\
n
'
),
got_xml
.
split
(
'
\
n
'
))]))
def
test_getFullComputerInformation
(
self
):
def
test_getFullComputerInformation
(
self
):
self
.
_makeComplexComputeNode
(
with_slave
=
True
)
self
.
_makeComplexComputeNode
(
self
.
project
,
with_slave
=
True
)
self
.
login
(
self
.
start_requested_software_instance
.
getUserId
())
self
.
login
(
self
.
start_requested_software_instance
.
getUserId
())
response
=
self
.
portal_slap
.
getFullComputerInformation
(
self
.
compute_node_id
)
response
=
self
.
portal_slap
.
getFullComputerInformation
(
self
.
compute_node_id
)
self
.
assertEqual
(
200
,
response
.
status
)
self
.
assertEqual
(
200
,
response
.
status
)
...
@@ -1292,7 +1294,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
...
@@ -1292,7 +1294,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
'
\
n
'
.
join
([
q
for
q
in
difflib
.
unified_diff
(
expected_xml
.
split
(
'
\
n
'
),
got_xml
.
split
(
'
\
n
'
))]))
'
\
n
'
.
join
([
q
for
q
in
difflib
.
unified_diff
(
expected_xml
.
split
(
'
\
n
'
),
got_xml
.
split
(
'
\
n
'
))]))
def
test_getComputerPartitionStatus
(
self
):
def
test_getComputerPartitionStatus
(
self
):
self
.
_makeComplexComputeNode
()
self
.
_makeComplexComputeNode
(
self
.
project
)
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
portal_type
=
'Compute Partition'
).
getReference
()
portal_type
=
'Compute Partition'
).
getReference
()
created_at
=
rfc1123_date
(
DateTime
())
created_at
=
rfc1123_date
(
DateTime
())
...
@@ -1342,7 +1344,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
...
@@ -1342,7 +1344,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
'
\
n
'
.
join
([
q
for
q
in
difflib
.
unified_diff
(
expected_xml
.
split
(
'
\
n
'
),
got_xml
.
split
(
'
\
n
'
))]))
'
\
n
'
.
join
([
q
for
q
in
difflib
.
unified_diff
(
expected_xml
.
split
(
'
\
n
'
),
got_xml
.
split
(
'
\
n
'
))]))
def
test_getComputerPartitionStatus_visited
(
self
):
def
test_getComputerPartitionStatus_visited
(
self
):
self
.
_makeComplexComputeNode
()
self
.
_makeComplexComputeNode
(
self
.
project
)
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
portal_type
=
'Compute Partition'
).
getReference
()
portal_type
=
'Compute Partition'
).
getReference
()
created_at
=
rfc1123_date
(
DateTime
())
created_at
=
rfc1123_date
(
DateTime
())
...
@@ -1395,7 +1397,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
...
@@ -1395,7 +1397,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
'
\
n
'
.
join
([
q
for
q
in
difflib
.
unified_diff
(
expected_xml
.
split
(
'
\
n
'
),
got_xml
.
split
(
'
\
n
'
))]))
'
\
n
'
.
join
([
q
for
q
in
difflib
.
unified_diff
(
expected_xml
.
split
(
'
\
n
'
),
got_xml
.
split
(
'
\
n
'
))]))
def
test_registerComputerPartition_withSlave
(
self
):
def
test_registerComputerPartition_withSlave
(
self
):
self
.
_makeComplexComputeNode
(
with_slave
=
True
)
self
.
_makeComplexComputeNode
(
self
.
project
,
with_slave
=
True
)
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
portal_type
=
'Compute Partition'
).
getReference
()
portal_type
=
'Compute Partition'
).
getReference
()
self
.
login
(
self
.
start_requested_software_instance
.
getUserId
())
self
.
login
(
self
.
start_requested_software_instance
.
getUserId
())
...
@@ -1526,7 +1528,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
...
@@ -1526,7 +1528,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
'
\
n
'
.
join
([
q
for
q
in
difflib
.
unified_diff
(
expected_xml
.
split
(
'
\
n
'
),
got_xml
.
split
(
'
\
n
'
))]))
'
\
n
'
.
join
([
q
for
q
in
difflib
.
unified_diff
(
expected_xml
.
split
(
'
\
n
'
),
got_xml
.
split
(
'
\
n
'
))]))
def
test_registerComputerPartition
(
self
):
def
test_registerComputerPartition
(
self
):
self
.
_makeComplexComputeNode
()
self
.
_makeComplexComputeNode
(
self
.
project
)
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
portal_type
=
'Compute Partition'
).
getReference
()
portal_type
=
'Compute Partition'
).
getReference
()
self
.
login
(
self
.
start_requested_software_instance
.
getUserId
())
self
.
login
(
self
.
start_requested_software_instance
.
getUserId
())
...
@@ -1646,7 +1648,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
...
@@ -1646,7 +1648,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
'recmethod'
:
'updateConnection'
}])
'recmethod'
:
'updateConnection'
}])
def
test_setConnectionXml_withSlave
(
self
):
def
test_setConnectionXml_withSlave
(
self
):
self
.
_makeComplexComputeNode
(
with_slave
=
True
)
self
.
_makeComplexComputeNode
(
self
.
project
,
with_slave
=
True
)
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
portal_type
=
'Compute Partition'
).
getReference
()
portal_type
=
'Compute Partition'
).
getReference
()
slave_reference
=
self
.
start_requested_slave_instance
.
getReference
()
slave_reference
=
self
.
start_requested_slave_instance
.
getReference
()
...
@@ -1680,7 +1682,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
...
@@ -1680,7 +1682,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
os
.
unlink
(
self
.
instance_update_connection_simulator
)
os
.
unlink
(
self
.
instance_update_connection_simulator
)
def
test_setConnectionXml
(
self
):
def
test_setConnectionXml
(
self
):
self
.
_makeComplexComputeNode
()
self
.
_makeComplexComputeNode
(
self
.
project
)
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
portal_type
=
'Compute Partition'
).
getReference
()
portal_type
=
'Compute Partition'
).
getReference
()
connection_xml
=
"""<marshal>
connection_xml
=
"""<marshal>
...
@@ -1713,7 +1715,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
...
@@ -1713,7 +1715,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
os
.
unlink
(
self
.
instance_update_connection_simulator
)
os
.
unlink
(
self
.
instance_update_connection_simulator
)
def
test_softwareInstanceError
(
self
):
def
test_softwareInstanceError
(
self
):
self
.
_makeComplexComputeNode
()
self
.
_makeComplexComputeNode
(
self
.
project
)
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
portal_type
=
'Compute Partition'
).
getReference
()
portal_type
=
'Compute Partition'
).
getReference
()
self
.
login
(
self
.
start_requested_software_instance
.
getUserId
())
self
.
login
(
self
.
start_requested_software_instance
.
getUserId
())
...
@@ -1761,7 +1763,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
...
@@ -1761,7 +1763,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
'
\
n
'
.
join
([
q
for
q
in
difflib
.
unified_diff
(
expected_xml
.
split
(
'
\
n
'
),
got_xml
.
split
(
'
\
n
'
))]))
'
\
n
'
.
join
([
q
for
q
in
difflib
.
unified_diff
(
expected_xml
.
split
(
'
\
n
'
),
got_xml
.
split
(
'
\
n
'
))]))
def
test_softwareInstanceError_twice
(
self
):
def
test_softwareInstanceError_twice
(
self
):
self
.
_makeComplexComputeNode
()
self
.
_makeComplexComputeNode
(
self
.
project
)
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
portal_type
=
'Compute Partition'
).
getReference
()
portal_type
=
'Compute Partition'
).
getReference
()
self
.
login
(
self
.
start_requested_software_instance
.
getUserId
())
self
.
login
(
self
.
start_requested_software_instance
.
getUserId
())
...
@@ -1867,7 +1869,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
...
@@ -1867,7 +1869,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
'recmethod'
:
'bang'
}])
'recmethod'
:
'bang'
}])
def
test_softwareInstanceBang
(
self
):
def
test_softwareInstanceBang
(
self
):
self
.
_makeComplexComputeNode
()
self
.
_makeComplexComputeNode
(
self
.
project
)
self
.
instance_bang_simulator
=
tempfile
.
mkstemp
()[
1
]
self
.
instance_bang_simulator
=
tempfile
.
mkstemp
()[
1
]
try
:
try
:
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
...
@@ -1930,7 +1932,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
...
@@ -1930,7 +1932,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
'recmethod'
:
'rename'
}])
'recmethod'
:
'rename'
}])
def
test_softwareInstanceRename
(
self
):
def
test_softwareInstanceRename
(
self
):
self
.
_makeComplexComputeNode
()
self
.
_makeComplexComputeNode
(
self
.
project
)
self
.
instance_rename_simulator
=
tempfile
.
mkstemp
()[
1
]
self
.
instance_rename_simulator
=
tempfile
.
mkstemp
()[
1
]
try
:
try
:
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
...
@@ -1950,7 +1952,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
...
@@ -1950,7 +1952,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
os
.
unlink
(
self
.
instance_rename_simulator
)
os
.
unlink
(
self
.
instance_rename_simulator
)
def
test_destroyedComputePartition
(
self
):
def
test_destroyedComputePartition
(
self
):
self
.
_makeComplexComputeNode
()
self
.
_makeComplexComputeNode
(
self
.
project
)
partition_id
=
self
.
destroy_requested_software_instance
.
getAggregateValue
(
partition_id
=
self
.
destroy_requested_software_instance
.
getAggregateValue
(
portal_type
=
'Compute Partition'
).
getReference
()
portal_type
=
'Compute Partition'
).
getReference
()
ssl_key
=
self
.
destroy_requested_software_instance
.
getSslKey
()
ssl_key
=
self
.
destroy_requested_software_instance
.
getSslKey
()
...
@@ -1978,7 +1980,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
...
@@ -1978,7 +1980,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
'recmethod'
:
'requestInstance'
}])
'recmethod'
:
'requestInstance'
}])
def
test_request_withSlave
(
self
):
def
test_request_withSlave
(
self
):
self
.
_makeComplexComputeNode
()
self
.
_makeComplexComputeNode
(
self
.
project
)
self
.
instance_request_simulator
=
tempfile
.
mkstemp
()[
1
]
self
.
instance_request_simulator
=
tempfile
.
mkstemp
()[
1
]
try
:
try
:
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
...
@@ -2013,7 +2015,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
...
@@ -2013,7 +2015,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
os
.
unlink
(
self
.
instance_request_simulator
)
os
.
unlink
(
self
.
instance_request_simulator
)
def
test_request
(
self
):
def
test_request
(
self
):
self
.
_makeComplexComputeNode
()
self
.
_makeComplexComputeNode
(
self
.
project
)
self
.
instance_request_simulator
=
tempfile
.
mkstemp
()[
1
]
self
.
instance_request_simulator
=
tempfile
.
mkstemp
()[
1
]
try
:
try
:
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
...
@@ -2048,7 +2050,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
...
@@ -2048,7 +2050,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
os
.
unlink
(
self
.
instance_request_simulator
)
os
.
unlink
(
self
.
instance_request_simulator
)
def
test_request_stopped
(
self
):
def
test_request_stopped
(
self
):
self
.
_makeComplexComputeNode
()
self
.
_makeComplexComputeNode
(
self
.
project
)
self
.
instance_request_simulator
=
tempfile
.
mkstemp
()[
1
]
self
.
instance_request_simulator
=
tempfile
.
mkstemp
()[
1
]
try
:
try
:
partition_id
=
self
.
stop_requested_software_instance
.
getAggregateValue
(
partition_id
=
self
.
stop_requested_software_instance
.
getAggregateValue
(
...
@@ -2083,7 +2085,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
...
@@ -2083,7 +2085,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
os
.
unlink
(
self
.
instance_request_simulator
)
os
.
unlink
(
self
.
instance_request_simulator
)
def
test_updateInstanceSuccessorList
(
self
):
def
test_updateInstanceSuccessorList
(
self
):
self
.
_makeComplexComputeNode
()
self
.
_makeComplexComputeNode
(
self
.
project
)
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
portal_type
=
'Compute Partition'
).
getReference
()
portal_type
=
'Compute Partition'
).
getReference
()
...
@@ -2135,7 +2137,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
...
@@ -2135,7 +2137,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
self
.
start_requested_software_instance
.
getSuccessorTitleList
())
self
.
start_requested_software_instance
.
getSuccessorTitleList
())
def
test_updateInstanceSuccessorList_one_child
(
self
):
def
test_updateInstanceSuccessorList_one_child
(
self
):
self
.
_makeComplexComputeNode
()
self
.
_makeComplexComputeNode
(
self
.
project
)
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
portal_type
=
'Compute Partition'
).
getReference
()
portal_type
=
'Compute Partition'
).
getReference
()
...
@@ -2168,7 +2170,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
...
@@ -2168,7 +2170,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
self
.
start_requested_software_instance
.
getSuccessorTitleList
())
self
.
start_requested_software_instance
.
getSuccessorTitleList
())
def
test_updateInstanceSuccessorList_no_child
(
self
):
def
test_updateInstanceSuccessorList_no_child
(
self
):
self
.
_makeComplexComputeNode
()
self
.
_makeComplexComputeNode
(
self
.
project
)
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
portal_type
=
'Compute Partition'
).
getReference
()
portal_type
=
'Compute Partition'
).
getReference
()
...
@@ -2200,7 +2202,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
...
@@ -2200,7 +2202,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
self
.
start_requested_software_instance
.
getSuccessorTitleList
())
self
.
start_requested_software_instance
.
getSuccessorTitleList
())
def
test_stoppedComputePartition
(
self
):
def
test_stoppedComputePartition
(
self
):
self
.
_makeComplexComputeNode
()
self
.
_makeComplexComputeNode
(
self
.
project
)
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
portal_type
=
'Compute Partition'
).
getReference
()
portal_type
=
'Compute Partition'
).
getReference
()
self
.
login
(
self
.
start_requested_software_instance
.
getUserId
())
self
.
login
(
self
.
start_requested_software_instance
.
getUserId
())
...
@@ -2247,7 +2249,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
...
@@ -2247,7 +2249,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
'
\
n
'
.
join
([
q
for
q
in
difflib
.
unified_diff
(
expected_xml
.
split
(
'
\
n
'
),
got_xml
.
split
(
'
\
n
'
))]))
'
\
n
'
.
join
([
q
for
q
in
difflib
.
unified_diff
(
expected_xml
.
split
(
'
\
n
'
),
got_xml
.
split
(
'
\
n
'
))]))
def
test_startedComputePartition
(
self
):
def
test_startedComputePartition
(
self
):
self
.
_makeComplexComputeNode
()
self
.
_makeComplexComputeNode
(
self
.
project
)
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
portal_type
=
'Compute Partition'
).
getReference
()
portal_type
=
'Compute Partition'
).
getReference
()
self
.
login
(
self
.
start_requested_software_instance
.
getUserId
())
self
.
login
(
self
.
start_requested_software_instance
.
getUserId
())
...
@@ -2600,7 +2602,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin):
...
@@ -2600,7 +2602,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin):
os
.
unlink
(
self
.
compute_node_bang_simulator
)
os
.
unlink
(
self
.
compute_node_bang_simulator
)
def
test_getComputerPartitionStatus
(
self
):
def
test_getComputerPartitionStatus
(
self
):
self
.
_makeComplexComputeNode
()
self
.
_makeComplexComputeNode
(
self
.
project
)
self
.
login
(
self
.
person_user_id
)
self
.
login
(
self
.
person_user_id
)
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
portal_type
=
'Compute Partition'
).
getReference
()
portal_type
=
'Compute Partition'
).
getReference
()
...
@@ -2651,7 +2653,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin):
...
@@ -2651,7 +2653,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin):
'
\
n
'
.
join
([
q
for
q
in
difflib
.
unified_diff
(
expected_xml
.
split
(
'
\
n
'
),
got_xml
.
split
(
'
\
n
'
))]))
'
\
n
'
.
join
([
q
for
q
in
difflib
.
unified_diff
(
expected_xml
.
split
(
'
\
n
'
),
got_xml
.
split
(
'
\
n
'
))]))
def
test_getComputerPartitionStatus_visited
(
self
):
def
test_getComputerPartitionStatus_visited
(
self
):
self
.
_makeComplexComputeNode
(
person
=
self
.
person
)
self
.
_makeComplexComputeNode
(
self
.
project
,
person
=
self
.
person
)
self
.
login
(
self
.
person_user_id
)
self
.
login
(
self
.
person_user_id
)
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
portal_type
=
'Compute Partition'
).
getReference
()
portal_type
=
'Compute Partition'
).
getReference
()
...
@@ -2706,7 +2708,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin):
...
@@ -2706,7 +2708,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin):
'
\
n
'
.
join
([
q
for
q
in
difflib
.
unified_diff
(
expected_xml
.
split
(
'
\
n
'
),
got_xml
.
split
(
'
\
n
'
))]))
'
\
n
'
.
join
([
q
for
q
in
difflib
.
unified_diff
(
expected_xml
.
split
(
'
\
n
'
),
got_xml
.
split
(
'
\
n
'
))]))
def
test_registerComputerPartition_withSlave
(
self
):
def
test_registerComputerPartition_withSlave
(
self
):
self
.
_makeComplexComputeNode
(
person
=
self
.
person
,
with_slave
=
True
)
self
.
_makeComplexComputeNode
(
self
.
project
,
person
=
self
.
person
,
with_slave
=
True
)
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
portal_type
=
'Compute Partition'
).
getReference
()
portal_type
=
'Compute Partition'
).
getReference
()
self
.
login
(
self
.
person_user_id
)
self
.
login
(
self
.
person_user_id
)
...
@@ -2837,7 +2839,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin):
...
@@ -2837,7 +2839,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin):
'
\
n
'
.
join
([
q
for
q
in
difflib
.
unified_diff
(
expected_xml
.
split
(
'
\
n
'
),
got_xml
.
split
(
'
\
n
'
))]))
'
\
n
'
.
join
([
q
for
q
in
difflib
.
unified_diff
(
expected_xml
.
split
(
'
\
n
'
),
got_xml
.
split
(
'
\
n
'
))]))
def
test_registerComputerPartition
(
self
):
def
test_registerComputerPartition
(
self
):
self
.
_makeComplexComputeNode
(
person
=
self
.
person
)
self
.
_makeComplexComputeNode
(
self
.
project
,
person
=
self
.
person
)
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
portal_type
=
'Compute Partition'
).
getReference
()
portal_type
=
'Compute Partition'
).
getReference
()
self
.
login
(
self
.
person_user_id
)
self
.
login
(
self
.
person_user_id
)
...
@@ -2957,7 +2959,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin):
...
@@ -2957,7 +2959,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin):
'recmethod'
:
'bang'
}])
'recmethod'
:
'bang'
}])
def
test_softwareInstanceBang
(
self
):
def
test_softwareInstanceBang
(
self
):
self
.
_makeComplexComputeNode
(
person
=
self
.
person
)
self
.
_makeComplexComputeNode
(
self
.
project
,
person
=
self
.
person
)
self
.
instance_bang_simulator
=
tempfile
.
mkstemp
()[
1
]
self
.
instance_bang_simulator
=
tempfile
.
mkstemp
()[
1
]
try
:
try
:
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
...
@@ -3022,7 +3024,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin):
...
@@ -3022,7 +3024,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin):
'recmethod'
:
'rename'
}])
'recmethod'
:
'rename'
}])
def
test_softwareInstanceRename
(
self
):
def
test_softwareInstanceRename
(
self
):
self
.
_makeComplexComputeNode
(
person
=
self
.
person
)
self
.
_makeComplexComputeNode
(
self
.
project
,
person
=
self
.
person
)
self
.
instance_rename_simulator
=
tempfile
.
mkstemp
()[
1
]
self
.
instance_rename_simulator
=
tempfile
.
mkstemp
()[
1
]
try
:
try
:
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
...
@@ -3114,7 +3116,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin):
...
@@ -3114,7 +3116,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSSlapToolMixin):
default_email_coordinate_text
=
"%s@example.org"
%
self
.
person
.
getReference
(),
default_email_coordinate_text
=
"%s@example.org"
%
self
.
person
.
getReference
(),
career_role
=
'member'
,
career_role
=
'member'
,
)
)
self
.
_makeComplexComputeNode
(
person
=
self
.
person
)
self
.
_makeComplexComputeNode
(
self
.
project
,
person
=
self
.
person
)
self
.
start_requested_software_instance
.
updateLocalRolesOnSecurityGroups
()
self
.
start_requested_software_instance
.
updateLocalRolesOnSecurityGroups
()
self
.
tic
()
self
.
tic
()
self
.
login
(
self
.
person_user_id
)
self
.
login
(
self
.
person_user_id
)
...
...
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