Changeset 3846
- Timestamp:
- 07/28/10 19:08:03 (2 years ago)
- Files:
-
- trunk/node/t/munin_node_proxyspooler.t (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/node/t/munin_node_proxyspooler.t
r3823 r3846 3 3 use strict; 4 4 5 use Test::More tests => 3 3;5 use Test::More tests => 32; 6 6 use Test::Differences; 7 7 use Test::Deep; … … 185 185 ### _get_service_list 186 186 SKIP: { 187 skip 'Set MUNIN_HOST and MUNIN_PORT environment variables to the hostname and port of a node to test against', 3 188 unless $host and $port; 189 190 my $spooler = Munin::Node::ProxySpooler->new( 191 host => $host, 192 port => $port, 193 ) or next; 194 195 $spooler->_open_node_connection; 196 197 my @nodes = $spooler->_get_node_list; 198 199 my @services = $spooler->_get_service_list($nodes[0]); 187 skip 'Set MUNIN_HOST and MUNIN_PORT environment variables to the hostname and port of a node to test against', 2 188 unless $host and $port; 189 190 my $spooler = Munin::Node::ProxySpooler->new( 191 host => $host, 192 port => $port, 193 ) or next; 194 195 $spooler->_open_node_connection; 196 197 my @services = $spooler->_get_service_list(); 200 198 ok(\@services, 'Got a list of services from the node') or next; 201 199 202 200 cmp_deeply(\@services, array_each(re('^[-\w.:]+$')), 'all the services look reasonable'); 203 204 ###############205 206 @services = $spooler->_get_service_list('fnord.example.com');207 is(scalar(@services), 0, 'No services for an unknown node') or next;208 201 } 209 202 … … 219 212 ) or next; 220 213 221 my $intervals = $spooler->_get_intervals or next;214 my $intervals = $spooler->_get_intervals() or next; 222 215 223 216 cmp_deeply([ keys %$intervals ], array_each(re('^[-\w.:]+$')), 'all the keys look like services'); … … 234 227 local *Munin::Node::ProxySpooler::_close_node_connection = sub {}; 235 228 236 local *Munin::Node::ProxySpooler::_get_node_list = sub { 'test.example.com' };237 229 local *Munin::Node::ProxySpooler::_get_service_list = sub { 'fnord' }; 238 230 use warnings;
