diff mbox

[ovs-dev] vagrant: Add Debian Jessie support

Message ID 1473455358-25427-1-git-send-email-cascardo@redhat.com
State Changes Requested
Headers show

Commit Message

Thadeu Lima de Souza Cascardo Sept. 9, 2016, 9:09 p.m. UTC
Now, vagrant up will test both Fedora 23 and Debian Jessie (8.0), which uses
Linux 3.16.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
---
 Vagrantfile | 44 ++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 42 insertions(+), 2 deletions(-)

Comments

Joe Stringer Sept. 10, 2016, 1:44 a.m. UTC | #1
On 9 September 2016 at 14:09, Thadeu Lima de Souza Cascardo
<cascardo@redhat.com> wrote:
> Now, vagrant up will test both Fedora 23 and Debian Jessie (8.0), which uses
> Linux 3.16.
>
> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
> ---
>  Vagrantfile | 44 ++++++++++++++++++++++++++++++++++++++++++--
>  1 file changed, 42 insertions(+), 2 deletions(-)
>
> diff --git a/Vagrantfile b/Vagrantfile
> index 843d88c..1a97d13 100644
> --- a/Vagrantfile
> +++ b/Vagrantfile
> @@ -13,11 +13,25 @@ dnf -y install autoconf automake openssl-devel libtool \
>                 wget python-six pyftpdlib checkpolicy selinux-policy-devel \
>                 libcap-ng-devel kernel-devel-`uname -r` ethtool
>  echo "search extra update built-in" >/etc/depmod.d/search_path.conf
> -cd /vagrant
> -./boot.sh
> +SCRIPT
> +
> +$bootstrap_debian = <<SCRIPT
> +aptitude -y update
> +aptitude -y upgrade
> +aptitude -y install -R \
> +               build-essential dpkg-dev lintian devscripts fakeroot \
> +               debhelper dh-autoreconf \
> +               autoconf automake libtool \
> +               python-all python-twisted-core python-twisted-conch \
> +               xdg-utils groff graphviz netcat \
> +               wget python-six ethtool \
> +               libcap-ng-dev libssl-dev python-dev openssl \
> +               linux-headers-`uname -r`

I think we also need "pkg-config python-flake8".

When I tried this out, the "test_ovs_system_userspace" provision
target failed completely, partly because the 'tun' module apparently
needs to be loaded and that's missing from our initialization in this
make target... but when I tried to load this module I see errors like
this in my kernel logs:

[  925.888049] tun: Unknown symbol __sk_attach_filter (err 0)
[  925.888126] tun: Unknown symbol __sk_detach_filter (err 0)

Do you also see this?
Thadeu Lima de Souza Cascardo Sept. 12, 2016, 10:57 a.m. UTC | #2
On Fri, Sep 09, 2016 at 06:44:21PM -0700, Joe Stringer wrote:
> On 9 September 2016 at 14:09, Thadeu Lima de Souza Cascardo
> <cascardo@redhat.com> wrote:
> > Now, vagrant up will test both Fedora 23 and Debian Jessie (8.0), which uses
> > Linux 3.16.
> >
> > Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
> > ---
> >  Vagrantfile | 44 ++++++++++++++++++++++++++++++++++++++++++--
> >  1 file changed, 42 insertions(+), 2 deletions(-)
> >
> > diff --git a/Vagrantfile b/Vagrantfile
> > index 843d88c..1a97d13 100644
> > --- a/Vagrantfile
> > +++ b/Vagrantfile
> > @@ -13,11 +13,25 @@ dnf -y install autoconf automake openssl-devel libtool \
> >                 wget python-six pyftpdlib checkpolicy selinux-policy-devel \
> >                 libcap-ng-devel kernel-devel-`uname -r` ethtool
> >  echo "search extra update built-in" >/etc/depmod.d/search_path.conf
> > -cd /vagrant
> > -./boot.sh
> > +SCRIPT
> > +
> > +$bootstrap_debian = <<SCRIPT
> > +aptitude -y update
> > +aptitude -y upgrade
> > +aptitude -y install -R \
> > +               build-essential dpkg-dev lintian devscripts fakeroot \
> > +               debhelper dh-autoreconf \
> > +               autoconf automake libtool \
> > +               python-all python-twisted-core python-twisted-conch \
> > +               xdg-utils groff graphviz netcat \
> > +               wget python-six ethtool \
> > +               libcap-ng-dev libssl-dev python-dev openssl \
> > +               linux-headers-`uname -r`
> 
> I think we also need "pkg-config python-flake8".
> 

