File: test_oop.pl

package info (click to toggle)
lxctl 0.3.1%2Bdebian-2
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 388 kB
  • sloc: perl: 2,656; makefile: 35
file content (47 lines) | stat: -rwxr-xr-x 1,035 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/perl
use Lxc::object;
use Test::More tests => 6;

my $lxc = new Lxc::object;

my $tmp = $lxc->check();

my $tmp2 = $lxc->get_vg();

$lxc->set_vg("TEMP!");

$tmp = $lxc->get_vg();

$lxc->set_vg($tmp2);

eval {
	$tmp = $lxc->get_conf("testvm", "lxc.rootfs");
} or do {
	print "Can't run, testvm is not avaliable\n";
};

ok(defined($lxc->get_config_path()), "Should be defined");
ok(defined($lxc->get_roots_path()), "Should be defined");
ok(defined($lxc->get_template_path()), "Should be defined");
ok(defined($lxc->get_lxc_conf_dir()), "Should be defined");
ok(defined($lxc->get_cgroup_path()), "Should be defined");
ok(defined($lxc->get_vg()), "Should be defined");

$tmp = $lxc->get_config_path();
print "CONFIG_PATH: $tmp\n";

$tmp = $lxc->get_roots_path();
print "ROOTS_PATH: $tmp\n";

$tmp = $lxc->get_template_path();
print "TEMPLATE_PATH: $tmp\n";

$tmp = $lxc->get_lxc_conf_dir();
print "LXC_CONF_DIR: $tmp\n";

$tmp = $lxc->get_cgroup_path();
print "CGROUP_PATH: $tmp\n";

$tmp = $lxc->get_vg();
print "VG: $tmp\n";