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
Jérome Perrin
slapos.core
Commits
9b62f377
Commit
9b62f377
authored
Feb 02, 2012
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP slave instance test with locking
parent
afe602ef
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
437 additions
and
13 deletions
+437
-13
master/product/Vifib/tests/testVifibSlapComputerPartitionLock.py
...product/Vifib/tests/testVifibSlapComputerPartitionLock.py
+437
-13
No files found.
master/product/Vifib/tests/testVifibSlapComputerPartitionLock.py
View file @
9b62f377
...
...
@@ -72,6 +72,20 @@ class TestVifibSlapComputerPartitionLock(TestVifibSlapWebServiceMixin):
Logout
\
'
create_new_user_slave_instance_sequence_string
=
'
\
LoginWebUser
\
PersonRequestSlaveInstance
\
Tic
\
Logout
\
\
LoginDefaultUser
\
ConfirmOrderedSaleOrderActiveSense
\
Tic
\
SetSelectedComputerPartition
\
SelectCurrentlyUsedSalePackingListUid
\
Logout
\
'
def
test_person_locked_by_default
(
self
):
"""Newly registered customer are locked by default
"""
...
...
@@ -489,7 +503,7 @@ class TestVifibSlapComputerPartitionLock(TestVifibSlapWebServiceMixin):
self
.
assertRaises
(
slap
.
Unauthorized
,
slap_computer_partition
.
request
,
**
kw
)
def
new_instance_string
(
self
):
def
new_
software_
instance_string
(
self
):
return
\
self
.
prepare_installed_software_release_sequence_string
+
\
self
.
register_new_user_sequence_string
+
'
\
...
...
@@ -500,6 +514,17 @@ class TestVifibSlapComputerPartitionLock(TestVifibSlapWebServiceMixin):
'
+
\
self
.
create_new_user_instance_sequence_string
def
new_slave_instance_string
(
self
):
return
\
self
.
prepare_installed_computer_partition_sequence_string
+
\
self
.
register_new_user_sequence_string
+
'
\
LoginERP5TypeTestCase
\
UnlockPerson
\
Tic
\
Logout
\
'
+
\
self
.
create_new_user_slave_instance_sequence_string
def
lock_user_string
(
self
):
return
'
\
LoginERP5TypeTestCase
\
...
...
@@ -516,7 +541,7 @@ class TestVifibSlapComputerPartitionLock(TestVifibSlapWebServiceMixin):
"""
sequence_list
=
SequenceList
()
sequence_string
=
\
self
.
new_instance_string
()
+
\
self
.
new_
software_
instance_string
()
+
\
self
.
lock_user_string
()
+
'
\
\
SlapLoginCurrentSoftwareInstance
\
...
...
@@ -535,7 +560,7 @@ class TestVifibSlapComputerPartitionLock(TestVifibSlapWebServiceMixin):
"""
sequence_list
=
SequenceList
()
sequence_string
=
\
self
.
new_instance_string
()
+
\
self
.
new_
software_
instance_string
()
+
\
self
.
lock_user_string
()
+
'
\
LoginERP5TypeTestCase
\
CheckInstanceLocked
\
...
...
@@ -554,7 +579,7 @@ class TestVifibSlapComputerPartitionLock(TestVifibSlapWebServiceMixin):
"""
sequence_list
=
SequenceList
()
sequence_string
=
\
self
.
new_instance_string
()
+
'
\
self
.
new_
software_
instance_string
()
+
'
\
\
SlapLoginCurrentComputer
\
SoftwareInstanceBuilding
\
...
...
@@ -579,7 +604,7 @@ class TestVifibSlapComputerPartitionLock(TestVifibSlapWebServiceMixin):
"""
sequence_list
=
SequenceList
()
sequence_string
=
\
self
.
new_instance_string
()
+
'
\
self
.
new_
software_
instance_string
()
+
'
\
\
SlapLoginCurrentComputer
\
SoftwareInstanceBuilding
\
...
...
@@ -606,7 +631,7 @@ class TestVifibSlapComputerPartitionLock(TestVifibSlapWebServiceMixin):
"""
sequence_list
=
SequenceList
()
sequence_string
=
\
self
.
new_instance_string
()
+
'
\
self
.
new_
software_
instance_string
()
+
'
\
\
SlapLoginCurrentComputer
\
SoftwareInstanceBuilding
\
...
...
@@ -638,7 +663,7 @@ class TestVifibSlapComputerPartitionLock(TestVifibSlapWebServiceMixin):
"""
sequence_list
=
SequenceList
()
sequence_string
=
\
self
.
new_instance_string
()
+
'
\
self
.
new_
software_
instance_string
()
+
'
\
\
SlapLoginCurrentComputer
\
SoftwareInstanceBuilding
\
...
...
@@ -675,7 +700,7 @@ class TestVifibSlapComputerPartitionLock(TestVifibSlapWebServiceMixin):
"""
sequence_list
=
SequenceList
()
sequence_string
=
\
self
.
new_instance_string
()
+
'
\
self
.
new_
software_
instance_string
()
+
'
\
\
SlapLoginCurrentComputer
\
SoftwareInstanceBuilding
\
...
...
@@ -717,7 +742,7 @@ class TestVifibSlapComputerPartitionLock(TestVifibSlapWebServiceMixin):
"""
sequence_list
=
SequenceList
()
sequence_string
=
\
self
.
new_instance_string
()
+
'
\
self
.
new_
software_
instance_string
()
+
'
\
\
SlapLoginCurrentComputer
\
SoftwareInstanceBuilding
\
...
...
@@ -764,7 +789,7 @@ class TestVifibSlapComputerPartitionLock(TestVifibSlapWebServiceMixin):
"""
sequence_list
=
SequenceList
()
sequence_string
=
\
self
.
new_instance_string
()
+
'
\
self
.
new_
software_
instance_string
()
+
'
\
\
SlapLoginCurrentComputer
\
SoftwareInstanceBuilding
\
...
...
@@ -806,7 +831,7 @@ class TestVifibSlapComputerPartitionLock(TestVifibSlapWebServiceMixin):
"""
sequence_list
=
SequenceList
()
sequence_string
=
\
self
.
new_instance_string
()
+
'
\
self
.
new_
software_
instance_string
()
+
'
\
\
SlapLoginCurrentComputer
\
SoftwareInstanceBuilding
\
...
...
@@ -848,7 +873,7 @@ class TestVifibSlapComputerPartitionLock(TestVifibSlapWebServiceMixin):
"""
sequence_list
=
SequenceList
()
sequence_string
=
\
self
.
new_instance_string
()
+
'
\
self
.
new_
software_
instance_string
()
+
'
\
\
SlapLoginCurrentComputer
\
SoftwareInstanceBuilding
\
...
...
@@ -895,7 +920,7 @@ class TestVifibSlapComputerPartitionLock(TestVifibSlapWebServiceMixin):
"""
sequence_list
=
SequenceList
()
sequence_string
=
\
self
.
new_instance_string
()
+
\
self
.
new_
software_
instance_string
()
+
\
self
.
lock_user_string
()
+
'
\
LoginERP5TypeTestCase
\
CheckInstanceLocked
\
...
...
@@ -929,6 +954,405 @@ class TestVifibSlapComputerPartitionLock(TestVifibSlapWebServiceMixin):
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
test_lock_slave_instance_requested
(
self
):
"""Locked person's requested instance are automatically locked
"""
sequence_list
=
SequenceList
()
sequence_string
=
\
self
.
new_slave_instance_string
()
+
\
self
.
lock_user_string
()
+
'
\
LoginERP5TypeTestCase
\
CheckInstanceLocked
\
CheckStoppedComputerPartitionGetStateCall
\
Logout
\
\
LoginERP5TypeTestCase
\
CheckSiteConsistency
\
Logout
\
'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
test_lock_slave_instance_building
(
self
):
"""Locked person's building instance are automatically locked
"""
sequence_list
=
SequenceList
()
sequence_string
=
\
self
.
new_slave_instance_string
()
+
'
\
\
SlapLoginCurrentComputer
\
SlaveInstanceBuilding
\
Tic
\
SlapLogout
\
'
+
\
self
.
lock_user_string
()
+
'
\
LoginERP5TypeTestCase
\
CheckInstanceLocked
\
CheckStoppedComputerPartitionGetStateCall
\
Logout
\
\
LoginERP5TypeTestCase
\
CheckSiteConsistency
\
Logout
\
'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
test_lock_slave_instance_installed
(
self
):
"""Locked person's installed instance are automatically locked
"""
sequence_list
=
SequenceList
()
sequence_string
=
\
self
.
new_slave_instance_string
()
+
'
\
\
SlapLoginCurrentComputer
\
SlaveInstanceBuilding
\
Tic
\
SlaveInstanceAvailable
\
Tic
\
SlapLogout
\
'
+
\
self
.
lock_user_string
()
+
'
\
LoginERP5TypeTestCase
\
CheckInstanceLocked
\
CheckStoppedComputerPartitionGetStateCall
\
Logout
\
\
LoginERP5TypeTestCase
\
CheckSiteConsistency
\
Logout
\
'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
test_lock_slave_instance_starting
(
self
):
"""Locked person's starting instance are automatically locked
"""
sequence_list
=
SequenceList
()
sequence_string
=
\
self
.
new_slave_instance_string
()
+
'
\
\
SlapLoginCurrentComputer
\
SlaveInstanceBuilding
\
Tic
\
SlaveInstanceAvailable
\
Tic
\
SlapLogout
\
\
LoginWebUser
\
RequestSlaveInstanceStart
\
Tic
\
Logout
\
'
+
\
self
.
lock_user_string
()
+
'
\
LoginERP5TypeTestCase
\
CheckInstanceLocked
\
CheckStoppedComputerPartitionGetStateCall
\
Logout
\
\
LoginERP5TypeTestCase
\
CheckSiteConsistency
\
Logout
\
'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
test_lock_slave_instance_started
(
self
):
"""Locked person's started instance are automatically locked
"""
sequence_list
=
SequenceList
()
sequence_string
=
\
self
.
new_slave_instance_string
()
+
'
\
\
SlapLoginCurrentComputer
\
SlaveInstanceBuilding
\
Tic
\
SlaveInstanceAvailable
\
Tic
\
SlapLogout
\
\
LoginWebUser
\
RequestSlaveInstanceStart
\
Tic
\
Logout
\
\
SlapLoginCurrentComputer
\
SlaveInstanceStarted
\
Tic
\
SlapLogout
\
'
+
\
self
.
lock_user_string
()
+
'
\
LoginERP5TypeTestCase
\
CheckInstanceLocked
\
CheckStoppedComputerPartitionGetStateCall
\
Logout
\
\
LoginERP5TypeTestCase
\
CheckSiteConsistency
\
Logout
\
'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
test_lock_slave_instance_stopping
(
self
):
"""Locked person's stopping instance are automatically locked
"""
sequence_list
=
SequenceList
()
sequence_string
=
\
self
.
new_slave_instance_string
()
+
'
\
\
SlapLoginCurrentComputer
\
SlaveInstanceBuilding
\
Tic
\
SlaveInstanceAvailable
\
Tic
\
SlapLogout
\
\
LoginWebUser
\
RequestSlaveInstanceStart
\
Tic
\
Logout
\
\
SlapLoginCurrentComputer
\
SlaveInstanceStarted
\
Tic
\
SlapLogout
\
\
LoginWebUser
\
RequestSlaveInstanceStop
\
Tic
\
Logout
\
'
+
\
self
.
lock_user_string
()
+
'
\
LoginERP5TypeTestCase
\
CheckInstanceLocked
\
CheckStoppedComputerPartitionGetStateCall
\
Logout
\
\
LoginERP5TypeTestCase
\
CheckSiteConsistency
\
Logout
\
'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
test_lock_slave_instance_stopped
(
self
):
"""Locked person's stopped instance are automatically locked
"""
sequence_list
=
SequenceList
()
sequence_string
=
\
self
.
new_slave_instance_string
()
+
'
\
\
SlapLoginCurrentComputer
\
SlaveInstanceBuilding
\
Tic
\
SlaveInstanceAvailable
\
Tic
\
SlapLogout
\
\
LoginWebUser
\
RequestSlaveInstanceStart
\
Tic
\
Logout
\
\
SlapLoginCurrentComputer
\
SlaveInstanceStarted
\
Tic
\
SlapLogout
\
\
LoginWebUser
\
RequestSlaveInstanceStop
\
Tic
\
Logout
\
\
SlapLoginCurrentComputer
\
SlaveInstanceStopped
\
Tic
\
SlapLogout
\
'
+
\
self
.
lock_user_string
()
+
'
\
LoginERP5TypeTestCase
\
CheckInstanceLocked
\
CheckStoppedComputerPartitionGetStateCall
\
Logout
\
\
LoginERP5TypeTestCase
\
CheckSiteConsistency
\
Logout
\
'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
test_lock_slave_instance_update
(
self
):
"""Locked person's updated instance are automatically locked
"""
sequence_list
=
SequenceList
()
sequence_string
=
\
self
.
new_slave_instance_string
()
+
'
\
\
SlapLoginCurrentComputer
\
SlaveInstanceBuilding
\
Tic
\
SlaveInstanceAvailable
\
Tic
\
SlapLogout
\
\
LoginWebUser
\
RequestSlaveInstanceStart
\
Tic
\
Logout
\
\
SlapLoginCurrentComputer
\
SlaveInstanceStarted
\
Tic
\
SlapLogout
\
\
LoginWebUser
\
RequestSlaveInstanceUpdate
\
Tic
\
Logout
\
'
+
\
self
.
lock_user_string
()
+
'
\
LoginERP5TypeTestCase
\
CheckInstanceLocked
\
CheckStoppedComputerPartitionGetStateCall
\
Logout
\
\
LoginERP5TypeTestCase
\
CheckSiteConsistency
\
Logout
\
'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
test_lock_slave_instance_destroying
(
self
):
"""Locked person's destroying instance are not automatically locked
"""
sequence_list
=
SequenceList
()
sequence_string
=
\
self
.
new_slave_instance_string
()
+
'
\
\
SlapLoginCurrentComputer
\
SlaveInstanceBuilding
\
Tic
\
SlaveInstanceAvailable
\
Tic
\
SlapLogout
\
\
LoginWebUser
\
RequestSlaveInstanceStart
\
Tic
\
Logout
\
\
SlapLoginCurrentComputer
\
SlaveInstanceStarted
\
Tic
\
SlapLogout
\
\
LoginWebUser
\
RequestSlaveInstanceDestroy
\
Tic
\
Logout
\
'
+
\
self
.
lock_user_string
()
+
'
\
LoginERP5TypeTestCase
\
CheckInstanceNotLocked
\
CheckDestroyedComputerPartitionGetStateCall
\
Logout
\
\
LoginERP5TypeTestCase
\
CheckSiteConsistency
\
Logout
\
'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
test_lock_slave_instance_destroyed
(
self
):
"""Locked person's destroyed instance are not automatically locked
"""
sequence_list
=
SequenceList
()
sequence_string
=
\
self
.
new_slave_instance_string
()
+
'
\
\
SlapLoginCurrentComputer
\
SlaveInstanceBuilding
\
Tic
\
SlaveInstanceAvailable
\
Tic
\
SlapLogout
\
\
LoginWebUser
\
RequestSlaveInstanceStart
\
Tic
\
Logout
\
\
SlapLoginCurrentComputer
\
SlaveInstanceStarted
\
Tic
\
SlapLogout
\
\
LoginWebUser
\
RequestSlaveInstanceDestroy
\
Tic
\
Logout
\
\
SlapLoginCurrentComputer
\
SlaveInstanceDestroyed
\
Tic
\
SlapLogout
\
'
+
\
self
.
lock_user_string
()
+
'
\
LoginERP5TypeTestCase
\
CheckInstanceNotLocked
\
CheckDestroyedComputerPartitionGetStateCall
\
Logout
\
\
LoginERP5TypeTestCase
\
CheckSiteConsistency
\
Logout
\
'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
test_lock_slave_instance_can_be_destroyed
(
self
):
"""Locked person's instance can be destroyed
"""
sequence_list
=
SequenceList
()
sequence_string
=
\
self
.
new_slave_instance_string
()
+
\
self
.
lock_user_string
()
+
'
\
LoginERP5TypeTestCase
\
CheckInstanceLocked
\
CheckStoppedComputerPartitionGetStateCall
\
Logout
\
\
LoginWebUser
\
RequestSlaveInstanceDestroy
\
Tic
\
Logout
\
\
LoginERP5TypeTestCase
\
CheckInstanceNotLocked
\
CheckDestroyedComputerPartitionGetStateCall
\
Logout
\
\
SlapLoginCurrentComputer
\
SlaveInstanceDestroyed
\
Tic
\
SlapLogout
\
\
LoginERP5TypeTestCase
\
CheckInstanceNotLocked
\
CheckDestroyedComputerPartitionGetStateCall
\
Logout
\
\
LoginERP5TypeTestCase
\
CheckSiteConsistency
\
Logout
\
'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
test_suite
():
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
TestVifibSlapComputerPartitionLock
))
...
...
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