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
cd70a8ed
Unverified
Commit
cd70a8ed
authored
Nov 28, 2017
by
Felix Abecassis
Committed by
Christian Brauner
Dec 15, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: add a function for negative netdev tests
Signed-off-by:
Felix Abecassis
<
fabecassis@nvidia.com
>
parent
192ab19d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
6 deletions
+22
-6
parse_config_file.c
src/tests/parse_config_file.c
+22
-6
No files found.
src/tests/parse_config_file.c
View file @
cd70a8ed
...
@@ -155,6 +155,23 @@ static int set_and_clear_complete_netdev(struct lxc_container *c)
...
@@ -155,6 +155,23 @@ static int set_and_clear_complete_netdev(struct lxc_container *c)
return
0
;
return
0
;
}
}
static
int
set_invalid_netdev
(
struct
lxc_container
*
c
)
{
if
(
c
->
set_config_item
(
c
,
"lxc.net.0.asdf"
,
"veth"
))
{
lxc_error
(
"%s
\n
"
,
"lxc.net.0.asdf should be invalid"
);
return
-
1
;
}
if
(
c
->
set_config_item
(
c
,
"lxc.net.2147483647.type"
,
"veth"
))
{
lxc_error
(
"%s
\n
"
,
"lxc.net.2147483647.type should be invalid"
);
return
-
1
;
}
c
->
clear_config
(
c
);
c
->
lxc_conf
=
NULL
;
return
0
;
}
int
test_idmap_parser
(
void
)
int
test_idmap_parser
(
void
)
{
{
size_t
i
;
size_t
i
;
...
@@ -970,12 +987,6 @@ int main(int argc, char *argv[])
...
@@ -970,12 +987,6 @@ int main(int argc, char *argv[])
goto
non_test_error
;
goto
non_test_error
;
}
}
if
(
!
set_get_compare_clear_save_load
(
c
,
"lxc.net.0.asdf"
,
"veth"
,
tmpf
,
true
))
{
lxc_error
(
"%s
\n
"
,
"lxc.net.0.asdf"
);
goto
non_test_error
;
}
if
(
set_get_compare_clear_save_load_network
(
if
(
set_get_compare_clear_save_load_network
(
c
,
"lxc.net.0.macvlan.mode"
,
"private"
,
tmpf
,
true
,
c
,
"lxc.net.0.macvlan.mode"
,
"private"
,
tmpf
,
true
,
"macvlan"
))
{
"macvlan"
))
{
...
@@ -1070,6 +1081,11 @@ int main(int argc, char *argv[])
...
@@ -1070,6 +1081,11 @@ int main(int argc, char *argv[])
goto
non_test_error
;
goto
non_test_error
;
}
}
if
(
set_invalid_netdev
(
c
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"failed to reject invalid configuration"
);
goto
non_test_error
;
}
ret
=
EXIT_SUCCESS
;
ret
=
EXIT_SUCCESS
;
non_test_error:
non_test_error:
(
void
)
unlink
(
tmpf
);
(
void
)
unlink
(
tmpf
);
...
...
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