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
bdad17c8
Unverified
Commit
bdad17c8
authored
Jul 03, 2018
by
2xsec
Committed by
Christian Brauner
Jul 03, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: cleanup clonetest.c
Signed-off-by:
2xsec
<
dh48.jeong@samsung.com
>
parent
371fb550
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
clonetest.c
src/tests/clonetest.c
+11
-0
No files found.
src/tests/clonetest.c
View file @
bdad17c8
...
@@ -41,6 +41,7 @@ int main(int argc, char *argv[])
...
@@ -41,6 +41,7 @@ int main(int argc, char *argv[])
lxc_container_put
(
c
);
lxc_container_put
(
c
);
c
=
NULL
;
c
=
NULL
;
}
}
if
(
c2
)
{
if
(
c2
)
{
c2
->
destroy
(
c2
);
c2
->
destroy
(
c2
);
lxc_container_put
(
c2
);
lxc_container_put
(
c2
);
...
@@ -52,11 +53,14 @@ int main(int argc, char *argv[])
...
@@ -52,11 +53,14 @@ int main(int argc, char *argv[])
ret
=
1
;
ret
=
1
;
goto
out
;
goto
out
;
}
}
c
->
save_config
(
c
,
NULL
);
c
->
save_config
(
c
,
NULL
);
if
(
!
c
->
createl
(
c
,
"busybox"
,
NULL
,
NULL
,
0
,
NULL
))
{
if
(
!
c
->
createl
(
c
,
"busybox"
,
NULL
,
NULL
,
0
,
NULL
))
{
fprintf
(
stderr
,
"%d: failed to create a container
\n
"
,
__LINE__
);
fprintf
(
stderr
,
"%d: failed to create a container
\n
"
,
__LINE__
);
goto
out
;
goto
out
;
}
}
c
->
load_config
(
c
,
NULL
);
c
->
load_config
(
c
,
NULL
);
if
(
!
c
->
is_defined
(
c
))
{
if
(
!
c
->
is_defined
(
c
))
{
...
@@ -92,12 +96,14 @@ int main(int argc, char *argv[])
...
@@ -92,12 +96,14 @@ int main(int argc, char *argv[])
c2
->
destroy
(
c2
);
c2
->
destroy
(
c2
);
lxc_container_put
(
c2
);
lxc_container_put
(
c2
);
}
}
c2
=
lxc_container_new
(
"clonetest-o1"
,
NULL
);
c2
=
lxc_container_new
(
"clonetest-o1"
,
NULL
);
if
(
c2
)
{
if
(
c2
)
{
if
(
c2
->
is_defined
(
c2
))
if
(
c2
->
is_defined
(
c2
))
c2
->
destroy
(
c2
);
c2
->
destroy
(
c2
);
lxc_container_put
(
c2
);
lxc_container_put
(
c2
);
}
}
c2
=
lxc_container_new
(
"clonetest-o2"
,
NULL
);
c2
=
lxc_container_new
(
"clonetest-o2"
,
NULL
);
if
(
c2
)
{
if
(
c2
)
{
if
(
c2
->
is_defined
(
c2
))
if
(
c2
->
is_defined
(
c2
))
...
@@ -112,6 +118,7 @@ int main(int argc, char *argv[])
...
@@ -112,6 +118,7 @@ int main(int argc, char *argv[])
fprintf
(
stderr
,
"failed loading clonetestlvm1
\n
"
);
fprintf
(
stderr
,
"failed loading clonetestlvm1
\n
"
);
goto
out
;
goto
out
;
}
}
if
(
!
c
->
is_defined
(
c
))
{
if
(
!
c
->
is_defined
(
c
))
{
fprintf
(
stderr
,
"clonetestlvm1 does not exist, skipping lvm tests
\n
"
);
fprintf
(
stderr
,
"clonetestlvm1 does not exist, skipping lvm tests
\n
"
);
ret
=
0
;
ret
=
0
;
...
@@ -138,6 +145,7 @@ int main(int argc, char *argv[])
...
@@ -138,6 +145,7 @@ int main(int argc, char *argv[])
fprintf
(
stderr
,
"lvm clone failed
\n
"
);
fprintf
(
stderr
,
"lvm clone failed
\n
"
);
goto
out
;
goto
out
;
}
}
lxc_container_put
(
c2
);
lxc_container_put
(
c2
);
lxc_container_put
(
c
);
lxc_container_put
(
c
);
c
=
c2
=
NULL
;
c
=
c2
=
NULL
;
...
@@ -166,13 +174,16 @@ out:
...
@@ -166,13 +174,16 @@ out:
if
(
c3
)
{
if
(
c3
)
{
lxc_container_put
(
c3
);
lxc_container_put
(
c3
);
}
}
if
(
c2
)
{
if
(
c2
)
{
c2
->
destroy
(
c2
);
c2
->
destroy
(
c2
);
lxc_container_put
(
c2
);
lxc_container_put
(
c2
);
}
}
if
(
c
)
{
if
(
c
)
{
c
->
destroy
(
c
);
c
->
destroy
(
c
);
lxc_container_put
(
c
);
lxc_container_put
(
c
);
}
}
exit
(
ret
);
exit
(
ret
);
}
}
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