Create mininet image with OVS 2.6.1 76/62276/7
authorVictor Pickard <vpickard@redhat.com>
Thu, 24 Aug 2017 14:35:55 +0000 (10:35 -0400)
committerAnil Belur <abelur@linuxfoundation.org>
Tue, 29 Aug 2017 21:26:27 +0000 (07:26 +1000)
Netvirt L2GW CSIT needs OVS 2.6.1 to get newer
version (1.6.0) of the hardware_vtep schema.

This newer version is needed so that we can set
the replication_mode of the logical switch to
"source_node", so that BUM pkts will be replicated
by the HWVTEP (or HWVTEP emulator, in CSIT tests).

I have tested HWVTEP csit with OVS 2.6.1 in sandbox.
Here is a link to those runs, build 28 is where
the test run starts with successful upgrade
to OVS 2.6.1.

https://jenkins.opendaylight.org/sandbox/job/netvirt-csit-hwvtep-1node-openstack-newton-upstream-transparent-nitrogen/

There are 8 failures, in the BGP VPN test suite,
but they are not due to this patch. These tests
fail because quagga bgp was not in the image.

Change-Id: Ie26617b8f168cf3afad63f06bd25da152ac4a342
Signed-off-by: Victor Pickard <vpickard@redhat.com>
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
also-by: Anil Belur <abelur@linuxfoundation.org>

packer/provision/mininet-ovs-2.6.sh [new file with mode: 0644]
packer/templates/mininet-ovs-2.6.json [new file with mode: 0644]

