Gentoo Archives: gentoo-commits

From: Kent Fredric <kentnl@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-perl/Net-Telnet-Cisco/files/, dev-perl/Net-Telnet-Cisco/
Date: Wed, 13 Dec 2017 07:58:40
Message-Id: 1513151908.c7a7dac46ea577c87c327edef6f8912df2065238.kentnl@gentoo
1 commit: c7a7dac46ea577c87c327edef6f8912df2065238
2 Author: Kent Fredric <kentnl <AT> gentoo <DOT> org>
3 AuthorDate: Wed Dec 13 06:40:50 2017 +0000
4 Commit: Kent Fredric <kentnl <AT> gentoo <DOT> org>
5 CommitDate: Wed Dec 13 07:58:28 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c7a7dac4
7
8 dev-perl/Net-Telnet-Cisco: Bump to version 1.110.0
9
10 - EAPI6
11 - Enable tests
12 - Patch out interactive steps in tests
13 - Add network-test plans
14
15 Upstream:
16 - Fix handling of warnings leading to crash
17 - Override Net::Telnet::fhopen to do the right thing
18 - Fix autopage handling in constructor
19 - Fix bad splitting and useless modifier in split
20 - Remove hard requirement of Term::ReadKey
21
22 Package-Manager: Portage-2.3.18, Repoman-2.3.6
23
24 dev-perl/Net-Telnet-Cisco/Manifest | 1 +
25 .../Net-Telnet-Cisco-1.110.0.ebuild | 31 +++++
26 ...Net-Telnet-Cisco-1.11-no-interactive-test.patch | 125 +++++++++++++++++++++
27 3 files changed, 157 insertions(+)
28
29 diff --git a/dev-perl/Net-Telnet-Cisco/Manifest b/dev-perl/Net-Telnet-Cisco/Manifest
30 index 9b502326e0c..8e5501b4bf6 100644
31 --- a/dev-perl/Net-Telnet-Cisco/Manifest
32 +++ b/dev-perl/Net-Telnet-Cisco/Manifest
33 @@ -1 +1,2 @@
34 DIST Net-Telnet-Cisco-1.10.tar.gz 17579 BLAKE2B 0fd21fcb58d7d0b8474df3e04b28cc8e2ae978f1d02f2c050bc9974b39f1b531ff159f9282aec9d17ddae309ff902a0a5eeacdf9903acfd5ee503f803d9cdb00 SHA512 1fcae8e54425a2ddf2e32c772886af97d308421eb664abb296ec16e97531c2eb6727ea4607d48fa957e9a926dc5b88bfffdfa75da10793f4f0247fa3b1f45672
35 +DIST Net-Telnet-Cisco-1.11.tar.gz 19282 BLAKE2B 39925b96a8d709f58012c12ec368c48a54549a324ae0fbcdc4cf97daed034b6cb76639b3fda1c3b77824e5c702f6b8e5abc4093558888788ce6cac19342575c4 SHA512 b12da84517df470d40d56a54e8d8c7b331bed87c3c330da7fc1efb7d078805e6f7348f0b52971d3c1b4e3d39014d76bbe7535c40ad3afa7efcf567521ddf0c4b
36
37 diff --git a/dev-perl/Net-Telnet-Cisco/Net-Telnet-Cisco-1.110.0.ebuild b/dev-perl/Net-Telnet-Cisco/Net-Telnet-Cisco-1.110.0.ebuild
38 new file mode 100644
39 index 00000000000..238f2c98ec1
40 --- /dev/null
41 +++ b/dev-perl/Net-Telnet-Cisco/Net-Telnet-Cisco-1.110.0.ebuild
42 @@ -0,0 +1,31 @@
43 +# Copyright 1999-2017 Gentoo Foundation
44 +# Distributed under the terms of the GNU General Public License v2
45 +
46 +EAPI=6
47 +
48 +DIST_AUTHOR=VINSWORLD
49 +DIST_VERSION=1.11
50 +inherit perl-module
51 +
52 +DESCRIPTION="Automate telnet sessions w/ routers&switches"
53 +
54 +SLOT="0"
55 +KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
56 +IUSE="test"
57 +
58 +RDEPEND=">=dev-perl/Net-Telnet-3.20.0"
59 +DEPEND="${RDEPEND}
60 + virtual/perl-ExtUtils-MakeMaker
61 + test? ( dev-perl/TermReadKey )
62 +"
63 +PATCHES=( "${FILESDIR}/${PN}-1.11-no-interactive-test.patch" )
64 +PERL_RM_FILES=( "t/02-pod-coverage.t" )
65 +
66 +src_test() {
67 + if [[ -z $CISCO_TEST_ROUTER ]]; then
68 + elog "Comprehensive testing requires a configured, network accessible Cisco Router"
69 + elog "to test against. For details, see:"
70 + elog "https://wiki.gentoo.org/wiki/Project:Perl/maint-notes/${CATEGORY}/${PN}"
71 + fi
72 + perl-module_src_test
73 +}
74
75 diff --git a/dev-perl/Net-Telnet-Cisco/files/Net-Telnet-Cisco-1.11-no-interactive-test.patch b/dev-perl/Net-Telnet-Cisco/files/Net-Telnet-Cisco-1.11-no-interactive-test.patch
76 new file mode 100644
77 index 00000000000..7ab7b2ad20a
78 --- /dev/null
79 +++ b/dev-perl/Net-Telnet-Cisco/files/Net-Telnet-Cisco-1.11-no-interactive-test.patch
80 @@ -0,0 +1,125 @@
81 +From 60d93af35887e53677be5a0f95591489c2683c73 Mon Sep 17 00:00:00 2001
82 +From: Kent Fredric <kentnl@g.o>
83 +Date: Wed, 13 Dec 2017 18:42:56 +1300
84 +Subject: Remove test interactivity
85 +
86 +Pass configuration by enviroment variables and don't prompt.
87 +---
88 + test.pl | 82 ++++++++++++++++-------------------------------------------------
89 + 1 file changed, 20 insertions(+), 62 deletions(-)
90 +
91 +diff --git a/test.pl b/test.pl
92 +index 369bc30..e9f7ae2 100644
93 +--- a/test.pl
94 ++++ b/test.pl
95 +@@ -5,14 +5,8 @@
96 +
97 + use Test::More tests => 32;
98 + #use Test::More qw/no_plan/;
99 +-use ExtUtils::MakeMaker qw/prompt/;
100 + use Carp;
101 + use Cwd;
102 +-my $HAVE_Term_ReadKey = 0;
103 +-eval "use Term::ReadKey";
104 +-if(!$@) {
105 +- $HAVE_Term_ReadKey = 1
106 +-}
107 +
108 + use vars qw/$ROUTER $PASSWD $LOGIN $S $EN_PASS $PASSCODE/;
109 +
110 +@@ -161,18 +155,9 @@ END { cleanup() };
111 +
112 + sub cleanup {
113 + return unless -f "input.log" || -f "dump.log";
114 +-
115 +- print <<EOB;
116 +-
117 +-Would you like to delete the test logs? They will contain
118 +-security info like your login and passwords. If you ran
119 +-into problems and wish to investigate, you can save them
120 +-and manually delete them later.
121 +-EOB
122 +-
123 + my $dir = cwd();
124 +
125 +- my $ans = prompt("Delete logs", "y");
126 ++ my $ans = "y";
127 + if ($ans eq "y") {
128 + print "Deleting logs in $dir...";
129 + unlink "input.log" or warn "Can't delete input.log! $!";
130 +@@ -183,53 +168,26 @@ EOB
131 + }
132 + }
133 +
134 +-sub get_login {
135 +- print <<EOB;
136 +-
137 +-Net::Telnet::Cisco needs to log into a router to
138 +-perform it\'s full suite of tests. To log in, we
139 +-need a test router, a login, a password, an
140 +-optional enable password, and an optional
141 +-SecurID/TACACS PASSCODE.
142 +-
143 +-To skip these tests, hit "return".
144 +-
145 +-EOB
146 +-
147 +- $ROUTER = prompt("Router:", $ROUTER) or return;
148 +- $LOGIN = prompt("Login:", $LOGIN) or return;
149 +- $PASSWD = passprompt("Password:", $PASSWD) or return;
150 +- $EN_PASS = passprompt("Enable password [optional]:", $EN_PASS);
151 +- $PASSCODE = passprompt("SecurID/TACACS PASSCODE [optional]:", $PASSCODE);
152 ++sub maskpass {
153 ++ return 'not set' unless defined $_[0];
154 ++ return ( '*' x ( length $_[0] ) ) . ' [masked]';
155 + }
156 +
157 ++sub get_login {
158 ++ $ROUTER = $ENV{CISCO_TEST_ROUTER} or return;
159 ++ $LOGIN = $ENV{CISCO_TEST_LOGIN} or return;
160 ++ $PASSWD = $ENV{CISCO_TEST_PASSWORD} or return;
161 ++ $EN_PASS = $ENV{CISCO_TEST_ENABLE_PASSWORD};
162 ++ $PASSCODE = $ENV{CISCO_TEST_PASSCODE};
163 ++
164 ++ printf STDERR
165 ++ <<EOB, $ROUTER, $LOGIN, maskpass($PASSWD), maskpass($EN_PASS), maskpass($PASSCODE);
166 ++Using the following configuration for testing:
167 ++ Router: %s
168 ++ Login: %s
169 ++ Password: %s
170 ++ Enable Password: %s
171 ++ SecureID/TACACS PASSCODE: %s
172 +
173 +-# Lifted from ExtUtils::MakeMaker.
174 +-#
175 +-# If the user has Term::ReadKey, we can hide any passwords
176 +-# they type from shoulder-surfing attacks.
177 +-#
178 +-# Args: "Question for user", "optional default answer"
179 +-sub passprompt ($;$) {
180 +- my($mess,$def)=@_;
181 +- $ISA_TTY = -t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT)) ; # Pipe?
182 +- Carp::confess("prompt function called without an argument") unless defined $mess;
183 +- my $dispdef = defined $def ? "[$def] " : " ";
184 +- $def = defined $def ? $def : "";
185 +- my $ans;
186 +- local $|=1;
187 +- print "$mess $dispdef";
188 +- if ($ISA_TTY) {
189 +- if ( $Term::ReadKey::VERSION ) {
190 +- ReadMode( 'noecho' );
191 +- chomp($ans = ReadLine(0));
192 +- ReadMode( 'normal' );
193 +- print "\n";
194 +- } else {
195 +- chomp($ans = <STDIN>);
196 +- }
197 +- } else {
198 +- print "$def\n";
199 +- }
200 +- return ($ans ne '') ? $ans : $def;
201 ++EOB
202 + }
203 +--
204 +2.14.3
205 +