Merge "minor change to the structure of VPLSfailsafe"
diff --git a/TestON/JenkinsFile/scripts/SCPFIntentInstallWithdrawRerouteLat.R b/TestON/JenkinsFile/scripts/SCPFIntentInstallWithdrawRerouteLat.R
index f2697db..186c1c2 100644
--- a/TestON/JenkinsFile/scripts/SCPFIntentInstallWithdrawRerouteLat.R
+++ b/TestON/JenkinsFile/scripts/SCPFIntentInstallWithdrawRerouteLat.R
@@ -18,7 +18,7 @@
# along with TestON. If not, see <http://www.gnu.org/licenses/>.
#
# If you have any questions, or if you don't understand R,
-# please contact Jeremy Ronquillo: jeremyr@opennetworking.org
+# please contact Jeremy Ronquillo: j_ronquillo@u.pacific.edu
# **********************************************************
# STEP 1: File management.
@@ -26,9 +26,7 @@
print( "STEP 1: File management." )
-# Command line arguments are read. Args usually include the database filename and the output
-# directory for the graphs to save to.
-# ie: Rscript SCPFgraphGenerator SCPFsampleDataDB.csv ~/tmp/
+# Command line arguments are read.
print( "Reading commmand-line args." )
args <- commandArgs( trailingOnly=TRUE )
@@ -51,9 +49,7 @@
flowObjFileModifier <- "fobj_"
}
-# Filenames for output graphs include the testname and the graph type.
-# See the examples below. paste() is used to concatenate strings.
-
+# paste() is used to concatenate strings
errBarOutputFile <- paste( args[ 9 ], "SCPFIntentInstallWithdrawRerouteLat", sep="" )
errBarOutputFile <- paste( errBarOutputFile, args[ 7 ], sep="_" )
if ( args[ 1 ] == "y" ){
@@ -153,20 +149,11 @@
theme_set( theme_grey( base_size = 20 ) ) # set the default text size of the graph.
-# Calculate window to display graph, based on the lowest and highest points of the data.
-if ( min( dataFrame$ms - dataFrame$stds ) < 0){
- yWindowMin <- min( dataFrame$ms - dataFrame$stds ) * 1.05
-} else {
- yWindowMin <- 0
-}
-yWindowMax <- max( dataFrame$ms + dataFrame$stds )
-
mainPlot <- ggplot( data = dataFrame, aes( x = scale, y = ms, ymin = ms - stds, ymax = ms + stds,fill = type ) )
# Formatting the plot
width <- 1.3 # Width of the bars.
xScaleConfig <- scale_x_continuous( breaks=c( 1, 3, 5, 7, 9) )
-yLimit <- ylim( yWindowMin, yWindowMax )
xLabel <- xlab( "Scale" )
yLabel <- ylab( "Latency (ms)" )
fillLabel <- labs( fill="Type" )
@@ -180,7 +167,7 @@
theme <- theme( plot.title=element_text( hjust = 0.5, size = 22, face='bold' ) )
# Store plot configurations as 1 variable
-fundamentalGraphData <- mainPlot + xScaleConfig + yLimit + xLabel + yLabel + fillLabel + theme
+fundamentalGraphData <- mainPlot + xScaleConfig + xLabel + yLabel + fillLabel + theme
# Create the bar graph with error bars.
diff --git a/TestON/JenkinsFile/scripts/SCPFLineGraph.R b/TestON/JenkinsFile/scripts/SCPFLineGraph.R
index 4b1ead6..376014d 100644
--- a/TestON/JenkinsFile/scripts/SCPFLineGraph.R
+++ b/TestON/JenkinsFile/scripts/SCPFLineGraph.R
@@ -18,7 +18,7 @@
# along with TestON. If not, see <http://www.gnu.org/licenses/>.
#
# If you have any questions, or if you don't understand R,
-# please contact Jeremy Ronquillo: jeremyr@opennetworking.org
+# please contact Jeremy Ronquillo: j_ronquillo@u.pacific.edu
# This is the R script that generates the SCPF front page graphs.
@@ -31,7 +31,7 @@
# Import libraries to be used for graphing and organizing data, respectively.
# Find out more about ggplot2: https://github.com/tidyverse/ggplot2
# reshape2: https://github.com/hadley/reshape
-# RPostgreSQL: https://code.google.com/archive/p/rpostgresql/
+# RPostgreSQL: https://code.google.com/archive/p/rpostgresql/
print( "Importing libraries." )
library( ggplot2 )
library( reshape2 )
diff --git a/TestON/JenkinsFile/scripts/SCPFbatchFlowResp.R b/TestON/JenkinsFile/scripts/SCPFbatchFlowResp.R
index 476cafb..3698afb 100644
--- a/TestON/JenkinsFile/scripts/SCPFbatchFlowResp.R
+++ b/TestON/JenkinsFile/scripts/SCPFbatchFlowResp.R
@@ -18,7 +18,7 @@
# along with TestON. If not, see <http://www.gnu.org/licenses/>.
#
# If you have any questions, or if you don't understand R,
-# please contact Jeremy Ronquillo: jeremyr@opennetworking.org
+# please contact Jeremy Ronquillo: j_ronquillo@u.pacific.edu
# **********************************************************
# STEP 1: File management.
@@ -26,9 +26,7 @@
print( "STEP 1: File management." )
-# Command line arguments are read. Args usually include the database filename and the output
-# directory for the graphs to save to.
-# ie: Rscript SCPFgraphGenerator SCPFsampleDataDB.csv ~/tmp/
+# Command line arguments are read.
print( "Reading commmand-line args." )
args <- commandArgs( trailingOnly=TRUE )
@@ -46,9 +44,7 @@
q() # basically exit(), but in R
}
-# Filenames for output graphs include the testname and the graph type.
-# See the examples below. paste() is used to concatenate strings.
-
+# paste() is used to concatenate strings.
errBarOutputFile <- paste( args[ 7 ], args[ 5 ], sep="" )
errBarOutputFile <- paste( errBarOutputFile, args[ 6 ], sep="_" )
errBarOutputFile <- paste( errBarOutputFile, "_PostGraph.jpg", sep="" )
@@ -101,7 +97,7 @@
mainPlot <- ggplot( data = dataFrame, aes( x = iterative, y = ms, fill = type ) )
xScaleConfig <- scale_x_continuous( breaks = dataFrame$iterative, label = dataFrame$date )
-xLabel <- xlab( "date" )
+xLabel <- xlab( "Build Date" )
yLabel <- ylab( "Latency (ms)" )
fillLabel <- labs( fill="Type" )
theme <- theme( plot.title=element_text( hjust = 0.5, size = 28, face='bold' ) )
diff --git a/TestON/JenkinsFile/scripts/SCPFcbench.R b/TestON/JenkinsFile/scripts/SCPFcbench.R
index 786a2fa..bccfb38 100644
--- a/TestON/JenkinsFile/scripts/SCPFcbench.R
+++ b/TestON/JenkinsFile/scripts/SCPFcbench.R
@@ -18,7 +18,7 @@
# along with TestON. If not, see <http://www.gnu.org/licenses/>.
#
# If you have any questions, or if you don't understand R,
-# please contact Jeremy Ronquillo: jeremyr@opennetworking.org
+# please contact Jeremy Ronquillo: j_ronquillo@u.pacific.edu
# **********************************************************
# STEP 1: File management.
@@ -26,9 +26,7 @@
print( "STEP 1: File management." )
-# Command line arguments are read. Args usually include the database filename and the output
-# directory for the graphs to save to.
-# ie: Rscript SCPFgraphGenerator SCPFsampleDataDB.csv ~/tmp/
+# Command line arguments are read.
print( "Reading commmand-line args." )
args <- commandArgs( trailingOnly=TRUE )
@@ -47,9 +45,7 @@
q() # basically exit(), but in R
}
-# Filenames for output graphs include the testname and the graph type.
-# See the examples below. paste() is used to concatenate strings.
-
+# paste() is used to concatenate strings.
errBarOutputFile <- paste( args[ 7 ], args[ 5 ], sep="" )
errBarOutputFile <- paste( errBarOutputFile, args[ 6 ], sep="_" )
errBarOutputFile <- paste( errBarOutputFile, "_errGraph.jpg", sep="" )
diff --git a/TestON/JenkinsFile/scripts/SCPFflowTp1g.R b/TestON/JenkinsFile/scripts/SCPFflowTp1g.R
index e11196a..89e2379 100644
--- a/TestON/JenkinsFile/scripts/SCPFflowTp1g.R
+++ b/TestON/JenkinsFile/scripts/SCPFflowTp1g.R
@@ -18,7 +18,7 @@
# along with TestON. If not, see <http://www.gnu.org/licenses/>.
#
# If you have any questions, or if you don't understand R,
-# please contact Jeremy Ronquillo: jeremyr@opennetworking.org
+# please contact Jeremy Ronquillo: j_ronquillo@u.pacific.edu
# **********************************************************
# STEP 1: File management.
@@ -26,9 +26,7 @@
print( "STEP 1: File management." )
-# Command line arguments are read. Args usually include the database filename and the output
-# directory for the graphs to save to.
-# ie: Rscript SCPFgraphGenerator SCPFsampleDataDB.csv ~/tmp/
+# Command line arguments are read.
print( "Reading commmand-line args." )
args <- commandArgs( trailingOnly=TRUE )
@@ -47,9 +45,7 @@
q() # basically exit(), but in R
}
-# Filenames for output graphs include the testname and the graph type.
-# See the examples below. paste() is used to concatenate strings.
-
+# paste() is used to concatenate strings.
errBarOutputFile <- paste( args[ 9 ], args[ 6 ], sep="" )
errBarOutputFile <- paste( errBarOutputFile, args[ 7 ], sep="_" )
if ( args[ 8 ] == 'y' ){
diff --git a/TestON/JenkinsFile/scripts/SCPFhostLat.R b/TestON/JenkinsFile/scripts/SCPFhostLat.R
index 75e2a45..e17cedb 100644
--- a/TestON/JenkinsFile/scripts/SCPFhostLat.R
+++ b/TestON/JenkinsFile/scripts/SCPFhostLat.R
@@ -18,7 +18,7 @@
# along with TestON. If not, see <http://www.gnu.org/licenses/>.
#
# If you have any questions, or if you don't understand R,
-# please contact Jeremy Ronquillo: jeremyr@opennetworking.org
+# please contact Jeremy Ronquillo: j_ronquillo@u.pacific.edu
# **********************************************************
# STEP 1: File management.
@@ -26,9 +26,7 @@
print( "STEP 1: File management." )
-# Command line arguments are read. Args usually include the database filename and the output
-# directory for the graphs to save to.
-# ie: Rscript SCPFgraphGenerator SCPFsampleDataDB.csv ~/tmp/
+# Command line arguments are read.
print( "Reading commmand-line args." )
args <- commandArgs( trailingOnly=TRUE )
@@ -47,9 +45,7 @@
q() # basically exit(), but in R
}
-# Filenames for output graphs include the testname and the graph type.
-# See the examples below. paste() is used to concatenate strings.
-
+# paste() is used to concatenate strings
errBarOutputFile <- paste( args[ 7 ], args[ 5 ], sep="" )
errBarOutputFile <- paste( errBarOutputFile, args[ 6 ], sep="_" )
errBarOutputFile <- paste( errBarOutputFile, "_errGraph.jpg", sep="" )
diff --git a/TestON/JenkinsFile/scripts/SCPFintentEventTp.R b/TestON/JenkinsFile/scripts/SCPFintentEventTp.R
index a8d8248..7a55371 100644
--- a/TestON/JenkinsFile/scripts/SCPFintentEventTp.R
+++ b/TestON/JenkinsFile/scripts/SCPFintentEventTp.R
@@ -18,7 +18,7 @@
# along with TestON. If not, see <http://www.gnu.org/licenses/>.
#
# If you have any questions, or if you don't understand R,
-# please contact Jeremy Ronquillo: jeremyr@opennetworking.org
+# please contact Jeremy Ronquillo: j_ronquillo@u.pacific.edu
# **********************************************************
# STEP 1: File management.
@@ -28,7 +28,6 @@
# Command line arguments are read. Args usually include the database filename and the output
# directory for the graphs to save to.
-# ie: Rscript SCPFgraphGenerator SCPFsampleDataDB.csv ~/tmp/
print( "Reading commmand-line args." )
args <- commandArgs( trailingOnly=TRUE )
@@ -47,9 +46,7 @@
q() # basically exit(), but in R
}
-# Filenames for output graphs include the testname and the graph type.
-# See the examples below. paste() is used to concatenate strings.
-
+# paste() is used to concatenate strings.
errBarOutputFile <- paste( args[ 9 ], args[ 6 ], sep="" )
errBarOutputFile <- paste( errBarOutputFile, args[ 7 ], sep="_" )
if ( args[ 8 ] == 'y' ){
diff --git a/TestON/JenkinsFile/scripts/SCPFmastershipFailoverLat.R b/TestON/JenkinsFile/scripts/SCPFmastershipFailoverLat.R
index 594a515..09ac5cb 100644
--- a/TestON/JenkinsFile/scripts/SCPFmastershipFailoverLat.R
+++ b/TestON/JenkinsFile/scripts/SCPFmastershipFailoverLat.R
@@ -18,7 +18,7 @@
# along with TestON. If not, see <http://www.gnu.org/licenses/>.
#
# If you have any questions, or if you don't understand R,
-# please contact Jeremy Ronquillo: jeremyr@opennetworking.org
+# please contact Jeremy Ronquillo: j_ronquillo@u.pacific.edu
# **********************************************************
# STEP 1: File management.
@@ -26,9 +26,7 @@
print( "STEP 1: File management." )
-# Command line arguments are read. Args usually include the database filename and the output
-# directory for the graphs to save to.
-# ie: Rscript SCPFgraphGenerator SCPFsampleDataDB.csv ~/tmp/
+# Command line arguments are read.
print( "Reading commmand-line args." )
args <- commandArgs( trailingOnly=TRUE )
@@ -40,16 +38,13 @@
library( reshape2 )
library( RPostgreSQL ) # For databases
-# Normal usage
# Check if sufficient args are provided.
if ( is.na( args[ 7 ] ) ){
print( "Usage: Rscript SCPFmastershipFailoverLat <database-host> <database-port> <database-user-id> <database-password> <test-name> <branch-name> <directory-to-save-graphs>" )
q() # basically exit(), but in R
}
-# Filenames for output graphs include the testname and the graph type.
-# See the examples below. paste() is used to concatenate strings.
-
+# paste() is used to concatenate strings.
errBarOutputFile <- paste( args[ 7 ], args[ 5 ], sep="" )
errBarOutputFile <- paste( errBarOutputFile, args[ 6 ], sep="_" )
errBarOutputFile <- paste( errBarOutputFile, "_errGraph.jpg", sep="" )
@@ -120,13 +115,12 @@
mainPlot <- ggplot( data = avgData, aes( x = scale, y = ms, ymin = ms - stdData$ms, ymax = ms + stdData$ms,fill = type ) )
xScaleConfig <- scale_x_continuous( breaks=c( 1, 3, 5, 7, 9) )
-yLimit <- ylim( yMin, yMax )
xLabel <- xlab( "Scale" )
yLabel <- ylab( "Latency (ms)" )
fillLabel <- labs( fill="Type" )
theme <- theme( plot.title=element_text( hjust = 0.5, size = 28, face='bold' ) )
-fundamentalGraphData <- mainPlot + xScaleConfig + yLimit + xLabel + yLabel + fillLabel + theme
+fundamentalGraphData <- mainPlot + xScaleConfig + xLabel + yLabel + fillLabel + theme
print( "Generating bar graph with error bars." )
diff --git a/TestON/JenkinsFile/scripts/SCPFportLat.R b/TestON/JenkinsFile/scripts/SCPFportLat.R
index 9eb38a5..e4b9d4f 100644
--- a/TestON/JenkinsFile/scripts/SCPFportLat.R
+++ b/TestON/JenkinsFile/scripts/SCPFportLat.R
@@ -18,7 +18,7 @@
# along with TestON. If not, see <http://www.gnu.org/licenses/>.
#
# If you have any questions, or if you don't understand R,
-# please contact Jeremy Ronquillo: jeremyr@opennetworking.org
+# please contact Jeremy Ronquillo: j_ronquillo@u.pacific.edu
# **********************************************************
# STEP 1: File management.
@@ -26,9 +26,7 @@
print( "STEP 1: File management." )
-# Command line arguments are read. Args usually include the database filename and the output
-# directory for the graphs to save to.
-# ie: Rscript SCPFgraphGenerator SCPFsampleDataDB.csv ~/tmp/
+# Command line arguments are read.
print( "Reading commmand-line args." )
args <- commandArgs( trailingOnly=TRUE )
@@ -46,8 +44,7 @@
q() # basically exit(), but in R
}
-# Filenames for output graphs include the testname and the graph type.
-# See the examples below. paste() is used to concatenate strings.
+# paste() is used to concatenate strings.
errBarOutputFileUp <- paste( args[ 7 ], "SCPFportLat_", sep = "" )
errBarOutputFileUp <- paste( errBarOutputFileUp, args[ 6 ], sep = "" )
errBarOutputFileUp <- paste( errBarOutputFileUp, "_UpErrBarWithStack.jpg", sep = "" )
@@ -114,24 +111,16 @@
print( "Generating fundamental graph data (Port Up Latency)." )
width <- 1
- if ( min( fileData[ 'up_end_to_end_avg' ] - upAvgsData$stds ) < 0 ) {
- yMin <- min( fileData[ 'up_end_to_end_avg' ] - upAvgsData$stds ) * 1.05
- } else {
- yMin <- 0
- }
theme_set( theme_grey( base_size = 20 ) ) # set the default text size of the graph.
-yMax <- max( fileData[ 'up_end_to_end_avg' ] + upAvgsData$stds )
-
mainPlot <- ggplot( data = upAvgsData, aes( x = scale, y = ms, fill = type, ymin = fileData[ 'up_end_to_end_avg' ] - stds, ymax = fileData[ 'up_end_to_end_avg' ] + stds ) )
xScaleConfig <- scale_x_continuous( breaks=c( 1, 3, 5, 7, 9) )
-yLimit <- ylim( yMin, yMax )
xLabel <- xlab( "Scale" )
yLabel <- ylab( "Latency (ms)" )
fillLabel <- labs( fill="Type" )
theme <- theme( plot.title=element_text( hjust = 0.5, size = 28, face='bold' ) )
-fundamentalGraphData <- mainPlot + yLimit + xScaleConfig + xLabel + yLabel + fillLabel + theme
+fundamentalGraphData <- mainPlot + xScaleConfig + xLabel + yLabel + fillLabel + theme
print( "Generating bar graph with error bars (Port Up Latency)." )
barGraphFormat <- geom_bar( stat="identity", width = width )
@@ -149,18 +138,11 @@
print( "Generating fundamental graph data (Port Down Latency)." )
- if ( min( fileData[ 'down_end_to_end_avg' ] - downAvgsData$stds ) < 0 ) {
- yMin <- min( fileData[ 'down_end_to_end_avg' ] - downAvgsData$stds )
- } else {
- yMin <- 0
- }
- yMax <- max( fileData[ 'down_end_to_end_avg' ] + downAvgsData$stds )
mainPlot <- ggplot( data = downAvgsData, aes( x = scale, y = ms, fill = type, ymin = fileData[ 'down_end_to_end_avg' ] - stds, ymax = fileData[ 'down_end_to_end_avg' ] + stds ) )
-yLimit <- ylim( yMin, yMax )
theme <- theme( plot.title=element_text( hjust = 0.5, size = 28, face='bold' ) )
-fundamentalGraphData <- mainPlot + yLimit + xScaleConfig + xLabel + yLabel + fillLabel + theme
+fundamentalGraphData <- mainPlot + xScaleConfig + xLabel + yLabel + fillLabel + theme
print( "Generating bar graph with error bars (Port Down Latency)." )
barGraphFormat <- geom_bar( stat="identity", width = width )
diff --git a/TestON/JenkinsFile/scripts/SCPFscaleTopo.R b/TestON/JenkinsFile/scripts/SCPFscaleTopo.R
index cbc0291..de22c3a 100644
--- a/TestON/JenkinsFile/scripts/SCPFscaleTopo.R
+++ b/TestON/JenkinsFile/scripts/SCPFscaleTopo.R
@@ -18,7 +18,7 @@
# along with TestON. If not, see <http://www.gnu.org/licenses/>.
#
# If you have any questions, or if you don't understand R,
-# please contact Jeremy Ronquillo: jeremyr@opennetworking.org
+# please contact Jeremy Ronquillo: j_ronquillo@u.pacific.edu
# **********************************************************
# STEP 1: File management.
@@ -26,9 +26,7 @@
print( "STEP 1: File management." )
-# Command line arguments are read. Args usually include the database filename and the output
-# directory for the graphs to save to.
-# ie: Rscript SCPFgraphGenerator SCPFsampleDataDB.csv ~/tmp/
+# Command line arguments are read.
print( "Reading commmand-line args." )
args <- commandArgs( trailingOnly=TRUE )
@@ -46,9 +44,7 @@
q() # basically exit(), but in R
}
-# Filenames for output graphs include the testname and the graph type.
-# See the examples below. paste() is used to concatenate strings.
-
+# paste() is used to concatenate strings
outputFile <- paste( args[ 7 ], args[ 5 ], sep="" )
outputFile <- paste( outputFile, args[ 6 ], sep="_" )
outputFile <- paste( outputFile, "_graph.jpg", sep="" )
@@ -80,7 +76,7 @@
# Parse lists into data frames.
dataFrame <- melt( avgs ) # This is where reshape2 comes in. Avgs list is converted to data frame
-dataFrame$scale <- fileData$scale # Add node scaling to the data frame.
+dataFrame$scale <- fileData$scale # Add node scaling to the data frame.
colnames( dataFrame ) <- c( "ms", "type", "scale")
@@ -114,20 +110,12 @@
print( "Generating fundamental graph data." )
-# Calculate window to display graph, based on the lowest and highest points of the data.
-if ( min( avgsSum ) < 0){
- yWindowMin <- min( avgsSum ) * 1.05
-} else {
- yWindowMin <- 0
-}
-yWindowMax <- max( avgsSum ) * 1.2
-
theme_set( theme_grey( base_size = 20 ) ) # set the default text size of the graph.
# Create the primary plot here.
# ggplot contains the following arguments:
# - data: the data frame that the graph will be based off of
-# - aes: the asthetics of the graph which require:
+# - aes: the asthetics of the graph which require:
# - x: x-axis values (usually node scaling)
# - y: y-axis values (usually time in milliseconds)
# - fill: the category of the colored side-by-side bars (usually type)
@@ -136,7 +124,6 @@
# Formatting the plot
width <- 0.6 # Width of the bars.
xScaleConfig <- scale_x_continuous( breaks = dataFrame$iterative, label = dataFrame$scale )
-yLimit <- ylim( yWindowMin, yWindowMax )
xLabel <- xlab( "Scale" )
yLabel <- ylab( "Latency (ms)" )
fillLabel <- labs( fill="Type" )
@@ -144,7 +131,7 @@
theme <- theme( plot.title=element_text( hjust = 0.5, size = 28, face='bold' ) )
# Store plot configurations as 1 variable
-fundamentalGraphData <- mainPlot + xScaleConfig + yLimit + xLabel + yLabel + fillLabel + theme
+fundamentalGraphData <- mainPlot + xScaleConfig + xLabel + yLabel + fillLabel + theme
# Create the stacked bar graph with error bars.
# geom_bar contains:
diff --git a/TestON/JenkinsFile/scripts/SCPFscalingMaxIntents.R b/TestON/JenkinsFile/scripts/SCPFscalingMaxIntents.R
index e5f54e5..bc90806 100644
--- a/TestON/JenkinsFile/scripts/SCPFscalingMaxIntents.R
+++ b/TestON/JenkinsFile/scripts/SCPFscalingMaxIntents.R
@@ -18,7 +18,7 @@
# along with TestON. If not, see <http://www.gnu.org/licenses/>.
#
# If you have any questions, or if you don't understand R,
-# please contact Jeremy Ronquillo: jeremyr@opennetworking.org
+# please contact Jeremy Ronquillo: j_ronquillo@u.pacific.edu
# **********************************************************
# STEP 1: File management.
@@ -26,9 +26,6 @@
print( "STEP 1: File management." )
-# Command line arguments are read. Args usually include the database filename and the output
-# directory for the graphs to save to.
-# ie: Rscript SCPFgraphGenerator SCPFsampleDataDB.csv ~/tmp/
print( "Reading commmand-line args." )
args <- commandArgs( trailingOnly=TRUE )
@@ -47,9 +44,7 @@
q() # basically exit(), but in R
}
-# Filenames for output graphs include the testname and the graph type.
-# See the examples below. paste() is used to concatenate strings.
-
+# paste() is used to concatenate strings.
outputFile <- paste( args[ 8 ], args[ 6 ], sep="" )
if ( args[ 1 ] == "y" ){
outputFile <- paste( outputFile, "flowObj", sep="_" )
@@ -80,7 +75,7 @@
fileData <- dbGetQuery( con, command )
if ( args[ 1 ] == "y" ){
- chartTitle <- "Number of Installed Intents & Flows with Flow Objectives"
+ chartTitle <- "Number of Installed Intents & Flows w/ FlowObj"
} else {
chartTitle <- "Number of Installed Intents & Flows"
}
diff --git a/TestON/JenkinsFile/scripts/SCPFswitchLat.R b/TestON/JenkinsFile/scripts/SCPFswitchLat.R
index 9131be9..0493859 100644
--- a/TestON/JenkinsFile/scripts/SCPFswitchLat.R
+++ b/TestON/JenkinsFile/scripts/SCPFswitchLat.R
@@ -18,7 +18,7 @@
# along with TestON. If not, see <http://www.gnu.org/licenses/>.
#
# If you have any questions, or if you don't understand R,
-# please contact Jeremy Ronquillo: jeremyr@opennetworking.org
+# please contact Jeremy Ronquillo: j_ronquillo@u.pacific.edu
# **********************************************************
# STEP 1: File management.
@@ -26,9 +26,7 @@
print( "STEP 1: File management." )
-# Command line arguments are read. Args usually include the database filename and the output
-# directory for the graphs to save to.
-# ie: Rscript SCPFgraphGenerator SCPFsampleDataDB.csv ~/tmp/
+# Command line arguments are read.
print( "Reading commmand-line args." )
args <- commandArgs( trailingOnly=TRUE )
@@ -46,8 +44,7 @@
q() # basically exit(), but in R
}
-# Filenames for output graphs include the testname and the graph type.
-# See the examples below. paste() is used to concatenate strings.
+# paste() is used to concatenate strings.
errBarOutputFileUp <- paste( args[ 7 ], "SCPFswitchLat_", sep = "" )
errBarOutputFileUp <- paste( errBarOutputFileUp, args[ 6 ], sep = "" )
errBarOutputFileUp <- paste( errBarOutputFileUp, "_UpErrBarWithStack.jpg", sep = "" )
@@ -109,24 +106,17 @@
print( "Generating fundamental graph data (Switch Up Latency)." )
width <- 1
- if ( min( fileData[ 'up_end_to_end_avg' ] - upAvgsData$stds ) < 0 ) {
- yMin <- min( fileData[ 'up_end_to_end_avg' ] + upAvgsData$stds ) * 1.05
- } else {
- yMin <- 0
- }
-yMax <- max( fileData[ 'up_end_to_end_avg' ] + upAvgsData$stds )
theme_set( theme_grey( base_size = 20 ) ) # set the default text size of the graph.
mainPlot <- ggplot( data = upAvgsData, aes( x = scale, y = ms, fill = type, ymin = fileData[ 'up_end_to_end_avg' ] - stds, ymax = fileData[ 'up_end_to_end_avg' ] + stds ) )
xScaleConfig <- scale_x_continuous( breaks=c( 1, 3, 5, 7, 9) )
-yLimit <- ylim( yMin, yMax )
xLabel <- xlab( "Scale" )
yLabel <- ylab( "Latency (ms)" )
fillLabel <- labs( fill="Type" )
theme <- theme( plot.title=element_text( hjust = 0.5, size = 28, face='bold' ) )
-fundamentalGraphData <- mainPlot + yLimit + xScaleConfig + xLabel + yLabel + fillLabel + theme
+fundamentalGraphData <- mainPlot + xScaleConfig + xLabel + yLabel + fillLabel + theme
print( "Generating bar graph with error bars (Switch Up Latency)." )
barGraphFormat <- geom_bar( stat="identity", width = width )
@@ -144,18 +134,11 @@
print( "Generating fundamental graph data (Switch Down Latency)." )
- if ( min( fileData[ 'down_end_to_end_avg' ] - downAvgsData$stds ) < 0 ) {
- yMin <- min( fileData[ 'down_end_to_end_avg' ] - downAvgsData$stds )
- } else {
- yMin <- 0
- }
- yMax <- max( fileData[ 'down_end_to_end_avg' ] + downAvgsData$stds )
mainPlot <- ggplot( data = downAvgsData, aes( x = scale, y = ms, fill = type, ymin = fileData[ 'down_end_to_end_avg' ] - stds, ymax = fileData[ 'down_end_to_end_avg' ] + stds ) )
-yLimit <- ylim( yMin, yMax )
theme <- theme( plot.title=element_text( hjust = 0.5, size = 28, face='bold' ) )
-fundamentalGraphData <- mainPlot + yLimit + xScaleConfig + xLabel + yLabel + fillLabel + theme
+fundamentalGraphData <- mainPlot + xScaleConfig + xLabel + yLabel + fillLabel + theme
print( "Generating bar graph with error bars (Switch Down Latency)." )
barGraphFormat <- geom_bar( stat="identity", width = width )
diff --git a/TestON/JenkinsFile/scripts/testCaseGraphGenerator.R b/TestON/JenkinsFile/scripts/testCaseGraphGenerator.R
index bb7b4b4..395823d 100644
--- a/TestON/JenkinsFile/scripts/testCaseGraphGenerator.R
+++ b/TestON/JenkinsFile/scripts/testCaseGraphGenerator.R
@@ -18,9 +18,9 @@
# along with TestON. If not, see <http://www.gnu.org/licenses/>.
#
# If you have any questions, or if you don't understand R,
-# please contact Jeremy Ronquillo: jeremyr@opennetworking.org
+# please contact Jeremy Ronquillo: j_ronquillo@u.pacific.edu
-# This is the R script that generates the FUNC and HA result graphs.
+# This is the R script that generates the FUNC, HA, and various USECASE result graphs.
# **********************************************************
# STEP 1: Data management.
diff --git a/TestON/drivers/common/cli/emulator/mininetclidriver.py b/TestON/drivers/common/cli/emulator/mininetclidriver.py
index d5adc69..a1b691c 100644
--- a/TestON/drivers/common/cli/emulator/mininetclidriver.py
+++ b/TestON/drivers/common/cli/emulator/mininetclidriver.py
@@ -38,6 +38,7 @@
import sys
import types
import os
+import time
from math import pow
from drivers.common.cli.emulatordriver import Emulator
from core.graph import Graph
@@ -198,6 +199,7 @@
self.handle.expect( self.prompt )
main.log.info( "Sending '" + cmdString + "' to " + self.name )
self.handle.sendline( cmdString )
+ startTime = time.time()
while True:
i = self.handle.expect( [ 'mininet>',
'Exception',
@@ -206,7 +208,7 @@
pexpect.TIMEOUT ],
timeout )
if i == 0:
- main.log.info( self.name + ": Mininet built" )
+ main.log.info( self.name + ": Mininet built\nTime Took : " + str( time.time() - startTime ) )
return main.TRUE
elif i == 1:
response = str( self.handle.before +
@@ -1291,7 +1293,7 @@
main.cleanAndExit()
return response
- def links( self, timeout=20 ):
+ def links( self, timeout=1000 ):
main.log.info( self.name + ": List network links" )
try:
response = self.execute( cmd='links', prompt='mininet>',
@@ -2253,7 +2255,7 @@
main.log.exception( self.name + ": Uncaught exception!" )
main.cleanAndExit()
- def stopNet( self, fileName="", timeout=5 ):
+ def stopNet( self, fileName="", timeout=5, exitTimeout=1000 ):
"""
Stops mininet.
Returns main.TRUE if the mininet successfully stops and
@@ -2272,11 +2274,12 @@
pexpect.TIMEOUT ],
timeout )
if i == 0:
- main.log.info( "Exiting mininet..." )
+ main.log.info( "Exiting mininet.." )
+ startTime = time.time()
response = self.execute( cmd="exit",
- prompt="(.*)",
- timeout=120 )
- main.log.info( self.name + ": Stopped" )
+ prompt=self.prompt,
+ timeout=exitTimeout )
+ main.log.info( self.name + ": Stopped\nTime Took : " + str( time.time() - startTime ) )
self.handle.sendline( "sudo mn -c" )
response = main.TRUE
@@ -2808,7 +2811,7 @@
main.log.exception( self.name + ": Uncaught exception!" )
main.cleanAndExit()
- def getSwitches( self, verbose=False ):
+ def getSwitches( self, verbose=False, updateTimeout=1000 ):
"""
Read switches from Mininet.
@@ -2833,7 +2836,7 @@
r"(?P<ports>([^,]+,)*[^,\s]+)" +\
r"\spid=(?P<pid>(\d)+)"
# Update mn port info
- self.update()
+ self.update( updateTimeout )
output = {}
dump = self.dump().split( "\n" )
for line in dump:
@@ -2861,7 +2864,7 @@
main.log.exception( self.name + ": Uncaught exception!" )
main.cleanAndExit()
- def getHosts( self, verbose=False ):
+ def getHosts( self, verbose=False, updateTimeout=1000 ):
"""
Read hosts from Mininet.
@@ -2881,7 +2884,7 @@
hostRE = r"Host\s(?P<name>[^:]+)\:((\s(?P<ifname>[^:]+)\:" +\
"(?P<ip>[^\s]+))|(\s)\spid=(?P<pid>[^>]+))"
# update mn port info
- self.update()
+ self.update( updateTimeout )
# Get mininet dump
dump = self.dump().split( "\n" )
hosts = {}
@@ -2930,7 +2933,7 @@
main.log.exception( self.name + ": Uncaught exception!" )
main.cleanAndExit()
- def getLinks( self, timeout=20 ):
+ def getLinks( self, timeout=20, updateTimeout=1000 ):
"""
Gathers information about current Mininet links. These links may not
be up if one of the ports is down.
@@ -2947,7 +2950,7 @@
hosts, this is just the eth#.
"""
try:
- self.update()
+ self.update( updateTimeout )
response = self.links( timeout=timeout ).split( '\n' )
# Examples:
@@ -3466,7 +3469,7 @@
main.log.exception( self.name + ": Uncaught exception" )
return None
- def update( self ):
+ def update( self, timeout=1000 ):
"""
updates the port address and status information for
each port in mn"""
@@ -3477,8 +3480,7 @@
self.handle.expect( "mininet>" )
self.handle.sendline( "update" )
- self.handle.expect( "update" )
- self.handle.expect( "mininet>" )
+ self.handle.expect( "mininet>", timeout )
self.handle.sendline( "" )
self.handle.expect( "mininet>" )
diff --git a/TestON/drivers/common/cli/onosclidriver.py b/TestON/drivers/common/cli/onosclidriver.py
index 56e728b..4807763 100644
--- a/TestON/drivers/common/cli/onosclidriver.py
+++ b/TestON/drivers/common/cli/onosclidriver.py
@@ -4483,6 +4483,7 @@
assert handle is not None, "Error in sendline"
assert "Command not found:" not in handle, handle
assert "Error:" not in handle, handle
+ assert "Error executing" not in handle, handle
if not handle:
main.log.error( self.name + ": There is no output in " +
"summary command" )
diff --git a/TestON/drivers/common/clidriver.py b/TestON/drivers/common/clidriver.py
index b178700..90b7e3e 100644
--- a/TestON/drivers/common/clidriver.py
+++ b/TestON/drivers/common/clidriver.py
@@ -479,7 +479,7 @@
assert "cannot access" not in output
assert "command not found" not in output
main.log.debug( output )
- lines = [ line for line in output.splitlines() ]
+ lines = [ line for line in output.split('\r\n') ]
retValue = True
if ignoreRoot:
lastIndex = -2
diff --git a/TestON/tests/SCPF/SCPFscaleTopo/SCPFscaleTopo.params b/TestON/tests/SCPF/SCPFscaleTopo/SCPFscaleTopo.params
index 7bfb458..b152611 100755
--- a/TestON/tests/SCPF/SCPFscaleTopo/SCPFscaleTopo.params
+++ b/TestON/tests/SCPF/SCPFscaleTopo/SCPFscaleTopo.params
@@ -8,7 +8,7 @@
# 200 - bring onos node up and balance masters
# 1000 - report logs
# 1,[2,10,300,11,100,300,11,200,300,11,1000]*3
- <testcases>1,[2,10,300,11,1000]*10</testcases>
+ <testcases>1,[3,2,10,300,11,1000]*7,3</testcases>
<DEPENDENCY>
<path>/tests/SCPF/SCPFscaleTopo/dependencies/</path>
@@ -51,12 +51,18 @@
<nodeSleep>10</nodeSleep>
<pingall>15</pingall>
<MNsleep>60</MNsleep>
- <host>0</host>
+ <host>20</host>
</SLEEP>
<TIMEOUT>
# pingall timeout unit: ms
<pingall>0.03</pingall>
+ # others unit: s
+ <basicMininet>1000</basicMininet>
+ <startNet>50</startNet>
+ <stopNet>60</stopNet>
+ <update>40</update>
+ <links>60</links>
</TIMEOUT>
<ATTEMPTS>
@@ -66,7 +72,7 @@
<TOPOLOGY>
<topology>torus</topology>
- <scale>5,10,20,30,35,40,45,50,55,60</scale>
+ <scale>10,20,30,40,50,55,60</scale>
<host>True</host>
</TOPOLOGY>
diff --git a/TestON/tests/SCPF/SCPFscaleTopo/SCPFscaleTopo.py b/TestON/tests/SCPF/SCPFscaleTopo/SCPFscaleTopo.py
index d4740f4..923f056 100644
--- a/TestON/tests/SCPF/SCPFscaleTopo/SCPFscaleTopo.py
+++ b/TestON/tests/SCPF/SCPFscaleTopo/SCPFscaleTopo.py
@@ -74,6 +74,13 @@
main.pingTimeout = float( main.params[ 'TIMEOUT' ][ 'pingall' ] )
main.hostDiscover = main.params[ 'TOPOLOGY' ][ 'host' ]
main.hostDiscoverSleep = float( main.params[ 'SLEEP' ][ 'host' ] )
+ main.basicMNTime = int( main.params[ 'TIMEOUT' ][ 'basicMininet' ] )
+ main.startNetTime = int( main.params[ 'TIMEOUT' ][ 'startNet' ] )
+ main.stopNetTime = int( main.params[ 'TIMEOUT' ][ 'stopNet' ] )
+ main.MNupdateTime = int( main.params[ 'TIMEOUT' ][ 'update' ] )
+ main.MNLinksTime = int( main.params[ 'TIMEOUT' ][ 'links' ] )
+ main.currScale = None
+ main.threadID = 0
if main.hostDiscover == 'True':
main.hostDiscover = True
else:
@@ -132,6 +139,12 @@
- Connect to cli
"""
import time
+ main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster )
+
+ def CASE3( self, main ):
+ """
+ cleanup mininet.
+ """
try:
from tests.dependencies.utils import Utils
except ImportError:
@@ -141,8 +154,8 @@
main.Utils
except ( NameError, AttributeError ):
main.Utils = Utils()
- main.Utils.mininetCleanup( main.Mininet1 )
- main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster )
+ main.Utils.mininetCleanup( main.Mininet1, exitTimeout=main.basicMNTime + ( int( main.currScale ) if main.currScale is not None
+ else 1 ) * main.stopNetTime )
def CASE10( self, main ):
"""
@@ -162,7 +175,7 @@
" --switch ovsm --topo " + main.topoName + "," + main.currScale + "," + main.currScale
for ctrl in main.Cluster.runningNodes:
mnCmd += " --controller remote,ip=" + ctrl.ipAddress
- stepResult = main.Mininet1.startNet( mnCmd=mnCmd )
+ stepResult = main.Mininet1.startNet( mnCmd=mnCmd, timeout=( main.basicMNTime + int( main.currScale ) * main.startNetTime ) )
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
onpass=main.topoName +
@@ -202,6 +215,8 @@
except ( NameError, AttributeError ):
main.topoRelated = Topology()
# First capture
+
+ main.postResult = True
for i in range( 3 ):
# Calculate total time
main.allinfo[ 0 ][ 'info' + str( i ) ][ 'totalTime' ] = main.scaleTopoFunction.getInfoFromLog( main, main.searchTerm[ 'start' ], 'first', main.searchTerm[ 'end' ], 'last', index=i, funcMode='TD' )
@@ -214,72 +229,97 @@
# Calculate the disconnecti rate
main.allinfo[ 0 ][ 'info' + str( i ) ][ 'disconnectRate' ] = main.scaleTopoFunction.getInfoFromLog( main, main.searchTerm[ 'Disconnect' ], 'num', main.searchTerm[ 'start' ], 'num', index=i, funcMode='DR' )
main.log.debug( "The data is " + str( main.allinfo[ 0 ] ) )
-
- main.case( "Verifying topology: TORUS %sx%s" % ( main.currScale, main.currScale ) )
- main.caseExplanation = "Pinging all hosts and comparing topology " +\
- "elements between Mininet and ONOS"
-
- main.log.info( "Gathering topology information" )
- time.sleep( main.MNSleep )
- stepResult = main.TRUE
- main.step( "Comparing MN topology to ONOS topology" )
- compareRetry = 0
- while compareRetry < 3:
- # While loop for retry
- devices = main.topoRelated.getAll( "devices" )
- ports = main.topoRelated.getAll( "ports" )
- links = main.topoRelated.getAll( "links" )
- mnSwitches = main.Mininet1.getSwitches()
- mnLinks = main.Mininet1.getLinks( timeout=180 )
-
- for controller in range( len( main.Cluster.active() ) ):
- currentDevicesResult = main.topoRelated.compareDevicePort(
- main.Mininet1, controller,
- mnSwitches,
- devices, ports )
-
- currentLinksResult = main.topoRelated.compareBase( links, controller,
- main.Mininet1.compareLinks,
- [ mnSwitches, mnLinks ] )
-
- stepResult = stepResult and currentDevicesResult and currentLinksResult
- if stepResult:
- break
- compareRetry += 1
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass=" Topology match Mininet",
- onfail="ONOS Topology doesn't match Mininet" )
-
- if stepResult:
- if main.hostDiscover:
- hostList = []
- for i in range( 1, int( main.currScale ) + 1 ):
- for j in range( 1, int( main.currScale ) + 1 ):
- # Generate host list
- hoststr = "h" + str( i ) + "x" + str( j )
- hostList.append( hoststr )
- for i in range( len( hostList ) ):
- totalHost = main.topo.sendArpPackage( main, hostList[ i ] )
- time.sleep( main.hostDiscoverSleep )
- if totalHost < 0:
- # if totalHost less than 0 which means dependence function has exception.
- main.log.info( "Error when discover host!" )
- break
- if totalHost == int( main.currScale ) * int( main.currScale ):
- main.log.info( "Discovered all hosts" )
- stepResult = stepResult and main.TRUE
- else:
- main.log.warn( "Some hosts ware not discovered by ONOS... Topology doesn't match!" )
- stepResult = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass=" Topology match Mininet",
- onfail="ONOS Topology doesn't match Mininet" )
- main.log.info( "Finished this iteration, continue to scale next topology." )
+ if -1 in main.allinfo[ 0 ][ 'info0' ].values() or -1 in main.allinfo[ 0 ][ 'info1' ].values() or -1 in main.allinfo[ 0 ][ 'info2' ].values():
+ main.log.warn( "Something happened to ONOS. Skip the rest of the steps" )
+ main.postResult = False
else:
- main.log.info( "Clean up and exit TestON. Finished this test." )
- main.cleanAndExit()
+ main.case( "Verifying topology: TORUS %sx%s" % ( main.currScale, main.currScale ) )
+ main.caseExplanation = "Pinging all hosts and comparing topology " +\
+ "elements between Mininet and ONOS"
+
+ main.log.info( "Gathering topology information" )
+ time.sleep( main.MNSleep )
+ stepResult = main.TRUE
+ main.step( "Comparing MN topology to ONOS topology" )
+ compareRetry = 0
+
+ while compareRetry < 3:
+ currentDevicesResult = main.TRUE
+ currentLinksResult = main.TRUE
+ # While loop for retry
+ devices = main.topoRelated.getAll( "devices" )
+ ports = main.topoRelated.getAll( "ports" )
+ links = main.topoRelated.getAll( "links" )
+ mnSwitches = main.Mininet1.getSwitches( updateTimeout=main.basicMNTime + int( main.currScale ) * main.MNupdateTime )
+ main.log.info( "Comparing switches..." )
+ devicePool = []
+ for controller in range( len( main.Cluster.active() ) ):
+ t = main.Thread( target=main.topoRelated.compareDevicePort,
+ threadID=main.threadID,
+ name="Compare-Device-Port",
+ args=[ main.Mininet1, controller,
+ mnSwitches,
+ devices, ports ] )
+ devicePool.append( t )
+ t.start()
+ main.threadID = main.threadID + 1
+
+ mnLinks = main.Mininet1.getLinks( timeout=main.basicMNTime + int( main.currScale ) * main.MNLinksTime,
+ updateTimeout=main.basicMNTime + int(main.currScale) * main.MNupdateTime )
+ main.log.info( "Comparing links..." )
+ linkPool = []
+ for controller in range( len( main.Cluster.active() ) ):
+ t = main.Thread( target=main.topoRelated.compareBase,
+ threadID=main.threadID,
+ name="Compare-Link-Result",
+ args=[ links, controller,
+ main.Mininet1.compareLinks,
+ [ mnSwitches, mnLinks ] ] )
+ linkPool.append( t )
+ t.start()
+ main.threadID = main.threadID + 1
+
+ for t in devicePool:
+ t.join()
+ currentDevicesResult = currentDevicesResult and t.result
+ for t in linkPool:
+ t.join()
+ currentLinksResult = currentLinksResult and t.result
+ stepResult = stepResult and currentDevicesResult and currentLinksResult
+ if stepResult:
+ break
+ compareRetry += 1
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass=" Topology match Mininet",
+ onfail="ONOS Topology doesn't match Mininet" )
+
+ if stepResult:
+ if main.hostDiscover:
+ hostList = []
+ for i in range( 1, int( main.currScale ) + 1 ):
+ for j in range( 1, int( main.currScale ) + 1 ):
+ # Generate host list
+ hoststr = "h" + str( i ) + "x" + str( j )
+ hostList.append( hoststr )
+ for i in range( len( hostList ) ):
+ main.topo.sendArpPackage( main, hostList[ i ] )
+ time.sleep( 20 )
+ totalHost = main.topo.getHostNum( main )
+ if totalHost == int( main.currScale ) * int( main.currScale ):
+ main.log.info( "Discovered all hosts" )
+ stepResult = stepResult and main.TRUE
+ else:
+ main.log.warn( "Some hosts ware not discovered by ONOS... Topology doesn't match!" )
+ stepResult = main.FALSE
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass=" Topology match Mininet",
+ onfail="ONOS Topology doesn't match Mininet" )
+ main.log.info( "Finished this iteration, continue to scale next topology." )
+ else:
+ main.log.info( "Clean up and exit TestON. Finished this test." )
+ main.cleanAndExit()
def CASE100( self, main ):
"""
@@ -356,76 +396,77 @@
Report errors/warnings/exceptions
"""
# Compare the slowest Node through total time of each node
- slowestNode = 0
- slowestTotalTime = 0
- # Second capture
- for i in range( 3 ):
- # Calculate total time
- main.allinfo[ 1 ][ 'info' + str( i ) ][ 'totalTime' ] = main.scaleTopoFunction.getInfoFromLog( main,
- main.searchTerm[ 'start' ],
- 'first',
- main.searchTerm[ 'end' ],
- 'last',
- index=i,
- funcMode='TD' )
- # Compare the total time
- if main.allinfo[ 1 ][ 'info' + str( i ) ][ 'totalTime' ] > slowestTotalTime:
- slowestTotalTime = main.allinfo[ 1 ][ 'info' + str( i ) ][ 'totalTime' ]
- slowestNode = i
- # Calculate switch connection time
- main.allinfo[ 1 ][ 'info' + str( i ) ][ 'swConnection' ] = main.scaleTopoFunction.getInfoFromLog( main,
- main.searchTerm[ 'start' ],
- 'first',
- main.searchTerm[ 'start' ],
- 'last',
- index=i,
- funcMode='TD' )
- # Calculate the time from last switch connection to the last role request
- main.allinfo[ 1 ][ 'info' + str( i ) ][ 'lastSwToLastRr' ] = main.scaleTopoFunction.compareTimeDiffWithRoleRequest( main,
- main.searchTerm[ 'start' ],
- 'last',
- index=i )
- # Calculate the time from the last role request to the last topology
- main.allinfo[ 1 ][ 'info' + str( i ) ][ 'lastRrToLastTopology' ] = main.scaleTopoFunction.compareTimeDiffWithRoleRequest( main,
- main.searchTerm[ 'end' ],
- 'last',
- index=i )
- # Calculate the disconnecti rate
- main.allinfo[ 1 ][ 'info' + str( i ) ][ 'disconnectRate' ] = main.scaleTopoFunction.getInfoFromLog( main,
- main.searchTerm[ 'Disconnect' ],
- 'num',
- main.searchTerm[ 'start' ],
- 'num',
- index=i,
- funcMode='DR' )
+ if main.postResult:
+ slowestNode = 0
+ slowestTotalTime = 0
+ # Second capture
+ for i in range( 3 ):
+ # Calculate total time
+ main.allinfo[ 1 ][ 'info' + str( i ) ][ 'totalTime' ] = main.scaleTopoFunction.getInfoFromLog( main,
+ main.searchTerm[ 'start' ],
+ 'first',
+ main.searchTerm[ 'end' ],
+ 'last',
+ index=i,
+ funcMode='TD' )
+ # Compare the total time
+ if main.allinfo[ 1 ][ 'info' + str( i ) ][ 'totalTime' ] > slowestTotalTime:
+ slowestTotalTime = main.allinfo[ 1 ][ 'info' + str( i ) ][ 'totalTime' ]
+ slowestNode = i
+ # Calculate switch connection time
+ main.allinfo[ 1 ][ 'info' + str( i ) ][ 'swConnection' ] = main.scaleTopoFunction.getInfoFromLog( main,
+ main.searchTerm[ 'start' ],
+ 'first',
+ main.searchTerm[ 'start' ],
+ 'last',
+ index=i,
+ funcMode='TD' )
+ # Calculate the time from last switch connection to the last role request
+ main.allinfo[ 1 ][ 'info' + str( i ) ][ 'lastSwToLastRr' ] = main.scaleTopoFunction.compareTimeDiffWithRoleRequest( main,
+ main.searchTerm[ 'start' ],
+ 'last',
+ index=i )
+ # Calculate the time from the last role request to the last topology
+ main.allinfo[ 1 ][ 'info' + str( i ) ][ 'lastRrToLastTopology' ] = main.scaleTopoFunction.compareTimeDiffWithRoleRequest( main,
+ main.searchTerm[ 'end' ],
+ 'last',
+ index=i )
+ # Calculate the disconnecti rate
+ main.allinfo[ 1 ][ 'info' + str( i ) ][ 'disconnectRate' ] = main.scaleTopoFunction.getInfoFromLog( main,
+ main.searchTerm[ 'Disconnect' ],
+ 'num',
+ main.searchTerm[ 'start' ],
+ 'num',
+ index=i,
+ funcMode='DR' )
- if ( main.allinfo[ 0 ] != main.allinfo[ 1 ] ):
- main.log.error( "The results of two capture are different!" )
- main.log.debug( "The data is " + str( main.allinfo ) )
- if main.writeData != -1:
- main.log.info( "Write the date into database" )
- # write the date into data base
- with open( main.dbFilePath, "a" ) as dbFile:
- temp = str( main.currScale )
- temp += ",'baremetal1'"
- # put result from second capture into data base
- temp += "," + str( "%.2f" % main.allinfo[ 1 ][ 'info' + str( slowestNode ) ][ 'totalTime' ] )
- temp += "," + str( "%.2f" % main.allinfo[ 1 ][ 'info' + str( slowestNode ) ][ 'swConnection' ] )
- temp += "," + str( "%.2f" % main.allinfo[ 1 ][ 'info' + str( slowestNode ) ][ 'lastSwToLastRr' ] )
- temp += "," + str( "%.2f" % main.allinfo[ 1 ][ 'info' + str( slowestNode ) ][ 'lastRrToLastTopology' ] )
- temp += "," + str( "%.2f" % main.allinfo[ 1 ][ 'info' + str( slowestNode ) ][ 'disconnectRate' ] )
- temp += "\n"
- dbFile.write( temp )
- else:
- main.log.error( "The data from log is wrong!" )
- main.writeData = 1
- main.case( "Checking logs for errors, warnings, and exceptions" )
- main.log.info( "Error report: \n" )
- main.ONOSbench.logReport( main.Cluster.active( 0 ).ipAddress,
- [ "INFO",
- "FOLLOWER",
- "WARN",
- "flow",
- "ERROR",
- "Except" ],
- "s" )
+ if ( main.allinfo[ 0 ] != main.allinfo[ 1 ] ):
+ main.log.error( "The results of two capture are different!" )
+ main.log.debug( "The data is " + str( main.allinfo ) )
+ if main.writeData != -1:
+ main.log.info( "Write the date into database" )
+ # write the date into data base
+ with open( main.dbFilePath, "a" ) as dbFile:
+ temp = str( main.currScale )
+ temp += ",'baremetal1'"
+ # put result from second capture into data base
+ temp += "," + str( "%.2f" % main.allinfo[ 1 ][ 'info' + str( slowestNode ) ][ 'totalTime' ] )
+ temp += "," + str( "%.2f" % main.allinfo[ 1 ][ 'info' + str( slowestNode ) ][ 'swConnection' ] )
+ temp += "," + str( "%.2f" % main.allinfo[ 1 ][ 'info' + str( slowestNode ) ][ 'lastSwToLastRr' ] )
+ temp += "," + str( "%.2f" % main.allinfo[ 1 ][ 'info' + str( slowestNode ) ][ 'lastRrToLastTopology' ] )
+ temp += "," + str( "%.2f" % main.allinfo[ 1 ][ 'info' + str( slowestNode ) ][ 'disconnectRate' ] )
+ temp += "\n"
+ dbFile.write( temp )
+ else:
+ main.log.error( "The data from log is wrong!" )
+ main.writeData = 1
+ main.case( "Checking logs for errors, warnings, and exceptions" )
+ main.log.info( "Error report: \n" )
+ main.ONOSbench.logReport( main.Cluster.active( 0 ).ipAddress,
+ [ "INFO",
+ "FOLLOWER",
+ "WARN",
+ "flow",
+ "ERROR",
+ "Except" ],
+ "s" )
diff --git a/TestON/tests/SCPF/SCPFscaleTopo/dependencies/scaleTopoFunction.py b/TestON/tests/SCPF/SCPFscaleTopo/dependencies/scaleTopoFunction.py
index 7620354..964f0c2 100644
--- a/TestON/tests/SCPF/SCPFscaleTopo/dependencies/scaleTopoFunction.py
+++ b/TestON/tests/SCPF/SCPFscaleTopo/dependencies/scaleTopoFunction.py
@@ -70,6 +70,9 @@
except IndexError:
main.log.error( "Got wrong role request string from Tshark file" )
return -1
+ except ValueError:
+ main.log.error( "Got wrong string from log" )
+ return -1
def compareTimeDiffWithRoleRequest( main, term, Mode, index=0 ):
@@ -93,7 +96,9 @@
main.log.error( "Catch the wrong information of search term " )
main.writeData = -1
return -1
-
+ except ValueError:
+ main.log.error( "Got wrong string from log" )
+ return -1
def getInfoFromLog( main, term1, mode1, term2, mode2, index=0, funcMode='TD' ):
"""
@@ -139,7 +144,9 @@
main.log.error( "Catch the wrong information of search term" )
main.writeData = -1
return -1
-
+ except ValueError:
+ main.log.error( "Got wrong string from log" )
+ return -1
def testTopology( main, topoFile='', args='', mnCmd='', timeout=300, clean=True ):
"""
diff --git a/TestON/tests/SCPF/SCPFscaleTopo/dependencies/topo.py b/TestON/tests/SCPF/SCPFscaleTopo/dependencies/topo.py
index 373ed2b..4476dfd 100644
--- a/TestON/tests/SCPF/SCPFscaleTopo/dependencies/topo.py
+++ b/TestON/tests/SCPF/SCPFscaleTopo/dependencies/topo.py
@@ -37,14 +37,15 @@
if isinstance( hostList, list ):
for h in hostList:
main.Mininet1.arping( srcHost=h, dstHost="10.0.0.1", output=main.FALSE, noResult=True )
- time.sleep( 0.5 )
else:
main.Mininet1.arping( srcHost=hostList, dstHost="10.0.0.1", output=main.FALSE, noResult=True )
+
+def getHostNum( main ):
try:
summaryStr = ""
summaryStr = json.loads( main.Cluster.active( 0 ).CLI.summary().encode() )
hostNum = summaryStr.get( 'hosts' )
-
+ main.log.info( "host nums from ONOS : " + str( hostNum ) )
except ( TypeError, ValueError ):
main.log.exception( " Object not as expected: {!r}".format( summaryStr ) )
return -1
diff --git a/TestON/tests/dependencies/utils.py b/TestON/tests/dependencies/utils.py
index 5e15c2a..e1c2027 100644
--- a/TestON/tests/dependencies/utils.py
+++ b/TestON/tests/dependencies/utils.py
@@ -35,7 +35,7 @@
main.case( "Stop Mininet" )
main.caseExplanation = "Stopping the current mininet to start up fresh"
- def mininetCleanup( self, Mininet, timeout=5 ):
+ def mininetCleanup( self, Mininet, timeout=5, exitTimeout=1000 ):
"""
Description:
Clean up the mininet using stopNet and verify it.
@@ -47,7 +47,7 @@
else returns main.FALSE
"""
main.step( "Stopping Mininet" )
- topoResult = Mininet.stopNet( timeout=timeout )
+ topoResult = Mininet.stopNet( timeout=timeout, exitTimeout=exitTimeout )
utilities.assert_equals( expect=main.TRUE,
actual=topoResult,
onpass="Successfully stopped mininet",