Squashed commit of the following: commit 606d572db561d8de659bce6ac96252f8a1d7ee29 Author: Oliver Gorwits <oliver@cpan.org> Date: Sat May 6 14:56:07 2017 +0100 tests should be release tests, so move to xt/ commit7673f3ee1eAuthor: Oliver Gorwits <oliver@cpan.org> Date: Sat May 6 14:19:19 2017 +0100 allow check_acl to accept Device or NetAddr::IP instance commitc31059bc01Author: Oliver Gorwits <oliver@cpan.org> Date: Sat May 6 14:19:00 2017 +0100 update docs commitdeaeab2670Author: Oliver Gorwits <oliver@cpan.org> Date: Sat May 6 14:18:27 2017 +0100 SNMP only stanza has access to full check_acl features commit4a44fa5863Author: Oliver Gorwits <oliver@cpan.org> Date: Mon May 1 18:49:38 2017 +0100 add AND operator and negation support to ACLs
		
			
				
	
	
		
			29 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Perl
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Perl
		
	
	
	
	
	
| #!/usr/bin/perl
 | |
| 
 | |
| use strict; use warnings FATAL => 'all';
 | |
| use Test::More 0.88;
 | |
| 
 | |
| BEGIN {
 | |
|     use_ok( 'App::Netdisco::Util::Web', 'sort_port' );
 | |
| }
 | |
| 
 | |
| #  1 = first is greater
 | |
| #  0 = same
 | |
| # -1 = first is lesser
 | |
| 
 | |
| is(sort_port(1,1), 0, 'number - same values');
 | |
| is(sort_port('1:2','1:10'), -1, 'colon number (Extreme) - first lesser');
 | |
| is(sort_port('D1','D10'), -1, 'HP - simple letter and number [#152]');
 | |
| 
 | |
| # Juniper examples for [#128]
 | |
| # https://www.juniper.net/documentation/en_US/junos14.2/topics/concept/interfaces-interface-naming-overview.html
 | |
| is(sort_port('so-1/0/0.0','so-1/0/1.0'), -1, 'juniper - FPC in slot 1 with OC3 PIC - 1');
 | |
| is(sort_port('so-1/1/0.0','so-1/1/1.0'), -1, 'juniper - FPC in slot 1 with OC3 PIC - 2');
 | |
| is(sort_port('so-1/0/0.0','so-1/1/0.0'), -1, 'juniper - FPC in slot 1 with OC3 PIC - 3');
 | |
| 
 | |
| is(sort_port('so-1/0/0:0','so-1/0/1:0'), -1, 'juniper - FPC in slot 1 with OC3 PIC channelized - 1');
 | |
| is(sort_port('so-1/1/0:0','so-1/1/1:0'), -1, 'juniper - FPC in slot 1 with OC3 PIC channelized - 2');
 | |
| is(sort_port('so-1/0/0:0','so-1/1/0:0'), -1, 'juniper - FPC in slot 1 with OC3 PIC channelized - 3');
 | |
| 
 | |
| done_testing;
 |