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
20069fa3
Commit
20069fa3
authored
Jul 05, 2017
by
Christian Brauner
Committed by
GitHub
Jul 05, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1677 from 0x0916/2017-07-05/fix-parse-config-file
tests: delete the intermediate file and directory.
parents
d552fc35
a6638e2e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
attach.c
src/tests/attach.c
+1
-0
parse_config_file.c
src/tests/parse_config_file.c
+7
-7
No files found.
src/tests/attach.c
View file @
20069fa3
...
@@ -403,6 +403,7 @@ int main(int argc, char *argv[])
...
@@ -403,6 +403,7 @@ int main(int argc, char *argv[])
if
(
ret
<
0
)
if
(
ret
<
0
)
return
EXIT_FAILURE
;
return
EXIT_FAILURE
;
(
void
)
rmdir
(
LXCPATH
"/alternate-path-test"
);
TSTOUT
(
"All tests passed
\n
"
);
TSTOUT
(
"All tests passed
\n
"
);
return
EXIT_SUCCESS
;
return
EXIT_SUCCESS
;
}
}
src/tests/parse_config_file.c
View file @
20069fa3
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
#include <sys/types.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/wait.h>
#include <unistd.h>
#include <unistd.h>
#include <libgen.h>
#include "confile_utils.h"
#include "confile_utils.h"
#include "lxc/state.h"
#include "lxc/state.h"
...
@@ -279,12 +280,6 @@ int main(int argc, char *argv[])
...
@@ -279,12 +280,6 @@ int main(int argc, char *argv[])
char
tmpf
[]
=
"lxc-parse-config-file-XXXXXX"
;
char
tmpf
[]
=
"lxc-parse-config-file-XXXXXX"
;
char
retval
[
4096
]
=
{
0
};
char
retval
[
4096
]
=
{
0
};
c
=
lxc_container_new
(
tmpf
,
NULL
);
if
(
!
c
)
{
lxc_error
(
"%s
\n
"
,
"failed to create new container"
);
exit
(
EXIT_FAILURE
);
}
fd
=
mkstemp
(
tmpf
);
fd
=
mkstemp
(
tmpf
);
if
(
fd
<
0
)
{
if
(
fd
<
0
)
{
lxc_error
(
"%s
\n
"
,
"Could not create temporary file"
);
lxc_error
(
"%s
\n
"
,
"Could not create temporary file"
);
...
@@ -292,6 +287,11 @@ int main(int argc, char *argv[])
...
@@ -292,6 +287,11 @@ int main(int argc, char *argv[])
}
}
close
(
fd
);
close
(
fd
);
c
=
lxc_container_new
(
tmpf
,
NULL
);
if
(
!
c
)
{
lxc_error
(
"%s
\n
"
,
"Failed to create new container"
);
exit
(
EXIT_FAILURE
);
}
/* lxc.arch */
/* lxc.arch */
if
(
set_get_compare_clear_save_load
(
c
,
"lxc.arch"
,
"x86_64"
,
tmpf
,
if
(
set_get_compare_clear_save_load
(
c
,
"lxc.arch"
,
"x86_64"
,
tmpf
,
...
@@ -986,7 +986,7 @@ int main(int argc, char *argv[])
...
@@ -986,7 +986,7 @@ int main(int argc, char *argv[])
ret
=
EXIT_SUCCESS
;
ret
=
EXIT_SUCCESS
;
non_test_error:
non_test_error:
(
void
)
unlink
(
tmpf
);
(
void
)
unlink
(
tmpf
);
c
->
destroy
(
c
);
(
void
)
rmdir
(
dirname
(
c
->
configfile
)
);
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