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
Klaus Wölfel
slapos.core
Commits
81748d83
Commit
81748d83
authored
Jun 06, 2017
by
Tomáš Peterka
Committed by
Rafael Monnerat
Jun 06, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[test] Mock 'brctl' command to always show existence of bridge for interface 'bridge'
parent
75650e2c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
slapos/tests/slapformat.py
slapos/tests/slapformat.py
+7
-1
No files found.
slapos/tests/slapformat.py
View file @
81748d83
...
@@ -98,6 +98,11 @@ class FakeCallAndRead:
...
@@ -98,6 +98,11 @@ class FakeCallAndRead:
retval
=
0
,
'OK'
retval
=
0
,
'OK'
elif
argument_list
[:
3
]
==
[
'route'
,
'add'
,
'-host'
]:
elif
argument_list
[:
3
]
==
[
'route'
,
'add'
,
'-host'
]:
retval
=
0
,
'OK'
retval
=
0
,
'OK'
elif
argument_list
[:
2
]
==
[
'brctl'
,
'show'
]:
retval
=
0
,
"
\
n
"
.
join
((
"bridge name bridge id STP enabled interfaces"
,
"bridge bridge bridge b001 000:000 1 fakeinterface"
,
" fakeinterface2"
""
))
self
.
external_command_list
.
append
(
' '
.
join
(
argument_list
))
self
.
external_command_list
.
append
(
' '
.
join
(
argument_list
))
return
retval
return
retval
...
@@ -355,7 +360,7 @@ class TestComputer(SlapformatMixin):
...
@@ -355,7 +360,7 @@ class TestComputer(SlapformatMixin):
"chmod('/software_root', 493)"
],
"chmod('/software_root', 493)"
],
self
.
test_result
.
bucket
)
self
.
test_result
.
bucket
)
self
.
assertEqual
([
self
.
assertEqual
([
'ip addr list bridge'
,
'ip addr list bridge'
],
],
self
.
fakeCallAndRead
.
external_command_list
)
self
.
fakeCallAndRead
.
external_command_list
)
...
@@ -439,6 +444,7 @@ class TestComputer(SlapformatMixin):
...
@@ -439,6 +444,7 @@ class TestComputer(SlapformatMixin):
'ip addr list bridge'
,
'ip addr list bridge'
,
'tunctl -t tap -u testuser'
,
'tunctl -t tap -u testuser'
,
'ip link set tap up'
,
'ip link set tap up'
,
'brctl show'
,
# we check bridges at Interface initialization
'brctl show'
,
'brctl show'
,
'brctl addif bridge tap'
,
'brctl addif bridge tap'
,
'ip addr add ip/255.255.255.255 dev bridge'
,
'ip addr add ip/255.255.255.255 dev bridge'
,
...
...
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