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
36ea23a8
Commit
36ea23a8
authored
Dec 12, 2018
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: make each test use a different partition_id
This can hide problems when tests are not isolated correctly.
parent
682e9b46
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
13 deletions
+13
-13
slapos/tests/cli.py
slapos/tests/cli.py
+1
-1
slapos/tests/slap.py
slapos/tests/slap.py
+12
-12
No files found.
slapos/tests/cli.py
View file @
36ea23a8
...
...
@@ -328,7 +328,7 @@ class TestCliSupervisorctl(CliMixin):
class
TestCliConsole
(
unittest
.
TestCase
):
def
setUp
(
self
):
cp
=
slapos
.
slap
.
ComputerPartition
(
'computer_id'
,
'partition_id'
)
cp
=
slapos
.
slap
.
ComputerPartition
(
'computer_id'
,
self
.
id
()
)
cp
.
_parameter_dict
=
{
'parameter_name'
:
'parameter_value'
}
request_patch
=
patch
.
object
(
slapos
.
slap
.
OpenOrder
,
'request'
,
return_value
=
cp
)
...
...
slapos/tests/slap.py
View file @
36ea23a8
...
...
@@ -53,7 +53,7 @@ class SlapMixin(unittest.TestCase):
self
.
server_url
=
self
.
_server_url
print
'Testing against SLAP server %r'
%
self
.
server_url
self
.
slap
=
slapos
.
slap
.
slap
()
self
.
partition_id
=
'PARTITION_01'
self
.
partition_id
=
self
.
id
()
if
os
.
environ
.
has_key
(
'SLAPGRID_INSTANCE_ROOT'
):
del
os
.
environ
[
'SLAPGRID_INSTANCE_ROOT'
]
...
...
@@ -223,7 +223,7 @@ class TestSlap(SlapMixin):
"""
computer_guid
=
self
.
_getTestComputerId
()
self
.
slap
.
initializeConnection
(
self
.
server_url
)
partition_id
=
'PARTITION_01'
partition_id
=
self
.
id
()
def
handler
(
url
,
req
):
qs
=
urlparse
.
parse_qs
(
url
.
query
)
...
...
@@ -644,7 +644,7 @@ class TestComputerPartition(SlapMixin):
'software_type'
,
'myref'
)
def
test_request_not_raises
(
self
):
partition_id
=
'PARTITION_01'
partition_id
=
self
.
id
()
def
handler
(
url
,
req
):
qs
=
urlparse
.
parse_qs
(
url
.
query
)
...
...
@@ -688,7 +688,7 @@ class TestComputerPartition(SlapMixin):
self
.
assertIsInstance
(
requested_partition
,
slapos
.
slap
.
ComputerPartition
)
def
test_request_raises_later
(
self
):
partition_id
=
'PARTITION_01'
partition_id
=
self
.
id
()
def
handler
(
url
,
req
):
qs
=
urlparse
.
parse_qs
(
url
.
query
)
...
...
@@ -735,8 +735,8 @@ class TestComputerPartition(SlapMixin):
requested_partition
.
getId
)
def
test_request_fullfilled_work
(
self
):
partition_id
=
'PARTITION_01
'
requested_partition_id
=
'PARTITION_02
'
partition_id
=
'PARTITION_01
-%s'
%
self
.
id
()
requested_partition_id
=
'PARTITION_02
-%s'
%
self
.
id
()
computer_guid
=
self
.
_getTestComputerId
()
def
handler
(
url
,
req
):
...
...
@@ -792,7 +792,7 @@ class TestComputerPartition(SlapMixin):
def
test_request_with_slapgrid_request_transaction
(
self
):
from
slapos.slap.slap
import
COMPUTER_PARTITION_REQUEST_LIST_TEMPLATE_FILENAME
partition_id
=
'PARTITION_01'
partition_id
=
self
.
id
()
instance_root
=
tempfile
.
mkdtemp
()
partition_root
=
os
.
path
.
join
(
instance_root
,
partition_id
)
os
.
mkdir
(
partition_root
)
...
...
@@ -874,7 +874,7 @@ class TestComputerPartition(SlapMixin):
Partition
"""
computer_guid
=
self
.
_getTestComputerId
()
partition_id
=
'PARTITION_01'
partition_id
=
self
.
id
()
slap
=
self
.
slap
slap
.
initializeConnection
(
self
.
server_url
)
...
...
@@ -918,7 +918,7 @@ class TestComputerPartition(SlapMixin):
Asserts that calling ComputerPartition.error on new partition works
"""
computer_guid
=
self
.
_getTestComputerId
()
partition_id
=
'PARTITION_01'
partition_id
=
self
.
id
()
slap
=
self
.
slap
slap
.
initializeConnection
(
self
.
server_url
)
...
...
@@ -1070,7 +1070,7 @@ class TestOpenOrder(SlapMixin):
# XXX: Interface lack registerOpenOrder method declaration
open_order
=
self
.
slap
.
registerOpenOrder
()
computer_guid
=
self
.
_getTestComputerId
()
requested_partition_id
=
'PARTITION_01'
requested_partition_id
=
self
.
id
()
def
handler
(
url
,
req
):
from
slapos.slap.slap
import
SoftwareInstance
...
...
@@ -1096,7 +1096,7 @@ class TestOpenOrder(SlapMixin):
# XXX: Interface lack registerOpenOrder method declaration
open_order
=
self
.
slap
.
registerOpenOrder
()
computer_guid
=
self
.
_getTestComputerId
()
requested_partition_id
=
'PARTITION_01'
requested_partition_id
=
self
.
id
()
def
handler
(
url
,
req
):
from
slapos.slap.slap
import
SoftwareInstance
...
...
@@ -1126,7 +1126,7 @@ class TestOpenOrder(SlapMixin):
# XXX: Interface lack registerOpenOrder method declaration
open_order
=
self
.
slap
.
registerOpenOrder
()
computer_guid
=
self
.
_getTestComputerId
()
requested_partition_id
=
'PARTITION_01'
requested_partition_id
=
self
.
id
()
def
handler
(
url
,
req
):
from
slapos.slap.slap
import
SoftwareInstance
...
...
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