Agent-TCLI
view release on metacpan or search on metacpan
t/TCLI.Control.Interactive.t view on Meta::CPAN
#!/usr/bin/env perl
# $Id: TCLI.Control.Interactive.t 62 2007-05-03 15:55:17Z hacker $
use warnings;
use strict;
use Test::More tests => 49;
#use Test::More qw(no_plan);
# TASK Test suite is not complete. Need more testing for catching errors.
use Getopt::Lucid qw(:all);
sub VERBOSE () { 0 }
my ($opt, $verbose, $poe_td, $poe_te);
eval {$opt = Getopt::Lucid->getopt([
Counter("poe_debug|d"),
Counter("poe_event|e"),
Counter("verbose|v"),
Switch("blib|b"),
])};
if($@) {die "ERROR: $@";}
if ($opt->get_blib)
{
use lib 'blib/lib';
}
$verbose = $opt->get_verbose ? $opt->get_verbose : VERBOSE;
# xmpp username/password to log in with
$poe_td = $opt->get_poe_debug;
$poe_te = $opt->get_poe_event;
sub POE::Kernel::TRACE_DEFAULT () { $poe_td }
sub POE::Kernel::TRACE_EVENTS () { $poe_te }
use Agent::TCLI::Transport::Test;
use Agent::TCLI::Testee;
use POE;
BEGIN {
use_ok('Agent::TCLI::Control');
use_ok('Agent::TCLI::Command');
use_ok('Agent::TCLI::User');
}
sub Init {
my @obj_cmds = (
Agent::TCLI::Command->new(
'name' => 'meganat',
'contexts' => {'ROOT' => 'meganat'},
'help' => 'sets up outbound NAT table from a predefined address block',
'usage' => 'meganat add target=target.example.com',
'topic' => 'attack prep',
'call_style'=> 'session',
'command' => 'tcli-pf',
'handler' => 'establish_context',
),
Agent::TCLI::Command->new(
'name' => 'noreset',
'contexts' => {'ROOT' => 'noreset'},
'help' => 'sets up outbound filters to block TCP RESETS to target',
'usage' => 'noreset add target=target.example.com',
'topic' => 'attack prep',
'call_style'=> 'session',
'command' => 'tcli-pf',
( run in 0.574 second using v1.01-cache-2.11-cpan-39bf76dae61 )