--- /dev/null
+*** Settings ***
+Library OperatingSystem
+
+*** Variables ***
+${karaf_shell_port} 8101
+
+*** Keywords ***
+Verify Feature Is Installed
+ [Documentation] Will Succeed if the given ${feature_name} is found in the output of "feature:list -i" by
+ ... ssh'ing to the karaf console running on ${CONTROLLER}
+ [arguments] ${feature_name} ${controller}=${CONTROLLER} ${karaf_port}=${karaf_shell_port} ${prompt}=${linux_prompt} ${prompt_timeout}=5s
+ ${output}= Run sshpass -p karaf ssh -p ${karaf_port} karaf@${controller} feature:list -i
+ Should Contain ${output} ${feature_name}
+
+Verify Feature Is Not Installed
+ [Documentation] Will Succeed if the given ${feature_name} is NOT found in the output of "feature:list -i" by
+ ... ssh'ing to the karaf console running on ${CONTROLLER}
+ [arguments] ${feature_name} ${controller}=${CONTROLLER} ${karaf_port}=${karaf_shell_port} ${prompt}=${linux_prompt} ${prompt_timeout}=5s
+ ${output}= Run sshpass -p karaf ssh -p ${karaf_port} karaf@${controller} feature:list -i
+ Should Not Contain ${output} ${feature_name}
\ No newline at end of file
[Documentation] Will strip ALL quotes from given string and return the new string
${string_to_return}= Replace String ${string_to_strip} " \ count=-1
[Return] ${string_to_return}
+
+Run Command On Remote System
+ [Arguments] ${remote_system} ${cmd} ${user}=${MININET_USER} ${prompt}=${LINUX_PROMPT} ${prompt_timeout}=30s
+ [Documentation] Reduces the common work of running a command on a remote system to a single higher level robot keyword,
+ ... taking care to log in with a public key and. The command given is written and the output returned. No test conditions
+ ... are checked.
+ Log Attempting to execute ${cmd} on ${remote_system}
+ ${conn_id}= Open Connection ${remote_system} prompt=${prompt} timeout=${prompt_timeout}
+ Login With Public Key ${user} ${USER_HOME}/.ssh/id_rsa any
+ Write ${cmd}
+ ${output}= Read Until ${linux_prompt}
+ [Return] ${output}
+
+Verify File Exists On Remote System
+ [Arguments] ${remote_system} ${file} ${user}=${MININET_USER} ${prompt}=${LINUX_PROMPT} ${prompt_timeout}=5s
+ [Documentation] Will create connection with public key and will PASS if the given ${file} exists, otherwise will FAIL
+ ${conn_id}= Open Connection ${remote_system} prompt=${prompt} timeout=${prompt_timeout}
+ Login With Public Key ${user} ${USER_HOME}/.ssh/id_rsa any
+ SSHLibrary.File Should Exist ${file}
--- /dev/null
+*** Settings ***
+Documentation Cbench Latency and Throughput tests can be run from an external
+... cbench.
+... If cbench is run with a medium number of switches or higher (e.g. 32+)
+... the normal openflow operations seem to break.
+... BUG: https://bugs.opendaylight.org/show_bug.cgi?id=2897
+Suite Setup Cbench Suite Setup
+Force Tags cbench
+Library String
+Resource ../../../libraries/Utils.txt
+Resource ../../../libraries/KarafKeywords.txt
+
+
+*** Variables ***
+${throughput_threshold} 30000
+${latency_threshold} 10000
+${switch_count} 8
+${duration_in_secs} 12
+${loops} 10
+${num_of_unique_macs} 10000
+${cbench_system} ${MININET}
+${cbench_executable} /usr/local/bin/cbench
+
+*** Testcases ***
+Cbench Throughput Test
+ [Documentation] cbench executed in throughput mode (-t). Test parameters have defaults, but can be overridden
+ ... on the pybot command line
+ [Tags] throughput
+ [Timeout] ${test_timeout}
+ Log Cbench tests using ${loops} iterations of ${duration_in_secs} second tests. Switch Count: ${switch_count}. Unique MACS to cycle: ${num_of_unique_macs}
+ Run Cbench And Log Results -t -m ${duration_in_ms} -M ${num_of_unique_macs} -s ${switch_count} -l ${loops} ${throughput_threshold}
+
+Cbench Latency Test
+ [Documentation] cbench executed in default latency mode. Test parameters have defaults, but can be overridden
+ ... on the pybot command line
+ [Tags] latency
+ [Timeout] ${test_timeout}
+ Log Cbench tests using ${loops} iterations of ${duration_in_secs} second tests. Switch Count: ${switch_count}. Unique MACS to cycle: ${num_of_unique_macs}
+ Run Cbench And Log Results -m ${duration_in_ms} -M ${num_of_unique_macs} -s ${switch_count} -l ${loops} ${latency_threshold}
+
+*** Keywords ***
+Run Cbench And Log Results
+ [Arguments] ${cbench_args} ${average_threshold}
+ ${output}= Run Command On Remote System ${cbench_system} ${cbench_executable} -c ${CONTROLLER} ${cbench_args} prompt_timeout=${test_timeout}
+ Log ${output}
+ Should Contain ${output} RESULT
+ ${result_line}= Get Lines Containing String ${output} RESULT
+ @{results_list}= Split String ${result_line}
+ Log ${results_list[5]}
+ Log ${results_list[7]}
+ @{result_name_list}= Split String ${results_list[5]} /
+ @{result_value_list}= Split String ${results_list[7]} /
+ ${num_stats}= Get Length ${result_name_list}
+ : FOR ${i} IN RANGE 0 ${num_stats}
+ \ Log ${result_name_list[${i}]} :: ${result_value_list[${i}]}
+ ${min}= Set Variable ${result_value_list[${0}]}
+ ${max}= Set Variable ${result_value_list[${1}]}
+ ${average}= Set Variable ${result_value_list[${2}]}
+ ${stdev}= Set Variable ${result_value_list[${3}]}
+ ${date}= Get Time d,m,s
+ Log CBench Result: ${date},${cbench_args},${min},${max},${average},${stdev}
+ Should Be True ${average} > ${average_threshold} Flow mod per/sec threshold was not met
+
+Cbench Suite Setup
+ ${duration_in_ms} Evaluate ${duration_in_secs} * 1000
+ Set Suite Variable ${duration_in_ms}
+ ##Setting the test timeout dynamically in case larger values on command line override default
+ ${test_timeout} Evaluate (${loops} * ${duration_in_secs}) * 1.5
+ Set Suite Variable ${test_timeout}
+ Verify File Exists On Remote System ${cbench_system} ${cbench_executable}
+ Should Be True ${loops} >= 2 If number of loops is less than 2, cbench will not run
+ Verify Feature Is Installed odl-openflowplugin-drop-test
\ No newline at end of file
$ vagrant status
Current machine states:
-centos not created (virtualbox)
+fedora not created (virtualbox)
ubuntu not created (virtualbox)
```
$ vagrant up <name of box>
```
-For example, to start the CentOS tools VM:
+For example, to start the Fedora tools VM:
```ShellSession
-$ vagrant up centos
+$ vagrant up fedora
```
#### Connecting to boxes
$ vagrant ssh <name of box>
```
-For example, to connect to the CentOS tools VM:
+For example, to connect to the Fedora tools VM:
```ShellSession
-$ vagrant ssh centos
-[vagrant@tools-centos ~]$
+$ vagrant ssh fedora
+[vagrant@tools-fedora ~]$
```
#### Cleaning up boxes
# Initial Vagrant configuration
Vagrant.configure(2) do |config|
- # --------------------------------
- # Shared VirtualBox configuration
- # --------------------------------
+ # ---------------------
+ # Shared configurations
+ # ---------------------
+
+ # Enables SSH X11 forwarding
+ config.ssh.forward_x11 = "true"
+
+ # VirtualBox configuration
config.vm.provider "virtualbox" do |vb|
# Set RAM in MB
vb.memory = $MEMORY
vb.cpus = $CPU
end
- # --------------------------
- # Configuration for CentOS 7
- # --------------------------
- config.vm.define "centos" do |centos|
- # Build Vagrant box based on CentOS 7
- centos.vm.box = "chef/centos-7.0"
+ # ---------------------------
+ # Configuration for Fedora 20
+ # ---------------------------
+
+ # Multi-machine definition for Fedora
+ config.vm.define "fedora" do |fedora|
+ # Build Vagrant box based on Fedora 20
+ fedora.vm.box = "chef/fedora-20"
# Set hostname of box
- centos.vm.hostname = "tools-centos"
- # Enable X11 SSH forwarding for GUI applications
- config.ssh.forward_x11 = "true"
+ fedora.vm.hostname = "tools-fedora"
+ # Use PTY for provisionning
+ fedora.ssh.pty = "True"
# Use shell provisioner to install additional packages
- centos.vm.provision "shell", path: "scripts/centos.sh"
+ fedora.vm.provision "shell", path: "scripts/fedora.sh"
# Install OpenDaylight using its Puppet module
- centos.vm.provision "puppet" do |puppet|
+ fedora.vm.provision "puppet" do |puppet|
puppet.module_path = ["modules"]
puppet.manifest_file = "odl_install.pp"
end
# VirtualBox configuration specific to this box
- centos.vm.provider "virtualbox" do |vb|
- # Name of VirtualBox guest machine
- vb.name = "Integration Tools: CentOS-7"
+ fedora.vm.provider "virtualbox" do |vb|
+ # Name for guest machine
+ vb.name = "Integration Tools: Fedora 20"
end
end
# ----------------------------------
# Configuration for Ubuntu 14.04 LTS
# ----------------------------------
+
+ # Multi-machine definition for Ubuntu
config.vm.define "ubuntu" do |ubuntu|
# Build Vagrant box based on Ubuntu 14.04
ubuntu.vm.box = "ubuntu/trusty64"
# Set hostname of box
ubuntu.vm.hostname = "tools-ubuntu"
- # Enable X11 SSH forwarding for GUI applications
- ubuntu.ssh.forward_x11 = "true"
# Use shell provisioner to install additional packages
- #ubuntu.vm.provision "shell", path: "scripts/ubuntu.sh"
+ ubuntu.vm.provision "shell", path: "scripts/ubuntu.sh"
# VirtualBox configuration specific to this box
ubuntu.vm.provider "virtualbox" do |vb|
- # Name of VirtualBox guest machine
- vb.name = "Integration Tools: Ubuntu-14.04"
+ # Name for guest machine
+ vb.name = "Integration Tools: Ubuntu 14.04"
end
end
end
-# External shell script for the vagrant shell provisioner
-# This applies for the CentOS VM
+#!/usr/bin/env bash
+
+# --------------------------------------------
+# External shell provisioner script for Fedora
+# --------------------------------------------
# Add EPEL repo for access to Puppet, git-review, etc.
sudo yum install -y epel-release
# Install other packages (must be done after EPEL repo add)
sudo yum install -y \
puppet \
- git \
- git-review \
- vim \
- nano
+ git
-# External shell script for the vagrant shell provisioner
-# This applies for the Ubuntu VM
+#!/usr/bin/env bash
-#TODO
+# --------------------------------------------
+# External shell provisioner script for Ubuntu
+# --------------------------------------------
+
+# Install initial softwares:
+apt-get update
+apt-get install -y \
+ openjdk-7-jre \
+ openjdk-7-jdk \
+ git
+
+# Install Maven
+wget -nv http://apache.sunsite.ualberta.ca/maven/maven-3/3.3.1/binaries/apache-maven-3.3.1-bin.tar.gz
+mkdir -p /usr/local/apache-maven
+tar -C /usr/local/apache-maven/ -xzf apache-maven-3.3.1-bin.tar.gz
+echo "export PATH=$PATH:/usr/local/apache-maven/apache-maven-3.3.1/bin" >> /home/vagrant/.bash_profile
+echo "MAVEN_OPTS=\"-Xms256m -Xmx512m\"" >> /home/vagrant/.bash_profile