aboutsummaryrefslogtreecommitdiffstats
path: root/functest/utils/__init__.py
blob: e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 (plain)

onstant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Date: Wed, 25 Jan 2017 22:11:44 +0100
Subject: [PATCH] deb-src: Enable building Debian source pkgs

Armband plans on shipping prebuilt binaries.
Opensource rules dictate they should be accompanied by the
corresponding source packages.

So, add the possibility to also build Debian sources when a
dummy "ovs_build/build_debian_source" file exists (to avoid
passing an useless env var to each docker run).

Change-Id: I4e308d84c2eb01af043ed73440c46fc692c30d12
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
---
 ovs_build/build-ovs-dpdk.sh                        | 28 +++++++++++++++++-----
 ovs_build/build-ovs-nsh.sh                         | 26 +++++++++++++++++---
 .../debian/patches/series                          |  1 -
 3 files changed, 45 insertions(+), 10 deletions(-)
 delete mode 100644 ovs_build/openvswitch_2.6-dpdk_16.07/debian/patches/series

diff --git a/ovs_build/build-ovs-dpdk.sh b/ovs_build/build-ovs-dpdk.sh
index 7ce2a62..8dd7430 100755
--- a/ovs_build/build-ovs-dpdk.sh
+++ b/ovs_build/build-ovs-dpdk.sh
@@ -11,14 +11,30 @@ DEB_ARCH="$(dpkg --print-architecture)"

 export DEB_BUILD_OPTIONS='parallel=8 nocheck'

+function debian_build() {
+  if [ -f "${BUILD_SRC}/build_debian_source" ]; then
+    dpkg-source -b .
+    cp -f ../*.{dsc,xz} ${BUILD_HOME}/deb
+  fi
+  debian/rules build; fakeroot debian/rules binary
+}
+
+function debian_src_prepare_ovs() {
+  if [ -f "${BUILD_SRC}/build_debian_source" ]; then
+    suffix="${OVS_VER}.orig.tar.xz"
+    tar cJf ../openvswitch_${suffix} --exclude='./debian' .
+    cd ..; ln -sf openvswitch_${suffix} openvswitch-dpdk_${suffix}; cd -
+  fi
+}
+
 sudo apt-get update
 sudo apt-get -y --force-yes install devscripts dpkg-dev git wget dkms

 rm -rf ${BUILD_HOME}; mkdir -p ${BUILD_HOME}/deb

 cd ${BUILD_HOME}
-wget -c http://fast.dpdk.org/rel/dpdk-16.07.tar.xz
-xz -d dpdk-16.07.tar.xz; tar xvf dpdk-16.07.tar
+wget -c http://fast.dpdk.org/rel/dpdk-16.07.tar.xz -O dpdk_16.07.orig.tar.xz
+tar xJvf dpdk_16.07.orig.tar.xz
 cd dpdk-16.07
 cp -r ${BUILD_SRC}/dpdk_16.07.fuel/debian .
 cat << EOF > debian/changelog
@@ -45,7 +61,7 @@ sudo apt-get install -y --force-yes debhelper \
                python-sphinx  \
                texlive-fonts-recommended  \
                texlive-latex-extra
-debian/rules build; fakeroot debian/rules binary
+debian_build

 cd ${BUILD_HOME}
 sudo apt-get install -y --force-yes hwdata
@@ -73,7 +89,7 @@ sudo apt-get install -y --force-yes autoconf \
                python-six

 git clone https://github.com/openvswitch/ovs.git
-cd ovs; git checkout ${OVS_COMMIT}; rm -rf .git
+cd ovs; git checkout ${OVS_COMMIT}; rm -rf .git; debian_src_prepare_ovs
 cd ${BUILD_HOME}; cp -r ovs ovs-dpdk

 cd ovs-dpdk
@@ -86,10 +102,10 @@ openvswitch-dpdk (${OVS_VER}-1) unstable; urgency=low
  -- Open vSwitch team <dev@openvswitch.org>  $(date --rfc-2822)
 EOF

-debian/rules build; fakeroot debian/rules binary
+debian_build

 cd ${BUILD_HOME}/ovs
-debian/rules build; fakeroot debian/rules binary
+debian_build

 cp -r ${BUILD_HOME}/*.deb ${BUILD_HOME}/deb
 cd ${BUILD_HOME}/deb
diff --git a/ovs_build/build-ovs-nsh.sh b/ovs_build/build-ovs-nsh.sh
index dbebdb2..efbabab 100755
--- a/ovs_build/build-ovs-nsh.sh
+++ b/ovs_build/build-ovs-nsh.sh
@@ -11,6 +11,22 @@ DEB_ARCH="$(dpkg --print-architecture)"

 export DEB_BUILD_OPTIONS='parallel=8 nocheck'

+function debian_build() {
+  if [ -f "${BUILD_SRC}/build_debian_source" ]; then
+    dpkg-source -b .
+    cp -f ../*.{dsc,xz} ${BUILD_HOME}/deb
+  fi
+  debian/rules build; fakeroot debian/rules binary
+}
+
+function debian_src_prepare_ovs() {
+  if [ -f "${BUILD_SRC}/build_debian_source" ]; then
+    suffix="${OVS_VER}.orig.tar.xz"
+    tar cJf ../openvswitch_${suffix} --exclude='./debian' .
+    cd ..; ln -sf openvswitch_${suffix} openvswitch-dpdk_${suffix}; cd -
+  fi
+}
+
 sudo apt-get update
 sudo apt-get -y --force-yes install devscripts dpkg-dev git wget dkms

@@ -39,12 +55,16 @@ sudo apt-get install -y --force-yes autoconf \
                python-six

 git clone https://github.com/openvswitch/ovs.git
-cd ovs; git checkout ${OVS_COMMIT}; rm -rf .git
+cd ovs; git checkout ${OVS_COMMIT}; rm -rf .git; debian_src_prepare_ovs
+mkdir -p debian/patches; mkdir -p .pc
 PATCHES=$(cd ${BUILD_SRC}/ovs_nsh_patches/v2.6.1/; echo *patch)
 for patch in ${PATCHES}
 do
-    patch -p1 < ${BUILD_SRC}/ovs_nsh_patches/v2.6.1/${patch}
+    echo "${patch}" >> debian/patches/series
+    cp ${BUILD_SRC}/ovs_nsh_patches/v2.6.1/${patch} debian/patches/
+    patch -p1 < debian/patches/${patch}
 done
+cp debian/patches/series .pc/applied-patches

 cat << EOF > debian/changelog
 openvswitch (${OVS_VER}-1.nsh) unstable; urgency=low
@@ -53,7 +73,7 @@ openvswitch (${OVS_VER}-1.nsh) unstable; urgency=low

  -- Open vSwitch team <dev@openvswitch.org>  $(date --rfc-2822)
 EOF
-debian/rules build; fakeroot debian/rules binary
+debian_build

 cp -r ${BUILD_HOME}/*.deb ${BUILD_HOME}/deb
 cd ${BUILD_HOME}/deb
diff --git a/ovs_build/openvswitch_2.6-dpdk_16.07/debian/patches/series b/ovs_build/openvswitch_2.6-dpdk_16.07/debian/patches/series
deleted file mode 100644
index 8b13789..0000000
--- a/ovs_build/openvswitch_2.6-dpdk_16.07/debian/patches/series
+++ /dev/null
@@ -1 +0,0 @@
-