]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
tests: Avoid the download template when possible
authorStéphane Graber <stgraber@ubuntu.com>
Fri, 13 Jun 2014 21:45:26 +0000 (17:45 -0400)
committerStéphane Graber <stgraber@ubuntu.com>
Sat, 14 Jun 2014 19:51:00 +0000 (15:51 -0400)
The use of the download template with an hardcoded --arch=amd64 in aa.c
was causing test failures on any platform incapable of running amd64
binaries.

This wasn't noticed in the CI environment as we run the tests within
containers on an amd64 kernel but this caused failures on the Ubuntu CI
environment.

Instead, let's use the busybox template, tweaking the configuration when
needed to match the needs of the testcase.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
src/tests/aa.c

index a8ff691b98061d15b02113f8cbbd0744f82ac015..2be472d251c6cdbbf72fce6e34b6c3d71cabef56 100644 (file)
@@ -164,10 +164,16 @@ int main(int argc, char *argv[])
                goto err;
        }
        c->save_config(c, NULL);
-       if (!c->createl(c, "download", NULL, NULL, 0, "-d", "ubuntu", "-r", "trusty", "-a", "amd64", NULL)) {
+       if (!c->createl(c, "busybox", NULL, NULL, 0, NULL)) {
                fprintf(stderr, "%s: %d: failed to create container\n", __FILE__, __LINE__);
                goto err;
        }
+
+       c->clear_config_item(c, "lxc.mount.auto");
+       c->set_config_item(c, "lxc.mount.entry", "proc proc proc");
+       c->set_config_item(c, "lxc.mount.entry", "sysfs sys sysfs");
+       c->save_config(c, NULL);
+
        c->want_daemonize(c, true);
        if (!c->startl(c, 0, NULL)) {
                fprintf(stderr, "Error starting container");