]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
tests: Fix startone
authorStéphane Graber <stgraber@ubuntu.com>
Fri, 24 Jan 2014 20:51:27 +0000 (15:51 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Fri, 24 Jan 2014 20:56:32 +0000 (15:56 -0500)
 - Fix cgroup test to work on multi-core systems
 - Drop user interaction

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
src/tests/startone.c

index aa607c7f197305f4755a470ad86e992d435c4557..b46fc982894f9d9d67a1dac730e5209067271064 100644 (file)
@@ -158,12 +158,6 @@ int main(int argc, char *argv[])
                goto out;
        }
 
-       printf("hit return to start container");
-       char mychar;
-       ret = scanf("%c", &mychar);
-       if (ret < 0)
-               goto out;
-
        if (!lxc_container_get(c)) {
                fprintf(stderr, "%d: failed to get extra ref to container\n", __LINE__);
                exit(1);
@@ -196,7 +190,7 @@ int main(int argc, char *argv[])
        }
 
        len = c->get_cgroup_item(c, "cpuset.cpus", buf, 200);
-       if (len <= 0 || strcmp(buf, "0\n")) {
+       if (len <= 0 || strncmp(buf, "0", 1)) {
                fprintf(stderr, "%d: not able to get cpuset.cpus (len %d buf %s)\n", __LINE__, len, buf);
                goto out;
        }
@@ -217,10 +211,6 @@ int main(int argc, char *argv[])
 
        c->set_cgroup_item(c, "freezer.state", "THAWED");
 
-       printf("hit return to finish");
-       ret = scanf("%c", &mychar);
-       if (ret < 0)
-               goto out;
        c->stop(c);
 
     /* feh - multilib has moved the lxc-init crap */