I will add it and python-pyftpdlib as well, so we test conntrack helpers.

> When I tried this out, the "test_ovs_system_userspace" provision
> target failed completely, partly because the 'tun' module apparently
> needs to be loaded and that's missing from our initialization in this
> make target... but when I tried to load this module I see errors like
> this in my kernel logs:
> 
> [  925.888049] tun: Unknown symbol __sk_attach_filter (err 0)
> [  925.888126] tun: Unknown symbol __sk_detach_filter (err 0)
> 
> Do you also see this?

Hum... that works for me.

root@jessie:~# modprobe tun
root@jessie:~# dmesg | tail
[    6.170213] nf_conntrack version 0.5.0 (3954 buckets, 15816 max)
[    6.183509] openvswitch: Open vSwitch switching datapath 2.6.90
[    6.184662] openvswitch: LISP tunneling driver
[    6.185212] openvswitch: GRE over IPv4 tunneling driver
[    6.185825] openvswitch: Geneve tunneling driver
[    6.186377] openvswitch: VxLAN tunneling driver
[    6.186918] openvswitch: STT tunneling driver
[   20.531677] random: nonblocking pool is initialized
[37892.644399] tun: Universal TUN/TAP device driver, 1.6
[37892.645111] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
root@jessie:~#

What Linux version is this using?

Cascardo.
Joe Stringer Sept. 12, 2016, 5:29 p.m. UTC | #3
On 12 September 2016 at 03:57, Thadeu Lima de Souza Cascardo
<cascardo@redhat.com> wrote:
> On Fri, Sep 09, 2016 at 06:44:21PM -0700, Joe Stringer wrote:
>> On 9 September 2016 at 14:09, Thadeu Lima de Souza Cascardo
>> <cascardo@redhat.com> wrote:
>> > Now, vagrant up will test both Fedora 23 and Debian Jessie (8.0), which uses
>> > Linux 3.16.
>> >
>> > Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
>> > ---
>> >  Vagrantfile | 44 ++++++++++++++++++++++++++++++++++++++++++--
>> >  1 file changed, 42 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/Vagrantfile b/Vagrantfile
>> > index 843d88c..1a97d13 100644
>> > --- a/Vagrantfile
>> > +++ b/Vagrantfile
>> > @@ -13,11 +13,25 @@ dnf -y install autoconf automake openssl-devel libtool \
>> >                 wget python-six pyftpdlib checkpolicy selinux-policy-devel \
>> >                 libcap-ng-devel kernel-devel-`uname -r` ethtool
>> >  echo "search extra update built-in" >/etc/depmod.d/search_path.conf
>> > -cd /vagrant
>> > -./boot.sh
>> > +SCRIPT
>> > +
>> > +$bootstrap_debian = <<SCRIPT
>> > +aptitude -y update
>> > +aptitude -y upgrade
>> > +aptitude -y install -R \
>> > +               build-essential dpkg-dev lintian devscripts fakeroot \
>> > +               debhelper dh-autoreconf \
>> > +               autoconf automake libtool \
>> > +               python-all python-twisted-core python-twisted-conch \
>> > +               xdg-utils groff graphviz netcat \
>> > +               wget python-six ethtool \
>> > +               libcap-ng-dev libssl-dev python-dev openssl \
>> > +               linux-headers-`uname -r`
>>
>> I think we also need "pkg-config python-flake8".
>>
>
> I will add it and python-pyftpdlib as well, so we test conntrack helpers.
>
>> When I tried this out, the "test_ovs_system_userspace" provision
>> target failed completely, partly because the 'tun' module apparently
>> needs to be loaded and that's missing from our initialization in this
>> make target... but when I tried to load this module I see errors like
>> this in my kernel logs:
>>
>> [  925.888049] tun: Unknown symbol __sk_attach_filter (err 0)
>> [  925.888126] tun: Unknown symbol __sk_detach_filter (err 0)
>>
>> Do you also see this?
>
> Hum... that works for me.
>
> root@jessie:~# modprobe tun
> root@jessie:~# dmesg | tail
> [    6.170213] nf_conntrack version 0.5.0 (3954 buckets, 15816 max)
> [    6.183509] openvswitch: Open vSwitch switching datapath 2.6.90
> [    6.184662] openvswitch: LISP tunneling driver
> [    6.185212] openvswitch: GRE over IPv4 tunneling driver
> [    6.185825] openvswitch: Geneve tunneling driver
> [    6.186377] openvswitch: VxLAN tunneling driver
> [    6.186918] openvswitch: STT tunneling driver
> [   20.531677] random: nonblocking pool is initialized
> [37892.644399] tun: Universal TUN/TAP device driver, 1.6
> [37892.645111] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
> root@jessie:~#
>
> What Linux version is this using?

