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
1
Merge Requests
1
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
Romain Courteaud
slapos.core
Commits
14dc7d72
Commit
14dc7d72
authored
Jun 06, 2017
by
Tomáš Peterka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update slapformat test to reflect changes in slapos.format
parent
fc204fb0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
slapos/tests/slapformat.py
slapos/tests/slapformat.py
+6
-2
No files found.
slapos/tests/slapformat.py
View file @
14dc7d72
...
...
@@ -186,6 +186,7 @@ class SlaposUtilMock:
class
CGroupManagerMock
(
slapos
.
format
.
CGroupManager
):
short_name
=
'cgroup_mock'
cpuset_path
=
"/tmp/cpuset/"
task_write_mode
=
"at"
# append insted of write tasks PIDs for the tests
...
...
@@ -193,6 +194,9 @@ class CGroupManagerMock(slapos.format.CGroupManager):
"""Always allowed."""
return
True
# update available managers with our partially-mocked version
slapos
.
format
.
available_managers
[
CGroupManagerMock
.
short_name
]
=
CGroupManagerMock
class
SlapformatMixin
(
unittest
.
TestCase
):
# keep big diffs
...
...
@@ -701,7 +705,7 @@ class TestComputerWithCGroup(SlapformatMixin):
slapos
.
format
.
Partition
(
'partition'
,
'/tmp/slapgrid/instance_root/part1'
,
slapos
.
format
.
User
(
'testuser'
),
[],
tap
=
None
),
],
manager
_list
=
(
CGroupManagerMock
,
)
manager
s
=
(
CGroupManagerMock
.
short_name
,
)
)
# self.patchOs(self.logger)
...
...
@@ -715,7 +719,7 @@ class TestComputerWithCGroup(SlapformatMixin):
def
test_positive_cgroups
(
self
):
"""Positive test of cgroups."""
# Test parsing "cpuset.cpus" file
self
.
assertEqual
(
self
.
computer
.
manager_list
[
0
].
_cpu_list
(),
self
.
cpu_list
)
self
.
assertEqual
(
self
.
computer
.
_
manager_list
[
0
].
_cpu_list
(),
self
.
cpu_list
)
# This should created per-cpu groups and move all tasks in CPU pool into cpu0
self
.
computer
.
format
(
alter_network
=
False
,
alter_user
=
False
)
# Test files creation for exclusive CPUs
...
...
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