Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
935cfd3e
Commit
935cfd3e
authored
Jun 29, 2017
by
0x0916
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testcase: define a network before checks
Signed-off-by:
0x0916
<
w@laoqinren.net
>
parent
ae1dc8b4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
4 deletions
+20
-4
default.conf.lxcbr
config/etc/default.conf.lxcbr
+4
-4
get_item.c
src/tests/get_item.c
+16
-0
No files found.
config/etc/default.conf.lxcbr
View file @
935cfd3e
lxc.net
work
.type = veth
lxc.net
.0
.type = veth
lxc.net
work
.link = lxcbr0
lxc.net
.0
.link = lxcbr0
lxc.net
work
.flags = up
lxc.net
.0
.flags = up
lxc.net
work
.hwaddr = 00:16:3e:xx:xx:xx
lxc.net
.0
.hwaddr = 00:16:3e:xx:xx:xx
src/tests/get_item.c
View file @
935cfd3e
...
@@ -298,6 +298,22 @@ int main(int argc, char *argv[])
...
@@ -298,6 +298,22 @@ int main(int argc, char *argv[])
}
}
printf
(
"%d: get_config_item(lxc.network) returned %d %s
\n
"
,
__LINE__
,
ret
,
v2
);
printf
(
"%d: get_config_item(lxc.network) returned %d %s
\n
"
,
__LINE__
,
ret
,
v2
);
if
(
!
c
->
set_config_item
(
c
,
"lxc.network.type"
,
"veth"
))
{
fprintf
(
stderr
,
"%d: failed to set network.type
\n
"
,
__LINE__
);
goto
out
;
}
if
(
!
c
->
set_config_item
(
c
,
"lxc.network.link"
,
"lxcbr0"
))
{
fprintf
(
stderr
,
"%d: failed to set network.link
\n
"
,
__LINE__
);
goto
out
;
}
if
(
!
c
->
set_config_item
(
c
,
"lxc.network.flags"
,
"up"
))
{
fprintf
(
stderr
,
"%d: failed to set network.flags
\n
"
,
__LINE__
);
goto
out
;
}
if
(
!
c
->
set_config_item
(
c
,
"lxc.network.hwaddr"
,
"00:16:3e:xx:xx:xx"
))
{
fprintf
(
stderr
,
"%d: failed to set network.hwaddr
\n
"
,
__LINE__
);
goto
out
;
}
if
(
!
c
->
set_config_item
(
c
,
"lxc.network.ipv4"
,
"10.2.3.4"
))
{
if
(
!
c
->
set_config_item
(
c
,
"lxc.network.ipv4"
,
"10.2.3.4"
))
{
fprintf
(
stderr
,
"%d: failed to set ipv4
\n
"
,
__LINE__
);
fprintf
(
stderr
,
"%d: failed to set ipv4
\n
"
,
__LINE__
);
goto
out
;
goto
out
;
...
...
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