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
72583ee1
Unverified
Commit
72583ee1
authored
Jun 01, 2017
by
Christian Brauner
Committed by
Stéphane Graber
Jul 16, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: comp retval to exp val whenever we can
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
6e74f4f2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
58 deletions
+74
-58
parse_config_file.c
src/tests/parse_config_file.c
+74
-58
No files found.
src/tests/parse_config_file.c
View file @
72583ee1
...
@@ -31,10 +31,10 @@
...
@@ -31,10 +31,10 @@
#include "lxc/state.h"
#include "lxc/state.h"
#include "lxctest.h"
#include "lxctest.h"
#define MYNAME "lxctest1"
static
int
set_get_compare_clear_save_load
(
struct
lxc_container
*
c
,
const
char
*
key
,
const
char
*
value
,
static
int
set_clear_save_and_load
(
struct
lxc_container
*
c
,
const
char
*
key
,
const
char
*
config_file
,
const
char
*
value
,
const
char
*
config_fil
e
)
bool
compar
e
)
{
{
char
retval
[
4096
]
=
{
0
};
char
retval
[
4096
]
=
{
0
};
int
ret
;
int
ret
;
...
@@ -51,6 +51,17 @@ static int set_clear_save_and_load(struct lxc_container *c, const char *key,
...
@@ -51,6 +51,17 @@ static int set_clear_save_and_load(struct lxc_container *c, const char *key,
return
-
1
;
return
-
1
;
}
}
if
(
compare
)
{
ret
=
strcmp
(
retval
,
value
);
if
(
ret
!=
0
)
{
lxc_error
(
"expected value
\"
%s
\"
and retrieved value
\"
%s
\"
"
"for config key
\"
%s
\"
do not match
\n
"
,
value
,
retval
,
key
);
return
-
1
;
}
}
if
(
config_file
)
{
if
(
config_file
)
{
if
(
!
c
->
save_config
(
c
,
config_file
))
{
if
(
!
c
->
save_config
(
c
,
config_file
))
{
lxc_error
(
"%s
\n
"
,
"failed to save config file"
);
lxc_error
(
"%s
\n
"
,
"failed to save config file"
);
...
@@ -71,7 +82,7 @@ static int set_clear_save_and_load(struct lxc_container *c, const char *key,
...
@@ -71,7 +82,7 @@ static int set_clear_save_and_load(struct lxc_container *c, const char *key,
return
-
1
;
return
-
1
;
}
}
if
(
config_file
)
{
if
(
config_file
)
{
if
(
!
c
->
save_config
(
c
,
config_file
))
{
if
(
!
c
->
save_config
(
c
,
config_file
))
{
lxc_error
(
"%s
\n
"
,
"failed to save config file"
);
lxc_error
(
"%s
\n
"
,
"failed to save config file"
);
return
-
1
;
return
-
1
;
...
@@ -114,51 +125,50 @@ int main(int argc, char *argv[])
...
@@ -114,51 +125,50 @@ int main(int argc, char *argv[])
close
(
fd
);
close
(
fd
);
/* lxc.arch */
/* lxc.arch */
if
(
set_
clear_save_and_load
(
c
,
"lxc.arch"
,
"x86_64"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.arch"
,
"x86_64"
,
tmpf
,
true
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.arch"
);
lxc_error
(
"%s
\n
"
,
"lxc.arch"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.pts */
/* lxc.pts */
if
(
set_
clear_save_and_load
(
c
,
"lxc.pts"
,
"1000"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.pts"
,
"1000"
,
tmpf
,
true
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.pts"
);
lxc_error
(
"%s
\n
"
,
"lxc.pts"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.tty */
/* lxc.tty */
if
(
set_
clear_save_and_load
(
c
,
"lxc.tty"
,
"4"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.tty"
,
"4"
,
tmpf
,
true
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.tty"
);
lxc_error
(
"%s
\n
"
,
"lxc.tty"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.devttydir */
/* lxc.devttydir */
if
(
set_
clear_save_and_load
(
c
,
"lxc.devttydir"
,
"not-dev"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.devttydir"
,
"not-dev"
,
tmpf
,
true
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.devttydir"
);
lxc_error
(
"%s
\n
"
,
"lxc.devttydir"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.kmsg */
/* lxc.kmsg */
if
(
set_
clear_save_and_load
(
c
,
"lxc.kmsg"
,
"1"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.kmsg"
,
"1"
,
tmpf
,
true
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.kmsg"
);
lxc_error
(
"%s
\n
"
,
"lxc.kmsg"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.aa_profile */
/* lxc.aa_profile */
if
(
set_
clear_save_and_load
(
c
,
"lxc.aa_profile"
,
"unconfined"
,
tmpf
)
<
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.aa_profile"
,
"unconfined"
,
tmpf
,
true
)
<
0
)
{
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.aa_profile"
);
lxc_error
(
"%s
\n
"
,
"lxc.aa_profile"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.aa_allow_incomplete */
/* lxc.aa_allow_incomplete */
if
(
set_
clear_save_and_load
(
c
,
"lxc.aa_allow_incomplete"
,
"1"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.aa_allow_incomplete"
,
"1"
,
tmpf
,
true
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.aa_allow_incomplete"
);
lxc_error
(
"%s
\n
"
,
"lxc.aa_allow_incomplete"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.cgroup.cpuset.cpus */
/* lxc.cgroup.cpuset.cpus */
if
(
set_clear_save_and_load
(
c
,
"lxc.cgroup.cpuset.cpus"
,
"1-100"
,
if
(
set_get_compare_clear_save_load
(
c
,
"lxc.cgroup.cpuset.cpus"
,
"1-100"
,
tmpf
,
false
)
<
0
)
{
tmpf
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.cgroup.cpuset.cpus"
);
lxc_error
(
"%s
\n
"
,
"lxc.cgroup.cpuset.cpus"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
...
@@ -192,8 +202,8 @@ int main(int argc, char *argv[])
...
@@ -192,8 +202,8 @@ int main(int argc, char *argv[])
* chown the container's directory but we haven't created an on-disk
* chown the container's directory but we haven't created an on-disk
* container. So let's test set-get-clear.
* container. So let's test set-get-clear.
*/
*/
if
(
set_
clear_save_and
_load
(
c
,
"lxc.id_map"
,
"u 0 100000 1000000000"
,
if
(
set_
get_compare_clear_save
_load
(
c
,
"lxc.id_map"
,
"u 0 100000 1000000000"
,
NULL
)
<
0
)
{
NULL
,
false
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.id_map"
);
lxc_error
(
"%s
\n
"
,
"lxc.id_map"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
...
@@ -219,238 +229,244 @@ int main(int argc, char *argv[])
...
@@ -219,238 +229,244 @@ int main(int argc, char *argv[])
c
->
lxc_conf
=
NULL
;
c
->
lxc_conf
=
NULL
;
/* lxc.loglevel */
/* lxc.loglevel */
if
(
set_
clear_save_and_load
(
c
,
"lxc.loglevel"
,
"debug"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.loglevel"
,
"DEBUG"
,
tmpf
,
true
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.loglevel"
);
lxc_error
(
"%s
\n
"
,
"lxc.loglevel"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.logfile */
/* lxc.logfile */
if
(
set_
clear_save_and_load
(
c
,
"lxc.logfile"
,
"/some/path"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.logfile"
,
"/some/path"
,
tmpf
,
true
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.logfile"
);
lxc_error
(
"%s
\n
"
,
"lxc.logfile"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.mount */
/* lxc.mount */
if
(
set_
clear_save_and_load
(
c
,
"lxc.mount"
,
"/some/path"
,
NULL
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.mount"
,
"/some/path"
,
NULL
,
true
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.mount"
);
lxc_error
(
"%s
\n
"
,
"lxc.mount"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.mount.auto */
/* lxc.mount.auto
if
(
set_clear_save_and_load
(
c
,
"lxc.mount.auto"
,
"proc:rw sys:rw cgroup-full:rw"
,
tmpf
)
<
0
)
{
* Note that we cannot compare the values since the getter for
* lxc.mount.auto does not preserve ordering.
*/
if
(
set_get_compare_clear_save_load
(
c
,
"lxc.mount.auto"
,
"proc:rw sys:rw cgroup-full:rw"
,
tmpf
,
false
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.mount.auto"
);
lxc_error
(
"%s
\n
"
,
"lxc.mount.auto"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.mount.entry */
/* lxc.mount.entry
if
(
set_clear_save_and_load
(
* Note that we cannot compare the values since the getter for
* lxc.mount.entry appends newlines.
*/
if
(
set_get_compare_clear_save_load
(
c
,
"lxc.mount.entry"
,
c
,
"lxc.mount.entry"
,
"/dev/dri dev/dri none bind,optional,create=dir"
,
tmpf
)
<
0
)
{
"/dev/dri dev/dri none bind,optional,create=dir"
,
tmpf
,
false
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.mount.entry"
);
lxc_error
(
"%s
\n
"
,
"lxc.mount.entry"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.rootfs */
/* lxc.rootfs */
if
(
set_
clear_save_and_load
(
c
,
"lxc.rootfs"
,
"/some/path"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.rootfs"
,
"/some/path"
,
tmpf
,
true
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.rootfs"
);
lxc_error
(
"%s
\n
"
,
"lxc.rootfs"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.rootfs.mount */
/* lxc.rootfs.mount */
if
(
set_
clear_save_and_load
(
c
,
"lxc.rootfs.mount"
,
"/some/path"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.rootfs.mount"
,
"/some/path"
,
tmpf
,
true
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.rootfs.mount"
);
lxc_error
(
"%s
\n
"
,
"lxc.rootfs.mount"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.rootfs.options */
/* lxc.rootfs.options */
if
(
set_
clear_save_and_load
(
c
,
"lxc.rootfs.options"
,
"ext4,discard"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.rootfs.options"
,
"ext4,discard"
,
tmpf
,
true
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.rootfs.options"
);
lxc_error
(
"%s
\n
"
,
"lxc.rootfs.options"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.rootfs.backend */
/* lxc.rootfs.backend */
if
(
set_
clear_save_and_load
(
c
,
"lxc.rootfs.backend"
,
"btrfs"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.rootfs.backend"
,
"btrfs"
,
tmpf
,
true
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.rootfs.backend"
);
lxc_error
(
"%s
\n
"
,
"lxc.rootfs.backend"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.utsname */
/* lxc.utsname */
if
(
set_
clear_save_and_load
(
c
,
"lxc.utsname"
,
"the-shire"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.utsname"
,
"the-shire"
,
tmpf
,
true
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.utsname"
);
lxc_error
(
"%s
\n
"
,
"lxc.utsname"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.hook.pre-start */
/* lxc.hook.pre-start */
if
(
set_
clear_save_and_load
(
c
,
"lxc.hook.pre-start"
,
"/some/pre-start"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.hook.pre-start"
,
"/some/pre-start"
,
tmpf
,
false
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.hook.pre-start"
);
lxc_error
(
"%s
\n
"
,
"lxc.hook.pre-start"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.hook.pre-mount */
/* lxc.hook.pre-mount */
if
(
set_
clear_save_and_load
(
c
,
"lxc.hook.pre-mount"
,
"/some/pre-mount"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.hook.pre-mount"
,
"/some/pre-mount"
,
tmpf
,
false
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.hook.pre-mount"
);
lxc_error
(
"%s
\n
"
,
"lxc.hook.pre-mount"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.hook.mount */
/* lxc.hook.mount */
if
(
set_
clear_save_and_load
(
c
,
"lxc.hook.mount"
,
"/some/mount"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.hook.mount"
,
"/some/mount"
,
tmpf
,
false
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.hook.mount"
);
lxc_error
(
"%s
\n
"
,
"lxc.hook.mount"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.hook.autodev */
/* lxc.hook.autodev */
if
(
set_
clear_save_and_load
(
c
,
"lxc.hook.autodev"
,
"/some/autodev"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.hook.autodev"
,
"/some/autodev"
,
tmpf
,
false
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.hook.autodev"
);
lxc_error
(
"%s
\n
"
,
"lxc.hook.autodev"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.hook.start */
/* lxc.hook.start */
if
(
set_
clear_save_and_load
(
c
,
"lxc.hook.start"
,
"/some/start"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.hook.start"
,
"/some/start"
,
tmpf
,
false
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.hook.start"
);
lxc_error
(
"%s
\n
"
,
"lxc.hook.start"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.hook.stop */
/* lxc.hook.stop */
if
(
set_
clear_save_and_load
(
c
,
"lxc.hook.stop"
,
"/some/stop"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.hook.stop"
,
"/some/stop"
,
tmpf
,
false
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.hook.stop"
);
lxc_error
(
"%s
\n
"
,
"lxc.hook.stop"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.hook.post-stop */
/* lxc.hook.post-stop */
if
(
set_
clear_save_and_load
(
c
,
"lxc.hook.post-stop"
,
"/some/post-stop"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.hook.post-stop"
,
"/some/post-stop"
,
tmpf
,
false
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.hook.post-stop"
);
lxc_error
(
"%s
\n
"
,
"lxc.hook.post-stop"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.hook.clone */
/* lxc.hook.clone */
if
(
set_
clear_save_and_load
(
c
,
"lxc.hook.clone"
,
"/some/clone"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.hook.clone"
,
"/some/clone"
,
tmpf
,
false
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.hook.clone"
);
lxc_error
(
"%s
\n
"
,
"lxc.hook.clone"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.hook.destroy */
/* lxc.hook.destroy */
if
(
set_
clear_save_and_load
(
c
,
"lxc.hook.destroy"
,
"/some/destroy"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.hook.destroy"
,
"/some/destroy"
,
tmpf
,
false
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.hook.destroy"
);
lxc_error
(
"%s
\n
"
,
"lxc.hook.destroy"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.cap.drop */
/* lxc.cap.drop */
if
(
set_
clear_save_and_load
(
c
,
"lxc.cap.drop"
,
"sys_module mknod setuid net_raw"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.cap.drop"
,
"sys_module mknod setuid net_raw"
,
tmpf
,
false
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.cap.drop"
);
lxc_error
(
"%s
\n
"
,
"lxc.cap.drop"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.cap.keep */
/* lxc.cap.keep */
if
(
set_
clear_save_and_load
(
c
,
"lxc.cap.keep"
,
"sys_module mknod setuid net_raw"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.cap.keep"
,
"sys_module mknod setuid net_raw"
,
tmpf
,
false
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.cap.keep"
);
lxc_error
(
"%s
\n
"
,
"lxc.cap.keep"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.console */
/* lxc.console */
if
(
set_
clear_save_and_load
(
c
,
"lxc.console"
,
"none"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.console"
,
"none"
,
tmpf
,
true
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.console"
);
lxc_error
(
"%s
\n
"
,
"lxc.console"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.console.logfile */
/* lxc.console.logfile */
if
(
set_
clear_save_and_load
(
c
,
"lxc.console.logfile"
,
"/some/logfile"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.console.logfile"
,
"/some/logfile"
,
tmpf
,
true
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.console.logfile"
);
lxc_error
(
"%s
\n
"
,
"lxc.console.logfile"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.seccomp */
/* lxc.seccomp */
if
(
set_
clear_save_and_load
(
c
,
"lxc.seccomp"
,
"/some/seccomp/file"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.seccomp"
,
"/some/seccomp/file"
,
tmpf
,
true
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.seccomp"
);
lxc_error
(
"%s
\n
"
,
"lxc.seccomp"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.autodev */
/* lxc.autodev */
if
(
set_
clear_save_and_load
(
c
,
"lxc.autodev"
,
"1"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.autodev"
,
"1"
,
tmpf
,
true
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.autodev"
);
lxc_error
(
"%s
\n
"
,
"lxc.autodev"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.haltsignal */
/* lxc.haltsignal */
if
(
set_
clear_save_and_load
(
c
,
"lxc.haltsignal"
,
"1"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.haltsignal"
,
"1"
,
tmpf
,
true
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.haltsignal"
);
lxc_error
(
"%s
\n
"
,
"lxc.haltsignal"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.rebootsignal */
/* lxc.rebootsignal */
if
(
set_
clear_save_and_load
(
c
,
"lxc.rebootsignal"
,
"1"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.rebootsignal"
,
"1"
,
tmpf
,
true
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.rebootsignal"
);
lxc_error
(
"%s
\n
"
,
"lxc.rebootsignal"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.stopsignal */
/* lxc.stopsignal */
if
(
set_
clear_save_and_load
(
c
,
"lxc.stopsignal"
,
"1"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.stopsignal"
,
"1"
,
tmpf
,
true
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.stopsignal"
);
lxc_error
(
"%s
\n
"
,
"lxc.stopsignal"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.start.auto */
/* lxc.start.auto */
if
(
set_
clear_save_and_load
(
c
,
"lxc.start.auto"
,
"1"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.start.auto"
,
"1"
,
tmpf
,
true
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.start.auto"
);
lxc_error
(
"%s
\n
"
,
"lxc.start.auto"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.start.delay */
/* lxc.start.delay */
if
(
set_
clear_save_and_load
(
c
,
"lxc.start.delay"
,
"5"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.start.delay"
,
"5"
,
tmpf
,
true
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.start.delay"
);
lxc_error
(
"%s
\n
"
,
"lxc.start.delay"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.start.order */
/* lxc.start.order */
if
(
set_
clear_save_and_load
(
c
,
"lxc.start.order"
,
"1"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.start.order"
,
"1"
,
tmpf
,
true
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.start.order"
);
lxc_error
(
"%s
\n
"
,
"lxc.start.order"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.utsname */
/* lxc.utsname */
if
(
set_
clear_save_and_load
(
c
,
"lxc.utsname"
,
"get-schwifty"
,
tmpf
)
<
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.utsname"
,
"get-schwifty"
,
tmpf
,
true
)
<
0
)
{
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.utsname"
);
lxc_error
(
"%s
\n
"
,
"lxc.utsname"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.monitor.unshare */
/* lxc.monitor.unshare */
if
(
set_
clear_save_and_load
(
c
,
"lxc.monitor.unshare"
,
"1"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.monitor.unshare"
,
"1"
,
tmpf
,
true
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.monitor.unshare"
);
lxc_error
(
"%s
\n
"
,
"lxc.monitor.unshare"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.group */
/* lxc.group */
if
(
set_
clear_save_and_load
(
c
,
"lxc.group"
,
"some,container,groups"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.group"
,
"some,container,groups"
,
tmpf
,
false
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.group"
);
lxc_error
(
"%s
\n
"
,
"lxc.group"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.environment */
/* lxc.environment */
if
(
set_
clear_save_and_load
(
c
,
"lxc.environment"
,
"FOO=BAR"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.environment"
,
"FOO=BAR"
,
tmpf
,
false
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.environment"
);
lxc_error
(
"%s
\n
"
,
"lxc.environment"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.init_cmd */
/* lxc.init_cmd */
if
(
set_
clear_save_and_load
(
c
,
"lxc.init_cmd"
,
"/bin/bash"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.init_cmd"
,
"/bin/bash"
,
tmpf
,
true
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.init_cmd"
);
lxc_error
(
"%s
\n
"
,
"lxc.init_cmd"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.init_uid */
/* lxc.init_uid */
if
(
set_
clear_save_and_load
(
c
,
"lxc.init_uid"
,
"1000"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.init_uid"
,
"1000"
,
tmpf
,
true
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.init_uid"
);
lxc_error
(
"%s
\n
"
,
"lxc.init_uid"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.init_gid */
/* lxc.init_gid */
if
(
set_
clear_save_and_load
(
c
,
"lxc.init_gid"
,
"1000"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.init_gid"
,
"1000"
,
tmpf
,
true
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.init_gid"
);
lxc_error
(
"%s
\n
"
,
"lxc.init_gid"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
/* lxc.ephemeral */
/* lxc.ephemeral */
if
(
set_
clear_save_and_load
(
c
,
"lxc.ephemeral"
,
"1"
,
tmpf
)
<
0
)
{
if
(
set_
get_compare_clear_save_load
(
c
,
"lxc.ephemeral"
,
"1"
,
tmpf
,
true
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.ephemeral"
);
lxc_error
(
"%s
\n
"
,
"lxc.ephemeral"
);
goto
non_test_error
;
goto
non_test_error
;
}
}
...
...
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