Hmm. uname shows:
Linux jessie 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u1
(2016-09-03) x86_64 GNU/Linux

However, when I restarted the vagrant VM I could load tun fine and the
tests all passed..

This isn't the first time that I've observed vagrant VMs having
different behaviour between the first boot and subsequent boots. I
think this is safe to ignore.

Feel free to go ahead and submit your latest version and I'll be happy
to apply it.
diff mbox

Patch

diff --git a/Vagrantfile b/Vagrantfile
index 843d88c..1a97d13 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -13,11 +13,25 @@  dnf -y install autoconf automake openssl-devel libtool \
                wget python-six pyftpdlib checkpolicy selinux-policy-devel \
                libcap-ng-devel kernel-devel-`uname -r` ethtool
 echo "search extra update built-in" >/etc/depmod.d/search_path.conf
-cd /vagrant
-./boot.sh
+SCRIPT
+
+$bootstrap_debian = <<SCRIPT
+aptitude -y update
+aptitude -y upgrade
+aptitude -y install -R \
+		build-essential dpkg-dev lintian devscripts fakeroot \
+		debhelper dh-autoreconf \
+		autoconf automake libtool \
+		python-all python-twisted-core python-twisted-conch \
+		xdg-utils groff graphviz netcat \
+		wget python-six ethtool \
+		libcap-ng-dev libssl-dev python-dev openssl \
+		linux-headers-`uname -r`
 SCRIPT
 
 $configure_ovs = <<SCRIPT
+cd /vagrant
+./boot.sh
 mkdir -p ~/build
 cd ~/build
 /vagrant/configure --with-linux=/lib/modules/`uname -r`/build --enable-silent-rules
@@ -48,12 +62,38 @@  systemctl start openvswitch
 systemctl status openvswitch
 SCRIPT
 
+$install_deb = <<SCRIPT
+cd ~/build
+PACKAGE_VERSION=`autom4te -l Autoconf -t 'AC_INIT:$2' /vagrant/configure.ac`
+make dist
+cd ~/
+ln -sf ~/build/openvswitch-$PACKAGE_VERSION.tar.gz openvswitch_$PACKAGE_VERSION.orig.tar.gz
+rm -rf ~/openvswitch-$PACKAGE_VERSION
+tar xzf openvswitch_$PACKAGE_VERSION.orig.tar.gz
+cd ~/openvswitch-$PACKAGE_VERSION
+debuild -us -uc
+dpkg -i ../openvswitch-{common,switch}*deb
+systemctl enable openvswitch-switch
+systemctl start openvswitch-switch
+systemctl status openvswitch-switch
+SCRIPT
+
 $test_ovs_system_userspace = <<SCRIPT
 cd ~/build
 make check-system-userspace
 SCRIPT
 
 Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
+  config.vm.define "debian-8" do |debian|
+       debian.vm.box = "debian/jessie64"
+       debian.vm.synced_folder ".", "/vagrant", type: "rsync"
+       debian.vm.provision "bootstrap", type: "shell", inline: $bootstrap_debian
+       debian.vm.provision "configure_ovs", type: "shell", inline: $configure_ovs
+       debian.vm.provision "build_ovs", type: "shell", inline: $build_ovs
+       debian.vm.provision "test_ovs_kmod", type: "shell", inline: $test_kmod
+       debian.vm.provision "test_ovs_system_userspace", type: "shell", inline: $test_ovs_system_userspace
+       debian.vm.provision "install_deb", type: "shell", inline: $install_deb
+  end
   config.vm.define "fedora-23" do |fedora|
        fedora.vm.box = "bento/fedora-23"
        fedora.vm.provision "bootstrap", type: "shell", inline: $bootstrap_fedora