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
07629dce
Commit
07629dce
authored
Jun 01, 2017
by
Tomáš Peterka
Committed by
Rafael Monnerat
Jun 02, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[test] Pass Logger instead of Handler as a logger
parent
9da1f41e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
slapos/tests/slapformat.py
slapos/tests/slapformat.py
+12
-9
No files found.
slapos/tests/slapformat.py
View file @
07629dce
...
...
@@ -239,6 +239,9 @@ class SlapformatMixin(unittest.TestCase):
self
.
test_result
=
TestLoggerHandler
()
logger
.
addHandler
(
self
.
test_result
)
config
.
logger
=
logger
if
hasattr
(
self
,
"logger"
):
raise
ValueError
(
"{} already has logger attached"
.
format
(
self
.
__class__
.
__name__
))
self
.
logger
=
logger
self
.
partition
=
slapos
.
format
.
Partition
(
'partition'
,
'/part_path'
,
slapos
.
format
.
User
(
'testuser'
),
[],
None
)
global
USER_LIST
...
...
@@ -281,7 +284,7 @@ class TestComputer(SlapformatMixin):
@
unittest
.
skip
(
"Not implemented"
)
def
test_construct_empty_prepared
(
self
):
computer
=
slapos
.
format
.
Computer
(
'computer'
,
interface
=
slapos
.
format
.
Interface
(
logger
=
self
.
test_result
,
interface
=
slapos
.
format
.
Interface
(
logger
=
self
.
logger
,
name
=
'bridge'
,
ipv4_local_network
=
'127.0.0.1/16'
))
computer
.
instance_root
=
'/instance_root'
...
...
@@ -302,7 +305,7 @@ class TestComputer(SlapformatMixin):
def
test_construct_empty_prepared_no_alter_user
(
self
):
computer
=
slapos
.
format
.
Computer
(
'computer'
,
interface
=
slapos
.
format
.
Interface
(
logger
=
self
.
test_result
,
interface
=
slapos
.
format
.
Interface
(
logger
=
self
.
logger
,
name
=
'bridge'
,
ipv4_local_network
=
'127.0.0.1/16'
))
computer
.
instance_root
=
'/instance_root'
...
...
@@ -319,7 +322,7 @@ class TestComputer(SlapformatMixin):
@
unittest
.
skip
(
"Not implemented"
)
def
test_construct_empty_prepared_no_alter_network
(
self
):
computer
=
slapos
.
format
.
Computer
(
'computer'
,
interface
=
slapos
.
format
.
Interface
(
logger
=
self
.
test_result
,
interface
=
slapos
.
format
.
Interface
(
logger
=
self
.
logger
,
name
=
'bridge'
,
ipv4_local_network
=
'127.0.0.1/16'
))
computer
.
instance_root
=
'/instance_root'
...
...
@@ -340,7 +343,7 @@ class TestComputer(SlapformatMixin):
def
test_construct_empty_prepared_no_alter_network_user
(
self
):
computer
=
slapos
.
format
.
Computer
(
'computer'
,
interface
=
slapos
.
format
.
Interface
(
logger
=
self
.
test_result
,
interface
=
slapos
.
format
.
Interface
(
logger
=
self
.
logger
,
name
=
'bridge'
,
ipv4_local_network
=
'127.0.0.1/16'
))
computer
.
instance_root
=
'/instance_root'
...
...
@@ -359,7 +362,7 @@ class TestComputer(SlapformatMixin):
@
unittest
.
skip
(
"Not implemented"
)
def
test_construct_prepared
(
self
):
computer
=
slapos
.
format
.
Computer
(
'computer'
,
interface
=
slapos
.
format
.
Interface
(
logger
=
self
.
test_result
,
interface
=
slapos
.
format
.
Interface
(
logger
=
self
.
logger
,
name
=
'bridge'
,
ipv4_local_network
=
'127.0.0.1/16'
))
computer
.
instance_root
=
'/instance_root'
...
...
@@ -405,7 +408,7 @@ class TestComputer(SlapformatMixin):
def
test_construct_prepared_no_alter_user
(
self
):
computer
=
slapos
.
format
.
Computer
(
'computer'
,
interface
=
slapos
.
format
.
Interface
(
logger
=
self
.
test_result
,
interface
=
slapos
.
format
.
Interface
(
logger
=
self
.
logger
,
name
=
'bridge'
,
ipv4_local_network
=
'127.0.0.1/16'
))
computer
.
instance_root
=
'/instance_root'
...
...
@@ -498,7 +501,7 @@ class TestComputer(SlapformatMixin):
@
unittest
.
skip
(
"Not implemented"
)
def
test_construct_prepared_no_alter_network
(
self
):
computer
=
slapos
.
format
.
Computer
(
'computer'
,
interface
=
slapos
.
format
.
Interface
(
logger
=
self
.
test_result
,
interface
=
slapos
.
format
.
Interface
(
logger
=
self
.
logger
,
name
=
'bridge'
,
ipv4_local_network
=
'127.0.0.1/16'
))
computer
.
instance_root
=
'/instance_root'
...
...
@@ -540,7 +543,7 @@ class TestComputer(SlapformatMixin):
def
test_construct_prepared_no_alter_network_user
(
self
):
computer
=
slapos
.
format
.
Computer
(
'computer'
,
interface
=
slapos
.
format
.
Interface
(
logger
=
self
.
test_result
,
interface
=
slapos
.
format
.
Interface
(
logger
=
self
.
logger
,
name
=
'bridge'
,
ipv4_local_network
=
'127.0.0.1/16'
))
computer
.
instance_root
=
'/instance_root'
...
...
@@ -581,7 +584,7 @@ class TestComputer(SlapformatMixin):
global
USER_LIST
USER_LIST
=
[
'root'
]
computer
=
slapos
.
format
.
Computer
(
'computer'
,
interface
=
slapos
.
format
.
Interface
(
logger
=
self
.
test_result
,
interface
=
slapos
.
format
.
Interface
(
logger
=
self
.
logger
,
name
=
'myinterface'
,
ipv4_local_network
=
'127.0.0.1/16'
))
computer
.
instance_root
=
'/instance_root'
...
...
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