From: Serge Hallyn Date: Wed, 12 Mar 2014 23:48:15 +0000 (-0500) Subject: lxc: tests: use busybox template rather than ubuntu X-Git-Tag: lxc-1.1.0.alpha1~212 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=787c3ebec62eae66ad0441710ee46c8d355bfcfd;p=thirdparty%2Flxc.git lxc: tests: use busybox template rather than ubuntu to speed up tests where it doesn't matter Signed-off-by: Serge Hallyn Acked-by: Stéphane Graber --- diff --git a/src/tests/clonetest.c b/src/tests/clonetest.c index efd673eb1..814706d27 100644 --- a/src/tests/clonetest.c +++ b/src/tests/clonetest.c @@ -53,7 +53,7 @@ int main(int argc, char *argv[]) goto out; } c->save_config(c, NULL); - if (!c->createl(c, "ubuntu", NULL, NULL, 0, NULL)) { + if (!c->createl(c, "busybox", NULL, NULL, 0, NULL)) { fprintf(stderr, "%d: failed to create a container\n", __LINE__); goto out; } diff --git a/src/tests/createtest.c b/src/tests/createtest.c index 597dff5ab..955a85134 100644 --- a/src/tests/createtest.c +++ b/src/tests/createtest.c @@ -50,7 +50,7 @@ int main(int argc, char *argv[]) } c->set_config_item(c, "lxc.network.link", "lxcbr0"); c->set_config_item(c, "lxc.network.flags", "up"); - if (!c->createl(c, "ubuntu", NULL, NULL, 0, "-r", "trusty", NULL)) { + if (!c->createl(c, "busybox", NULL, NULL, 0, NULL)) { fprintf(stderr, "%d: failed to create a trusty container\n", __LINE__); goto out; } diff --git a/src/tests/destroytest.c b/src/tests/destroytest.c index 4d051192c..4bb6aaead 100644 --- a/src/tests/destroytest.c +++ b/src/tests/destroytest.c @@ -28,7 +28,7 @@ #define MYNAME "lxctest1" -static int create_ubuntu(void) +static int create_container(void) { int status, ret; pid_t pid = fork(); @@ -38,7 +38,7 @@ static int create_ubuntu(void) return -1; } if (pid == 0) { - ret = execlp("lxc-create", "lxc-create", "-t", "ubuntu", "-n", MYNAME, NULL); + ret = execlp("lxc-create", "lxc-create", "-t", "busybox", "-n", MYNAME, NULL); // Should not return perror("execl"); exit(1); @@ -76,8 +76,8 @@ int main(int argc, char *argv[]) goto out; } - if (create_ubuntu()) { - fprintf(stderr, "%d: failed to create a ubuntu container\n", __LINE__); + if (create_container()) { + fprintf(stderr, "%d: failed to create a container\n", __LINE__); goto out; } diff --git a/src/tests/get_item.c b/src/tests/get_item.c index 518dbd19c..d9c5aef57 100644 --- a/src/tests/get_item.c +++ b/src/tests/get_item.c @@ -171,7 +171,7 @@ int main(int argc, char *argv[]) ret = 1; goto out; } - if (!c->createl(c, "ubuntu", NULL, NULL, 0, "-r", "trusty", NULL)) { + if (!c->createl(c, "busybox", NULL, NULL, 0, NULL)) { fprintf(stderr, "%d: failed to create a trusty container\n", __LINE__); ret = 1; goto out; diff --git a/src/tests/saveconfig.c b/src/tests/saveconfig.c index e87c74d97..de2fa82b6 100644 --- a/src/tests/saveconfig.c +++ b/src/tests/saveconfig.c @@ -28,7 +28,7 @@ #define MYNAME "lxctest1" -static int create_ubuntu(void) +static int create_container(void) { int status, ret; pid_t pid = fork(); @@ -38,7 +38,7 @@ static int create_ubuntu(void) return -1; } if (pid == 0) { - ret = execlp("lxc-create", "lxc-create", "-t", "ubuntu", "-n", MYNAME, NULL); + ret = execlp("lxc-create", "lxc-create", "-t", "busybox", "-n", MYNAME, NULL); // Should not return perror("execl"); exit(1); @@ -76,8 +76,8 @@ int main(int argc, char *argv[]) goto out; } - if (create_ubuntu()) { - fprintf(stderr, "%d: failed to create a ubuntu container\n", __LINE__); + if (create_container()) { + fprintf(stderr, "%d: failed to create a container\n", __LINE__); goto out; } diff --git a/src/tests/shutdowntest.c b/src/tests/shutdowntest.c index 53fe8c6e6..2450221ff 100644 --- a/src/tests/shutdowntest.c +++ b/src/tests/shutdowntest.c @@ -51,8 +51,8 @@ int main(int argc, char *argv[]) } c->set_config_item(c, "lxc.network.link", "lxcbr0"); c->set_config_item(c, "lxc.network.flags", "up"); - if (!c->createl(c, "ubuntu", NULL, NULL, 0, "-r", "trusty", NULL)) { - fprintf(stderr, "%d: failed to create a trusty container\n", __LINE__); + if (!c->createl(c, "busybox", NULL, NULL, 0, NULL)) { + fprintf(stderr, "%d: failed to create a container\n", __LINE__); goto out; } diff --git a/src/tests/startone.c b/src/tests/startone.c index b46fc9828..d2879f624 100644 --- a/src/tests/startone.c +++ b/src/tests/startone.c @@ -29,7 +29,7 @@ #define MYNAME "lxctest1" -static int destroy_ubuntu(void) +static int destroy_container(void) { int status, ret; pid_t pid = fork(); @@ -61,7 +61,7 @@ again: return WEXITSTATUS(status); } -static int create_ubuntu(void) +static int create_container(void) { int status, ret; pid_t pid = fork(); @@ -71,7 +71,7 @@ static int create_ubuntu(void) return -1; } if (pid == 0) { - ret = execlp("lxc-create", "lxc-create", "-t", "ubuntu", "-n", MYNAME, NULL); + ret = execlp("lxc-create", "lxc-create", "-t", "busybox", "-n", MYNAME, NULL); // Should not return perror("execl"); exit(1); @@ -116,9 +116,9 @@ int main(int argc, char *argv[]) goto out; } - ret = create_ubuntu(); + ret = create_container(); if (ret) { - fprintf(stderr, "%d: failed to create a ubuntu container\n", __LINE__); + fprintf(stderr, "%d: failed to create a container\n", __LINE__); goto out; } @@ -251,7 +251,7 @@ ok: out: if (c) { c->stop(c); - destroy_ubuntu(); + destroy_container(); } lxc_container_put(c); exit(ret);