diff --git a/packer/provision/mininet-ovs-2.6.sh b/packer/provision/mininet-ovs-2.6.sh
new file mode 100644 (file)
index 0000000..5e32c11
--- /dev/null
@@ -0,0 +1,78 @@
+#!/bin/bash -x
+
+# vim: sw=4 ts=4 sts=4 et tw=72 :
+
+# force any errors to cause the script and job to end in failure
+set -xeu -o pipefail
+
+# Ensure that necessary variables are set to enable noninteractive mode in
+# commands.
+export DEBIAN_FRONTEND=noninteractive
+
+# To handle the prompt style that is expected all over the environment
+# with how use use robotframework we need to make sure that it is
+# consistent for any of the users that are created during dynamic spin
+# ups
+echo 'PS1="[\u@\h \W]> "' >> /etc/skel/.bashrc
+
+echo '---> Install OpenVSwitch 2.6.1'
+apt-get update -m
+apt-get install dh-autoreconf debhelper autoconf automake libssl-dev pkg-config bzip2 openssl python-all procps python-qt4 python-zopeinterface python-twisted-conch
+mkdir /root/ovs
+cd /root
+pwd
+wget http://openvswitch.org/releases/openvswitch-2.6.1.tar.gz
+tar -xzvf openvswitch-2.6.1.tar.gz -C /root/ovs --strip-components=1
+cd /root/ovs
+DEB_BUILD_OPTIONS='parallel=8 nocheck' fakeroot debian/rules binary
+cd /root
+dpkg -i openvswitch-common_2.6.1-1_amd64.deb openvswitch-switch_2.6.1-1_amd64.deb python-openvswitch_2.6.1-1_all.deb openvswitch-vtep_2.6.1-1_amd64.deb
+systemctl unmask openvswitch-switch
+service openvswitch-switch start
+service openvswitch-vtep start
+echo '---> Waiting 15 secs for services to start'
+sleep 15
+ovs-vsctl --version
+ovs-vsctl show
+ps -elf|grep ovs
+ps -elf|grep vtep
+echo '---> Finished installing OpenVSwitch 2.6.1'
+
+echo '---> Installing mininet'
+apt-get install mininet
+
+echo '---> Installing build pre-requisites'
+apt-get install build-essential snmp libsnmp-dev snmpd libpcap-dev \
+autoconf make automake libtool libconfig-dev libssl-dev libffi-dev libssl-doc pkg-config
+
+git clone https://github.com/intracom-telecom-sdn/mtcbench.git
+mtcbench/deploy/docker/provision.sh
+# TODO: remove workaround for build issue with mtcbench
+# when mtcbench dependency build correctly
+# https://github.com/intracom-telecom-sdn/mtcbench/issues/10
+mtcbench/build_mtcbench.sh || true
+cd mtcbench/oflops/cbench
+make
+cp cbench /usr/local/bin/
+
+echo '---> Installing exabgp'
+apt-get install exabgp
+
+# Install vlan for vlan based tests in VTN suites
+apt-get install vlan
+
+# Install netaddr package which is needed by some custom mininet topologies
+apt-get install python-netaddr
+
+# Check out quagga , compile and install for router functionalities
+echo "Installing the Quagga..."
+mkdir -p /tmp/build_quagga
+cd /tmp/build_quagga
+git clone https://github.com/6WIND/zrpcd.git
+cd zrpcd
+git checkout 20170731
+chmod a+x /tmp/build_quagga/zrpcd/pkgsrc/dev_compile_script.sh
+/tmp/build_quagga/zrpcd/pkgsrc/dev_compile_script.sh -d -b -t
+
+# Removing the build_quagga folder
+rm -rf /tmp/build_quagga/
diff --git a/packer/templates/mininet-ovs-2.6.json b/packer/templates/mininet-ovs-2.6.json
new file mode 100644 (file)
index 0000000..5bb8ba5
--- /dev/null
@@ -0,0 +1,67 @@
+{
+  "variables": {
+    "public_base_image": null,
+    "public_network": null,
+    "public_cloud_user": null,
+    "public_auth_url": null,
+    "public_tenant": null,
+    "public_user": null,
+    "public_pass": null,
+    "private_base_image": null,
+    "private_network": null,
+    "private_cloud_user": null,
+    "private_auth_url": null,
+    "private_tenant": null,
+    "private_user": null,
+    "private_pass": null,
+    "distro": null,
+    "cloud_user_data": null
+  },
+  "builders": [
+    {
+      "type": "openstack",
+      "name": "public_cloud",
+      "identity_endpoint": "{{user `public_auth_url`}}",
+      "tenant_name": "{{user `public_tenant`}}",
+      "username": "{{user `public_user`}}",
+      "password": "{{user `public_pass`}}",
+      "region": "DFW",
+      "ssh_username": "{{user `public_cloud_user`}}",
+      "image_name": "{{user `distro`}} - mininet-ovs-26 - {{isotime \"20060102-1504\"}}",
+      "source_image_name": "{{user `public_base_image`}}",
+      "flavor": "general1-1",
+      "networks": [
+        "{{user `public_network`}}"
+      ],
+      "user_data_file": "{{user `cloud_user_data`}}"
+    },
+    {
+      "type": "openstack",
+      "name": "private_cloud",
+      "identity_endpoint": "{{user `private_auth_url`}}",
+      "tenant_name": "{{user `private_tenant`}}",
+      "username": "{{user `private_user`}}",
+      "password": "{{user `private_pass`}}",
+      "ssh_username": "{{user `private_cloud_user`}}",
+      "image_name": "{{user `distro`}} - mininet-ovs-26 - {{isotime \"20060102-1504\"}}",
+      "source_image_name": "{{user `private_base_image`}}",
+      "flavor": "general1-1",
+      "networks": [
+        "{{user `private_network`}}"
+      ],
+      "user_data_file": "{{user `cloud_user_data`}}"
+    }
+  ],
+  "provisioners": [
+    {
+      "type": "shell",
+      "scripts": [
+        "provision/baseline.sh",
+        "provision/mininet-ovs-2.6.sh",
+        "provision/system_reseal_local_env.sh",
+        "provision/system_reseal.sh"
+      ],
+      "execute_command": "chmod +x {{ .Path }}; if [ \"$UID\" == \"0\" ]; then {{ .Vars }} '{{ .Path }}'; else {{ .Vars }} sudo -E '{{ .Path }}'; fi"
+    }
+  ]
+}