1 |
#!/usr/bin/perl |
2 |
use warnings; |
3 |
use strict; |
4 |
|
5 |
use Test::More tests => 7; |
6 |
use blib; |
7 |
|
8 |
my $debug = shift @ARGV; |
9 |
|
10 |
BEGIN { |
11 |
use_ok('VZ'); |
12 |
} |
13 |
|
14 |
is_deeply( hostname2ip('localhost'), '127.0.0.1', 'hostname2ip' ); |
15 |
|
16 |
is_deeply( ip2hostname('127.0.0.1'), 'localhost', 'ip2hostname' ); |
17 |
|
18 |
ok(conf_veids(), 'conf_veids'); |
19 |
|
20 |
|
21 |
SKIP: { |
22 |
|
23 |
skip( 'need root', 3 ) unless $> == 0; |
24 |
|
25 |
ok(my $text = vzlist(), 'vzlist'); |
26 |
diag $text if $debug; |
27 |
|
28 |
ok(my $hash = vzlist( hash => 1 ), 'vzlist( hash => 1 )'); |
29 |
diag dump($hash) if $debug; |
30 |
|
31 |
isa_ok($hash, 'HASH'); |
32 |
|
33 |
} |