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
9e247a41
Commit
9e247a41
authored
Jul 27, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initiate slapgrid testing.
parent
e39aec89
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
0 deletions
+38
-0
slapos/tests/slapgrid.py
slapos/tests/slapgrid.py
+38
-0
No files found.
slapos/tests/slapgrid.py
0 → 100644
View file @
9e247a41
from
slapos.grid
import
slapgrid
import
os
import
shutil
import
tempfile
import
unittest
import
socket
class
TestSlapgridCP
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
_tempdir
=
tempfile
.
mkdtemp
()
self
.
software_root
=
os
.
path
.
join
(
self
.
_tempdir
,
'software'
)
self
.
instance_root
=
os
.
path
.
join
(
self
.
_tempdir
,
'instance'
)
self
.
master_url
=
'http://127.0.0.1:0/'
self
.
computer_id
=
'computer'
self
.
supervisord_socket
=
os
.
path
.
join
(
self
.
_tempdir
,
'supervisord.sock'
)
self
.
supervisord_configuration_path
=
os
.
path
.
join
(
self
.
_tempdir
,
'supervisord'
)
self
.
usage_report_periodicity
=
1
self
.
buildout
=
None
self
.
grid
=
slapgrid
.
Slapgrid
(
self
.
software_root
,
self
.
instance_root
,
self
.
master_url
,
self
.
computer_id
,
self
.
supervisord_socket
,
self
.
supervisord_configuration_path
,
self
.
usage_report_periodicity
,
self
.
buildout
)
def
tearDown
(
self
):
shutil
.
rmtree
(
self
.
_tempdir
)
def
test_no_software_root
(
self
):
self
.
assertRaises
(
OSError
,
self
.
grid
.
processComputerPartitionList
)
def
test_no_instance_root
(
self
):
os
.
mkdir
(
self
.
software_root
)
self
.
assertRaises
(
OSError
,
self
.
grid
.
processComputerPartitionList
)
def
test_no_master
(
self
):
os
.
mkdir
(
self
.
software_root
)
os
.
mkdir
(
self
.
instance_root
)
self
.
assertRaises
(
socket
.
error
,
self
.
grid
.
processComputerPartitionList
)
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