aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFeng Pan <fpan@redhat.com>2016-11-07 19:22:21 -0500
committerFeng Pan <fpan@redhat.com>2016-11-21 21:27:09 -0500
commit9326e4237f4d161f297dc4493ab4928ea6e2bf0f (patch)
tree25372fa964fe84b160c5bfc58304285902edbefc
parentc70bea9fb9cd5dfb29d7ab8f7aaae7324c31f1e3 (diff)
Initial Commit.
Change-Id: I212ec4be42357edddd931e9e479e33131ccd4bac Signed-off-by: Feng Pan <fpan@redhat.com>
-rw-r--r--.gitignore12
-rw-r--r--.gitreview4
-rw-r--r--Gemfile19
-rw-r--r--LICENSE13
-rw-r--r--README.md164
-rw-r--r--Rakefile3
-rw-r--r--lib/puppet/provider/vpp_service/vpp.rb115
-rw-r--r--lib/puppet/type/vpp_service.rb46
-rw-r--r--manifests/config.pp16
-rw-r--r--manifests/honeycomb.pp51
-rw-r--r--manifests/init.pp90
-rw-r--r--manifests/install.pp25
-rw-r--r--manifests/params.pp13
-rw-r--r--manifests/service.pp13
-rw-r--r--metadata.json28
-rw-r--r--releasenotes/source/_static/.placeholder0
-rw-r--r--releasenotes/source/conf.py262
-rw-r--r--releasenotes/source/index.rst18
-rw-r--r--releasenotes/source/unreleased.rst5
-rwxr-xr-xscripts/allow-local-ssh-root.sh27
-rwxr-xr-xscripts/ci-beaker.sh19
-rwxr-xr-xscripts/ci-unit-tests.sh19
-rwxr-xr-xscripts/prepare-node.sh8
-rw-r--r--setup.cfg13
-rw-r--r--setup.py22
-rw-r--r--spec/acceptance/fdio_spec.rb51
-rw-r--r--spec/acceptance/honeycomb_spec.rb33
-rw-r--r--spec/acceptance/nodesets/centos-70-x64.yml11
-rw-r--r--spec/acceptance/nodesets/default.yml10
-rw-r--r--spec/acceptance/nodesets/nodepool-centos7.yml10
-rw-r--r--spec/acceptance/nodesets/nodepool-trusty.yml10
-rw-r--r--spec/acceptance/nodesets/nodepool-xenial.yml10
-rw-r--r--spec/acceptance/nodesets/ubuntu-server-1404-x64.yml11
-rw-r--r--spec/classes/fdio_spec.rb95
-rw-r--r--spec/classes/honeycomb_spec.rb32
-rw-r--r--spec/shared_examples.rb5
-rw-r--r--spec/spec_helper.rb10
-rw-r--r--spec/spec_helper_acceptance.rb1
-rw-r--r--spec/unit/provider/vpp_service/vpp_spec.rb46
-rw-r--r--spec/unit/type/vpp_service_spec.rb56
-rw-r--r--templates/honeycomb.json.erb41
-rw-r--r--templates/startup.conf.erb25
-rw-r--r--test-requirements.txt4
-rw-r--r--tox.ini8
44 files changed, 1474 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..8cc7db9
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,12 @@
+pkg/
+Gemfile.lock
+vendor/
+spec/fixtures/
+.vagrant/
+.bundle/
+.bundled_gems/
+coverage/
+.idea/
+*.swp
+*.iml
+openstack/
diff --git a/.gitreview b/.gitreview
new file mode 100644
index 0000000..099649b
--- /dev/null
+++ b/.gitreview
@@ -0,0 +1,4 @@
+[gerrit]
+host=gerrit.fd.io
+port=29418
+project=puppet-fdio.git
diff --git a/Gemfile b/Gemfile
new file mode 100644
index 0000000..caddc65
--- /dev/null
+++ b/Gemfile
@@ -0,0 +1,19 @@
+source ENV['GEM_SOURCE'] || "https://rubygems.org"
+
+group :development, :test, :system_tests do
+ gem 'puppet-openstack_spec_helper', :require => 'false', :git => 'https://git.openstack.org/openstack/puppet-openstack_spec_helper'
+end
+
+if facterversion = ENV['FACTER_GEM_VERSION']
+ gem 'facter', facterversion, :require => false
+else
+ gem 'facter', :require => false
+end
+
+if puppetversion = ENV['PUPPET_GEM_VERSION']
+ gem 'puppet', puppetversion, :require => false
+else
+ gem 'puppet', :require => false
+end
+
+# vim:ft=ruby
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..1423ad7
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,13 @@
+Copyright 2016 Feng Pan (fpan@redhat.com)
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..620e21a
--- /dev/null
+++ b/README.md
@@ -0,0 +1,164 @@
+# fdio
+
+#### Table of Contents
+1. [Overview](#overview)
+1. [Module Description](#module-description)
+1. [Setup](#setup)
+1. [Usage](#usage)
+1. [Reference ](#reference)
+1. [Limitations](#limitations)
+1. [Development](#development)
+1. [Release Notes/Contributors](#release-notescontributors)
+
+## Overview
+
+Puppet module that installs and configures [FD.io][1] projects VPP and Honeycomb Agent.
+
+## Module Description
+
+Deploys FD.io projects to various OSs via package.
+
+All configuration should be handled through the Puppet module's [params](#parameters).
+
+## Setup
+
+### What `fdio` affects
+
+* [VPP][2], a packet processing platform.
+* [Honeycomb][3], a management agent for VPP.
+
+## Usage
+
+The most basic usage, passing no parameters to the fdio class, will install and start VPP with a default configuration.
+
+```puppet
+class { 'fdio':
+}
+```
+
+### Set uio-driver
+
+To set the uio-driver use the `vpp_dpdk_uio_driver` param.
+
+```puppet
+class { 'fdio':
+ vpp_dpdk_devs => ['0000:00:07.0'],
+ vpp_dpdk_uio_driver => 'vfio_pci',
+}
+```
+
+## Reference
+
+### Classes
+
+#### Public classes
+
+* `::fdio`: Main entry point to the module.
+* `::fdio::honeycomb`: Class to install and configure Honeycomb agent.
+
+#### Private classes
+
+* `::fdio::params`: Contains default class param values.
+* `::fdio::install`: Installs VPP from packages.
+* `::fdio::config`: Manages VPP startup config
+* `::fdio::service`: Shuts down and disables kernel interfaces, starts VPP service and configuring VPP interfaces
+
+
+#### Parameters
+
+#### `::fdio`
+
+##### `repo_branch`
+
+FD.io repository branch name.
+
+Default: `release`
+
+Valid options: `release`, `master`, and branch name such as `stable.1609`.
+
+##### `vpp_dpdk_devs`
+
+PCI devices to bind to VPP.
+
+Default: []
+
+Valid options: list of PCI devices in the form of "DDDD:BB:SS.F"
+
+##### `vpp_dpdk_uio_driver`
+
+Sets the uio-driver for VPP
+
+Default: `uio_pci_generic`
+
+Valid options: `vfio-pci`, `uio_pci_generic` and `igb_uio`. Note that `igb_uio` must be already loaded in the kernel before this module is invoked.
+
+##### `vpp_vlan_enabled`
+
+Enabled vlan tagged traffic on VPP interfaces. This is needed to configure vlan_strip_offload option for Cisco VIC interfaces.
+
+Default: `false`
+
+Valid options: `true`, `false`
+
+##### `vpp_cpu_main_core`
+##### `vpp_cpu_corelist_worker`
+
+VPP thread pinning configuration. Details about those options can be found [here][4].
+
+Default: `undef`
+
+Valid options: Same format as VPP startup config is accepted. Reference [here][4].
+
+##### `vpp_cpu_corelist_worker`
+
+Configures VPP interface with IP settings found on its corresponding kernel NIC.
+
+Default: `true`
+
+Valid options: `true`, `false`
+
+#### `::fdio::honeycomb`
+
+##### `rest_port`
+
+Port for Honeycomb REST interface to listen on.
+
+Default: `'8181'`
+
+Valid options: Valid TCP port number.
+
+##### `websocket_rest_port`
+
+Port for Honeycomb REST interface to listen on for websocket connections.
+
+Default: `'7779'`
+
+Valid options: Valid TCP port number.
+
+##### `user`
+
+Username to configure in honeycomb
+
+Default: `'admin'`
+
+##### `password`
+
+Password to configure in honeycomb
+
+Default: `'admin'`
+
+## Limitations
+
+* Currently only works on Centos 7. Ubuntu support will be added in the future.
+
+## Development
+
+We welcome contributions and work to make them easy!
+
+## Release Notes/Contributors
+
+
+[1]: https://fd.io/
+[2]: https://wiki.fd.io/view/VPP
+[3]: https://wiki.fd.io/view/Honeycomb
+[4]: https://wiki.fd.io/view/VPP/Command-line_Arguments#.22cpu.22_parameters \ No newline at end of file
diff --git a/Rakefile b/Rakefile
new file mode 100644
index 0000000..b835b03
--- /dev/null
+++ b/Rakefile
@@ -0,0 +1,3 @@
+require 'puppet-openstack_spec_helper/rake_tasks'
+
+PuppetLint.configuration.send('disable_140chars')
diff --git a/lib/puppet/provider/vpp_service/vpp.rb b/lib/puppet/provider/vpp_service/vpp.rb
new file mode 100644
index 0000000..e1c702c
--- /dev/null
+++ b/lib/puppet/provider/vpp_service/vpp.rb
@@ -0,0 +1,115 @@
+Puppet::Type.type(:vpp_service).provide :vpp do
+
+ commands :vppctlcmd => "vppctl"
+ commands :systemctlcmd => "systemctl"
+
+ def get_int_prefix(name)
+ if %r{([[:alpha:]]*#{name})\s+} =~ `vppctl show int`
+ return $1
+ else
+ raise Puppet::Error.new("Cannot find vpp interface matching: #{name}")
+ end
+ end
+
+ def convert_pci_addr(pci_dev)
+ if pci_dev =~ /\p{XDigit}+:(\p{XDigit}+):(\p{XDigit}+)\.(\p{XDigit}+)/
+ return "%x/%x/%x" % ["0x#{$1}".hex, "0x#{$2}".hex, "0x#{$3}".hex]
+ else
+ raise Puppet::Error.new("Incorrect pci dev format: #{pci_dev}")
+ end
+ end
+
+ def vpp_pre_config
+ @resource[:pci_devs].each do |pci_dev|
+ Facter.value(:interfaces).split(',').each do |kernel_nic|
+ if pci_dev == `ethtool -i #{kernel_nic} | grep bus-info | awk '{print $2}'`.strip
+ unless system("ip link set dev #{kernel_nic} down")
+ raise Puppet::Error.new("Failed to shut down kernel nic #{kernel_nic}")
+ end
+
+ #Disable NIC on boot
+ file_data = ""
+ onboot_exists = false
+ if File.exist?("/etc/sysconfig/network-scripts/ifcfg-#{kernel_nic}")
+ IO.foreach("/etc/sysconfig/network-scripts/ifcfg-#{kernel_nic}") do |line|
+ if /ONBOOT/.match(line)
+ onboot_exists = true
+ file_data += "ONBOOT=no\n"
+ else
+ file_data += line
+ end
+ end
+ unless onboot_exists
+ file_data += "ONBOOT=no"
+ end
+ File.open("/etc/sysconfig/network-scripts/ifcfg-#{kernel_nic}", "w") {|file| file.puts file_data}
+ end
+
+ if Facter.value("ipaddress_#{kernel_nic}")
+ @int_ip_mapping[pci_dev] = Facter.value("ipaddress_#{kernel_nic}") + "/" + Facter.value("netmask_#{kernel_nic}")
+ end
+ end
+ end
+ end
+ end
+
+ def configure_vpp_interfaces
+ @resource[:pci_devs].each do |pci_dev|
+ vpp_int_name= get_int_prefix(convert_pci_addr(pci_dev))
+ vppctlcmd "set int state", vpp_int_name, @resource[:state]
+ if @resource[:copy_kernel_nic_ip] && @int_ip_mapping.has_key?(pci_dev)
+ vppctlcmd "set int ip address", vpp_int_name, @int_ip_mapping[pci_dev]
+ end
+ end
+ end
+
+ def create
+ @int_ip_mapping = {}
+ vpp_pre_config
+
+ #Bring up VPP service
+ systemctlcmd "restart", "vpp"
+ systemctlcmd "enable", "vpp"
+ sleep 10
+ systemctlcmd "is-active", "vpp"
+ systemctlcmd "is-enabled", "vpp"
+
+ #Configure VPP interfaces
+ configure_vpp_interfaces
+ end
+
+ def destroy
+ systemctlcmd "stop", "vpp"
+ systemctlcmd "disable", "vpp"
+ end
+
+ def exists?
+ if system("systemctl is-active vpp --quiet")
+ @resource[:pci_devs].each do |pci_dev|
+ int_name_str = convert_pci_addr(pci_dev)
+ if %r{([[:alpha:]]*#{int_name_str})\s+} !~ `vppctl show int`
+ return false
+ end
+ end
+ else
+ return false
+ end
+ return true
+ end
+
+ def state
+ @resource[:pci_devs].each do |pci_dev|
+ vpp_int_output = `vppctl show int #{get_int_prefix(convert_pci_addr(pci_dev))}`
+ if ! /\s+up\s+/.match(vpp_int_output)
+ return "down"
+ end
+ end
+ return "up"
+ end
+
+ def state=(value)
+ @resource[:pci_devs].each do |pci_dev|
+ vppctlcmd "set int state", get_int_prefix(convert_pci_addr(pci_dev)), value
+ end
+ end
+end \ No newline at end of file
diff --git a/lib/puppet/type/vpp_service.rb b/lib/puppet/type/vpp_service.rb
new file mode 100644
index 0000000..c1c818f
--- /dev/null
+++ b/lib/puppet/type/vpp_service.rb
@@ -0,0 +1,46 @@
+Puppet::Type.newtype(:vpp_service) do
+
+ ensurable
+
+ newparam(:name) do
+ end
+
+ newparam(:pci_devs, :array_matching => :all) do
+ desc "PCI dev addresses to be bound to VPP"
+ def insync?(is)
+ is.sort == should.sort
+ end
+
+ validate do |values|
+ values = [values] unless values.is_a?(Array)
+ values.map! do |value|
+ if value =~ /\p{XDigit}+:(\p{XDigit}+):(\p{XDigit}+)\.(\p{XDigit}+)/
+ value
+ else
+ raise(Puppet::Error, "Incorrect PCI dev address #{value}")
+ end
+ end
+ end
+
+ munge do |values|
+ if values.is_a?(Array)
+ values
+ else
+ [values]
+ end
+ end
+ end
+
+ newproperty(:state) do
+ desc "VPP interface state"
+ defaultto :up
+ newvalues(:up, :down)
+ end
+
+ newparam(:copy_kernel_nic_ip) do
+ desc "Whether to configure VPP interface with kernel NIC's IP settings"
+ defaultto :true
+ newvalues(:true, :false)
+ end
+
+end
diff --git a/manifests/config.pp b/manifests/config.pp
new file mode 100644
index 0000000..aeac676
--- /dev/null
+++ b/manifests/config.pp
@@ -0,0 +1,16 @@
+# == Class fdio::config
+#
+# This class handles fdio config changes.
+#
+class fdio::config {
+ file { '/etc/vpp/startup.conf':
+ content => template('fdio/startup.conf.erb'),
+ }
+
+ # ensure that dpdk module is loaded
+ exec { 'insert_dpdk_kmod':
+ command => "modprobe ${::fdio::vpp_dpdk_uio_driver}",
+ unless => "lsmod | grep ${::fdio::vpp_dpdk_uio_driver}",
+ path => '/bin:/sbin',
+ }
+}
diff --git a/manifests/honeycomb.pp b/manifests/honeycomb.pp
new file mode 100644
index 0000000..3d28179
--- /dev/null
+++ b/manifests/honeycomb.pp
@@ -0,0 +1,51 @@
+# == Class: honeycomb
+#
+# OpenDaylight Honeycomb Agent
+#
+# === Parameters:
+# [*rest_port*]
+# Port for Honeycomb REST interface to listen on.
+#
+# [*websocket_rest_port*]
+# Port for Honeycomb REST interface to listen on for websocket connections.
+#
+# [*user*]
+# Username to configure in honeycomb.
+#
+# [*password*]
+# Password to configure in honeycomb.
+#
+class fdio::honeycomb (
+ $rest_port = '8181',
+ $websocket_rest_port = '7779',
+ $user = 'admin',
+ $password = 'admin',
+) {
+ include ::fdio
+
+ package { 'honeycomb':
+ ensure => present,
+ require => Package['vpp'],
+ }
+ ->
+ # Configuration of Honeycomb
+ file { 'honeycomb.json':
+ ensure => file,
+ path => '/opt/honeycomb/config/honeycomb.json',
+ # Set user:group owners
+ owner => 'honeycomb',
+ group => 'honeycomb',
+ # Use a template to populate the content
+ content => template('fdio/honeycomb.json.erb'),
+ }
+ ~>
+ service { 'honeycomb':
+ ensure => running,
+ enable => true,
+ hasstatus => true,
+ hasrestart => true,
+ require => [ Vpp_service['vpp'], Package['honeycomb'] ],
+ restart => 'systemctl stop vpp;systemctl stop honeycomb;rm -rf /var/lib/honeycomb/persist/*;systemctl start vpp; sleep 5;systemctl start honeycomb',
+ }
+
+}
diff --git a/manifests/init.pp b/manifests/init.pp
new file mode 100644
index 0000000..7f2d09d
--- /dev/null
+++ b/manifests/init.pp
@@ -0,0 +1,90 @@
+# == Class: fdio
+#
+# Installs vpp and configures /etc/vpp/startup.conf
+#
+# === Parameters:
+# [*repo_branch*]
+# (optional) fd.io repo branch, valid values are 'release', 'master', and stable branch such as 'stable.1609'.
+# Defaults to 'release'.
+#
+# [*vpp_dpdk_devs*]
+# (optional) Array of PCI addresses to bind to vpp.
+# Defaults to undef.
+#
+# [*vpp_dpdk_uio_driver*]
+# (optional) VPP DPDK UIO driver type.
+# Defaults to 'uio_pci_generic'
+#
+# [*vpp_vlan_enabled*]
+# (optional) Enabled vlan tagged traffic on VPP interfaces. This is needed to configure
+# vlan_strip_offload option for Cisco VIC interfaces.
+# Default to false.
+#
+# [*vpp_cpu_main_core*]
+# (optional) VPP main thread pinning.
+# Defaults to undef (no pinning)
+#
+# [*vpp_cpu_corelist_workers*]
+# (optional) List of cores for VPP worker thread pinning in string format.
+# Defaults to undef (no pinning)
+#
+# [*copy_kernel_nic_ip*]
+# (optional) Configures VPP interface with IP settings found on its corresponding kernel NIC.
+# Defaults to true
+#
+class fdio (
+ $repo_branch = $::fdio::params::repo_branch,
+ $vpp_dpdk_devs = $::fdio::params::vpp_dpdk_devs,
+ $vpp_dpdk_uio_driver = $::fdio::params::vpp_dpdk_uio_driver,
+ $vpp_vlan_enabled = $::fdio::params::vpp_vlan_enabled,
+ $vpp_cpu_main_core = $::fdio::params::vpp_cpu_main_core,
+ $vpp_cpu_corelist_workers = $::fdio::params::vpp_cpu_corelist_workers,
+ $copy_kernel_nic_ip = $::fdio::params::copy_kernel_nic_ip,
+) inherits ::fdio::params {
+
+ validate_array($vpp_dpdk_devs)
+ validate_bool($vpp_vlan_enabled)
+ validate_bool($copy_kernel_nic_ip)
+
+ # Validate OS family
+ case $::osfamily {
+ 'RedHat': {}
+ 'Debian': {
+ warning('Debian has limited support, is less stable, less tested.')
+ }
+ default: {
+ fail("Unsupported OS family: ${::osfamily}")
+ }
+ }
+
+ # Validate OS
+ case $::operatingsystem {
+ 'centos', 'redhat': {
+ if $::operatingsystemmajrelease != '7' {
+ # RHEL/CentOS versions < 7 not supported as they lack systemd
+ fail("Unsupported OS: ${::operatingsystem} ${::operatingsystemmajrelease}")
+ }
+ }
+ 'fedora': {
+ # Fedora distros < 23 are EOL as of 2016-07-19
+ # https://fedoraproject.org/wiki/End_of_life
+ if $::operatingsystemmajrelease < '23' {
+ fail("Unsupported OS: ${::operatingsystem} ${::operatingsystemmajrelease}")
+ }
+ }
+ 'ubuntu': {
+ if $::operatingsystemmajrelease != '16.04' {
+ fail("Unsupported OS: ${::operatingsystem} ${::operatingsystemmajrelease}")
+ }
+ }
+ default: {
+ fail("Unsupported OS: ${::operatingsystem}")
+ }
+ }
+
+ class { '::fdio::install': } ->
+ class { '::fdio::config': } ~>
+ class { '::fdio::service': } ->
+ Class['::fdio']
+
+}
diff --git a/manifests/install.pp b/manifests/install.pp
new file mode 100644
index 0000000..14577a7
--- /dev/null
+++ b/manifests/install.pp
@@ -0,0 +1,25 @@
+# == Class fdio::install
+#
+# Manages the installation of fdio.
+#
+class fdio::install {
+ $base_url = $fdio::repo_branch ? {
+ 'release' => 'https://nexus.fd.io/content/repositories/fd.io.centos7/',
+ 'master' => 'https://nexus.fd.io/content/repositories/fd.io.master.centos7/',
+ default => "https://nexus.fd.io/content/repositories/fd.io.${fdio::repo_branch}.centos7/",
+ }
+
+ # Add fdio's Yum repository
+ yumrepo { "fdio-${fdio::repo_branch}":
+ baseurl => $base_url,
+ descr => "FD.io ${fdio::repo_branch} packages",
+ enabled => 1,
+ gpgcheck => 0,
+ }
+
+ # Install the VPP RPM
+ package { 'vpp':
+ ensure => present,
+ require => Yumrepo["fdio-${fdio::repo_branch}"],
+ }
+}
diff --git a/manifests/params.pp b/manifests/params.pp
new file mode 100644
index 0000000..9dae301
--- /dev/null
+++ b/manifests/params.pp
@@ -0,0 +1,13 @@
+# == Class fdio::params
+#
+# This class manages the default params for the fdio class.
+#
+class fdio::params {
+ $repo_branch = 'release'
+ $vpp_dpdk_devs = []
+ $vpp_dpdk_uio_driver = 'uio_pci_generic'
+ $vpp_vlan_enabled = false
+ $vpp_cpu_main_core = undef
+ $vpp_cpu_corelist_workers = undef
+ $copy_kernel_nic_ip = true
+}
diff --git a/manifests/service.pp b/manifests/service.pp
new file mode 100644
index 0000000..cb08721
--- /dev/null
+++ b/manifests/service.pp
@@ -0,0 +1,13 @@
+# == Class fdio::service
+#
+# Configure and start VPP service.
+#
+class fdio::service {
+ vpp_service { 'vpp' :
+ ensure => present,
+ pci_devs => $::fdio::vpp_dpdk_devs,
+ state => 'up',
+ copy_kernel_nic_ip => $::fdio::copy_kernel_nic_ip,
+ }
+}
+
diff --git a/metadata.json b/metadata.json
new file mode 100644
index 0000000..a2acf7e
--- /dev/null
+++ b/metadata.json
@@ -0,0 +1,28 @@
+{
+ "name": "puppet-fdio",
+ "version": "0.0.1",
+ "author": "Feng Pan <fpan@redhat.com>",
+ "summary": "Puppet module for fdio projects",
+ "license": "Apache-2.0",
+ "source": "https://git.fd.io/puppet-fdio",
+ "project_page": "https://wiki.fd.io/view/Puppet-fdio",
+ "issues_url": "https://jira.fd.io/projects/PUP",
+ "description": "Installs and configures FD.io projects like VPP and Honeycomb agent.",
+ "operatingsystem_support": [
+ {
+ "operatingsystem": "Fedora",
+ "operatingsystemrelease": ["23"]
+ },
+ {
+ "operatingsystem": "RedHat",
+ "operatingsystemrelease": ["7"]
+ },
+ {
+ "operatingsystem": "Ubuntu",
+ "operatingsystemrelease": ["16.04"]
+ }
+ ],
+ "dependencies": [
+ { "name": "puppetlabs/stdlib", "version_requirement": ">= 4.2.0 <5.0.0" }
+ ]
+}
diff --git a/releasenotes/source/_static/.placeholder b/releasenotes/source/_static/.placeholder
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/releasenotes/source/_static/.placeholder
diff --git a/releasenotes/source/conf.py b/releasenotes/source/conf.py
new file mode 100644
index 0000000..4cd25ca
--- /dev/null
+++ b/releasenotes/source/conf.py
@@ -0,0 +1,262 @@
+# -*- coding: utf-8 -*-
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#sys.path.insert(0, os.path.abspath('.'))
+
+# -- General configuration ------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be
+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
+# ones.
+extensions = [
+ 'oslosphinx',
+ 'reno.sphinxext',
+]
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8-sig'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'puppet-fdio Release Notes'
+copyright = u'2016, Puppet OpenStack Developers'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = '0.0.1'
+# The full version, including alpha/beta/rc tags.
+release = '0.0.1'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = []
+
+# The reST default role (used for this markup: `text`) to use for all
+# documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+# If true, keep warnings as "system message" paragraphs in the built documents.
+#keep_warnings = False
+
+
+# -- Options for HTML output ----------------------------------------------
+
+# The theme to use for HTML and HTML Help pages. See the documentation for
+# a list of builtin themes.
+html_theme = 'default'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further. For a list of options available for each theme, see the
+# documentation.
+#html_theme_options = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+#html_theme_path = []
+
+# The name for this set of Sphinx documents. If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar. Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+# Add any extra paths that contain custom files (such as robots.txt or
+# .htaccess) here, relative to this directory. These files are copied
+# directly to the root of the documentation.
+#html_extra_path = []
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_domain_indices = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+#html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it. The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = None
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'puppet-fdioReleaseNotesdoc'
+
+
+# -- Options for LaTeX output ---------------------------------------------
+
+latex_elements = {
+# The paper size ('letterpaper' or 'a4paper').
+#'papersize': 'letterpaper',
+
+# The font size ('10pt', '11pt' or '12pt').
+#'pointsize': '10pt',
+
+# Additional stuff for the LaTeX preamble.
+#'preamble': '',
+}
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title,
+# author, documentclass [howto, manual, or own class]).
+latex_documents = [
+ ('index', 'puppet-fdioReleaseNotes.tex', u'puppet-fdio Release Notes Documentation',
+ u'2016, Puppet OpenStack Developers', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# If true, show page references after internal links.
+#latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+#latex_show_urls = False
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_domain_indices = True
+
+
+# -- Options for manual page output ---------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+ ('index', 'puppet-fdioreleasenotes', u'puppet-fdio Release Notes Documentation',
+ [u'2016, Puppet OpenStack Developers'], 1)
+]
+
+# If true, show URL addresses after external links.
+#man_show_urls = False
+
+
+# -- Options for Texinfo output -------------------------------------------
+
+# Grouping the document tree into Texinfo files. List of tuples
+# (source start file, target name, title, author,
+# dir menu entry, description, category)
+texinfo_documents = [
+ ('index', 'puppet-fdioReleaseNotes', u'puppet-fdio Release Notes Documentation',
+ u'2016, Puppet OpenStack Developers', 'puppet-fdioReleaseNotes', 'One line description of project.',
+ 'Miscellaneous'),
+]
+
+# Documents to append as an appendix to all manuals.
+#texinfo_appendices = []
+
+# If false, no module index is generated.
+#texinfo_domain_indices = True
+
+# How to display URL addresses: 'footnote', 'no', or 'inline'.
+#texinfo_show_urls = 'footnote'
+
+# If true, do not generate a @detailmenu in the "Top" node's menu.
+#texinfo_no_detailmenu = False
+
+# -- Options for Internationalization output ------------------------------
+locale_dirs = ['locale/']
diff --git a/releasenotes/source/index.rst b/releasenotes/source/index.rst
new file mode 100644
index 0000000..4b90a52
--- /dev/null
+++ b/releasenotes/source/index.rst
@@ -0,0 +1,18 @@
+=======================================
+Welcome to puppet-fdio Release Notes!
+=======================================
+
+Contents
+========
+
+.. toctree::
+ :maxdepth: 2
+
+ unreleased
+
+
+Indices and tables
+==================
+
+* :ref:`genindex`
+* :ref:`search`
diff --git a/releasenotes/source/unreleased.rst b/releasenotes/source/unreleased.rst
new file mode 100644
index 0000000..2334dd5
--- /dev/null
+++ b/releasenotes/source/unreleased.rst
@@ -0,0 +1,5 @@
+==============================
+ Current Series Release Notes
+==============================
+
+ .. release-notes::
diff --git a/scripts/allow-local-ssh-root.sh b/scripts/allow-local-ssh-root.sh
new file mode 100755
index 0000000..a3ba4ed
--- /dev/null
+++ b/scripts/allow-local-ssh-root.sh
@@ -0,0 +1,27 @@
+#!/bin/bash -xe
+
+echo "" | sudo tee -a /etc/ssh/sshd_config
+echo "Match address 127.0.0.1" | sudo tee -a /etc/ssh/sshd_config
+echo " PermitRootLogin without-password" | sudo tee -a /etc/ssh/sshd_config
+echo "" | sudo tee -a /etc/ssh/sshd_config
+echo "Match address ::1" | sudo tee -a /etc/ssh/sshd_config
+echo " PermitRootLogin without-password" | sudo tee -a /etc/ssh/sshd_config
+if [ ! -f ~/.ssh/id_rsa.pub ]; then
+if [ -f ~/.ssh/id_rsa ]; then
+ ssh-keygen -y -f ~/.ssh/id_rsa -b 2048 -P "" > ~/.ssh/id_rsa.pub
+else
+ ssh-keygen -f ~/.ssh/id_rsa -b 2048 -P ""
+fi
+fi
+sudo mkdir -p /root/.ssh
+sudo chmod 700 /root/.ssh
+sudo rm -f /root/.ssh/authorized_keys
+cat ~/.ssh/id_rsa.pub | sudo tee -a /root/.ssh/authorized_keys
+sudo chmod 600 /root/.ssh/authorized_keys
+sudo restorecon /root/.ssh/authorized_keys
+if [ -f /usr/bin/yum ]; then
+ sudo systemctl restart sshd
+elif [ -f /usr/bin/apt-get ]; then
+ sudo service ssh restart
+fi
+sudo cat /root/.ssh/authorized_keys
diff --git a/scripts/ci-beaker.sh b/scripts/ci-beaker.sh
new file mode 100755
index 0000000..ae6f58b
--- /dev/null
+++ b/scripts/ci-beaker.sh
@@ -0,0 +1,19 @@
+#!/bin/bash -xe
+
+if [ "$#" -ne 1 ]; then
+ echo "Usage: $0 <os> (centos7, xenial)"
+ exit 1
+fi
+
+os=$1
+
+sudo sysctl -w vm.nr_hugepages=1024
+cat /proc/meminfo | grep Huge
+mkdir .bundled_gems
+export GEM_HOME=`pwd`/.bundled_gems
+gem install bundler --no-rdoc --no-ri --verbose
+$GEM_HOME/bin/bundle install --retry 3
+export BEAKER_set=nodepool-$os
+export BEAKER_debug=yes
+export BEAKER_color=no
+$GEM_HOME/bin/bundle exec rspec spec/acceptance
diff --git a/scripts/ci-unit-tests.sh b/scripts/ci-unit-tests.sh
new file mode 100755
index 0000000..a8d57ff
--- /dev/null
+++ b/scripts/ci-unit-tests.sh
@@ -0,0 +1,19 @@
+#!/bin/bash -xe
+
+if [ "$#" -ne 1 ]; then
+ echo "Usage: $0 <puppet_version>"
+ exit 1
+fi
+
+puppet_version=$1
+if [ "$puppet_version" != "latest" ]; then
+ export PUPPET_GEM_VERSION="~> $puppet_version.0"
+fi
+
+mkdir .bundled_gems
+export GEM_HOME=`pwd`/.bundled_gems
+gem install bundler --no-rdoc --no-ri --verbose
+$GEM_HOME/bin/bundle install --retry 3
+$GEM_HOME/bin/bundle exec rake syntax
+$GEM_HOME/bin/bundle exec rake lint
+$GEM_HOME/bin/bundle exec rake spec SPEC_OPTS='--format documentation'
diff --git a/scripts/prepare-node.sh b/scripts/prepare-node.sh
new file mode 100755
index 0000000..7f6ad10
--- /dev/null
+++ b/scripts/prepare-node.sh
@@ -0,0 +1,8 @@
+#!/bin/bash -xe
+
+if [ -f /usr/bin/yum ]; then
+sudo yum -y install libxml2-devel libxslt-devel ruby-devel zlib-devel
+elif [ -f /usr/bin/apt-get ]; then
+sudo apt-get update
+sudo apt-get install -y libxml2-dev libxslt-dev zlib1g-dev
+fi
diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 0000000..8c9b561
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,13 @@
+[metadata]
+name = puppet-fdio
+summary = Puppet module for fdio
+description-file =
+ README.md
+author = Feng Pan
+author-email = fpan@redhat.com
+home-page = https://wiki.fd.io/view/Puppet-fdio
+classifier =
+ Intended Audience :: Developers
+ Intended Audience :: System Administrators
+ License :: OSI Approved :: Apache Software License
+ Operating System :: POSIX :: Linux
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..70c2b3f
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,22 @@
+#!/usr/bin/env python
+# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT
+import setuptools
+
+setuptools.setup(
+ setup_requires=['pbr'],
+ pbr=True)
diff --git a/spec/acceptance/fdio_spec.rb b/spec/acceptance/fdio_spec.rb
new file mode 100644
index 0000000..5c30de1
--- /dev/null
+++ b/spec/acceptance/fdio_spec.rb
@@ -0,0 +1,51 @@
+require 'spec_helper_acceptance'
+
+describe 'fdio' do
+
+ context 'default parameters' do
+
+ it 'should work with no errors' do
+ pp= <<-EOS
+ class { '::fdio': }
+ EOS
+
+ apply_manifest(pp, :catch_failures => true)
+ apply_manifest(pp, :catch_changes => true)
+ end
+
+ describe package('vpp') do
+ it { should be_installed }
+ end
+
+ describe file('/etc/vpp/startup.conf') do
+ it { is_expected.to exist }
+ its(:content) { should match /uio-driver\s+uio_pci_generic/ }
+ its(:content) { should_not match /dev/ }
+ end
+
+ describe service('vpp') do
+ it { should be_running }
+ it { should be_enabled }
+ end
+ end
+
+ context 'pinning' do
+ it 'should work with no errors' do
+ pp= <<-EOS
+ class { '::fdio':
+ vpp_cpu_main_core => '1',
+ vpp_cpu_corelist_workers => '2',
+ }
+ EOS
+
+ apply_manifest(pp, :catch_failures => true)
+ apply_manifest(pp, :catch_changes => true)
+ end
+
+ describe file('/etc/vpp/startup.conf') do
+ its(:content) { should match /main-core\s+1/ }
+ its(:content) { should match /corelist-workers\s+2/ }
+ end
+
+ end
+end
diff --git a/spec/acceptance/honeycomb_spec.rb b/spec/acceptance/honeycomb_spec.rb
new file mode 100644
index 0000000..426d3b9
--- /dev/null
+++ b/spec/acceptance/honeycomb_spec.rb
@@ -0,0 +1,33 @@
+require 'spec_helper_acceptance'
+
+describe 'fdio::honeycomb' do
+
+ describe 'default parameters' do
+ it 'should work with no errors' do
+ pp= <<-EOS
+ class { '::fdio::honeycomb': }
+ EOS
+
+ apply_manifest(pp, :catch_failures => true)
+ apply_manifest(pp, :catch_changes => true)
+ end
+
+ describe package('honeycomb') do
+ it { should be_installed }
+ end
+
+ describe file('/opt/honeycomb/config/honeycomb.json') do
+ it { is_expected.to exist }
+ its(:content) { should match /"restconf-port":\s+8181/ }
+ its(:content) { should match /"restconf-websocket-port":\s+7779/ }
+ its(:content) { should match /"username":\s+"admin"/}
+ its(:content) { should match /"password":\s+"admin"/}
+ end
+
+ describe service('honeycomb') do
+ it { should be_running }
+ it { should be_enabled }
+ end
+ end
+
+end \ No newline at end of file
diff --git a/spec/acceptance/nodesets/centos-70-x64.yml b/spec/acceptance/nodesets/centos-70-x64.yml
new file mode 100644
index 0000000..5f097e9
--- /dev/null
+++ b/spec/acceptance/nodesets/centos-70-x64.yml
@@ -0,0 +1,11 @@
+HOSTS:
+ centos-server-70-x64:
+ roles:
+ - master
+ platform: el-7-x86_64
+ box: puppetlabs/centos-7.0-64-nocm
+ box_url: https://vagrantcloud.com/puppetlabs/centos-7.0-64-nocm
+ hypervisor: vagrant
+CONFIG:
+ log_level: debug
+ type: foss
diff --git a/spec/acceptance/nodesets/default.yml b/spec/acceptance/nodesets/default.yml
new file mode 100644
index 0000000..486b6a3
--- /dev/null
+++ b/spec/acceptance/nodesets/default.yml
@@ -0,0 +1,10 @@
+HOSTS:
+ ubuntu-server-14.04-amd64:
+ roles:
+ - master
+ platform: ubuntu-14.04-amd64
+ box: puppetlabs/ubuntu-14.04-64-nocm
+ box_url: https://vagrantcloud.com/puppetlabs/ubuntu-14.04-64-nocm
+ hypervisor: vagrant
+CONFIG:
+ type: foss
diff --git a/spec/acceptance/nodesets/nodepool-centos7.yml b/spec/acceptance/nodesets/nodepool-centos7.yml
new file mode 100644
index 0000000..c552874
--- /dev/null
+++ b/spec/acceptance/nodesets/nodepool-centos7.yml
@@ -0,0 +1,10 @@
+HOSTS:
+ centos-70-x64:
+ roles:
+ - master
+ platform: el-7-x86_64
+ hypervisor: none
+ ip: 127.0.0.1
+CONFIG:
+ type: foss
+ set_env: false
diff --git a/spec/acceptance/nodesets/nodepool-trusty.yml b/spec/acceptance/nodesets/nodepool-trusty.yml
new file mode 100644
index 0000000..9fc624e
--- /dev/null
+++ b/spec/acceptance/nodesets/nodepool-trusty.yml
@@ -0,0 +1,10 @@
+HOSTS:
+ ubuntu-14.04-amd64:
+ roles:
+ - master
+ platform: ubuntu-14.04-amd64
+ hypervisor: none
+ ip: 127.0.0.1
+CONFIG:
+ type: foss
+ set_env: false
diff --git a/spec/acceptance/nodesets/nodepool-xenial.yml b/spec/acceptance/nodesets/nodepool-xenial.yml
new file mode 100644
index 0000000..99dd318
--- /dev/null
+++ b/spec/acceptance/nodesets/nodepool-xenial.yml
@@ -0,0 +1,10 @@
+HOSTS:
+ ubuntu-16.04-amd64:
+ roles:
+ - master
+ platform: ubuntu-16.04-amd64
+ hypervisor: none
+ ip: 127.0.0.1
+CONFIG:
+ type: foss
+ set_env: false
diff --git a/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml b/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml
new file mode 100644
index 0000000..8001929
--- /dev/null
+++ b/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml
@@ -0,0 +1,11 @@
+HOSTS:
+ ubuntu-server-14.04-amd64:
+ roles:
+ - master
+ platform: ubuntu-14.04-amd64
+ box: puppetlabs/ubuntu-14.04-64-nocm
+ box_url: https://vagrantcloud.com/puppetlabs/ubuntu-14.04-64-nocm
+ hypervisor: vagrant
+CONFIG:
+ log_level: debug
+ type: foss
diff --git a/spec/classes/fdio_spec.rb b/spec/classes/fdio_spec.rb
new file mode 100644
index 0000000..0cc065a
--- /dev/null
+++ b/spec/classes/fdio_spec.rb
@@ -0,0 +1,95 @@
+require 'spec_helper'
+
+describe 'fdio' do
+
+ shared_examples_for 'fdio - default' do
+ it { should compile }
+ it { should compile.with_all_deps }
+
+ # Confirm presence of classes
+ it { should contain_class('fdio') }
+ it { should contain_class('fdio::params') }
+ it { should contain_class('fdio::install') }
+ it { should contain_class('fdio::config') }
+ it { should contain_class('fdio::service') }
+
+ # Confirm relationships between classes
+ it { should contain_class('fdio::install').that_comes_before('Class[fdio::config]') }
+ it { should contain_class('fdio::config').that_requires('Class[fdio::install]') }
+ it { should contain_class('fdio::config').that_notifies('Class[fdio::service]') }
+ it { should contain_class('fdio::service').that_subscribes_to('Class[fdio::config]') }
+ it { should contain_class('fdio::service').that_comes_before('Class[fdio]') }
+ it { should contain_class('fdio').that_requires('Class[fdio::service]') }
+ end
+
+ shared_examples_for 'fdio - rpm' do
+ it {
+ should contain_yumrepo('fdio-release').with(
+ 'baseurl' => 'https://nexus.fd.io/content/repositories/fd.io.centos7/',
+ 'enabled' => 1,
+ )
+ }
+ it { should contain_package('vpp').that_requires('Yumrepo[fdio-release]') }
+
+ context 'with stable 16.09 branch' do
+ let(:params) {{:repo_branch => 'stable.1609'}}
+
+ it {
+ should contain_yumrepo('fdio-stable.1609').with(
+ 'baseurl' => 'https://nexus.fd.io/content/repositories/fd.io.stable.1609.centos7/',
+ 'enabled' => 1,
+ )
+ }
+ it { should contain_package('vpp').that_requires('Yumrepo[fdio-stable.1609]') }
+ end
+ end
+
+ shared_examples_for 'fdio - config' do
+ it {
+ should contain_file('/etc/vpp/startup.conf').with(
+ 'path' => '/etc/vpp/startup.conf',
+ )
+ }
+ it {
+ should contain_exec('insert_dpdk_kmod').with(
+ 'command' => 'modprobe uio_pci_generic',
+ 'unless' => 'lsmod | grep uio_pci_generic',
+ )
+ }
+ end
+
+ shared_examples_for 'fdio - service' do
+ it {
+ should contain_vpp_service('vpp').with(
+ 'ensure' => 'present',
+ 'pci_devs' => [],
+ 'state' => 'up',
+ )
+ }
+
+ context 'with pci dev' do
+ let(:params) {{:vpp_dpdk_devs => ['0000:00:07.0']}}
+
+ it {
+ should contain_vpp_service('vpp').with(
+ 'ensure' => 'present',
+ 'pci_devs' => ['0000:00:07.0'],
+ 'state' => 'up',
+ )
+ }
+ end
+ end
+
+ context 'on RedHat platforms' do
+ let(:facts) {{
+ :osfamily => 'RedHat',
+ :operatingsystem => 'CentOS',
+ :operatingsystemmajrelease => '7',
+ }}
+
+ it_configures 'fdio - default'
+ it_configures 'fdio - rpm'
+ it_configures 'fdio - config'
+ it_configures 'fdio - service'
+ end
+end \ No newline at end of file
diff --git a/spec/classes/honeycomb_spec.rb b/spec/classes/honeycomb_spec.rb
new file mode 100644
index 0000000..8ba367a
--- /dev/null
+++ b/spec/classes/honeycomb_spec.rb
@@ -0,0 +1,32 @@
+require 'spec_helper'
+
+describe 'fdio::honeycomb' do
+ let(:facts) {{
+ :osfamily => 'RedHat',
+ :operatingsystem => 'CentOS',
+ :operatingsystemmajrelease => '7',
+ }}
+
+ it { should compile }
+ it { should compile.with_all_deps }
+ it { should contain_class('fdio::honeycomb') }
+ it { should contain_class('fdio::install').that_comes_before('Class[fdio::config]') }
+ it { should contain_package('honeycomb').that_requires('Package[vpp]') }
+ it { should contain_file('honeycomb.json').that_requires('Package[honeycomb]') }
+ it { should contain_file('honeycomb.json').that_notifies('Service[honeycomb]') }
+ it { should contain_service('honeycomb').that_requires('Package[honeycomb]') }
+ it { should contain_service('honeycomb').that_requires('Vpp_service[vpp]') }
+
+ it { should contain_file('honeycomb.json').with(
+ 'ensure' => 'file',
+ 'path' => '/opt/honeycomb/config/honeycomb.json',
+ 'owner' => 'honeycomb',
+ 'group' => 'honeycomb',
+ )
+ }
+ it { should contain_service('honeycomb').with(
+ 'ensure' => 'running',
+ 'enable' => 'true',
+ )
+ }
+end
diff --git a/spec/shared_examples.rb b/spec/shared_examples.rb
new file mode 100644
index 0000000..fec0eac
--- /dev/null
+++ b/spec/shared_examples.rb
@@ -0,0 +1,5 @@
+shared_examples_for "a Puppet::Error" do |description|
+ it "with message matching #{description.inspect}" do
+ expect { is_expected.to have_class_count(1) }.to raise_error(Puppet::Error, description)
+ end
+end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
new file mode 100644
index 0000000..cad00b1
--- /dev/null
+++ b/spec/spec_helper.rb
@@ -0,0 +1,10 @@
+require 'puppetlabs_spec_helper/module_spec_helper'
+require 'shared_examples'
+require 'puppet-openstack_spec_helper/facts'
+
+RSpec.configure do |c|
+ c.alias_it_should_behave_like_to :it_configures, 'configures'
+ c.alias_it_should_behave_like_to :it_raises, 'raises'
+end
+
+at_exit { RSpec::Puppet::Coverage.report! }
diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb
new file mode 100644
index 0000000..9196bc9
--- /dev/null
+++ b/spec/spec_helper_acceptance.rb
@@ -0,0 +1 @@
+require 'puppet-openstack_spec_helper/beaker_spec_helper'
diff --git a/spec/unit/provider/vpp_service/vpp_spec.rb b/spec/unit/provider/vpp_service/vpp_spec.rb
new file mode 100644
index 0000000..1d9d9ba
--- /dev/null
+++ b/spec/unit/provider/vpp_service/vpp_spec.rb
@@ -0,0 +1,46 @@
+require 'puppet'
+require 'puppet/provider/vpp_service/vpp'
+require 'spec_helper'
+
+provider_class = Puppet::Type.type(:vpp_service).provider(:vpp)
+
+describe 'Puppet::Type.type(:vpp_service).provider(:vpp)' do
+
+ let :vpp_attrs do
+ {
+ :name => 'vpp service config',
+ :pci_devs => '0000:00:07.0',
+ :ensure => 'present',
+ :state => 'up',
+ :copy_kernel_nic_ip => 'false',
+ }
+ end
+
+ let :resource do
+ Puppet::Type::Vpp_service.new(vpp_attrs)
+ end
+
+ let :provider do
+ provider_class.new(resource)
+ end
+
+ describe 'on create' do
+ it 'should call service restart' do
+ provider.expects(:vpp_pre_config)
+ provider.expects(:configure_vpp_interfaces)
+ provider.expects(:systemctlcmd).with('restart', 'vpp')
+ provider.expects(:systemctlcmd).with('enable', 'vpp')
+ provider.expects(:systemctlcmd).with('is-enabled', 'vpp')
+ provider.expects(:systemctlcmd).with('is-active', 'vpp')
+ provider.create
+ end
+ end
+
+ describe "when changing state" do
+ it 'should change state' do
+ provider.stubs(:get_int_prefix).returns('GigabitEthernet0/7/0')
+ provider.expects(:vppctlcmd).with('set int state', 'GigabitEthernet0/7/0', 'down')
+ provider.state = 'down'
+ end
+ end
+end \ No newline at end of file
diff --git a/spec/unit/type/vpp_service_spec.rb b/spec/unit/type/vpp_service_spec.rb
new file mode 100644
index 0000000..9b08ffa
--- /dev/null
+++ b/spec/unit/type/vpp_service_spec.rb
@@ -0,0 +1,56 @@
+require 'puppet'
+require 'puppet/type/vpp_service'
+require 'spec_helper'
+
+describe 'Puppet::Type.type(:neutron_config)' do
+
+ before :each do
+ @vpp_service = Puppet::Type.type(:vpp_service).new(:name => 'vpp service config')
+ end
+
+ it 'should have default values' do
+ expect(@vpp_service[:state]).to eq(:up)
+ expect(@vpp_service[:copy_kernel_nic_ip]).to eq(:true)
+ end
+
+ it 'should accept a single pci dev' do
+ Puppet::Type.type(:vpp_service).new(:name => 'vpp service config', :pci_devs => '0000:00:07.0')
+ end
+
+ it 'should accept array of pci devs' do
+ Puppet::Type.type(:vpp_service).new(:name => 'vpp service config', :pci_devs => ['0000:00:07.0', '0000:00:08.0'])
+ end
+
+ it 'should not accept invalid pci dev format' do
+ expect {
+ Puppet::Type.type(:vpp_service).new(:name => 'vpp service config', :pci_devs => ['0/7/0', '0000:00:08.0'])
+ }.to raise_error(Puppet::Error, /Incorrect PCI dev address/)
+ end
+
+ it 'should accept valid states' do
+ @vpp_service[:state] = :up
+ expect(@vpp_service[:state]).to eq(:up)
+ @vpp_service[:state] = :down
+ expect(@vpp_service[:state]).to eq(:down)
+ end
+
+ it 'should not accept invalid state' do
+ expect {
+ @vpp_service[:state] = :shut
+ }.to raise_error(Puppet::Error, /Invalid value/)
+ end
+
+ it 'should accept valid copy_kernel_nic_ip' do
+ @vpp_service[:copy_kernel_nic_ip] = :true
+ expect(@vpp_service[:copy_kernel_nic_ip]).to eq(:true)
+ @vpp_service[:copy_kernel_nic_ip] = :false
+ expect(@vpp_service[:copy_kernel_nic_ip]).to eq(:false)
+ end
+
+ it 'should not accept invalid copy_kernel_nic_ip' do
+ expect {
+ @vpp_service[:copy_kernel_nic_ip] = :yes
+ }.to raise_error(Puppet::Error, /Invalid value/)
+ end
+
+end
diff --git a/templates/honeycomb.json.erb b/templates/honeycomb.json.erb
new file mode 100644
index 0000000..6cf2bc3
--- /dev/null
+++ b/templates/honeycomb.json.erb
@@ -0,0 +1,41 @@
+ {
+ "persisted-context-path": "/var/lib/honeycomb/persist/context/data.json",
+ "persisted-context-restoration-type": "Merge",
+ "persisted-config-path": "/var/lib/honeycomb/persist/config/data.json",
+ "persisted-config-restoration-type": "Merge",
+
+ "notification-service-queue-depth": 1,
+
+ "restconf-http-enabled": "true",
+ "restconf-root-path": "/restconf",
+ "restconf-binding-address": "127.0.0.1",
+ "restconf-port": <%= scope.lookupvar('fdio::honeycomb::rest_port') %>,
+ "restconf-https-enabled": "true",
+ "restconf-https-binding-address": "0.0.0.0",
+ "restconf-https-port": 8443,
+ "restconf-keystore": "/honeycomb-keystore",
+ "restconf-keystore-password": "OBF:1v9s1unr1unn1vv51zlk1t331vg91x1b1vgl1t331zly1vu51uob1uo71v8u",
+ "restconf-keystore-manager-password": "OBF:1v9s1unr1unn1vv51zlk1t331vg91x1b1vgl1t331zly1vu51uob1uo71v8u",
+ "restconf-truststore": "/honeycomb-keystore",
+ "restconf-truststore-password": "OBF:1v9s1unr1unn1vv51zlk1t331vg91x1b1vgl1t331zly1vu51uob1uo71v8u",
+ "restconf-websocket-port": <%= scope.lookupvar('fdio::honeycomb::websocket_rest_port') %>,
+ "restconf-pool-max-size": 10,
+ "restconf-pool-min-size": 1,
+ "restconf-acceptors-size": 1,
+ "restconf-selectors-size": 1,
+ "restconf-https-acceptors-size": 1,
+ "restconf-https-selectors-size": 1,
+
+
+ "netconf-netty-threads": 2,
+ "netconf-tcp-enabled" : "true",
+ "netconf-tcp-binding-address": "127.0.0.1",
+ "netconf-tcp-binding-port": 7777,
+ "netconf-ssh-enabled" : "true",
+ "netconf-ssh-binding-address": "0.0.0.0",
+ "netconf-ssh-binding-port": 2831,
+ "netconf-notification-stream-name": "honeycomb",
+
+ "username": "<%= scope.lookupvar('fdio::honeycomb::user') %>",
+ "password": "<%= scope.lookupvar('fdio::honeycomb::password') %>"
+}
diff --git a/templates/startup.conf.erb b/templates/startup.conf.erb
new file mode 100644
index 0000000..e10dea4
--- /dev/null
+++ b/templates/startup.conf.erb
@@ -0,0 +1,25 @@
+unix {
+ nodaemon
+ log /tmp/vpp.log
+ full-coredump
+}
+
+dpdk {
+ <% if @vpp_dpdk_devs.is_a? Array -%><% @vpp_dpdk_devs.each do |n| -%>
+ dev <%=n-%> <% if @vpp_vlan_enabled && system("lspci -s #{n} | grep VIC") -%> {vlan-strip-offload off}<%end%>
+ <% end -%><% end -%>
+ uio-driver <%=@vpp_dpdk_uio_driver%>
+}
+
+cpu {
+ <% if @vpp_cpu_main_core -%>main-core <%=@vpp_cpu_main_core%> <%end%>
+ <% if @vpp_cpu_corelist_workers -%>corelist-workers <%=@vpp_cpu_corelist_workers%> <%end%>
+}
+
+api-trace {
+ on
+}
+
+api-segment {
+ gid vpp
+}
diff --git a/test-requirements.txt b/test-requirements.txt
new file mode 100644
index 0000000..bedd666
--- /dev/null
+++ b/test-requirements.txt
@@ -0,0 +1,4 @@
+# this is required for the docs build jobs
+sphinx!=1.2.0,!=1.3b1,<1.3,>=1.1.2
+oslosphinx>=2.5.0 # Apache-2.0
+reno>=0.1.1 # Apache-2.0
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 0000000..aea06c8
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,8 @@
+[tox]
+minversion = 1.6
+skipsdist = True
+envlist = releasenotes
+
+[testenv:releasenotes]
+deps = -rtest-requirements.txt
+commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html