root/test/t/106_stratcon_ip.t

Revision 4157a34c3d13eb5c24a6f212ff058080a60a4ee5, 0.6 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 8 years ago)

closes #226

  • Property mode set to 100644
Line 
1 use Test::More tests => 6;
2 use XML::LibXML;
3 use XML::LibXML::XPathContext;
4 use testconfig;
5 use apiclient;
6
7 use strict;
8 my $xp = XML::LibXML->new();
9 my $xpc = XML::LibXML::XPathContext->new();
10 my $doc;
11
12 ok(start_stratcon("106"), 'starting stratcon');
13 sleep(1);
14
15 my $conn = pg('reconnoiter','reconnoiter');
16 ok($conn, 'connected to db');
17 my $s = $conn->prepare("select remote_address from stratcon.current_node_config");
18 ok($s, 'prepared test query');
19 ok($s->execute(), 'executed test query');
20 my ($ip) = $s->fetchrow();
21 like($ip, qr/^(?:\d+\.){3}\d+$/, 'is an ip');
22 isn't($ip, "0.0.0.0", 'is not 0.0.0.0');
23 undef $conn;
24
25 1;
Note: See TracBrowser for help on using the browser.