regress: Updates to HP-specific code
Change submitted by: Jean Tourrilhes <jt@hpl.hp.com>
This commit is contained in:
1 parent
25ceca2b66
commit
319065259b
5 files changed
+113
-7
No files matched your search
@@ -10,6 +10,7 @@ my $mapFile;
|
||||
my $of_hp_switch_ip;
|
||||
my $of_hp_vlan;
|
||||
my $of_hp_controller;
|
||||
my $of_hp_listener;
|
||||
my $of_hp_community;
|
||||
|
||||
# Process command line options
|
||||
@@ -18,7 +19,11 @@ unless ( GetOptions( "map=s" => \$mapFile, ) ) {
|
||||
exit 1;
|
||||
}
|
||||
|
||||
# If not specified on command line, use enviroment variable - Jean II
|
||||
# If not specified on command line, use environment variable.
|
||||
# Try specific first, then try generic - Jean II
|
||||
if ( (! defined($mapFile) ) && (defined($ENV{'OFT_HP_MAP_ETH'})) ) {
|
||||
$mapFile = "$ENV{OFT_HP_MAP_ETH}";
|
||||
}
|
||||
if ( (! defined($mapFile) ) && (defined($ENV{'OFT_MAP_ETH'})) ) {
|
||||
$mapFile = "$ENV{OFT_MAP_ETH}";
|
||||
}
|
||||
@@ -46,12 +51,18 @@ if (defined($ENV{'OFT_HP_CONTROLLER'})) {
|
||||
my $of_port = get_of_port();
|
||||
$of_hp_controller = "tcp:10.10.10.2:$of_port";
|
||||
}
|
||||
if (defined($ENV{'OFT_HP_LISTENER'})) {
|
||||
# Transform into a passive string
|
||||
($proto, $host, $port) = split(/:/,$ENV{'OFT_HP_LISTENER'});
|
||||
$of_hp_listener = "p$proto:$port";
|
||||
}
|
||||
if (defined($ENV{'OFT_HP_COMMUNITY'})) {
|
||||
$of_hp_community = $ENV{'OFT_HP_COMMUNITY'};
|
||||
} else {
|
||||
$of_hp_community = 'public';
|
||||
}
|
||||
|
||||
|
||||
# disable OpenFlow module to make sure it restarts
|
||||
`snmpset -v2c -c ${of_hp_community} ${of_hp_switch_ip} iso.org.dod.internet.private.enterprises.11.2.14.11.5.1.7.1.35.1.1.2.${of_hp_vlan} i 2`;
|
||||
|
||||
@@ -61,5 +72,10 @@ usleep(300000);
|
||||
# set OpenFlow Controller string
|
||||
`snmpset -v2c -c ${of_hp_community} ${of_hp_switch_ip} iso.org.dod.internet.private.enterprises.11.2.14.11.5.1.7.1.35.1.1.3.${of_hp_vlan} s ${of_hp_controller}`;
|
||||
|
||||
# set OpenFlow Listener string
|
||||
if (defined($of_hp_listener)) {
|
||||
`snmpset -v2c -c ${of_hp_community} ${of_hp_switch_ip} iso.org.dod.internet.private.enterprises.11.2.14.11.5.1.7.1.35.1.1.4.${of_hp_vlan} s ${of_hp_listener}`;
|
||||
}
|
||||
|
||||
# enable OpenFlow module
|
||||
`snmpset -v2c -c ${of_hp_community} ${of_hp_switch_ip} iso.org.dod.internet.private.enterprises.11.2.14.11.5.1.7.1.35.1.1.2.${of_hp_vlan} i 1`;
|
||||
@@ -15,7 +15,11 @@ unless ( GetOptions( "map=s" => \$mapFile, ) ) {
|
||||
exit 1;
|
||||
}
|
||||
|
||||
# If not specified on command line, use enviroment variable - Jean II
|
||||
# If not specified on command line, use environment variable.
|
||||
# Try specific first, then try generic - Jean II
|
||||
if ( (! defined($mapFile) ) && (defined($ENV{'OFT_HP_MAP_ETH'})) ) {
|
||||
$mapFile = "$ENV{OFT_HP_MAP_ETH}";
|
||||
}
|
||||
if ( (! defined($mapFile) ) && (defined($ENV{'OFT_MAP_ETH'})) ) {
|
||||
$mapFile = "$ENV{OFT_MAP_ETH}";
|
||||
}
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# Wrapper for OpenFlow regression tests
|
||||
# Wrapper for running OpenFlow regression tests against ProCurve 3500/5400
|
||||
# Jean Tourrilhes - HP-Labs - copyright 2009-2010
|
||||
# $Id: of_regress_test.pl 105 2008-06-06 04:07:05Z brandonh $
|
||||
#
|
||||
##############################################################################
|
||||
@@ -22,11 +23,35 @@ sub INT_Handler {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
# HP switch starts at port 1 == A1
|
||||
# Test need extra delay due to slow controller socket (local buffers ?)
|
||||
# For the 5406zl and 3500yl...
|
||||
|
||||
# HP switch starts at port 1 == 'A1' or 1 == '1'
|
||||
# Test need extra delay due to slow controller socket
|
||||
# Add more idle time due to stat resolution
|
||||
# byte count is not available - Jean II
|
||||
push @ARGV, "--root=$ENV{'OFT_ROOT'}", "--common-st-args=hp", "--controller=".$ENV{'OFT_HP_CONTROLLER'}, "--port_base=1", "--send_delay=500000", "--base_idle=3", "--ignore_byte_count", "--less_ports";
|
||||
push @ARGV, "--root=$ENV{'OFT_ROOT'}", "--common-st-args=hp", "--controller=".$ENV{'OFT_HP_CONTROLLER'}, "--port_base=1", "--send_delay=500000", "--base_idle=3", "--ignore_byte_count";
|
||||
|
||||
# Use a single random port instead of all four
|
||||
push @ARGV, "--less_ports";
|
||||
|
||||
# For QinQ, you will need the premium license...
|
||||
push @ARGV, "--no_vlan";
|
||||
|
||||
# The hardware can not support slicing
|
||||
push @ARGV, "--no_slicing";
|
||||
|
||||
# The hardware can not support barrier
|
||||
push @ARGV, "--no_barrier";
|
||||
|
||||
# Check for listener
|
||||
if ( defined($ENV{'OFT_HP_LISTENER'}) ) {
|
||||
push @ARGV, "--listener=$ENV{OFT_HP_LISTENER}";
|
||||
}
|
||||
|
||||
# Check for specific MAP file...
|
||||
if ( defined($ENV{'OFT_HP_MAP_ETH'}) ) {
|
||||
push @ARGV, "--map=$ENV{OFT_HP_MAP_ETH}";
|
||||
}
|
||||
|
||||
# Other configuration is through Environment Variables, See of_hp_setup.pl
|
||||
# Jean II
|
||||
|
||||
Executable
+59
@@ -0,0 +1,59 @@
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# Wrapper for running OpenFlow regression tests against ProCurve 6600
|
||||
# Jean Tourrilhes - HP-Labs - copyright 2009-2010
|
||||
# $Id: of_regress_test.pl 105 2008-06-06 04:07:05Z brandonh $
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
use OF::Base;
|
||||
use Test::RegressTest;
|
||||
use strict;
|
||||
use OF::OFUtil;
|
||||
|
||||
# check vars are set.
|
||||
check_OF_vars_set();
|
||||
|
||||
sub INT_Handler {
|
||||
my $signame = shift;
|
||||
print "\nNo interrupt handler implemented yet...\n";
|
||||
print "\nExited with SIG$signame\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
# For the 6600...
|
||||
|
||||
# HP switch starts at port 25 == '1'
|
||||
# Test need extra delay due to slow controller socket
|
||||
# Add more idle time due to stat resolution
|
||||
# byte count is not available - Jean II
|
||||
push @ARGV, "--root=$ENV{'OFT_ROOT'}", "--common-st-args=hp", "--controller=".$ENV{'OFT_HP_CONTROLLER'}, "--port_base=25", "--send_delay=650000", "--base_idle=3", "--ignore_byte_count";
|
||||
|
||||
# Use a single random port instead of all four
|
||||
push @ARGV, "--less_ports";
|
||||
|
||||
# For QinQ, you will need the premium license...
|
||||
push @ARGV, "--no_vlan";
|
||||
|
||||
# The hardware can not support slicing
|
||||
push @ARGV, "--no_slicing";
|
||||
|
||||
# The hardware can not support barrier
|
||||
push @ARGV, "--no_barrier";
|
||||
|
||||
# Check for listener
|
||||
if ( defined($ENV{'OFT_HP_LISTENER'}) ) {
|
||||
push @ARGV, "--listener=$ENV{OFT_HP_LISTENER}";
|
||||
}
|
||||
|
||||
# Check for specific MAP file...
|
||||
if ( defined($ENV{'OFT_HP_MAP_ETH'}) ) {
|
||||
push @ARGV, "--map=$ENV{OFT_HP_MAP_ETH}";
|
||||
}
|
||||
|
||||
# Other configuration is through Environment Variables, See of_hp_setup.pl
|
||||
# Jean II
|
||||
|
||||
run_regress_test( \&INT_Handler, @ARGV );
|
||||
@@ -2,7 +2,9 @@ export OF_ROOT=/home/yourname/openflow
|
||||
export OFT_ROOT=${OF_ROOT}/regress
|
||||
export PATH=${OFT_ROOT}/bin:/sbin:/usr/sbin:${PATH}
|
||||
export PERL5LIB=${OFT_ROOT}/lib/Perl5:${PERL5LIB}
|
||||
export OFT_MAP_ETH=${OFT_ROOT}/bin/of_hp_eth.map
|
||||
export OFT_MAP_ETH=${OFT_ROOT}/bin/of_generic_eth.map
|
||||
export OFT_HP_MAP_ETH=${OFT_ROOT}/bin/of_hp_eth.map
|
||||
export OFT_HP_SWITCH_IP=10.10.10.2
|
||||
export OFT_HP_VLAN=10
|
||||
export OFT_HP_CONTROLLER="tcp:10.10.10.3:6633"
|
||||
export OFT_HP_LISTENER="tcp:10.10.10.2:6633"
|
||||
Reference in new issue
Block a user