mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 04:59:14 -07:00
dev-perl/Net-Telnet-Cisco: Bump to version 1.110.0
- EAPI6 - Enable tests - Patch out interactive steps in tests - Add network-test plans Upstream: - Fix handling of warnings leading to crash - Override Net::Telnet::fhopen to do the right thing - Fix autopage handling in constructor - Fix bad splitting and useless modifier in split - Remove hard requirement of Term::ReadKey Package-Manager: Portage-2.3.18, Repoman-2.3.6
This commit is contained in:
@@ -1 +1,2 @@
|
||||
DIST Net-Telnet-Cisco-1.10.tar.gz 17579 BLAKE2B 0fd21fcb58d7d0b8474df3e04b28cc8e2ae978f1d02f2c050bc9974b39f1b531ff159f9282aec9d17ddae309ff902a0a5eeacdf9903acfd5ee503f803d9cdb00 SHA512 1fcae8e54425a2ddf2e32c772886af97d308421eb664abb296ec16e97531c2eb6727ea4607d48fa957e9a926dc5b88bfffdfa75da10793f4f0247fa3b1f45672
|
||||
DIST Net-Telnet-Cisco-1.11.tar.gz 19282 BLAKE2B 39925b96a8d709f58012c12ec368c48a54549a324ae0fbcdc4cf97daed034b6cb76639b3fda1c3b77824e5c702f6b8e5abc4093558888788ce6cac19342575c4 SHA512 b12da84517df470d40d56a54e8d8c7b331bed87c3c330da7fc1efb7d078805e6f7348f0b52971d3c1b4e3d39014d76bbe7535c40ad3afa7efcf567521ddf0c4b
|
||||
|
||||
31
dev-perl/Net-Telnet-Cisco/Net-Telnet-Cisco-1.110.0.ebuild
Normal file
31
dev-perl/Net-Telnet-Cisco/Net-Telnet-Cisco-1.110.0.ebuild
Normal file
@@ -0,0 +1,31 @@
|
||||
# Copyright 1999-2017 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=6
|
||||
|
||||
DIST_AUTHOR=VINSWORLD
|
||||
DIST_VERSION=1.11
|
||||
inherit perl-module
|
||||
|
||||
DESCRIPTION="Automate telnet sessions w/ routers&switches"
|
||||
|
||||
SLOT="0"
|
||||
KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
|
||||
IUSE="test"
|
||||
|
||||
RDEPEND=">=dev-perl/Net-Telnet-3.20.0"
|
||||
DEPEND="${RDEPEND}
|
||||
virtual/perl-ExtUtils-MakeMaker
|
||||
test? ( dev-perl/TermReadKey )
|
||||
"
|
||||
PATCHES=( "${FILESDIR}/${PN}-1.11-no-interactive-test.patch" )
|
||||
PERL_RM_FILES=( "t/02-pod-coverage.t" )
|
||||
|
||||
src_test() {
|
||||
if [[ -z $CISCO_TEST_ROUTER ]]; then
|
||||
elog "Comprehensive testing requires a configured, network accessible Cisco Router"
|
||||
elog "to test against. For details, see:"
|
||||
elog "https://wiki.gentoo.org/wiki/Project:Perl/maint-notes/${CATEGORY}/${PN}"
|
||||
fi
|
||||
perl-module_src_test
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
From 60d93af35887e53677be5a0f95591489c2683c73 Mon Sep 17 00:00:00 2001
|
||||
From: Kent Fredric <kentnl@gentoo.org>
|
||||
Date: Wed, 13 Dec 2017 18:42:56 +1300
|
||||
Subject: Remove test interactivity
|
||||
|
||||
Pass configuration by enviroment variables and don't prompt.
|
||||
---
|
||||
test.pl | 82 ++++++++++++++++-------------------------------------------------
|
||||
1 file changed, 20 insertions(+), 62 deletions(-)
|
||||
|
||||
diff --git a/test.pl b/test.pl
|
||||
index 369bc30..e9f7ae2 100644
|
||||
--- a/test.pl
|
||||
+++ b/test.pl
|
||||
@@ -5,14 +5,8 @@
|
||||
|
||||
use Test::More tests => 32;
|
||||
#use Test::More qw/no_plan/;
|
||||
-use ExtUtils::MakeMaker qw/prompt/;
|
||||
use Carp;
|
||||
use Cwd;
|
||||
-my $HAVE_Term_ReadKey = 0;
|
||||
-eval "use Term::ReadKey";
|
||||
-if(!$@) {
|
||||
- $HAVE_Term_ReadKey = 1
|
||||
-}
|
||||
|
||||
use vars qw/$ROUTER $PASSWD $LOGIN $S $EN_PASS $PASSCODE/;
|
||||
|
||||
@@ -161,18 +155,9 @@ END { cleanup() };
|
||||
|
||||
sub cleanup {
|
||||
return unless -f "input.log" || -f "dump.log";
|
||||
-
|
||||
- print <<EOB;
|
||||
-
|
||||
-Would you like to delete the test logs? They will contain
|
||||
-security info like your login and passwords. If you ran
|
||||
-into problems and wish to investigate, you can save them
|
||||
-and manually delete them later.
|
||||
-EOB
|
||||
-
|
||||
my $dir = cwd();
|
||||
|
||||
- my $ans = prompt("Delete logs", "y");
|
||||
+ my $ans = "y";
|
||||
if ($ans eq "y") {
|
||||
print "Deleting logs in $dir...";
|
||||
unlink "input.log" or warn "Can't delete input.log! $!";
|
||||
@@ -183,53 +168,26 @@ EOB
|
||||
}
|
||||
}
|
||||
|
||||
-sub get_login {
|
||||
- print <<EOB;
|
||||
-
|
||||
-Net::Telnet::Cisco needs to log into a router to
|
||||
-perform it\'s full suite of tests. To log in, we
|
||||
-need a test router, a login, a password, an
|
||||
-optional enable password, and an optional
|
||||
-SecurID/TACACS PASSCODE.
|
||||
-
|
||||
-To skip these tests, hit "return".
|
||||
-
|
||||
-EOB
|
||||
-
|
||||
- $ROUTER = prompt("Router:", $ROUTER) or return;
|
||||
- $LOGIN = prompt("Login:", $LOGIN) or return;
|
||||
- $PASSWD = passprompt("Password:", $PASSWD) or return;
|
||||
- $EN_PASS = passprompt("Enable password [optional]:", $EN_PASS);
|
||||
- $PASSCODE = passprompt("SecurID/TACACS PASSCODE [optional]:", $PASSCODE);
|
||||
+sub maskpass {
|
||||
+ return 'not set' unless defined $_[0];
|
||||
+ return ( '*' x ( length $_[0] ) ) . ' [masked]';
|
||||
}
|
||||
|
||||
+sub get_login {
|
||||
+ $ROUTER = $ENV{CISCO_TEST_ROUTER} or return;
|
||||
+ $LOGIN = $ENV{CISCO_TEST_LOGIN} or return;
|
||||
+ $PASSWD = $ENV{CISCO_TEST_PASSWORD} or return;
|
||||
+ $EN_PASS = $ENV{CISCO_TEST_ENABLE_PASSWORD};
|
||||
+ $PASSCODE = $ENV{CISCO_TEST_PASSCODE};
|
||||
+
|
||||
+ printf STDERR
|
||||
+ <<EOB, $ROUTER, $LOGIN, maskpass($PASSWD), maskpass($EN_PASS), maskpass($PASSCODE);
|
||||
+Using the following configuration for testing:
|
||||
+ Router: %s
|
||||
+ Login: %s
|
||||
+ Password: %s
|
||||
+ Enable Password: %s
|
||||
+ SecureID/TACACS PASSCODE: %s
|
||||
|
||||
-# Lifted from ExtUtils::MakeMaker.
|
||||
-#
|
||||
-# If the user has Term::ReadKey, we can hide any passwords
|
||||
-# they type from shoulder-surfing attacks.
|
||||
-#
|
||||
-# Args: "Question for user", "optional default answer"
|
||||
-sub passprompt ($;$) {
|
||||
- my($mess,$def)=@_;
|
||||
- $ISA_TTY = -t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT)) ; # Pipe?
|
||||
- Carp::confess("prompt function called without an argument") unless defined $mess;
|
||||
- my $dispdef = defined $def ? "[$def] " : " ";
|
||||
- $def = defined $def ? $def : "";
|
||||
- my $ans;
|
||||
- local $|=1;
|
||||
- print "$mess $dispdef";
|
||||
- if ($ISA_TTY) {
|
||||
- if ( $Term::ReadKey::VERSION ) {
|
||||
- ReadMode( 'noecho' );
|
||||
- chomp($ans = ReadLine(0));
|
||||
- ReadMode( 'normal' );
|
||||
- print "\n";
|
||||
- } else {
|
||||
- chomp($ans = <STDIN>);
|
||||
- }
|
||||
- } else {
|
||||
- print "$def\n";
|
||||
- }
|
||||
- return ($ans ne '') ? $ans : $def;
|
||||
+EOB
|
||||
}
|
||||
--
|
||||
2.14.3
|
||||
|
||||
Reference in New Issue
Block a user