Commit e0182228 by Stéphane Graber

tests: apparmor: Always end with a newline

Some error messages in lxc-test-apparmor didn't end with a newline, leading to slightly difficult to read output. Signed-off-by: 's avatarStéphane Graber <stgraber@ubuntu.com> Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
parent cfaefa84
...@@ -69,7 +69,7 @@ static int do_test_file_open(struct lxc_container *c, char *fnam) ...@@ -69,7 +69,7 @@ static int do_test_file_open(struct lxc_container *c, char *fnam)
ret = pipe(pipefd); ret = pipe(pipefd);
if (ret < 0) { if (ret < 0) {
fprintf(stderr, "pipe failed %d", ret); fprintf(stderr, "pipe failed %d\n", ret);
return fret; return fret;
} }
attach_options.stdout_fd = pipefd[1]; attach_options.stdout_fd = pipefd[1];
...@@ -77,13 +77,13 @@ static int do_test_file_open(struct lxc_container *c, char *fnam) ...@@ -77,13 +77,13 @@ static int do_test_file_open(struct lxc_container *c, char *fnam)
attach_options.attach_flags |= LXC_ATTACH_LSM_NOW; attach_options.attach_flags |= LXC_ATTACH_LSM_NOW;
ret = c->attach(c, test_attach_write_file, fnam, &attach_options, &pid); ret = c->attach(c, test_attach_write_file, fnam, &attach_options, &pid);
if (ret < 0) { if (ret < 0) {
fprintf(stderr, "attach failed"); fprintf(stderr, "attach failed\n");
goto err1; goto err1;
} }
ret = read(pipefd[0], result, sizeof(result)-1); ret = read(pipefd[0], result, sizeof(result)-1);
if (ret < 0) { if (ret < 0) {
fprintf(stderr, "read failed %d", ret); fprintf(stderr, "read failed %d\n", ret);
goto err2; goto err2;
} }
...@@ -117,7 +117,7 @@ static bool test_aa_policy(struct lxc_container *c) ...@@ -117,7 +117,7 @@ static bool test_aa_policy(struct lxc_container *c)
for (i = 0; files_to_deny[i]; i++) { for (i = 0; files_to_deny[i]; i++) {
ret = do_test_file_open(c, files_to_deny[i]); ret = do_test_file_open(c, files_to_deny[i]);
if (ret < 0) { if (ret < 0) {
fprintf(stderr, "attach failed; skipping test"); fprintf(stderr, "attach failed; skipping test\n");
return true; return true;
} }
if (ret > 0) { if (ret > 0) {
...@@ -131,7 +131,7 @@ static bool test_aa_policy(struct lxc_container *c) ...@@ -131,7 +131,7 @@ static bool test_aa_policy(struct lxc_container *c)
for (i = 0; files_to_allow[i]; i++) { for (i = 0; files_to_allow[i]; i++) {
ret = do_test_file_open(c, files_to_allow[i]); ret = do_test_file_open(c, files_to_allow[i]);
if (ret < 0) { if (ret < 0) {
fprintf(stderr, "attach failed; skipping test"); fprintf(stderr, "attach failed; skipping test\n");
return true; return true;
} }
if (ret == 0) { if (ret == 0) {
...@@ -176,7 +176,7 @@ int main(int argc, char *argv[]) ...@@ -176,7 +176,7 @@ int main(int argc, char *argv[])
c->want_daemonize(c, true); c->want_daemonize(c, true);
if (!c->startl(c, 0, NULL)) { if (!c->startl(c, 0, NULL)) {
fprintf(stderr, "Error starting container"); fprintf(stderr, "Error starting container\n");
goto err; goto err;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment