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
Łukasz Nowak
slapos.core
Commits
9bedce75
Commit
9bedce75
authored
Sep 13, 2012
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove trailing whitespaces
parent
416e25a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
slapos/tests/slapgrid.py
slapos/tests/slapgrid.py
+14
-14
No files found.
slapos/tests/slapgrid.py
View file @
9bedce75
...
...
@@ -37,7 +37,7 @@ class BasicMixin:
self
.
master_url
,
self
.
computer_id
,
self
.
supervisord_socket
,
self
.
supervisord_configuration_path
,
self
.
usage_report_periodicity
,
self
.
buildout
,
develop
=
develop
)
def
tearDown
(
self
):
# XXX: Hardcoded pid, as it is not configurable in slapos
svc
=
os
.
path
.
join
(
self
.
instance_root
,
'var'
,
'run'
,
'supervisord.pid'
)
...
...
@@ -134,7 +134,7 @@ touch worked""")
def
_server_response
(
self_test
,
_requested_state
,
timestamp
=
None
):
def
server_response
(
self_httplib
,
path
,
method
,
body
,
header
):
parsed_url
=
urlparse
.
urlparse
(
path
.
lstrip
(
'/'
))
self_test
.
sequence
.
append
(
parsed_url
.
path
)
self_test
.
sequence
.
append
(
parsed_url
.
path
)
if
method
==
'GET'
:
parsed_qs
=
urlparse
.
parse_qs
(
parsed_url
.
query
)
else
:
...
...
@@ -150,7 +150,7 @@ def _server_response (self_test,_requested_state,timestamp=None):
partition
.
_software_release_document
=
sr
partition
.
_requested_state
=
_requested_state
if
not
timestamp
==
None
:
partition
.
_parameter_dict
=
{
'timestamp'
:
timestamp
}
partition
.
_parameter_dict
=
{
'timestamp'
:
timestamp
}
slap_computer
.
_computer_partition_list
=
[
partition
]
return
(
200
,
{},
xml_marshaller
.
xml_marshaller
.
dumps
(
slap_computer
))
if
parsed_url
.
path
==
'availableComputerPartition'
and
\
...
...
@@ -173,7 +173,7 @@ def _server_response (self_test,_requested_state,timestamp=None):
return
(
200
,
{},
''
)
else
:
return
(
404
,
{},
''
)
return
server_response
...
...
@@ -457,16 +457,16 @@ touch worked""")
self
.
assertSortedListEqual
(
os
.
listdir
(
partition
),
[
'.timestamp'
,
'worked'
,
'buildout.cfg'
])
self
.
assertSortedListEqual
(
os
.
listdir
(
self
.
software_root
),
[
software_hash
])
[
software_hash
])
timestamp_path
=
os
.
path
.
join
(
partition_path
,
'.timestamp'
)
self
.
setSlapgrid
()
self
.
setSlapgrid
()
self
.
assertTrue
(
self
.
grid
.
processComputerPartitionList
())
self
.
assertTrue
(
self
.
timestamp
in
open
(
timestamp_path
,
'r'
).
read
())
self
.
assertEqual
(
self
.
sequence
,
[
'getFullComputerInformation'
,
'availableComputerPartition'
,
'stoppedComputerPartition'
,
'getFullComputerInformation'
])
def
test_partition_timestamp_develop
(
self
):
...
...
@@ -549,7 +549,7 @@ touch worked""")
self
.
assertEqual
(
self
.
sequence
,
[
'getFullComputerInformation'
,
'availableComputerPartition'
,
'stoppedComputerPartition'
,
'getFullComputerInformation'
])
def
test_partition_timestamp_new_timestamp
(
self
):
...
...
@@ -585,9 +585,9 @@ touch worked""")
httplib
.
HTTPConnection
.
_callback
=
_server_response
(
self
,
'stopped'
,
str
(
int
(
self
.
timestamp
)
+
1
))
self
.
setSlapgrid
()
self
.
setSlapgrid
()
self
.
assertTrue
(
self
.
grid
.
processComputerPartitionList
())
self
.
setSlapgrid
()
self
.
setSlapgrid
()
self
.
assertTrue
(
self
.
grid
.
processComputerPartitionList
())
self
.
assertEqual
(
self
.
sequence
,
[
'getFullComputerInformation'
,
'availableComputerPartition'
,
...
...
@@ -627,7 +627,7 @@ touch worked""")
[
software_hash
])
httplib
.
HTTPConnection
.
_callback
=
_server_response
(
self
,
'stopped'
)
self
.
setSlapgrid
()
self
.
setSlapgrid
()
self
.
assertTrue
(
self
.
grid
.
processComputerPartitionList
())
self
.
assertEqual
(
self
.
sequence
,
[
'getFullComputerInformation'
,
'availableComputerPartition'
,
...
...
@@ -1177,10 +1177,10 @@ fi""" % {'worked_file': worked_file, 'lockfile': lockfile})
with
open
(
promise
,
'w'
)
as
f
:
f
.
write
(
"""#!/usr/bin/env sh
touch "%(worked_file)s"
if [ ! -f %(lockfile)s ]
if [ ! -f %(lockfile)s ]
then
touch "%(lockfile)s"
else
touch "%(lockfile)s"
else
sleep 5
fi
exit 0"""
%
{
'worked_file'
:
worked_file
,
'lockfile'
:
lockfile
})
...
...
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