]> git.proxmox.com Git - mirror_lxc.git/blame - src/tests/basic.c
Replace 'which' with 'command -v' in tests too
[mirror_lxc.git] / src / tests / basic.c
CommitLineData
c8208ff0
CB
1/* liblxcapi
2 *
3 * Copyright © 2018 Christian Brauner <christian.brauner@ubuntu.com>.
4 * Copyright © 2018 Canonical Ltd.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2, as
8 * published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20#include <stdio.h>
21#include <stdlib.h>
22
23#include <lxc/lxccontainer.h>
24
25#include "lxctest.h"
26
27int main(int argc, char *argv[])
28{
29 int ret;
30 struct lxc_container *c;
31
32 c = lxc_container_new("init-pid", NULL);
33 if (!c)
34 exit(EXIT_FAILURE);
35
36 ret = c->init_pid(c);
37 c->destroy(c);
38 lxc_container_put(c);
39 /* Return value needs to be -1. Any other negative error code is to be
40 * considered invalid.
41 */
42 if (ret != -1)
43 exit(EXIT_FAILURE);
44
45 exit(EXIT_SUCCESS);
46}