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
Xiaowu Zhang
slapos.core
Commits
ba93d902
Commit
ba93d902
authored
Sep 18, 2012
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'slapgrid_test'
parents
d722ef03
f4afcc60
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
12 deletions
+26
-12
slapos/grid/slapgrid.py
slapos/grid/slapgrid.py
+2
-5
slapos/slap/interface/slap.py
slapos/slap/interface/slap.py
+6
-0
slapos/tests/slap.py
slapos/tests/slap.py
+4
-1
slapos/tests/slapformat.py
slapos/tests/slapformat.py
+12
-6
slapos/tests/slapgrid.py
slapos/tests/slapgrid.py
+2
-0
No files found.
slapos/grid/slapgrid.py
View file @
ba93d902
...
...
@@ -979,13 +979,10 @@ class Slapgrid(object):
report_usage_issue_cp_list
.
append
(
computer_partition_id
)
for
computer_partition
in
computer_partition_list
:
computer_partition_id
=
computer_partition
.
getId
()
try
:
software_url
=
computer_partition
.
getSoftwareRelease
().
getURI
()
except
NotFoundError
:
software_url
=
None
if
computer_partition
.
getState
()
==
"destroyed"
:
try
:
computer_partition_id
=
computer_partition
.
getId
()
software_url
=
computer_partition
.
getSoftwareRelease
().
getURI
()
software_path
=
os
.
path
.
join
(
self
.
software_root
,
getSoftwareUrlHash
(
software_url
))
local_partition
=
Partition
(
...
...
slapos/slap/interface/slap.py
View file @
ba93d902
...
...
@@ -134,6 +134,12 @@ class ISoftwareRelease(IBuildoutController):
Returns a string representing the uri of the software release.
"""
def
getComputerId
():
"""
Returns a string representing the identifier of the computer where the SR
is installed.
"""
def
getState
():
"""
Returns a string representing the expected state of the software
...
...
slapos/tests/slap.py
View file @
ba93d902
...
...
@@ -273,11 +273,14 @@ class TestComputer(SlapMixin):
partition_id
)
self
.
assertEqual
(
self
.
computer
.
getComputerPartitionList
(),
[])
@
unittest
.
skip
(
"Not implemented"
)
def
test_computer_reportUsage_non_valid_xml_raises
(
self
):
"""
Asserts that calling Computer.reportUsage with non DTD
(not defined yet) XML raises (not defined yet) exception
"""
self
.
computer_guid
=
self
.
_getTestComputerId
()
self
.
slap
=
slapos
.
slap
.
slap
()
self
.
slap
.
initializeConnection
(
self
.
server_url
)
...
...
@@ -288,6 +291,7 @@ class TestComputer(SlapMixin):
self
.
assertRaises
(
UndefinedYetException
,
self
.
computer
.
reportUsage
,
non_dtd_xml
)
@
unittest
.
skip
(
"Not implemented"
)
def
test_computer_reportUsage_valid_xml_invalid_partition_raises
(
self
):
"""
Asserts that calling Computer.reportUsage with DTD (not defined
...
...
@@ -675,7 +679,6 @@ class TestOpenOrder(SlapMixin):
requested_partition_id
=
'PARTITION_01'
def
server_response
(
self
,
path
,
method
,
body
,
header
):
parsed_url
=
urlparse
.
urlparse
(
path
.
lstrip
(
'/'
))
parsed_qs
=
urlparse
.
parse_qs
(
parsed_url
.
query
)
from
slapos.slap.slap
import
SoftwareInstance
slap_partition
=
SoftwareInstance
(
slap_computer_id
=
computer_guid
,
...
...
slapos/tests/slapformat.py
View file @
ba93d902
...
...
@@ -205,11 +205,12 @@ class TestComputer(SlapformatMixin):
computer
=
slapos
.
format
.
Computer
(
'computer'
)
self
.
assertEqual
(
computer
.
getAddress
(),
{
'netmask'
:
None
,
'addr'
:
None
})
@
unittest
.
skip
(
"Not implemented"
)
def
test_construct_empty
(
self
):
computer
=
slapos
.
format
.
Computer
(
'computer'
)
computer
.
construct
()
raise
NotImplementedError
@
unittest
.
skip
(
"Not implemented"
)
def
test_construct_empty_prepared
(
self
):
computer
=
slapos
.
format
.
Computer
(
'computer'
,
interface
=
slapos
.
format
.
Interface
(
'bridge'
,
'127.0.0.1/16'
))
...
...
@@ -244,6 +245,7 @@ class TestComputer(SlapformatMixin):
'ip addr list bridge'
,],
self
.
fakeCallAndRead
.
external_command_list
)
@
unittest
.
skip
(
"Not implemented"
)
def
test_construct_empty_prepared_no_alter_network
(
self
):
computer
=
slapos
.
format
.
Computer
(
'computer'
,
interface
=
slapos
.
format
.
Interface
(
'bridge'
,
'127.0.0.1/16'
))
...
...
@@ -279,6 +281,7 @@ class TestComputer(SlapformatMixin):
],
self
.
fakeCallAndRead
.
external_command_list
)
@
unittest
.
skip
(
"Not implemented"
)
def
test_construct_prepared
(
self
):
computer
=
slapos
.
format
.
Computer
(
'computer'
,
interface
=
slapos
.
format
.
Interface
(
'bridge'
,
'127.0.0.1/16'
))
...
...
@@ -330,6 +333,8 @@ class TestComputer(SlapformatMixin):
computer
.
software_root
=
'/software_root'
partition
=
slapos
.
format
.
Partition
(
'partition'
,
'/part_path'
,
slapos
.
format
.
User
(
'testuser'
),
[],
None
)
global
USER_LIST
USER_LIST
=
[
'testuser'
]
partition
.
tap
=
slapos
.
format
.
Tap
(
'tap'
)
computer
.
partition_list
=
[
partition
]
global
INTERFACE_DICT
...
...
@@ -361,6 +366,7 @@ class TestComputer(SlapformatMixin):
],
self
.
fakeCallAndRead
.
external_command_list
)
@
unittest
.
skip
(
"Not implemented"
)
def
test_construct_prepared_no_alter_network
(
self
):
computer
=
slapos
.
format
.
Computer
(
'computer'
,
interface
=
slapos
.
format
.
Interface
(
'bridge'
,
'127.0.0.1/16'
))
...
...
@@ -389,15 +395,15 @@ class TestComputer(SlapformatMixin):
],
self
.
test_result
.
bucket
)
self
.
assertEqual
([
#
'ip addr list bridge',
#
'ip addr list bridge',
'groupadd slapsoft'
,
'useradd -d /software_root -g slapsoft -s /bin/false slapsoft -r'
,
'groupadd testuser'
,
'useradd -d /instance_root/partition -g testuser -s /bin/false -G slapsoft testuser -r'
,
#
'ip addr add ip/255.255.255.255 dev bridge',
#
'ip addr list bridge',
#
'ip addr add ip/ffff:ffff:ffff:ffff:: dev bridge',
#
'ip addr list bridge',
#
'ip addr add ip/255.255.255.255 dev bridge',
#
'ip addr list bridge',
#
'ip addr add ip/ffff:ffff:ffff:ffff:: dev bridge',
#
'ip addr list bridge',
],
self
.
fakeCallAndRead
.
external_command_list
)
...
...
slapos/tests/slapgrid.py
View file @
ba93d902
...
...
@@ -1415,6 +1415,7 @@ exit 0""" % {'worked_file': worked_file, 'lockfile': lockfile})
self
.
assertEquals
(
self
.
error
,
1
)
self
.
assertFalse
(
self
.
started
)
@
unittest
.
skip
(
"Not implemented"
)
def
test_slapgrid_processes_partition_after_global_timeout
(
self
):
"""
Test that slapgrid processes again partition after delay defined by
...
...
@@ -1423,6 +1424,7 @@ exit 0""" % {'worked_file': worked_file, 'lockfile': lockfile})
# XXX Not implemented
pass
@
unittest
.
skip
(
"Not implemented"
)
def
test_slapgrid_processes_partition_after_timeout_defined_by_software_release
(
self
):
"""
Test that if SR of instance defines a "buildotu delay", slapgrid processes
...
...
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