cgpath.c revision 481624b37b37ffa98b735cf3f94e35d1fbd729e0
/* liblxcapi
*
* Copyright � 2012 Serge Hallyn <serge.hallyn@ubuntu.com>.
* Copyright � 2012 Canonical Ltd.
*
* it under the terms of the GNU General Public License version 2, as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "../lxc/lxccontainer.h"
#include <unistd.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include "../lxc/commands.h"
#define MYNAME "lxctest1"
#define MYNAME2 "lxctest2"
#define TSTERR(x) do { \
} while (0)
int main()
{
char *path;
int len;
/* won't require privilege necessarily once users are classified by
* pam_cgroup */
if (geteuid() != 0) {
TSTERR("requires privilege");
exit(0);
}
printf("Basic cgroup path tests...\n");
TSTERR("zero result from lxc_cgroup_path_create");
exit(1);
}
TSTERR("lxc_cgroup_path_create NULL lxctest1");
exit(1);
}
TSTERR("zero result from lxc_cgroup_path_create");
exit(1);
}
TSTERR("lxc_cgroup_path_create ab lxctest1");
exit(1);
}
printf("... passed\n");
printf("Container creation tests...\n");
TSTERR("instantiating first container");
exit(1);
}
if (c->is_defined(c)) {
c->stop(c);
c->destroy(c);
}
TSTERR("creating first container");
goto out;
}
c->load_config(c, NULL);
c->want_daemonize(c);
TSTERR("starting first container");
goto out;
}
printf("first container passed. Now two containers...\n");
char *nsgroup;
TSTERR("getting first cgroup path from lxc_command");
goto out;
}
/* start second container */
TSTERR("instantiating second container");
goto out;
}
}
TSTERR("creating second container");
goto out;
}
TSTERR("starting second container");
goto out;
}
TSTERR("getting second cgroup path from lxc_command");
goto out;
}
if (!dirpath) {
TSTERR("getting second container's cgpath");
goto out;
}
TSTERR("getting nrtasks");
goto out;
}
printf("...passed\n");
retv = 0;
out:
if (dirpath)
if (c2) {
}
if (c) {
c->stop(c);
c->destroy(c);
}
return retv;
}