apitest.lua revision f080ffd7d656fbd9505a8e8eb52a05d61355c677
3f98cdc011bb4e8cd22c088f288b0bcdb6452492Jakub Hrozek-- This library is free software; you can redistribute it and/or modify
3f98cdc011bb4e8cd22c088f288b0bcdb6452492Jakub Hrozek-- it under the terms of the GNU General Public License version 2, as
3f98cdc011bb4e8cd22c088f288b0bcdb6452492Jakub Hrozek-- This program is distributed in the hope that it will be useful,
3f98cdc011bb4e8cd22c088f288b0bcdb6452492Jakub Hrozek-- but WITHOUT ANY WARRANTY; without even the implied warranty of
3f98cdc011bb4e8cd22c088f288b0bcdb6452492Jakub Hrozek-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3f98cdc011bb4e8cd22c088f288b0bcdb6452492Jakub Hrozek-- You should have received a copy of the GNU General Public License along
3f98cdc011bb4e8cd22c088f288b0bcdb6452492Jakub Hrozek-- with this program; if not, write to the Free Software Foundation, Inc.,
3f98cdc011bb4e8cd22c088f288b0bcdb6452492Jakub Hrozek-- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
3f98cdc011bb4e8cd22c088f288b0bcdb6452492Jakub Hrozek local function wrapper(...) io.write(string.format(...)) end
f6171b2bc954a367f316853ab71090eb213bdee3Pavel Březina log(0, "%-20s %s", "LXC version:", lxc.version_get())
f6171b2bc954a367f316853ab71090eb213bdee3Pavel Březina log(0, "%-20s %s", "Container name:", optarg["n"])
c9aab1c04c399ca2d1abef74f6df22ced34983dcPavel Březina log(0, "%-20s %s", "Creating container:", "yes")
c9aab1c04c399ca2d1abef74f6df22ced34983dcPavel Březina log(0, "%-20s %s", "With template:", optarg["t"])
c9aab1c04c399ca2d1abef74f6df22ced34983dcPavel Březina log(0, "%-20s %s", "Containers path:", LXC_PATH)
b0fa48b0d612b46a86e45f8e4b5d9feae9784c2bSimo Sorce assert(container:config_file_name() == string.format("%s/%s/config", LXC_PATH, optarg["n"]))
b0fa48b0d612b46a86e45f8e4b5d9feae9784c2bSimo Sorce log(0, "%-20s %s", "Destroy existing container:", optarg["n"])
44749ce0c1fee9babee80060fa0db99eebb2ab51Pavel Březina local cfg_containers = lxc.containers_configured()
b0fa48b0d612b46a86e45f8e4b5d9feae9784c2bSimo Sorce log(0, "%-20s %s", "Use existing container:", optarg["n"])
9675bccabff4e79d224f64611ad9ff3e073b488eSimo Sorce log(0, "%-20s %s", "Creating rootfs using:", optarg["t"])
local now_running
local now_running
local now_running
if (should_find) then
local mntents
local keys
local netcfg