Compare commits

...

89 Commits

Author SHA1 Message Date
Jenkins bcc7e1a4f4 Merge "Write clouds.yaml to only /etc" into stable/liberty 2016-11-30 16:30:31 +00:00
Jenkins dcffea9184 Merge "Fix api extension settings in tempest for Liberty" into stable/liberty 2016-11-28 23:43:42 +00:00
Monty Taylor 71afb5674d Don't clone dib-utils in install_heat
It's not used, and a recent change to trim down projects lists in
devstack-gate broke devstack in the gate that enabled heat.

(Cherry-picked from 201c01f19b)

Change-Id: I405423bdc9ba8dd9b30fce6fdceacccf662d5da3
2016-10-19 16:04:19 +11:00
Bruce Tan 3deab5cd91 Fix api extension settings in tempest for Liberty
On stable branches, we are supposed to hard code the extension list of
what API extensions are available when we branch the project so that
test cases against new features will be skipped. However, we didn't do
this on liberty branch for neutron, cinder and swift. So copy from
kilo and added the following API extensions (not in kilo):
  network
  - dns-integration
  - flavors
  - port-security
  - rbac-policies

  volume
  - capabilities
  - os-snapshot-manage
  - os-snapshot-unmanage

  object store
  - bulk

For nova API, we are using [1] "stable API" and API extensions are
removed. So we can use "all" for "compute_api_extensions".

[1] http://docs.openstack.org/developer/nova/stable_api.html#stable-api

Change-Id: Ic4a6292390a88e732f7460cf558c479baa8771b1
2016-10-13 11:14:56 +00:00
Huan Xie 5cdb66d752 Set ima_disk_format to vhd when hypervisor is XenServer
When running tempest testcase test_minimum_basic_scenario will always fail
due to lack of configuration [scenario] img_disk_format=vhd in tempest.conf
This patchset is to add this configuration when XenServer is used.

Change-Id: I4b916200e6eefb62f148ec8b644fb23ffc7e00a6
Closes-Bug: #1589787
(cherry picked from commit 36afed4353)
2016-10-11 03:06:17 +00:00
Jenkins 984f6bb676 Merge "Set default properties for Power: virtual console and scsi driver" into stable/liberty 2016-10-06 04:45:52 +00:00
Mark Vanderwiel 9edb50760a Add dependency for hexdump
hexdump is used in common function generate_hex_string which is
used by nova and heat.  The current general dependencies do not
have this dependency covered, instead it is usually pulled in by
other implicit dependencies when a full devstack is built. In
cases where only a subset is built (like just Heat and keystone)
hexdump is missing.

Added unit tests for the generate_hex_string function.

Depends-On: Ib47d802a31a0f4c2a49daa7e6698e37c70a2365a
Change-Id: I77c8c2019fb8b8174cdfaed3e56ebf728f0732b7
Closes-Bug: #1558672
(cherry picked from commit d99c29032b)
(cherry picked from commit 603fc0c6ec)
2016-10-05 09:49:38 +11:00
Rafael Folco 7c4d678b3b Set default properties for Power: virtual console and scsi driver
This patch enables the virtual console for Power systems /dev/hvc0
and sets scsi bus and virtio-scsi model as default.
The virtual console hvc0 enables full console including dmesg.
High performance virtio-scsi driver keeps the efficient design of
virtio-blk with effective SCSI passthrough.

Change-Id: I0b5cd4a15d30f06fc7993555d91d6907bd1acbd7
(cherry picked from commit 72f530fd7a)
2016-09-14 11:36:39 -05:00
Monty Taylor e8aa5d57d3 Write clouds.yaml to only /etc
After having migrated the copies of clouds.yaml to just consume from
/etc, remove the duplicate copy.

(cherry picked from commit ee9bb76647)

Conflicts:
	functions-common

Change-Id: I036704734785958c95d2234917d7b40bd797a375
2016-08-30 19:29:06 -03:00
Monty Taylor 0591b1a6a3 Accept IPv6 RAs on the interface with the default route
Because neutron sets ipv6 forwarding settings, we stop accepting RAs
from IPv6-only host environments. This leads to a loss of external
connectivity, which is bad for zuul running tests and stuff.

Setting accept_ra to 2 will cause the RAs to be accepted.

(cherry picked from commit 85b1308be4)

Conflicts:
	lib/neutron_plugins/services/l3

Closes-bug: #1616282

Change-Id: Ia044fff2a1731ab6c04f82aea47096b425e0c0a0
2016-08-24 21:45:16 +00:00
Matt Riedemann d870047bb9 Revert "Switch devstack to use qcow cirros img"
This reverts commit b4233fbc4e.

This is breaking grenade.

Change-Id: I6522a9706464ce9bdf74f154876cbd0dc71fe122
Closes-Bug: #1615241
2016-08-20 14:53:49 +00:00
Matthew Treinish b4233fbc4e Switch devstack to use qcow cirros img
This commit switches devstack to use the published qcow2 cirros image
instead of the AMI version. Using AMI was mostly a historical artifact
dating pretty far back, but in the real world no one really uses AMI
images with openstack clouds. This change reflects that and also
enables tempest ro remove its deprecated config options for using AMI
as a fallback on misconfiguration (which was just there to support
devstack's defaults)

This is need on all branches so that tempest can remove it's deprecated
options. It's also good to use a consistent image on all branches.

Change-Id: Id65ebae73b28da7185cb349b714b659af51ef77f
(cherry picked from commit 14fa51c28b)
(cherry picked from commit aecfdf5562)
2016-08-17 18:16:30 -04:00
Spyros Trigazis 4c15ae7bd2 Keep old behavior of setuptools for editable installs
In the 25.0.0 release [1] of setuptools during any install
operation the package in not overwritten. If a package is
installed from another requirement via pip and then it is
installed again from git, it is not updated causing
check_libs_from_git to fail.

[1] https://setuptools.readthedocs.io/en/latest/history.html#v25-0-0

Change-Id: Ibaa1d4157816ea649f4452756fbde25951347001
Closes-Bug: #1605998
(cherry picked from commit 88ccd47c88)
2016-07-28 12:02:16 -04:00
Sean Dague 39385cf471 add local.conf modifying functions
This adds a set of local.conf modifying functions which make it easier
for consuming projects like devstack-gate to programatically add
elements to local.conf structured files.

Change-Id: I3427968c2bd43aba12b3619acc27f73c74f0dabb
Co-Authored-By: fumihiko kakuma <kakuma@valinux.co.jp>
(cherry picked from commit bb35715cfe)
2016-07-25 20:12:33 +00:00
Jenkins bbeae070ef Merge "Introduce PUBLIC_BRIDGE_MTU variable to set br-ex MTU" into stable/liberty 2016-07-19 20:54:19 +00:00
Ihar Hrachyshka e4e088e566 Introduce PUBLIC_BRIDGE_MTU variable to set br-ex MTU
This variable can be used to accommodate for underlying infrastructure
that does not provide full 1500-sized traffic, or maybe instead gives
access to Jumbo frames.

Conflicts:
	lib/neutron_plugins/linuxbridge_agent
	lib/neutron_plugins/openvswitch_agent
	lib/neutron_plugins/services/l3

Change-Id: I38a80bac18673a30842a7b997d0669fed5aff976
Related-Bug: #1603268
(cherry picked from commit 7b5c7dce53)
(cherry picked from commit b078590721)
2016-07-17 00:22:15 +02:00
Ian Wienand 2a866dd2bd Add vercmp function
The existing vercmp_numbers function only handles, as the name says,
numbers.  I noticed that "sort" has had a version sort for a long time
[1] and, rather than re-implement it badly, use this as a version of
vercmp that works a bit more naturally.

This is intended to be used in an "if" statement as in

  prog_ver=$(prog_ver --version | grep ...)
  if vercmp $prog_ver "<" 2.0; then
     ...
  fi

A test-case is added to test the basic features and some edge-cases.

[1] http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=4c9fae4e97d95a9f89d1399a8aeb03051f0fec96

Conflicts:
	tests/unittest.sh

Change-Id: Ie55283acdc40a095b80b2631a55310072883ad0d
(cherry picked from commit 2ba36cda79)
2016-06-30 16:49:02 +02:00
Yalei Wang f8119e5813 Add pg_createcluster creating process for psql version after 9.3
postgresql 9.3 don't create /etc/postgresql and related conf file by
default. So we need start the pg_createcluster in devstack if has not
started after package installed.

Change-Id: I2b348658d79b23b5f21871b33d8023499b2fb956
Close-bug: #1552051
(cherry picked from commit 174986db21)
2016-06-28 08:58:49 +00:00
Jay Faulkner a943831c8d Change port used for Ironic static http to 3928
Due to recent infrastructure changes, infra began using port 8088. This
caused a conflict with our apache config, causing services to not start.
Infra is changing this port (Ie67bbba02dbf61a481f66001de3e0dede9448316)
but it may take up to a week to take effect.

Instead of having our gate broken for a week, I'm changing the default
port. 3928 was not chosen at random; it's listed as the netboot-pxe
service port in /etc/services.

Change-Id: Ibb635555dc516e54f8d46e2dba0f9cecfa5dd1b3
Closes-bug: 1590139
Co-Authored-By: John L. Villalovos <john.l.villalovos@intel.com>
(cherry picked from openstack/ironic commit
2898b622f7072995b0c778d2a762adba5afe75aa)
2016-06-16 20:14:24 -07:00
Jenkins d5cb356d13 Merge "Perform additional disable_service checks" into stable/liberty 2016-06-15 01:08:36 +00:00
Matthew Treinish fee3d18f1a Move tempest plugin install to the end
For the tempest plugin install inside the tox venv to hold we need to
ensure that it's the last thing run that touches the tox venv before
devstack ends. Otherwise there is a chance we'll recreate the venv in
a later step of installing and configuring tempest. This commit
moves the plugin installation into it's own function and calls that
function as last phase of the tempest setup to make sure it runs last.

Change-Id: Ie253171537e8c5a9887cc30aba1cad4b31e57663
(cherry picked from commit 7e603d1bf8)
2016-06-10 15:59:28 -04:00
Jenkins d5b4ac741c Merge "Default to venv isolated tempest on stable liberty" into stable/liberty 2016-05-20 23:46:18 +00:00
Roxana Gherle 38c31ca025 Assign admin role for admin user on default domain
This patch adds an admin role assignment for the admin user on
the default domain as part of the Keystone configuration stage.

(Cherry-picked from 59c6377ae5)
Closes-Bug: #1494081
Change-Id: I91c88917bd51be4572e4970c94e65d866798df26
2016-05-16 05:54:34 +00:00
Jenkins e8928e93bd Merge "Disable resize tests in Tempest if using cells with custom flavors" into stable/liberty 2016-05-10 15:52:11 +00:00
Jenkins 3a64be8d76 Merge "Disable compute interface attach Tempest tests if using cells" into stable/liberty 2016-05-10 15:52:02 +00:00
Matt Riedemann 73e16ae464 Disable resize tests in Tempest if using cells with custom flavors
By default, devstack creates it's own test flavors for Tempest runs.

These are not in the cells API database since they are non-default
for nova so any resize tests in Tempest with cells and these custom
flavors fail.

Configure Tempest to not run resize tests if using cells and custom
flavors.

This allows us to also clean up a bunch of the resize skips found
in nova/devstack/tempest-dsvm-cells-rc.

Change-Id: I20f46024e45e32c60275703a193a56ae8cfe7eca
Closes-Bug: #1513925
(cherry picked from commit 6cd616a9ed)
2016-05-10 09:55:02 -04:00
Matt Riedemann 8c432d935c Disable compute interface attach Tempest tests if using cells
Cells doesn't support the os-attach-interfaces API so disable those
tests in Tempest if running with Cells.

Change-Id: I5c7884407868eae70ea125f3f893c73214c04c75
(cherry picked from commit c94403d8e6)
2016-05-10 13:50:59 +00:00
Matthew Treinish 525bc5cfe4 Use common tempest tox venv and add plugin install variable
This commit adds a new variable to lib/tempest to provide the plugins
that should be installed into common tox venv that gets created. In
order to make this work the workarounds to handle migrating to a common
tox venv have to be removed otherwise the plugins could be installed in
a venv that isn't used. This also removes the constrained installation
steps, as the constraints packaged on liberty will eventually conflict
with what tempest actually requires since tempest follows master
requirements and constraints.

Change-Id: I63658b8d8dfa999e0feb79f8f2968f2b32e3ff57
Depends-On: Iab2e6e04b6c5795a4d0c8214564106525b942308
(cherry picked from commit 440464ccbb)
(cherry picked from commit a47398ffee)
2016-05-09 15:29:55 -04:00
Matthew Treinish 71af1ee707 Default to venv isolated tempest on stable liberty
Tempest follows global requirements of master on openstack (as it is
branchless) when running tempest in an all in one environment with an
older branch this can cause requirements conflicts. To prevent this
issue we need to venv isolate tempest from the system to ensure that
everything is properly isolated.

Change-Id: I6944b9f5732d21a6b4ceb567dda84d6daaf62e1c
2016-05-03 13:46:49 -04:00
Matthew Treinish 86b0f80488 Handle common and seperate tempest tox venvs
In order to support the effort to unify the tox venvs being created
by tempest this commit temporarily cases the path of the venv being
created. Once tempest is updated to only use .tox/tempest we can
remove the if blocks and just use it unconditionally.

Change-Id: I34a69020eee07156e64026781a3c0bffdb5ab415
(cherry picked from commit 412956a973)
(cherry picked from commit 0945f431c0)
2016-05-02 16:37:16 -04:00
Chris Dent 2af47f99fd Perform additional disable_service checks
With the advent of plugins and their settings files it has become
possible to disable_service in local.conf only to have the service
re-enabled in a plugin settings file. This happens because of
processing order.

To get around this the disable_service function now aggregates
service names into a DISABLED_SERVICES variable which is then checked
during enable_service. If something tries to enable something that
was previously disabled, a warning is produced in the log and the
service is not enabled.

Then after all configuration has been sourced a final check is to
done by verify_disabled_services to confirm that something has not
manually adjusted ENABLED_SERVICES to overcome a previously called
disable_service. If something has, the stack dies with an error.

Change-Id: I0f9403f44ed2fe693a46cd02486bd94043ce6b1a
Closes-Bug: #1504304
(cherry picked from commit c6d470142e)
2016-04-19 23:17:41 +00:00
Jim Rollenhagen a83b5385e8 Allow fetching IPA ramdisk with branch name
This adds branch name to the default URLs for IPA images, ensuring that
devstack runs will use the correct branch of IPA for tests.

It introduces a variable IPA_DOWNLOAD_BRANCH to accomplish this, which
defaults to master. This default will be set to the branch name on
stable branches, e.g. stable/mitaka. It is modified to match our URL
scheme for agent images, e.g. stable-mitaka.

This patch uses stable/liberty as the default, and is an indirect
backport of ironic commit 8e15d6a1388f49026c4d35ba87219a49ccc3c134, as
ironic moved to a devstack plugin in Mitaka.

Change-Id: I045f1a8d674acae9f45bdde8692d4ecc19b328c8
Depends-On: I3ec6dafb9522b5fe79e0c6681c2578d2a723380a
Closes-Bug: #1561756
2016-04-01 16:45:15 +00:00
Jenkins ec39f18e39 Merge "[ironic] set ipa-debug=1 for greater debugability" into stable/liberty 2016-03-24 15:15:46 +00:00
Jim Rollenhagen e776ec5b02 Install apparmor b/c Docker.io has undeclared dep
Docker has an undeclared dependency on apparmor for Ubuntu Trusty,
preventing the daemon from running and causing any -src jobs for IPA to
fail when using docker to build the package.

This should unbreak the IPA gate.

This is not a direct cherry-pick, as ironic in Mitaka uses a devstack
plugin, while ironic in Liberty uses devstack directly. This is,
however, a direct port from ironic's master branch. The commit there is
3a6a8ec98e56816c4671648d11716d71adc366b0.

Change-Id: I4c19c96d2d5cd8accb9ed8df6241fc9f0c229e0e
Co-Authored-By: Jay Faulkner <jay@jvf.cc>
2016-03-21 07:37:55 -07:00
John L. Villalovos ebb848a108 [ironic] set ipa-debug=1 for greater debugability
(cherry-pick from openstack/ironic commit 1accb30c2ebb166b54daf8df59c518cef388197f)

Change-Id: Id3ce64d9125d5d68c28c29bf8eb66c49490063a4
2016-03-17 17:05:39 -07:00
Jenkins bf7eb80b64 Merge "Move node UUID generation later in lib/ironic" into stable/liberty 2016-03-17 14:53:38 +00:00
Dmitry Tantsur 4d39e07119 Move node UUID generation later in lib/ironic
The uuidgen utility is not installed by default, and the top-level code runs
before the deb/rpm files are processed. This fixes Ironic gates.

Change-Id: Ib593bbf40fb06b72be8d9ceaa7d791e3d44e4dd0
2016-03-17 11:50:25 +01:00
gordon chung 40024ea262 Install uuid-runtime on Ubuntu
It seems uuidgen doesn't exist by default on the new trusty nodes [1].
There are quite a few projects that use uuidgen [2] so we need to
ensure it's on the node.

On Trusty, this is provided by the uuid-runtime package.  Note that on
Centos & Fedora this is provided by util-linux which is already tehre.

[1] http://logs.openstack.org/75/292475/1/check/gate-telemetry-dsvm-integration-ceilometer/2e85d1f/logs/devstacklog.txt.gz#_2016-03-16_19_20_30_116
[2] http://codesearch.openstack.org/?q=uuidgen&i=nope&files=&repos=

(Cherry-picked from f21b86fefb)
Change-Id: I230836d8b644698473d0611931334c232cf00734
2016-03-17 14:35:37 +11:00
John L. Villalovos 49b97f733d Ironic: Don't use token for glance & check for some unset vars
There is a regression issue in stable/liberty where using a token for
auth is failing for glance. We don't need to use a token as we already
have our credentials. So stop using a token to upload to glance.

We call various commands to set certain variables. Add some checks to
make sure those variables are set and fail if they are not.

Partial-Bug: #1549095
(cherry-picked from openstack/ironic commit e6b3c4217f27818acedb15c925641f9d1aa5ab34)
Change-Id: I398cd61dd731c03346cf10e5b3102d8d809d3f87
2016-03-09 13:12:35 -08:00
Jenkins 501bb07462 Merge "XenAPI: Fix disk_formats verified by tempest" into stable/liberty 2016-02-28 14:38:45 +00:00
Jenkins b9ee0e8b42 Merge "make fwaas plugin and driver configurable" into stable/liberty 2016-02-26 16:34:48 +00:00
Jerry Zhao 4b80bc25e8 make fwaas plugin and driver configurable
user can pass fwaas plugin and driver from localrc

(cherry-picked from commit 8eab6ad31b)
Change-Id: Id956d4d7e62ba81f77319c199c9cb9f354b13d12
2016-02-26 03:01:16 +00:00
Bob Ball 019bd53f08 XenAPI: Fix disk_formats verified by tempest
lib/glance restricts the disk_formats to those supported by XenAPI, so
tempest needs a similar restriction for the disk_formats tested.

Confirmed as passing internal Citrix CI (affected tempest jobs are
currently disabled in voting XenServer CI until this change lands)

Conflicts:
        lib/tempest

NOTE(mriedem): The conflict is due to this line being in lib/tempest
twice:

iniset $TEMPEST_CONFIG image-feature-enabled deactivate_image True

The duplication is removed so this is the same as master now.

Change-Id: Iefa5b16a3fa1789ed583426ea47ebb22e6cb571e
(cherry picked from commit 2dd761b169)
2016-02-25 11:14:48 -05:00
Arun S A G bcc239f30f Set unprovision and active timeout to match build_timeout
The build_timeout for the ironic baremetal build is at
340s. Modify the unprovision_timeout and active_timeout
to match BUILD_TIMEOUT to avoid frequent failures during
IPA gate jobs.

Change-Id: Idfdc54210e33c71719c7fd0c905d0b802809e173
Related-Bug: #1393099
(cherry picked from commit ad69e69e3f)
2016-02-10 23:27:17 +00:00
Matthew Treinish 380c6a4573 Switch tempest verify-config usage to avoid bug
This commit will unblock the world breakage caused by the recent
cliff release. This exposes a hole in our constraints usage in
devstack. We need to fix this bug for real in devstack and cliff,
but that will take a few minutes to an hour or so. So let's just
change the usage in the meantime, we can revert this when things
are fixed for real.

Change-Id: Ic63612dc50e064a3a69b88618e394ba17e083c22
Related-Bug: #1543841
2016-02-09 19:19:48 -05:00
Ken'ichi Ohmichi ab6da55578 Remove unnecessary group of Tempest config
Tempest refers CONF.identity-feature-enabled.api_extensions for
getting Keystone configuration from tempest.conf, but the commit
I3a92397d7bc62c3ec156281696d5c22504a86cb3 adds unnecessary group
identity and Tempest cannot refer the configuration now.
This patch fixes it.

Change-Id: Id7e1a94b1078b5934d2d140e85594ac0010e2e73
2016-02-02 07:39:23 +00:00
Jenkins 704d547242 Merge "always default to floating ips for validation" into stable/liberty 2016-02-01 14:34:12 +00:00
Jenkins 48c8a41dd0 Merge "Limit keystone extension tests for the existing" into stable/liberty 2016-01-31 00:15:39 +00:00
Ken'ichi Ohmichi 526f8f6542 Limit keystone extension tests for the existing
Since Ifac71f7415f21c402f6e00c5264e972b0e80388c in Mitaka, the
os_inherit of Keystone is enable on the default config.
In addition, Tempest is branchless now.

So we need to limit keystone extension tests as the existing
ones(OS-EC2) for stable branch.

Change-Id: I3a92397d7bc62c3ec156281696d5c22504a86cb3
2016-01-28 08:15:46 +00:00
Matthew Treinish bf8735ced4 Add subunit output for total elapsed time
This commit adds a success output for the entire devstack run to the
subunit output. Ideally we wouldn't need this, but because we don't
have timing data for every single operation performed by devstack we
need to do this to track the total duration of the devstack run.

To capture failures this commit adds saving a devstack event when we
trip the exit_trap. This will save a similar result to the stream in
the successful case, but instead mark it as a failure.

This is backported from master branch to generate subunit result so
d-g can collect it from the new location.

Depends-On: Icc7df33e4d73ba6322af38fbdf3aea230f2fcf4d
Depends-On: I97a604ac08797909afc236401281a5d84b98d53f
Change-Id: I07112dde996c3e2c73f5aafc9b73d33d26374633
2016-01-26 23:01:57 -08:00
Sean Dague 5762816346 always default to floating ips for validation
fixed ips are not cross host accessible in our current config. So
always configure tempest to use floating ips.

Change-Id: I1cf605229070024c9d5d29c7a08967aa505fda7b
(cherry picked from commit 5544c4a74f)
2016-01-26 14:10:15 +00:00
Ihar Hrachyshka bbcc74abcc neutron: enable ml2 mtu calculation mechanism
Setting path_mtu to reflect mtu for physical devices that handle traffic
issued from br-tun makes ml2 plugin to calculate mtu for tenant networks
properly, considering encapsulation headers. After that, calculated mtu
values can be propagated into instances (currently, only DHCP approach
is implemented; RA support for IPv6 subnets is under review).

This change allows to run tunnelled tenant networks in multinode when
underlying physical devices don't support jumbo frames.

Note: changing the default value in neutron would not be backwards
compatible, since it could slow down east-west tunnelled traffic in
clouds that run on jumbo-aware networks.

Change-Id: I8287677c7ad0f13fa9f5cb194f9372d04b78cb61
Related-Bug: #1527675
(cherry picked from commit 06cfce3756)
2016-01-25 12:39:22 +00:00
Jenkins 9a4130bae1 Merge "reduce default lease time to 5 minutes" into stable/liberty 2016-01-23 07:46:51 +00:00
Jenkins 58bcbce0e4 Merge "Revert "set the validation path to fixed for n-net"" into stable/liberty 2016-01-23 05:35:17 +00:00
Sean Dague bf3c7e5442 reduce default lease time to 5 minutes
Devstack used in development is about things coming and going
quickly. The long dhcp leases mean that we might miss a release, and
keep a stale lease around for way too long. See if this helps.

Change-Id: I9a58a4e64777f56ad7ec66242a319f985469469e
2016-01-22 17:36:57 +00:00
Jenkins 640bf5d2ec Merge "Always cache tokens in a shared memcache" into stable/liberty 2016-01-22 12:18:58 +00:00
Jenkins 5bd1fb6fcd Merge "neutron: enable MTU advertisement" into stable/liberty 2016-01-22 11:18:37 +00:00
Jenkins ac9f5d9ab1 Merge "Support for logging the nova-dhcpbridge command line" into stable/liberty 2016-01-22 00:12:32 +00:00
Matthew Treinish c21d6ae145 Revert "set the validation path to fixed for n-net"
We're seeing a 100% failure rate on the grenade multinode jobs on 2 cloud providers. We suspect it's because tempest is trying to ssh on the private network which it doesn't have access to. Lets revert to the previous behaviour and see if it fixes it

This reverts commit 46a272b31a.

Change-Id: I50a6de8db7d74b2250a8ad166d13c39af37e1c6c
2016-01-21 15:16:16 +00:00
Jenkins 5acb98ae49 Merge "Remove vme and ssse3 from gate64 cpu mapping" into stable/liberty 2016-01-21 04:09:02 +00:00
Morgan Fainberg 3bf121591a Always cache tokens in a shared memcache
Instead of using in-process caching for tokens per service per
worker (disabled by default now), use a shared memcache to cache
token validation(s). This should both offload/speedup validations
and avoid the issues surrounding inconsistent validation responses
when using in-process caching [since each worker caches separately].

Conflicts:
    files/debs/keystone
    files/rpms/keystone

Change-Id: Ifc17c27744dac5ad55e84752ca6f68169c2f5a86
(cherry picked from commit afd84acd03)
2016-01-20 15:02:35 -08:00
Matthew Treinish 385508edfd Cap installed pip to be < 8
Pip 8 just release which made uninstalling distutils installed packages
fatal. This was previously a deprecation warning and is now causing all
dsvm jobs to fail.

(cherry picked from commit 0ea729ac49)

Change-Id: I511d216d9d8619c7cf919c482aaead4e833cdaac
Depends-On: I315351f91747d27bf735bdc3f2a527d773b029be
2016-01-19 21:25:52 -05:00
Davanum Srinivas c3faf14326 Support for logging the nova-dhcpbridge command line
We are seeing a lot of gate failures as vm(s) are unable to acquire
DHCP leases:
https://bugs.launchpad.net/nova/+bug/1532809

we need to set log_file for nova-dhcpbridge configuration, so clone
the nova.conf and set the log_file properly to a path where the
CI can pick up from for analysis.

Change-Id: Iec4fe3f2235da9d1f5bd399d4ffc45af516c58ce
(cherry picked from commit ac8ff0f1e9)
(cherry picked from commit bd7a51200f)
2016-01-19 14:23:47 -05:00
Clark Boylan 6b757821fb Remove vme and ssse3 from gate64 cpu mapping
It turns out that we need to be even more restrictive on the cpu flags
we expose as some clouds don't expose vme or ssse3.

Fixes-Bug: 1535799
Change-Id: I6c8c1101771d1c5496884be7a405285472ae803a
(cherry picked from commit e62a5e1df8)
2016-01-19 08:24:26 -08:00
Ihar Hrachyshka 539d1898eb neutron: enable MTU advertisement
This is needed if you want to run devstack using tunnelling for tenant
networks as well as multiple nodes. In this case, packets get additional
encapsulation header, and if packets are of physical device mtu size,
tunnelled data can be dropped, especially when "Dont Fragment" (DF) flag
is set.

MTU is currently advertised using DHCP option only. It works as long as
guests know how to handle it. (Cirros honors the option as of 0.3.4).

Note this patch is Liberty only. For Mitaka, we plan to change the
default value for the option to True (see the dependency). We won't be
able to backport the neutron patch to stable release since it violates
stable maintenance rules.

Change-Id: I53c0a29438d0d6433efd4b379bc0391a69d26589
Depends-On: I5cbbc4660f8c4e15e59f8f5ce0419501bdd27348
Related-Bug: #1527675
2016-01-15 08:40:19 +00:00
Alexander Schmidt 91eba8eb20 Add distro support for KVM for IBM z Systems
Add "KVM for IBM z Systems" to the list of Fedora-like distros.

As the distribution does not have a dedicated kvm package,
prevent the installation of the kvm package during the libvirt
setup.

Conflicts:
    stack.sh

cherry-picked from a5ea08b752

Change-Id: Ibb5c60797d6867264f9dea7fea85cdf1d7c72ded
2016-01-08 16:43:03 +01:00
Jenkins 042e687b64 Merge "Ensure link is set to up, when moving IP addresses across interfaces." into stable/liberty 2016-01-06 17:32:48 +00:00
Shinobu KINJO 0387d1f951 Ensure link is set to up, when moving IP addresses across interfaces.
- To add, initialize and set up a valiable named IP_UP
 - To bring up interface after moving IP to OVS bridge

Change-Id: I70f5974c115be6f7e7422a9a325f36cf3b71455a
Closes-Bug: #1469596
(cherry picked from commit f95315b6ea)
2016-01-05 20:53:51 +00:00
Sean Dague 46a272b31a set the validation path to fixed for n-net
See if using fixed IPs for connectivity to hosts is more reliable than
floating ips, which really were not intended for these purposes (at
least in nova-net).

Change-Id: I251710ee9186a68bb3ddc58ca803c33b81c8ac49
(cherry picked from commit 563a7e75b7)
2016-01-05 13:40:10 +00:00
Davanum Srinivas d9422b838a Do not fail with Tox 2.3.1
Latest tox causes failures:
   File "/usr/local/lib/python2.7/dist-packages/tox/config.py", line 1140, in processcommand
     argv = list(shlexer)
   File "/usr/lib/python2.7/shlex.py", line 269, in next
     token = self.get_token()
   File "/usr/lib/python2.7/shlex.py", line 96, in get_token
     raw = self.read_token()
   File "/usr/lib/python2.7/shlex.py", line 172, in read_token
     raise ValueError, "No closing quotation"
 ValueError: No closing quotation

This is caused by a backwards incompatible change in tox:
https://bitbucket.org/hpk42/tox/issues/181

I also picked up a bit of https://review.openstack.org/#/c/236778/ but
tried to not get the worst of it (i.e., the new checks that would require
a lot more back-porting to stable/liberty).

Change-Id: Ic28c634cf806394cfa82b61cb45be60b8f40a61a
(cherry picked from commit f59e6df23a)
2016-01-04 22:42:58 -08:00
Jenkins e401ae4b9c Merge "Always use v3 nova/neutron authentication" into stable/liberty 2015-12-14 18:47:24 +00:00
Jenkins e0c8d4835c Merge "Fix tunneling support for linuxbridge-agent" into stable/liberty 2015-12-14 12:51:21 +00:00
Jamie Lennox 00f43e5b26 Always use v3 nova/neutron authentication
There is no need to test here whether v2 is disabled or not. V3
Authentication will always be available and we should just use that.

This backport is needed as the options used were deprecated in liberty already, and this is breaking grenade jobs.

Change-Id: I0d2d76ebdf261917f1a2b23c65f0f843ae50f49a
(cherry picked from commit 394968fa3d)
2015-12-14 12:08:30 +00:00
Sean Dague 6313bf8452 create apt_get_update to try to work around broken mirrors
Ubuntu's apt mirroring mechanism produces inconsistent mirrors pretty
regularly. The devstack-gate apt-get update model seems to have been
more effective getting past this than what we did in devstack. Adopt
that method for our updates.

Change-Id: I97c7896ef38b275aacb4f933fc849acee1bab858
(cherry picked from commit 88ee8ce468)
2015-12-11 10:15:49 -05:00
Nick cad121ea62 Fix tunneling support for linuxbridge-agent
When I deploy linuxbridge-agent and enable tunneling,
the configuration of neutron isn't right. It lacks
the whole section [vxlan] to be properly configured.

Change-Id: Ib3bfe0f3445f466f4dbb36f7f0cb0d940114e7f6
Closes-Bug: #1481126
Related-Bug: #1524913
(cherry picked from commit c295bca61f)
2015-12-10 12:25:24 -05:00
Ian Wienand d3a9cab22d Simplify RDO install
We can just directly install the latest RDO repo rather than having to
keep this up-to-date.  I don't think there is actually much there we
need any more; there was a lot more coming from RDO in the centos6
days.  openvswitch is one big one, however.

(cherry picked from commit 1eca508c57)

Change-Id: Ibce834c3e76d71a770013cf1b469aa86396751b9
2015-12-09 13:24:32 +01:00
obutenko 0355ecc4d3 Add flag for test_incremental_backup
Forced creation of incremental backup is not
implemented in old release (Juno and Kilo).
The test is skipped by default for Juno and Kilo gates.
Need to add flag to unskip this test in new release.

New test: Idde2c14aba78382b1063ce20269f4832f9fdd583
Change-Id: I565b5941d6067644fc9ca6cb0891d97f4946e031
Partial-Bug: #1506394
(cherry picked from commit a366b97c0a)
2015-12-01 13:25:57 +00:00
Sean Dague aca08dedc7 install ebtables locking workaround
ebtables is racing with itself when nova and libvirt attempt to create
rules at the same time in the nat table. ebtables now has an explicit
--concurrent flag, that all tools must opt into to prevent ebtables
from inherently being unsafe to run.

libvirt gained this support in 1.2.11, which is too new for our ubuntu
primary testing environment. Nova still hasn't added this support,
though even if it did, we'd run into the issue with libvirt.

We can do the most ghetto thing possible and create a wrapper for
ebtables that does explicit locking on it's own. It's pretty terrible,
but it should work. And it is the kind of work around that people
unable to upgrade libvirt will probably need to do.

This is an opt in value which we should set in the gate to True.

Related-Bug: #1501558

Change-Id: Ic6fa847eba34c21593b9df86a1c2c179534d0ba5
(cherry picked from commit 7860f2ba31)
2015-11-18 20:16:31 -05:00
Jenkins 6ff54a3936 Merge "remove gratuitous python packages" into stable/liberty 2015-11-10 07:39:02 +00:00
Ian Wienand 65f4f129cb Really get the "general" packages
We are specifying the argument to get_packages incorrectly, so we are
not actually adding the packages in "general" to the list of packages.

In most cases, this is hidden as other more specific plugins/services
request their packages.  However, as
I2dafd32f211fcbc9fff53030d736d97a5f1bb2df shows, not always.  I think
this was uncovered by 5f8133caac

Change-Id: Ie1b8d09369281059d21da61b2725a457f708ae9e
2015-11-09 13:03:45 +00:00
Sean Dague 1816012e83 remove gratuitous python packages
With pip + upper-constraints we're nearly always over installing all
python packages because we no longer support a range, we support
*exactly* one version.

This removes a bunch of the gratuitous package installs which we're
going to install over, lxml, numpy, libvirt. All of these we had
coming from packages in the past for speed concerns, but upper
constraints removes that.

It also ensures that all the headers to build all those are in
general, so they are guarunteed available at all times.

Change-Id: Ia76de730d65c84d81c4fb2c980ae1b4d595f9f5b
(cherry picked from commit 5f8133caac)
2015-11-06 11:50:51 -05:00
Mark Hamzy e19494f81e Restrict requests to fedora
The os_RELEASE for RHEL is 7.1 (for example). Which does not work for comparisons
to an integer.  And, while I am at it, change base_path to not use a hard-coded
directory.

Change-Id: I64a04810cc7ba4668c2cb7a8df79c206301e9e16
(cherry picked from commit 746e72d4c3)
2015-11-05 17:07:39 +00:00
Sean Dague b30dca9a30 remove wheel cache code
Thanks to lifeless, pip now implicitly has a wheel cache so that it
builds a wheel before every install, and uses that cache. All our
clever attempts at manually doing wheelhouse things is actually
bypassing the existing cache and making things take longer.

We should remove all of this code and just let pip do this thing,
which is does very well, and get out of the way.

Change-Id: Ia140dc34638d893b92f66d1ba20efd9522c5923b
(cherry picked from commit 9013bb0c24)
2015-11-04 17:09:06 -05:00
Einst Crazy d095b3287a modify stackforge/swift3 to openstack/swift3
As swift3.git has move from stackforge/swift3 to openstack/swift3,
so modify it.

Change-Id: Ieaff4c93889c46c7d4b8ecada1a5d7cf3c775965
(cherry picked from commit cc481740a0)
2015-11-02 12:27:28 +00:00
Jenkins cbcce857c8 Merge "Workaround potential failure to shutdown services" into stable/liberty 2015-10-09 21:19:46 +00:00
Jenkins 06796ede82 Merge "update references for liberty" into stable/liberty 2015-10-03 12:24:50 +00:00
Dan Smith d680e9b140 Workaround potential failure to shutdown services
Kill them twice to make sure they're good'n'dead. There is a supposed
fix to oslo-incubator code, but we're working around that here in the
meantime with this change.

This returned in Liberty.

Change-Id: I02a7af995dc7de857c4efcf2cef2f95d357c007a
Related-Bug: #1446583
2015-10-02 05:45:05 -04:00
Sean Dague 92005efdfc update references for liberty
Change-Id: I8b24421b07c20f4ffaec844cf2096c68e6a3f9de
2015-09-30 06:57:22 -04:00
Sean Dague 8dac66f087 Revert "Disable Cinder v1 API support by default"
There has been a ton of fall out from this change, and I 
think it's been premature. We should revert and try again
when more of the client space supports this.

This reverts commit a29434460e.

Change-Id: I1658dc48a024627be0fdb39c46137aaa3d9b911a
2015-09-30 10:34:22 +00:00
49 changed files with 1229 additions and 278 deletions
+1
View File
@@ -2,3 +2,4 @@
host=review.openstack.org
port=29418
project=openstack-dev/devstack.git
defaultbranch=stable/liberty
+1 -5
View File
@@ -13,7 +13,6 @@
# Duplicated from stackrc for now
DEST=/opt/stack
WHEELHOUSE=$(DEST)/.wheelhouse
all:
echo "This just saved you from a terrible mistake!"
@@ -25,9 +24,6 @@ stack:
unstack:
./unstack.sh
wheels:
WHEELHOUSE=$(WHEELHOUSE) tools/build-wheels.sh
docs:
tox -edocs
@@ -57,7 +53,7 @@ clean:
# Clean out the cache too
realclean: clean
rm -rf files/cirros*.tar.gz files/Fedora*.qcow2 $(WHEELHOUSE)
rm -rf files/cirros*.tar.gz files/Fedora*.qcow2
# Repo stuffs
-7
View File
@@ -588,13 +588,6 @@ with ``VOLUME_BACKING_FILE_SIZE``.
VOLUME_BACKING_FILE_SIZE=10250M
Cinder v1 API is depricated and disabled by default. You can enable v1 API by
setting ``CINDER_ENABLE_V1_API`` to ``True``.
::
CINDER_ENABLE_V1_API=True
Keystone
~~~~~~~~
-1
View File
@@ -206,7 +206,6 @@ Tools
* `tools/build\_docs.sh <tools/build_docs.sh.html>`__
* `tools/build\_venv.sh <tools/build_venv.sh.html>`__
* `tools/build\_wheels.sh <tools/build_wheels.sh.html>`__
* `tools/create-stack-user.sh <tools/create-stack-user.sh.html>`__
* `tools/create\_userrc.sh <tools/create_userrc.sh.html>`__
* `tools/fixup\_stuff.sh <tools/fixup_stuff.sh.html>`__
+2
View File
@@ -14,6 +14,8 @@ if is_service_enabled tempest; then
echo_summary "Initializing Tempest"
configure_tempest
init_tempest
echo_summary "Installing Tempest Plugins"
install_tempest_plugins
elif [[ "$1" == "stack" && "$2" == "post-extra" ]]; then
# local.conf Tempest option overrides
:
+5 -1
View File
@@ -3,6 +3,7 @@ screen
unzip
wget
psmisc
bsdmainutils
gcc
g++
git
@@ -20,8 +21,11 @@ python2.7
python-gdbm # needed for testr
bc
libyaml-dev
libffi-dev
libffi-dev # for pyOpenSSL
libssl-dev # for pyOpenSSL
libxml2-dev # lxml
libxslt1-dev # lxml
gettext # used for compiling message catalogs
openjdk-7-jre-headless # NOPRIME
pkg-config
uuid-runtime
+2
View File
@@ -1,3 +1,5 @@
# apparmor is an undeclared dependency for docker on ubuntu: https://github.com/docker/docker/issues/9745
apparmor
docker.io
ipmitool
iptables
+1 -1
View File
@@ -1,7 +1,7 @@
python-lxml
sqlite3
python-mysqldb
python-mysql.connector
libldap2-dev
libsasl2-dev
libkrb5-dev
memcached
-1
View File
@@ -1 +0,0 @@
python-numpy
-1
View File
@@ -15,4 +15,3 @@ rabbitmq-server # NOPRIME
sqlite3
vlan
radvd # NOPRIME
uuid-runtime
+2 -5
View File
@@ -8,7 +8,8 @@ libmysqlclient-dev
mysql-server # NOPRIME
python-mysqldb
python-mysql.connector
python-lxml # needed for glance which is needed for nova --- this shouldn't be here
libxml2-dev # needed for building lxml
libxslt1-dev
gawk
iptables
ebtables
@@ -25,7 +26,3 @@ curl
genisoimage # required for config_drive
rabbitmq-server # NOPRIME
socat # used by ajaxterm
python-libvirt # NOPRIME
python-libxml2
python-numpy # used by websockify for spice console
python-m2crypto
+23
View File
@@ -0,0 +1,23 @@
#!/bin/bash
#
# Copyright 2015 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 is a terrible, terrible, truly terrible work around for
# environments that have libvirt < 1.2.11. ebtables requires that you
# specifically tell it you would like to not race and get punched in
# the face when 2 run at the same time with a --concurrent flag.
flock -w 300 /var/lock/ebtables.nova /sbin/ebtables.real $@
+1
View File
@@ -19,5 +19,6 @@ screen
tar
tcpdump
unzip
util-linux
wget
net-tools
+1
View File
@@ -1,4 +1,5 @@
cyrus-sasl-devel
memcached
openldap2-devel
python-devel
sqlite3
+1
View File
@@ -19,6 +19,7 @@ screen
tar
tcpdump
unzip
util-linux
wget
which
bc
+1
View File
@@ -1,4 +1,5 @@
MySQL-python
libxslt-devel
sqlite
memcached
mod_ssl
-11
View File
@@ -1,11 +0,0 @@
# Once we can prebuild wheels before a devstack run, uncomment the skipped libraries
cryptography
# lxml # still install from from packages
# netifaces # still install from packages
#numpy # slowest wheel by far, stop building until we are actually using the output
posix-ipc
# psycopg # still install from packages
pycrypto
pyOpenSSL
PyYAML
xattr
+57 -2
View File
@@ -300,8 +300,8 @@ function upload_image {
*) echo "Do not know what to do with $image_fname"; false;;
esac
if is_arch "ppc64"; then
img_property="--property hw_cdrom_bus=scsi"
if is_arch "ppc64le" || is_arch "ppc64" || is_arch "ppc"; then
img_property="--property hw_disk_bus=scsi --property hw_scsi_model=virtio-scsi --property hw_cdrom_bus=scsi --property os_command_line=console=hvc0"
fi
if is_arch "aarch64"; then
@@ -524,12 +524,58 @@ function vercmp_numbers {
typeset v1=$1 v2=$2 sep
typeset -a ver1 ver2
deprecated "vercmp_numbers is deprecated for more generic vercmp"
IFS=. read -ra ver1 <<< "$v1"
IFS=. read -ra ver2 <<< "$v2"
_vercmp_r "${#ver1[@]}" "${ver1[@]}" "${ver2[@]}"
}
# vercmp ver1 op ver2
# Compare VER1 to VER2
# - op is one of < <= == >= >
# - returns true if satisified
# e.g.
# if vercmp 1.0 "<" 2.0; then
# ...
# fi
function vercmp {
local v1=$1
local op=$2
local v2=$3
local result
# sort the two numbers with sort's "-V" argument. Based on if v2
# swapped places with v1, we can determine ordering.
result=$(echo -e "$v1\n$v2" | sort -V | head -1)
case $op in
"==")
[ "$v1" = "$v2" ]
return
;;
">")
[ "$v1" != "$v2" ] && [ "$result" = "$v2" ]
return
;;
"<")
[ "$v1" != "$v2" ] && [ "$result" = "$v1" ]
return
;;
">=")
[ "$result" = "$v2" ]
return
;;
"<=")
[ "$result" = "$v1" ]
return
;;
*)
die $LINENO "unrecognised op: $op"
;;
esac
}
# This function sets log formatting options for colorizing log
# output to stdout. It is meant to be called by lib modules.
@@ -599,6 +645,15 @@ function create_disk {
fi
}
# set_mtu - Set MTU on a device
function set_mtu {
local dev=$1
local mtu=$2
sudo ip link set mtu $mtu dev $dev
}
# Restore xtrace
$XTRACE
+95 -20
View File
@@ -76,9 +76,11 @@ function write_clouds_yaml {
# The location is a variable to allow for easier refactoring later to make it
# overridable. There is currently no usecase where doing so makes sense, so
# it's not currently configurable.
CLOUDS_YAML=~/.config/openstack/clouds.yaml
mkdir -p $(dirname $CLOUDS_YAML)
CLOUDS_YAML=/etc/openstack/clouds.yaml
sudo mkdir -p $(dirname $CLOUDS_YAML)
sudo chown -R $STACK_USER /etc/openstack
CA_CERT_ARG=''
if [ -f "$SSL_BUNDLE_FILE" ]; then
@@ -385,6 +387,8 @@ function GetDistro {
DISTRO="rhel${os_RELEASE::1}"
elif [[ "$os_VENDOR" =~ (XenServer) ]]; then
DISTRO="xs$os_RELEASE"
elif [[ "$os_VENDOR" =~ (kvmibm) ]]; then
DISTRO="${os_VENDOR}${os_RELEASE::1}"
else
# Catch-all for now is Vendor + Release + Update
DISTRO="$os_VENDOR-$os_RELEASE.$os_UPDATE"
@@ -419,7 +423,7 @@ function is_fedora {
[ "$os_VENDOR" = "Fedora" ] || [ "$os_VENDOR" = "Red Hat" ] || \
[ "$os_VENDOR" = "CentOS" ] || [ "$os_VENDOR" = "OracleLinux" ] || \
[ "$os_VENDOR" = "CloudLinux" ]
[ "$os_VENDOR" = "CloudLinux" ] || [ "$os_VENDOR" = "kvmibm" ]
}
@@ -854,6 +858,38 @@ function get_or_add_user_project_role {
echo $user_role_id
}
# Gets or adds user role to domain
# Usage: get_or_add_user_domain_role <role> <user> <domain>
function get_or_add_user_domain_role {
local user_role_id
# Gets user role id
user_role_id=$(openstack role list \
--user $2 \
--os-url=$KEYSTONE_SERVICE_URI_V3 \
--os-identity-api-version=3 \
--column "ID" \
--domain $3 \
--column "Name" \
| grep " $1 " | get_field 1)
if [[ -z "$user_role_id" ]]; then
# Adds role to user and get it
openstack role add $1 \
--user $2 \
--domain $3 \
--os-url=$KEYSTONE_SERVICE_URI_V3 \
--os-identity-api-version=3
user_role_id=$(openstack role list \
--user $2 \
--os-url=$KEYSTONE_SERVICE_URI_V3 \
--os-identity-api-version=3 \
--column "ID" \
--domain $3 \
--column "Name" \
| grep " $1 " | get_field 1)
fi
echo $user_role_id
}
# Gets or adds group role to project
# Usage: get_or_add_group_project_role <role> <group> <project>
function get_or_add_group_project_role {
@@ -982,6 +1018,29 @@ function _get_package_dir {
echo "$pkg_dir"
}
# Wrapper for ``apt-get update`` to try multiple times on the update
# to address bad package mirrors (which happen all the time).
function apt_get_update {
# only do this once per run
if [[ "$REPOS_UPDATED" == "True" && "$RETRY_UPDATE" != "True" ]]; then
return
fi
# bail if we are offline
[[ "$OFFLINE" = "True" ]] && return
local sudo="sudo"
[[ "$(id -u)" = "0" ]] && sudo="env"
local proxies="http_proxy=${http_proxy:-} https_proxy=${https_proxy:-} no_proxy=${no_proxy:-} "
local update_cmd="$sudo $proxies apt-get update"
if ! timeout 300 sh -c "while ! $update_cmd; do sleep 30; done"; then
die $LINENO "Failed to update apt repos, we're dead now"
fi
REPOS_UPDATED=True
}
# Wrapper for ``apt-get`` to set cache and proxy environment variables
# Uses globals ``OFFLINE``, ``*_proxy``
# apt_get operation package [package ...]
@@ -1148,15 +1207,7 @@ function update_package_repo {
fi
if is_ubuntu; then
local xtrace=$(set +o | grep xtrace)
set +o xtrace
if [[ "$REPOS_UPDATED" != "True" || "$RETRY_UPDATE" = "True" ]]; then
# if there are transient errors pulling the updates, that's fine.
# It may be secondary repositories that we don't really care about.
apt_get update || /bin/true
REPOS_UPDATED=True
fi
$xtrace
apt_get_update
fi
}
@@ -1476,6 +1527,12 @@ function stop_process {
# Kill via pid if we have one available
if [[ -r $SERVICE_DIR/$SCREEN_NAME/$service.pid ]]; then
pkill -g $(cat $SERVICE_DIR/$SCREEN_NAME/$service.pid)
# TODO(danms): Remove this double-kill when we have
# this fixed in all services:
# https://bugs.launchpad.net/oslo-incubator/+bug/1446583
sleep 1
# /bin/true becakse pkill on a non existant process returns an error
pkill -g $(cat $SERVICE_DIR/$SCREEN_NAME/$service.pid) || /bin/true
rm $SERVICE_DIR/$SCREEN_NAME/$service.pid
fi
if [[ "$USE_SCREEN" = "True" ]]; then
@@ -1717,6 +1774,7 @@ function run_phase {
# the source phase corresponds to settings loading in plugins
if [[ "$mode" == "source" ]]; then
load_plugin_settings
verify_disabled_services
elif [[ "$mode" == "override_defaults" ]]; then
plugin_override_defaults
else
@@ -1772,25 +1830,26 @@ function disable_negated_services {
ENABLED_SERVICES=$(remove_disabled_services "$remaining" "$to_remove")
}
# disable_service() removes the services passed as argument to the
# ``ENABLED_SERVICES`` list, if they are present.
# disable_service() prepares the services passed as argument to be
# removed from the ``ENABLED_SERVICES`` list, if they are present.
#
# For example:
# disable_service rabbit
#
# This function does not know about the special cases
# for nova, glance, and neutron built into is_service_enabled().
# Uses global ``ENABLED_SERVICES``
# Uses global ``DISABLED_SERVICES``
# disable_service service [service ...]
function disable_service {
local tmpsvcs=",${ENABLED_SERVICES},"
local disabled_svcs="${DISABLED_SERVICES}"
local enabled_svcs=",${ENABLED_SERVICES},"
local service
for service in $@; do
disabled_svcs+=",$service"
if is_service_enabled $service; then
tmpsvcs=${tmpsvcs//,$service,/,}
enabled_svcs=${enabled_svcs//,$service,/,}
fi
done
ENABLED_SERVICES=$(_cleanup_service_list "$tmpsvcs")
DISABLED_SERVICES=$(_cleanup_service_list "$disabled_svcs")
ENABLED_SERVICES=$(_cleanup_service_list "$enabled_svcs")
}
# enable_service() adds the services passed as argument to the
@@ -1807,6 +1866,10 @@ function enable_service {
local tmpsvcs="${ENABLED_SERVICES}"
local service
for service in $@; do
if [[ ,${DISABLED_SERVICES}, =~ ,${service}, ]]; then
warn $LINENO "Attempt to enable_service ${service} when it has been disabled"
continue
fi
if ! is_service_enabled $service; then
tmpsvcs+=",$service"
fi
@@ -1910,6 +1973,18 @@ function use_exclusive_service {
return 0
}
# Make sure that nothing has manipulated ENABLED_SERVICES in a way
# that conflicts with prior calls to disable_service.
# Uses global ``ENABLED_SERVICES``
function verify_disabled_services {
local service
for service in ${ENABLED_SERVICES//,/ }; do
if [[ ,${DISABLED_SERVICES}, =~ ,${service}, ]]; then
die $LINENO "ENABLED_SERVICES directly modified to overcome 'disable_service ${service}'"
fi
done
}
# System Functions
# ================
+164
View File
@@ -250,6 +250,170 @@ function iniuncomment {
$xtrace
}
# Set a localrc var
function localrc_set {
local file=$1
local group="local"
local conf="localrc"
local section=""
local option=$2
local value=$3
localconf_set "$file" "$group" "$conf" "$section" "$option" "$value"
}
# Check if local.conf has section.
function localconf_has_section {
local file=$1
local group=$2
local conf=$3
local section=$4
local sep
sep=$(echo -ne "\x01")
local line
line=$(sed -ne "\\${sep}^\[\[${group}|${conf}\]\]${sep},\\${sep}\[\[.*\]\]${sep}{
/\[${section}\]/p
}" "$file")
[ -n "$line" ]
}
# Check if local.conf has option.
function localconf_has_option {
local file=$1
local group=$2
local conf=$3
local section=$4
local option=$5
local sep
sep=$(echo -ne "\x01")
local line
if [[ -z "$section" ]]; then
line=$(sed -ne "\\${sep}^\[\[${group}|${conf}\]\]${sep},\\${sep}\[\[.*\]\]${sep}{
/${option}[ \t]*=.*$/p
}" "$file")
else
line=$(sed -ne "\\${sep}^\[\[${group}|${conf}\]\]${sep},\\${sep}\[\[.*\]\]${sep}{
/\[${section}\]/,/\[\[.*\]\]\|\[.*\]/{
/${option}[ \t]*=.*$/p}
}" "$file")
fi
[ -n "$line" ]
}
# Update option in local.conf.
function localconf_update_option {
local sudo=$1
local file=$2
local group=$3
local conf=$4
local section=$5
local option=$6
local value=$7
local sep
sep=$(echo -ne "\x01")
if [[ -z "$section" ]]; then
$sudo sed -i -e "\\${sep}^\[\[${group}|${conf}\]\]${sep},\\${sep}\[\[.*\]\]${sep}{
s${sep}^\(${option}[ \t]*=[ \t]*\).*\$${sep}\1${value}${sep}
}" "$file"
else
$sudo sed -i -e "\\${sep}^\[\[${group}|${conf}\]\]${sep},\\${sep}\[\[.*\]\]${sep}{
/\[${section}\]/,/\[\[.*\]\]\|\[.*\]/s${sep}^\(${option}[ \t]*=[ \t]*\).*\$${sep}\1${value}${sep}
}" "$file"
fi
}
# Add option in local.conf.
function localconf_add_option {
local sudo=$1
local file=$2
local group=$3
local conf=$4
local section=$5
local option=$6
local value=$7
local sep
sep=$(echo -ne "\x01")
if [[ -z "$section" ]]; then
$sudo sed -i -e "\\${sep}^\[\[${group}|${conf}\]\]${sep} a $option=$value" "$file"
else
$sudo sed -i -e "\\${sep}^\[\[${group}|${conf}\]\]${sep},\\${sep}\[\[.*\]\]${sep}{
/\[${section}\]/ a $option=$value
}" "$file"
fi
}
# Add section and option in local.conf.
function localconf_add_section_and_option {
local sudo=$1
local file=$2
local group=$3
local conf=$4
local section=$5
local option=$6
local value=$7
local sep
sep=$(echo -ne "\x01")
$sudo sed -i -e "\\${sep}^\[\[${group}|${conf}\]\]${sep} {
a [$section]
a $option=$value
}" "$file"
}
# Set an option in a local.conf file.
# localconf_set [-sudo] config-file group conf-name section option value
# - if the file does not exist, it is created
function localconf_set {
local xtrace
xtrace=$(set +o | grep xtrace)
set +o xtrace
local sep
sep=$(echo -ne "\x01")
local sudo=""
if [ $1 == "-sudo" ]; then
sudo="sudo "
shift
fi
local file=$1
local group=$2
local conf=$3
local section=$4
local option=$5
local value=$6
if [[ -z $group || -z $conf || -z $option || -z $value ]]; then
$xtrace
return
fi
if ! grep -q "^\[\[${group}|${conf}\]\]" "$file" 2>/dev/null; then
# Add meta section at the end if it does not exist
echo -e "\n[[${group}|${conf}]]" | $sudo tee --append "$file" > /dev/null
# Add section at the end
if [[ -n "$section" ]]; then
echo -e "[$section]" | $sudo tee --append "$file" > /dev/null
fi
# Add option at the end
echo -e "$option=$value" | $sudo tee --append "$file" > /dev/null
elif [[ -z "$section" ]]; then
if ! localconf_has_option "$file" "$group" "$conf" "$section" "$option"; then
# Add option
localconf_add_option "$sudo" "$file" "$group" "$conf" "$section" "$option" "$value"
else
# Replace it
localconf_update_option "$sudo" "$file" "$group" "$conf" "$section" "$option" "$value"
fi
elif ! localconf_has_section "$file" "$group" "$conf" "$section"; then
# Add section and option in specified meta section
localconf_add_section_and_option "$sudo" "$file" "$group" "$conf" "$section" "$option" "$value"
elif ! localconf_has_option "$file" "$group" "$conf" "$section" "$option"; then
# Add option
localconf_add_option "$sudo" "$file" "$group" "$conf" "$section" "$option" "$value"
else
# Replace it
localconf_update_option "$sudo" "$file" "$group" "$conf" "$section" "$option" "$value"
fi
$xtrace
}
# Restore xtrace
$INC_CONF_TRACE
+4
View File
@@ -115,11 +115,15 @@ function pip_install {
fi
$xtrace
# adding SETUPTOOLS_SYS_PATH_TECHNIQUE is a workaround to keep
# the same behaviour of setuptools before version 25.0.0.
# related issue: https://github.com/pypa/pip/issues/3874
$sudo_pip \
http_proxy="${http_proxy:-}" \
https_proxy="${https_proxy:-}" \
no_proxy="${no_proxy:-}" \
PIP_FIND_LINKS=$PIP_FIND_LINKS \
SETUPTOOLS_SYS_PATH_TECHNIQUE=rewrite \
$cmd_pip $upgrade \
$@
+12 -17
View File
@@ -27,9 +27,6 @@ set +o xtrace
# Defaults
# --------
# NOTE (e0ne): Cinder API v1 is deprecated and will be disabled by default.
CINDER_ENABLE_V1_API=$(trueorfalse False CINDER_ENABLE_V1_API)
# set up default driver
CINDER_DRIVER=${CINDER_DRIVER:-default}
CINDER_PLUGINS=$TOP_DIR/lib/cinder_plugins
@@ -228,12 +225,9 @@ function configure_cinder {
iniset $CINDER_CONF oslo_concurrency lock_path $CINDER_STATE_PATH
iniset $CINDER_CONF DEFAULT periodic_interval $CINDER_PERIODIC_INTERVAL
# NOTE(thingee): Cinder V1 API is deprecated and defaults to off as of
# Juno.
if [[ ${CINDER_ENABLE_V1_API} = True ]]; then
iniset $CINDER_CONF DEFAULT enable_v1_api true
else
iniset $CINDER_CONF DEFAULT enable_v1_api false
fi
# Juno. Keep it enabled so we can continue testing while it's still
# supported.
iniset $CINDER_CONF DEFAULT enable_v1_api true
iniset $CINDER_CONF DEFAULT os_region_name "$REGION_NAME"
@@ -332,13 +326,12 @@ function create_cinder_accounts {
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
if [[ ${CINDER_ENABLE_V1_API} = True ]]; then
get_or_create_service "cinder" "volume" "Cinder Volume Service"
get_or_create_endpoint "volume" "$REGION_NAME" \
"$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(tenant_id)s" \
"$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(tenant_id)s" \
"$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(tenant_id)s"
fi
get_or_create_service "cinder" "volume" "Cinder Volume Service"
get_or_create_endpoint "volume" "$REGION_NAME" \
"$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(tenant_id)s" \
"$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(tenant_id)s" \
"$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(tenant_id)s"
get_or_create_service "cinderv2" "volumev2" "Cinder Volume Service V2"
get_or_create_endpoint "volumev2" "$REGION_NAME" \
"$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v2/\$(tenant_id)s" \
@@ -489,7 +482,9 @@ function create_volume_types {
local be be_name
for be in ${CINDER_ENABLED_BACKENDS//,/ }; do
be_name=${be##*:}
openstack volume type create --os-volume-api-version 2 --property volume_backend_name="${be_name}" ${be_name}
# FIXME(jamielennox): Remove --os-volume-api-version pinning when
# osc supports volume type create on v2 api. bug #1475060
openstack volume type create --os-volume-api-version 1 --property volume_backend_name="${be_name}" ${be_name}
done
fi
}
+8 -1
View File
@@ -47,7 +47,7 @@ function recreate_database_postgresql {
}
function configure_database_postgresql {
local pg_conf pg_dir pg_hba root_roles
local pg_conf pg_dir pg_hba root_roles version
echo_summary "Configuring and starting PostgreSQL"
if is_fedora; then
pg_hba=/var/lib/pgsql/data/pg_hba.conf
@@ -56,6 +56,13 @@ function configure_database_postgresql {
sudo postgresql-setup initdb
fi
elif is_ubuntu; then
version=`psql --version | cut -d ' ' -f3 | cut -d. -f1-2`
if vercmp $version '>=' 9.3; then
if [ -z "`pg_lsclusters -h`" ]; then
echo 'No PostgreSQL clusters exist; will create one'
sudo pg_createcluster $version main --start
fi
fi
pg_dir=`find /etc/postgresql -name pg_hba.conf|xargs dirname`
pg_hba=$pg_dir/pg_hba.conf
pg_conf=$pg_dir/postgresql.conf
+1 -3
View File
@@ -36,7 +36,6 @@ HEAT_DIR=$DEST/heat
HEAT_CFNTOOLS_DIR=$DEST/heat-cfntools
HEAT_TEMPLATES_REPO_DIR=$DEST/heat-templates
OCC_DIR=$DEST/os-collect-config
DIB_UTILS_DIR=$DEST/dib-utils
ORC_DIR=$DEST/os-refresh-config
OAC_DIR=$DEST/os-apply-config
@@ -220,7 +219,6 @@ function install_heat_other {
git_clone $OAC_REPO $OAC_DIR $OAC_BRANCH
git_clone $OCC_REPO $OCC_DIR $OCC_BRANCH
git_clone $ORC_REPO $ORC_DIR $ORC_BRANCH
git_clone $DIB_UTILS_REPO $DIB_UTILS_DIR $DIB_UTILS_BRANCH
}
# start_heat() - Start running processes, including screen
@@ -295,7 +293,7 @@ function create_heat_accounts {
# build_heat_pip_mirror() - Build a pip mirror containing heat agent projects
function build_heat_pip_mirror {
local project_dirs="$OCC_DIR $OAC_DIR $ORC_DIR $HEAT_CFNTOOLS_DIR $DIB_UTILS_DIR"
local project_dirs="$OCC_DIR $OAC_DIR $ORC_DIR $HEAT_CFNTOOLS_DIR"
local projpath proj package
rm -rf $HEAT_PIP_REPO
+15 -12
View File
@@ -59,7 +59,6 @@ IRONIC_HW_EPHEMERAL_DISK=${IRONIC_HW_EPHEMERAL_DISK:-0}
IRONIC_IPMIINFO_FILE=${IRONIC_IPMIINFO_FILE:-$IRONIC_DATA_DIR/hardware_info}
# Set up defaults for functional / integration testing
IRONIC_NODE_UUID=${IRONIC_NODE_UUID:-`uuidgen`}
IRONIC_SCRIPTS_DIR=${IRONIC_SCRIPTS_DIR:-$TOP_DIR/tools/ironic/scripts}
IRONIC_TEMPLATES_DIR=${IRONIC_TEMPLATES_DIR:-$TOP_DIR/tools/ironic/templates}
IRONIC_BAREMETAL_BASIC_OPS=$(trueorfalse False IRONIC_BAREMETAL_BASIC_OPS)
@@ -97,8 +96,11 @@ IRONIC_DEPLOY_RAMDISK=${IRONIC_DEPLOY_RAMDISK:-}
IRONIC_DEPLOY_KERNEL=${IRONIC_DEPLOY_KERNEL:-}
IRONIC_DEPLOY_ELEMENT=${IRONIC_DEPLOY_ELEMENT:-deploy-ironic}
IRONIC_AGENT_KERNEL_URL=${IRONIC_AGENT_KERNEL_URL:-http://tarballs.openstack.org/ironic-python-agent/coreos/files/coreos_production_pxe.vmlinuz}
IRONIC_AGENT_RAMDISK_URL=${IRONIC_AGENT_RAMDISK_URL:-http://tarballs.openstack.org/ironic-python-agent/coreos/files/coreos_production_pxe_image-oem.cpio.gz}
# NOTE(jroll) this needs to be updated when stable branches are cut
IPA_DOWNLOAD_BRANCH=${IPA_DOWNLOAD_BRANCH:-stable/liberty}
IPA_DOWNLOAD_BRANCH=$(echo $IPA_DOWNLOAD_BRANCH | tr / -)
IRONIC_AGENT_KERNEL_URL=${IRONIC_AGENT_KERNEL_URL:-http://tarballs.openstack.org/ironic-python-agent/coreos/files/coreos_production_pxe-${IPA_DOWNLOAD_BRANCH}.vmlinuz}
IRONIC_AGENT_RAMDISK_URL=${IRONIC_AGENT_RAMDISK_URL:-http://tarballs.openstack.org/ironic-python-agent/coreos/files/coreos_production_pxe_image-oem-${IPA_DOWNLOAD_BRANCH}.cpio.gz}
# Which deploy driver to use - valid choices right now
# are ``pxe_ssh``, ``pxe_ipmitool``, ``agent_ssh`` and ``agent_ipmitool``.
@@ -119,7 +121,7 @@ IRONIC_HOSTPORT=${IRONIC_HOSTPORT:-$SERVICE_HOST:$IRONIC_SERVICE_PORT}
IRONIC_IPXE_ENABLED=$(trueorfalse False IRONIC_IPXE_ENABLED)
IRONIC_HTTP_DIR=${IRONIC_HTTP_DIR:-$IRONIC_DATA_DIR/httpboot}
IRONIC_HTTP_SERVER=${IRONIC_HTTP_SERVER:-$HOST_IP}
IRONIC_HTTP_PORT=${IRONIC_HTTP_PORT:-8088}
IRONIC_HTTP_PORT=${IRONIC_HTTP_PORT:-3928}
# NOTE(lucasagomes): This flag is used to differentiate the nodes that
# uses IPA as their deploy ramdisk from nodes that uses the agent_* drivers
@@ -349,7 +351,7 @@ function configure_ironic_conductor {
if [[ "$IRONIC_VM_LOG_CONSOLE" == "True" ]] ; then
pxe_params+="nofb nomodeset vga=normal console=ttyS0"
if is_deployed_with_ipa_ramdisk; then
pxe_params+=" systemd.journald.forward_to_console=yes"
pxe_params+=" systemd.journald.forward_to_console=yes ipa-debug=1"
fi
fi
# When booting with less than 1GB, we need to switch from default tmpfs
@@ -499,11 +501,13 @@ function stop_ironic {
function create_ovs_taps {
local ironic_net_id=$(neutron net-list | grep private | get_field 1)
die_if_not_set $LINENO ironic_net_id "Failed to get ironic network id"
# Work around: No netns exists on host until a Neutron port is created. We
# need to create one in Neutron to know what netns to tap into prior to the
# first node booting.
local port_id=$(neutron port-create private | grep " id " | get_field 2)
die_if_not_set $LINENO port_id "Failed to create neutron port"
# intentional sleep to make sure the tag has been set to port
sleep 10
@@ -513,7 +517,9 @@ function create_ovs_taps {
else
local tapdev=$(sudo ip link list | grep " tap" | cut -d':' -f2 | cut -d'@' -f1 | cut -b2-)
fi
die_if_not_set $LINENO tapdev "Failed to get tap device id"
local tag_id=$(sudo ovs-vsctl show |grep ${tapdev} -A1 -m1 | grep tag | cut -d':' -f2 | cut -b2-)
die_if_not_set $LINENO tag_id "Failed to get tag id"
# make sure veth pair is not existing, otherwise delete its links
sudo ip link show ovs-tap1 && sudo ip link delete ovs-tap1
@@ -617,6 +623,7 @@ function enroll_nodes {
# First node created will be used for testing in ironic w/o glance
# scenario, so we need to know its UUID.
IRONIC_NODE_UUID=${IRONIC_NODE_UUID:-`uuidgen`}
local standalone_node_uuid=$([ $total_nodes -eq 0 ] && echo "--uuid $IRONIC_NODE_UUID")
local node_id=$(ironic node-create $standalone_node_uuid\
@@ -771,26 +778,22 @@ function upload_baremetal_ironic_deploy {
fi
fi
local token=$(openstack token issue -c id -f value)
die_if_not_set $LINENO token "Keystone fail to get token"
# load them into glance
IRONIC_DEPLOY_KERNEL_ID=$(openstack \
--os-token $token \
--os-url http://$GLANCE_HOSTPORT \
image create \
$(basename $IRONIC_DEPLOY_KERNEL_PATH) \
--public --disk-format=aki \
--container-format=aki \
< $IRONIC_DEPLOY_KERNEL_PATH | grep ' id ' | get_field 2)
die_if_not_set $LINENO IRONIC_DEPLOY_KERNEL_ID "Failed to load kernel image into glance"
IRONIC_DEPLOY_RAMDISK_ID=$(openstack \
--os-token $token \
--os-url http://$GLANCE_HOSTPORT \
image create \
$(basename $IRONIC_DEPLOY_RAMDISK_PATH) \
--public --disk-format=ari \
--container-format=ari \
< $IRONIC_DEPLOY_RAMDISK_PATH | grep ' id ' | get_field 2)
die_if_not_set $LINENO IRONIC_DEPLOY_RAMDISK_ID "Failed to load ramdisk image into glance"
}
function prepare_baremetal_basic_ops {
+10 -11
View File
@@ -351,6 +351,7 @@ function create_keystone_accounts {
local admin_user=$(get_or_create_user "admin" "$ADMIN_PASSWORD" default)
local admin_role=$(get_or_create_role "admin")
get_or_add_user_project_role $admin_role $admin_user $admin_tenant
get_or_add_user_domain_role $admin_role $admin_user default
# Create service project/role
get_or_create_project "$SERVICE_TENANT_NAME" default
@@ -443,6 +444,7 @@ function configure_auth_token_middleware {
iniset $conf_file $section auth_uri $KEYSTONE_SERVICE_URI
iniset $conf_file $section cafile $SSL_BUNDLE_FILE
iniset $conf_file $section signing_dir $signing_dir
iniset $conf_file $section memcache_servers 127.0.0.1:11211
}
# init_keystone() - Initialize databases, etc.
@@ -512,17 +514,11 @@ function install_keystone {
if is_service_enabled ldap; then
install_ldap
fi
if [[ "$KEYSTONE_TOKEN_BACKEND" = "memcache" ]]; then
# Install memcached and the memcache Python library that keystone uses.
# Unfortunately the Python library goes by different names in the .deb
# and .rpm circles.
install_package memcached
if is_ubuntu; then
install_package python-memcache
else
install_package python-memcached
fi
fi
# Install the memcache library so keystonemiddleware can cache tokens in a
# shared location.
pip_install python-memcached
git_clone $KEYSTONE_REPO $KEYSTONE_DIR $KEYSTONE_BRANCH
setup_develop $KEYSTONE_DIR
if [ "$KEYSTONE_USE_MOD_WSGI" == "True" ]; then
@@ -566,6 +562,9 @@ function start_keystone {
start_tls_proxy '*' $KEYSTONE_SERVICE_PORT $KEYSTONE_SERVICE_HOST $KEYSTONE_SERVICE_PORT_INT &
start_tls_proxy '*' $KEYSTONE_AUTH_PORT $KEYSTONE_AUTH_HOST $KEYSTONE_AUTH_PORT_INT &
fi
# (re)start memcached to make sure we have a clean memcache.
restart_service memcached
}
# stop_keystone() - Stop running processes
+24 -15
View File
@@ -171,6 +171,7 @@ PROVIDER_SUBNET_NAME=${PROVIDER_SUBNET_NAME:-"provider_net"}
# Define the public bridge that will transmit traffic from VMs to the
# physical network - used by both the OVS and Linux Bridge drivers.
PUBLIC_BRIDGE=${PUBLIC_BRIDGE:-br-ex}
PUBLIC_BRIDGE_MTU=${PUBLIC_BRIDGE_MTU:-1500}
# Use flat providernet for public network
#
@@ -358,6 +359,9 @@ else
Q_USE_SECGROUP=False
fi
default_route_dev=$(ip route | grep ^default | awk '{print $5}')
die_if_not_set $LINENO default_route_dev "Failure retrieving default route device"
# Save trace setting
XTRACE=$(set +o | grep xtrace)
set +o xtrace
@@ -468,19 +472,13 @@ function configure_neutron {
function create_nova_conf_neutron {
iniset $NOVA_CONF DEFAULT network_api_class "nova.network.neutronv2.api.API"
if [ "$ENABLE_IDENTITY_V2" == "False" ]; then
iniset $NOVA_CONF neutron auth_plugin "v3password"
iniset $NOVA_CONF neutron auth_url "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_AUTH_PORT/v3"
iniset $NOVA_CONF neutron username "$Q_ADMIN_USERNAME"
iniset $NOVA_CONF neutron password "$SERVICE_PASSWORD"
iniset $NOVA_CONF neutron user_domain_name "default"
else
iniset $NOVA_CONF neutron admin_username "$Q_ADMIN_USERNAME"
iniset $NOVA_CONF neutron admin_password "$SERVICE_PASSWORD"
iniset $NOVA_CONF neutron admin_auth_url "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_AUTH_PORT/v2.0"
iniset $NOVA_CONF neutron admin_tenant_name "$SERVICE_TENANT_NAME"
fi
iniset $NOVA_CONF neutron auth_plugin "v3password"
iniset $NOVA_CONF neutron auth_url "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_AUTH_PORT/v3"
iniset $NOVA_CONF neutron username "$Q_ADMIN_USERNAME"
iniset $NOVA_CONF neutron password "$SERVICE_PASSWORD"
iniset $NOVA_CONF neutron user_domain_name "Default"
iniset $NOVA_CONF neutron project_name "$SERVICE_TENANT_NAME"
iniset $NOVA_CONF neutron project_domain_name "Default"
iniset $NOVA_CONF neutron auth_strategy "$Q_AUTH_STRATEGY"
iniset $NOVA_CONF neutron region_name "$REGION_NAME"
iniset $NOVA_CONF neutron url "${Q_PROTOCOL}://$Q_HOST:$Q_PORT"
@@ -806,7 +804,9 @@ function _move_neutron_addresses_route {
local IP_ADD=""
local IP_DEL=""
local DEFAULT_ROUTE_GW=$(ip r | awk "/default.+$from_intf/ { print \$3; exit }")
local IP_UP=""
local DEFAULT_ROUTE_GW
DEFAULT_ROUTE_GW=$(ip r | awk "/default.+$from_intf/ { print \$3; exit }")
local ADD_OVS_PORT=""
if [[ $af == "inet" ]]; then
@@ -828,9 +828,10 @@ function _move_neutron_addresses_route {
if [[ "$IP_BRD" != "" ]]; then
IP_DEL="sudo ip addr del $IP_BRD dev $from_intf"
IP_ADD="sudo ip addr add $IP_BRD dev $to_intf"
IP_UP="sudo ip link set $to_intf up"
fi
$IP_DEL; $IP_ADD; $ADD_OVS_PORT; $ADD_DEFAULT_ROUTE
$IP_DEL; $IP_ADD; $IP_UP; $ADD_OVS_PORT; $ADD_DEFAULT_ROUTE
fi
}
@@ -960,6 +961,9 @@ function _configure_neutron_common {
fi
_neutron_setup_rootwrap
# push mtu into instances to avoid packet drops when tunnelling is used
iniset $NEUTRON_CONF DEFAULT advertise_mtu "True"
}
function _configure_neutron_debug_command {
@@ -1343,6 +1347,11 @@ function _neutron_configure_router_v6 {
# This logic is specific to using the l3-agent for layer 3
if is_service_enabled q-l3; then
# Ensure IPv6 RAs are accepted on the interface with the default route.
# This is needed for neutron-based devstack clouds to work in
# IPv6-only clouds in the gate. Please do not remove this without
# talking to folks in Infra.
sudo sysctl -w net.ipv6.conf.$default_route_dev.accept_ra=2
# Ensure IPv6 forwarding is enabled on the host
sudo sysctl -w net.ipv6.conf.all.forwarding=1
# Configure and enable public bridge
+13
View File
@@ -48,6 +48,7 @@ function neutron_plugin_configure_dhcp_agent {
function neutron_plugin_configure_l3_agent {
sudo brctl addbr $PUBLIC_BRIDGE
set_mtu $PUBLIC_BRIDGE $PUBLIC_BRIDGE_MTU
iniset $Q_L3_CONF_FILE DEFAULT external_network_bridge
iniset $Q_L3_CONF_FILE DEFAULT l3_agent_manager neutron.agent.l3_agent.L3NATAgentWithStateReport
}
@@ -69,6 +70,18 @@ function neutron_plugin_configure_plugin_agent {
fi
AGENT_BINARY="$NEUTRON_BIN_DIR/neutron-linuxbridge-agent"
iniset /$Q_PLUGIN_CONF_FILE agent tunnel_types $Q_TUNNEL_TYPES
# Configure vxlan tunneling
if [[ "$ENABLE_TENANT_TUNNELS" == "True" ]]; then
if [[ "$Q_ML2_TENANT_NETWORK_TYPE" == "vxlan" ]]; then
iniset /$Q_PLUGIN_CONF_FILE vxlan enable_vxlan "True"
iniset /$Q_PLUGIN_CONF_FILE vxlan local_ip $TUNNEL_ENDPOINT_IP
else
iniset /$Q_PLUGIN_CONF_FILE vxlan enable_vxlan "False"
fi
else
iniset /$Q_PLUGIN_CONF_FILE vxlan enable_vxlan "False"
fi
}
function neutron_plugin_setup_interface_driver {
+12
View File
@@ -40,6 +40,12 @@ Q_ML2_PLUGIN_EXT_DRIVERS=${Q_ML2_PLUGIN_EXT_DRIVERS-port_security}
# L3 Plugin to load for ML2
ML2_L3_PLUGIN=${ML2_L3_PLUGIN:-neutron.services.l3_router.l3_router_plugin.L3RouterPlugin}
# Underlying path MTU for physical network managing br-tun; use '-' instead of
# ':-' to allow people to explicitly override this to blank, to disable
# automatic MTU calculation for tunnelled tenant networks
Q_ML2_PLUGIN_PATH_MTU=${Q_ML2_PLUGIN_PATH_MTU-1500}
function populate_ml2_config {
CONF=$1
SECTION=$2
@@ -77,6 +83,12 @@ function neutron_plugin_configure_service {
echo "WARNING - The ml2 plugin is using local tenant networks, with no connectivity between hosts."
fi
# Enable ml2 mtu calculation mechanism for networks by providing path mtu
# value for physical devices that are used for br-tun traffic
if [[ "$ENABLE_TENANT_TUNNELS" == "True" ]] && [[ "$Q_ML2_PLUGIN_PATH_MTU" != "" ]]; then
iniset /$Q_PLUGIN_CONF_FILE ml2 path_mtu "$Q_ML2_PLUGIN_PATH_MTU"
fi
# Allow for overrding VLAN configuration (for example, to configure provider
# VLANs) by first checking if Q_ML2_PLUGIN_VLAN_TYPE_OPTIONS is set.
if [ "$Q_ML2_PLUGIN_VLAN_TYPE_OPTIONS" == "" ]; then
+6 -1
View File
@@ -102,11 +102,16 @@ function _neutron_ovs_base_configure_l3_agent {
sudo ip link set $Q_PUBLIC_VETH_EX up
sudo ip addr flush dev $Q_PUBLIC_VETH_EX
else
_neutron_ovs_base_add_bridge $PUBLIC_BRIDGE
_neutron_ovs_base_add_public_bridge
sudo ovs-vsctl br-set-external-id $PUBLIC_BRIDGE bridge-id $PUBLIC_BRIDGE
fi
}
function _neutron_ovs_base_add_public_bridge {
_neutron_ovs_base_add_bridge $PUBLIC_BRIDGE
set_mtu $PUBLIC_BRIDGE $PUBLIC_BRIDGE_MTU
}
function _neutron_ovs_base_configure_nova_vif_driver {
:
}
+3 -2
View File
@@ -5,7 +5,8 @@
FW_XTRACE=$(set +o | grep xtrace)
set +o xtrace
FWAAS_PLUGIN=neutron_fwaas.services.firewall.fwaas_plugin.FirewallPlugin
FWAAS_PLUGIN=${FWAAS_PLUGIN:-neutron_fwaas.services.firewall.fwaas_plugin.FirewallPlugin}
FWAAS_DRIVER=${FWAAS_DRIVER:-neutron_fwaas.services.firewall.drivers.linux.iptables_fwaas.IptablesFwaasDriver}
function neutron_fwaas_configure_common {
_neutron_service_plugin_class_add $FWAAS_PLUGIN
@@ -16,7 +17,7 @@ function neutron_fwaas_configure_driver {
cp $NEUTRON_FWAAS_DIR/etc/fwaas_driver.ini $FWAAS_DRIVER_CONF_FILENAME
iniset_multiline $FWAAS_DRIVER_CONF_FILENAME fwaas enabled True
iniset_multiline $FWAAS_DRIVER_CONF_FILENAME fwaas driver "neutron_fwaas.services.firewall.drivers.linux.iptables_fwaas.IptablesFwaasDriver"
iniset_multiline $FWAAS_DRIVER_CONF_FILENAME fwaas driver "$FWAAS_DRIVER"
}
function neutron_fwaas_stop {
+19
View File
@@ -652,6 +652,23 @@ function create_nova_conf {
iniset $NOVA_CONF serial_console serialproxy_host "$NOVA_SERVICE_LISTEN_ADDRESS"
iniset $NOVA_CONF serial_console enabled True
fi
# Setup logging for nova-dhcpbridge command line
sudo cp "$NOVA_CONF" "$NOVA_CONF_DIR/nova-dhcpbridge.conf"
local service="n-dhcp"
local logfile="${service}.log.${CURRENT_LOG_TIME}"
local real_logfile="${LOGDIR}/${logfile}"
if [[ -n ${LOGDIR} ]]; then
bash -c "cd '$LOGDIR' && ln -sf '$logfile' ${service}.log"
iniset "$NOVA_CONF_DIR/nova-dhcpbridge.conf" DEFAULT log_file "$real_logfile"
if [[ -n ${SCREEN_LOGDIR} ]]; then
# Drop the backward-compat symlink
ln -sf "$real_logfile" ${SCREEN_LOGDIR}/screen-${service}.log
fi
fi
iniset $NOVA_CONF DEFAULT dhcpbridge_flagfile "$NOVA_CONF_DIR/nova-dhcpbridge.conf"
}
function init_nova_cells {
@@ -692,6 +709,8 @@ function create_nova_conf_nova_network {
iniset $NOVA_CONF DEFAULT public_interface "$PUBLIC_INTERFACE"
iniset $NOVA_CONF DEFAULT vlan_interface "$VLAN_INTERFACE"
iniset $NOVA_CONF DEFAULT flat_network_bridge "$FLAT_NETWORK_BRIDGE"
# force down dhcp leases to 5 minutes, which lets us expire faster
iniset $NOVA_CONF DEFAULT dhcp_lease_time 300
if [ -n "$FLAT_INTERFACE" ]; then
iniset $NOVA_CONF DEFAULT flat_interface "$FLAT_INTERFACE"
fi
+9 -1
View File
@@ -31,9 +31,17 @@ function install_libvirt {
fi
install_package libvirt-bin libvirt-dev
pip_install_gr libvirt-python
if [[ "$EBTABLES_RACE_FIX" == "True" ]]; then
# Work around for bug #1501558. We can remove this once we
# get to a version of Ubuntu that has new enough libvirt.
TOP_DIR=$TOP_DIR $TOP_DIR/tools/install_ebtables_workaround.sh
fi
#pip_install_gr <there-si-no-guestfs-in-pypi>
elif is_fedora || is_suse; then
install_package kvm
# On "KVM for IBM z Systems", kvm does not have its own package
if [[ ! ${DISTRO} =~ "kvmibm1" ]]; then
install_package kvm
fi
# there is a dependency issue with kvm (which is really just a
# wrapper to qemu-system-x86) that leaves some bios files out,
# so install qemu-kvm (which shouldn't strictly be needed, as
+63 -21
View File
@@ -66,11 +66,15 @@ BUILD_TIMEOUT=${BUILD_TIMEOUT:-196}
# This must be False on stable branches, as master tempest
# deps do not match stable branch deps. Set this to True to
# have tempest installed in DevStack by default.
INSTALL_TEMPEST=${INSTALL_TEMPEST:-"True"}
INSTALL_TEMPEST=${INSTALL_TEMPEST:-"False"}
BOTO_MATERIALS_PATH="$FILES/images/s3-materials/cirros-${CIRROS_VERSION}"
BOTO_CONF=/etc/boto.cfg
# This variable is passed directly to pip install inside the common tox venv
# that is created
TEMPEST_PLUGINS=${TEMPEST_PLUGINS:-0}
# Cinder/Volume variables
TEMPEST_VOLUME_DRIVER=${TEMPEST_VOLUME_DRIVER:-default}
TEMPEST_DEFAULT_VOLUME_VENDOR="Open Source"
@@ -138,7 +142,7 @@ function configure_tempest {
local public_router_id
local tenant_networks_reachable
local boto_instance_type="m1.tiny"
local ssh_connect_method="fixed"
local ssh_connect_method="floating"
# Save IFS
ifs=$IFS
@@ -261,9 +265,6 @@ function configure_tempest {
if [ "$Q_USE_NAMESPACE" != "False" ]; then
tenant_networks_reachable=false
if ! is_service_enabled n-net; then
ssh_connect_method="floating"
fi
else
tenant_networks_reachable=true
fi
@@ -333,6 +334,7 @@ function configure_tempest {
if is_ssl_enabled_service "key" || is_service_enabled tls-proxy; then
iniset $TEMPEST_CONFIG identity ca_certificates_file $SSL_BUNDLE_FILE
fi
iniset $TEMPEST_CONFIG identity-feature-enabled api_extensions OS-EC2
# Image
# We want to be able to override this variable in the gate to avoid
@@ -340,7 +342,10 @@ function configure_tempest {
if [[ ! -z "$TEMPEST_HTTP_IMAGE" ]]; then
iniset $TEMPEST_CONFIG image http_image $TEMPEST_HTTP_IMAGE
fi
iniset $TEMPEST_CONFIG image-feature-enabled deactivate_image true
if [ "$VIRT_DRIVER" = "xenserver" ]; then
iniset $TEMPEST_CONFIG image disk_formats "ami,ari,aki,vhd,raw,iso"
iniset $TEMPEST_CONFIG scenario img_disk_format vhd
fi
# Image Features
iniset $TEMPEST_CONFIG image-feature-enabled deactivate_image True
@@ -374,7 +379,7 @@ function configure_tempest {
# NOTE(mtreinish): This must be done after auth settings are added to the tempest config
local tmp_cfg_file=$(mktemp)
cd $TEMPEST_DIR
tox -revenv -- verify-tempest-config -uro $tmp_cfg_file
tox -revenv-tempest -- verify-tempest-config -u -r -o $tmp_cfg_file
local compute_api_extensions=${COMPUTE_API_EXTENSIONS:-"all"}
if [[ ! -z "$DISABLE_COMPUTE_API_EXTENSIONS" ]]; then
@@ -401,6 +406,17 @@ function configure_tempest {
if is_service_enabled n-cell; then
# Cells doesn't support shelving/unshelving
iniset $TEMPEST_CONFIG compute-feature-enabled shelve False
# Cells doesn't support hot-plugging virtual interfaces.
iniset $TEMPEST_CONFIG compute-feature-enabled interface_attach False
if [[ -z "$DEFAULT_INSTANCE_TYPE" ]]; then
# Cells supports resize but does not currently work with devstack
# because of the custom flavors created for Tempest runs which are
# not in the cells database.
# TODO(mriedem): work on adding a nova-manage command to sync
# flavors into the cells database.
iniset $TEMPEST_CONFIG compute-feature-enabled resize False
fi
fi
# Network
@@ -412,7 +428,15 @@ function configure_tempest {
iniset $TEMPEST_CONFIG network-feature-enabled ipv6 "$IPV6_ENABLED"
iniset $TEMPEST_CONFIG network-feature-enabled ipv6_subnet_attributes "$IPV6_SUBNET_ATTRIBUTES_ENABLED"
local network_api_extensions=${NETWORK_API_EXTENSIONS:-"all"}
DEFAULT_NET_EXT="agent,allowed-address-pairs,binding"
DEFAULT_NET_EXT+=",dhcp_agent_scheduler,dns-integration"
DEFAULT_NET_EXT+=",dvr,ext-gw-mode,external-net"
DEFAULT_NET_EXT+=",extra_dhcp_opt,extraroute,flavors,fwaas"
DEFAULT_NET_EXT+=",fwaasrouterinsertion,l3-ha,l3_agent_scheduler,lbaas"
DEFAULT_NET_EXT+=",lbaas_agent_scheduler,metering,multi-provider,net-mtu,port-security"
DEFAULT_NET_EXT+=",provider,quotas,rbac-policies,router,security-group,service-type"
DEFAULT_NET_EXT+=",subnet_allocation,vpnaas"
local network_api_extensions="${NETWORK_API_EXTENSIONS:-$DEFAULT_NET_EXT}"
if [[ ! -z "$DISABLE_NETWORK_API_EXTENSIONS" ]]; then
# Enabled extensions are either the ones explicitly specified or those available on the API endpoint
network_api_extensions=${NETWORK_API_EXTENSIONS:-$(iniget $tmp_cfg_file network-feature-enabled api_extensions | tr -d " ")}
@@ -461,7 +485,11 @@ function configure_tempest {
iniset $TEMPEST_CONFIG telemetry-feature-enabled events "True"
# Object Store
local object_storage_api_extensions=${OBJECT_STORAGE_API_EXTENSIONS:-"all"}
DEFAULT_SWIFT_OPT="account_quotas,bulk,bulk_delete,bulk_upload,container_quotas"
DEFAULT_SWIFT_OPT+=",container_sync,crossdomain,formpost,ratelimit,slo"
DEFAULT_SWIFT_OPT+=",staticweb,tempauth,tempurl"
local object_storage_api_extensions="${OBJECT_STORAGE_API_EXTENSIONS:-$DEFAULT_SWIFT_OPT}"
if [[ ! -z "$DISABLE_OBJECT_STORAGE_API_EXTENSIONS" ]]; then
# Enabled extensions are either the ones explicitly specified or those available on the API endpoint
object_storage_api_extensions=${OBJECT_STORAGE_API_EXTENSIONS:-$(iniget $tmp_cfg_file object-storage-feature-enabled discoverable_apis | tr -d " ")}
@@ -478,8 +506,21 @@ function configure_tempest {
iniset $TEMPEST_CONFIG volume-feature-enabled bootable True
# TODO(jordanP): Remove the extend_with_snapshot flag when Juno is end of life.
iniset $TEMPEST_CONFIG volume-feature-enabled extend_with_snapshot True
# TODO(obutenko): Remove the incremental_backup_force flag when Kilo and Juno is end of life.
iniset $TEMPEST_CONFIG volume-feature-enabled incremental_backup_force True
local volume_api_extensions=${VOLUME_API_EXTENSIONS:-"all"}
DEFAULT_VOL_EXT="OS-SCH-HNT,backups,capabilities,cgsnapshots,consistencygroups"
DEFAULT_VOL_EXT+=",encryption,os-admin-actions,os-availability-zone"
DEFAULT_VOL_EXT+=",os-extended-services,os-extended-snapshot-attributes"
DEFAULT_VOL_EXT+=",os-hosts,os-image-create,os-quota-class-sets,os-quota-sets"
DEFAULT_VOL_EXT+=",os-services,os-snapshot-actions,os-snapshot-manage,os-snapshot-unmanage"
DEFAULT_VOL_EXT+=",os-types-extra-specs"
DEFAULT_VOL_EXT+=",os-types-manage,os-used-limits,os-vol-host-attr,os-vol-image-meta"
DEFAULT_VOL_EXT+=",os-vol-mig-status-attr,os-vol-tenant-attr,os-volume-actions"
DEFAULT_VOL_EXT+=",os-volume-encryption-metadata,os-volume-manage"
DEFAULT_VOL_EXT+=",os-volume-replication,os-volume-transfer,os-volume-type-access"
DEFAULT_VOL_EXT+=",os-volume-unmanage,qos-specs,scheduler-stats"
local volume_api_extensions="${VOLUME_API_EXTENSIONS:-$DEFAULT_VOL_EXT}"
if [[ ! -z "$DISABLE_VOLUME_API_EXTENSIONS" ]]; then
# Enabled extensions are either the ones explicitly specified or those available on the API endpoint
volume_api_extensions=${VOLUME_API_EXTENSIONS:-$(iniget $tmp_cfg_file volume-feature-enabled api_extensions | tr -d " ")}
@@ -492,15 +533,6 @@ function configure_tempest {
iniset $TEMPEST_CONFIG volume-feature-enabled backup False
fi
# Use only Cinder API v2
if [[ ${CINDER_ENABLE_V1_API} = True ]]; then
iniset $TEMPEST_CONFIG volume-feature-enabled api_v1 True
iniset $TEMPEST_CONFIG volume catalog_type volume
else
iniset $TEMPEST_CONFIG volume-feature-enabled api_v1 False
iniset $TEMPEST_CONFIG volume catalog_type volumev2
fi
# Using ``CINDER_ENABLED_BACKENDS``
if [[ -n "$CINDER_ENABLED_BACKENDS" ]] && [[ $CINDER_ENABLED_BACKENDS =~ .*,.* ]]; then
iniset $TEMPEST_CONFIG volume-feature-enabled multi_backend "True"
@@ -532,7 +564,8 @@ function configure_tempest {
# Baremetal
if [ "$VIRT_DRIVER" = "ironic" ] ; then
iniset $TEMPEST_CONFIG baremetal driver_enabled True
iniset $TEMPEST_CONFIG baremetal unprovision_timeout 300
iniset $TEMPEST_CONFIG baremetal unprovision_timeout $BUILD_TIMEOUT
iniset $TEMPEST_CONFIG baremetal active_timeout $BUILD_TIMEOUT
iniset $TEMPEST_CONFIG baremetal deploy_img_dir $FILES
iniset $TEMPEST_CONFIG baremetal node_uuid $IRONIC_NODE_UUID
iniset $TEMPEST_CONFIG compute-feature-enabled change_password False
@@ -626,7 +659,16 @@ function install_tempest {
pip_install tox
pushd $TEMPEST_DIR
tox --notest -efull
PROJECT_VENV["tempest"]=${TEMPEST_DIR}/.tox/full
PROJECT_VENV["tempest"]=${TEMPEST_DIR}/.tox/tempest
popd
}
# install_tempest_plugins() - Install any specified plugins into the tempest venv
function install_tempest_plugins {
pushd $TEMPEST_DIR
if [[ $TEMPEST_PLUGINS != 0 ]] ; then
tox -evenv-tempest -- pip install $TEMPEST_PLUGINS
fi
install_tempest_lib
popd
}
+11 -15
View File
@@ -42,6 +42,8 @@ if [[ -n "$NOUNSET" ]]; then
set -o nounset
fi
# Set start of devstack timestamp
DEVSTACK_START_TIME=$(date +%s)
# Configuration
# =============
@@ -169,7 +171,7 @@ source $TOP_DIR/stackrc
# Warn users who aren't on an explicitly supported distro, but allow them to
# override check and attempt installation with ``FORCE=yes ./stack``
if [[ ! ${DISTRO} =~ (precise|trusty|utopic|vivid|7.0|wheezy|sid|testing|jessie|f21|f22|rhel7) ]]; then
if [[ ! ${DISTRO} =~ (precise|trusty|utopic|vivid|7.0|wheezy|sid|testing|jessie|f21|f22|rhel7|kvmibm1) ]]; then
echo "WARNING: this script has not been tested on $DISTRO"
if [[ "$FORCE" != "yes" ]]; then
die $LINENO "If you wish to run this script anyway run with FORCE=yes"
@@ -278,14 +280,7 @@ EOF
# ... and also optional to be enabled
sudo yum-config-manager --enable rhel-7-server-optional-rpms
RHEL_RDO_REPO_RPM=${RHEL7_RDO_REPO_RPM:-"https://repos.fedorapeople.org/repos/openstack/openstack-kilo/rdo-release-kilo-1.noarch.rpm"}
RHEL_RDO_REPO_ID=${RHEL7_RDO_REPO_ID:-"openstack-kilo"}
if ! sudo yum repolist enabled $RHEL_RDO_REPO_ID | grep -q $RHEL_RDO_REPO_ID; then
echo "RDO repo not detected; installing"
yum_install $RHEL_RDO_REPO_RPM || \
die $LINENO "Error installing RDO repo, cannot continue"
fi
sudo yum install -y https://rdoproject.org/repos/rdo-release.rpm
if is_oraclelinux; then
sudo yum-config-manager --enable ol7_optional_latest ol7_addons ol7_MySQL56
@@ -464,11 +459,14 @@ function exit_trap {
if [[ $r -ne 0 ]]; then
echo "Error on exit"
generate-subunit $DEVSTACK_START_TIME $SECONDS 'fail' >> ${SUBUNIT_OUTPUT}
if [[ -z $LOGDIR ]]; then
$TOP_DIR/tools/worlddump.py
else
$TOP_DIR/tools/worlddump.py -d $LOGDIR
fi
else
generate-subunit $DEVSTACK_START_TIME $SECONDS >> ${SUBUNIT_OUTPUT}
fi
exit $r
@@ -545,6 +543,7 @@ source $TOP_DIR/lib/dstat
# Phase: source
run_phase source
# Interactive Configuration
# -------------------------
@@ -689,6 +688,9 @@ if [[ "$OFFLINE" != "True" ]]; then
PYPI_ALTERNATIVE_URL=${PYPI_ALTERNATIVE_URL:-""} $TOP_DIR/tools/install_pip.sh
fi
# Install subunit for the subunit output stream
pip_install -U os-testr
TRACK_DEPENDS=${TRACK_DEPENDS:-False}
# Install Python packages into a virtualenv so that we can track them
@@ -712,12 +714,6 @@ source $TOP_DIR/tools/fixup_stuff.sh
# Install required infra support libraries
install_infra
# Pre-build some problematic wheels
if [[ -n ${WHEELHOUSE:-} && ! -d ${WHEELHOUSE:-} ]]; then
source $TOP_DIR/tools/build_wheels.sh
fi
# Extras Pre-install
# ------------------
# Phase: pre-install
+27 -19
View File
@@ -29,6 +29,9 @@ DATA_DIR=${DEST}/data
# Destination for status files
SERVICE_DIR=${DEST}/status
# Path for subunit output file
SUBUNIT_OUTPUT=${DEST}/devstack.subunit
# Determine stack user
if [[ $EUID -eq 0 ]]; then
STACK_USER=stack
@@ -138,11 +141,6 @@ USE_VENV=$(trueorfalse False USE_VENV)
# requirmenets files here, in a comma-separated list
ADDITIONAL_VENV_PACKAGES=${ADITIONAL_VENV_PACKAGES:-""}
# Configure wheel cache location
export WHEELHOUSE=${WHEELHOUSE:-$DEST/.wheelhouse}
export PIP_WHEEL_DIR=${PIP_WHEEL_DIR:-$WHEELHOUSE}
export PIP_FIND_LINKS=${PIP_FIND_LINKS:-file://$WHEELHOUSE}
# This can be used to turn database query logging on and off
# (currently only implemented for MySQL backend)
DATABASE_QUERY_LOGGING=$(trueorfalse False DATABASE_QUERY_LOGGING)
@@ -190,51 +188,51 @@ REQUIREMENTS_DIR=$DEST/requirements
# block storage service
CINDER_REPO=${CINDER_REPO:-${GIT_BASE}/openstack/cinder.git}
CINDER_BRANCH=${CINDER_BRANCH:-master}
CINDER_BRANCH=${CINDER_BRANCH:-stable/liberty}
# image catalog service
GLANCE_REPO=${GLANCE_REPO:-${GIT_BASE}/openstack/glance.git}
GLANCE_BRANCH=${GLANCE_BRANCH:-master}
GLANCE_BRANCH=${GLANCE_BRANCH:-stable/liberty}
# heat service
HEAT_REPO=${HEAT_REPO:-${GIT_BASE}/openstack/heat.git}
HEAT_BRANCH=${HEAT_BRANCH:-master}
HEAT_BRANCH=${HEAT_BRANCH:-stable/liberty}
# django powered web control panel for openstack
HORIZON_REPO=${HORIZON_REPO:-${GIT_BASE}/openstack/horizon.git}
HORIZON_BRANCH=${HORIZON_BRANCH:-master}
HORIZON_BRANCH=${HORIZON_BRANCH:-stable/liberty}
# baremetal provisioning service
IRONIC_REPO=${IRONIC_REPO:-${GIT_BASE}/openstack/ironic.git}
IRONIC_BRANCH=${IRONIC_BRANCH:-master}
IRONIC_BRANCH=${IRONIC_BRANCH:-stable/liberty}
# unified auth system (manages accounts/tokens)
KEYSTONE_REPO=${KEYSTONE_REPO:-${GIT_BASE}/openstack/keystone.git}
KEYSTONE_BRANCH=${KEYSTONE_BRANCH:-master}
KEYSTONE_BRANCH=${KEYSTONE_BRANCH:-stable/liberty}
# neutron service
NEUTRON_REPO=${NEUTRON_REPO:-${GIT_BASE}/openstack/neutron.git}
NEUTRON_BRANCH=${NEUTRON_BRANCH:-master}
NEUTRON_BRANCH=${NEUTRON_BRANCH:-stable/liberty}
# neutron fwaas service
NEUTRON_FWAAS_REPO=${NEUTRON_FWAAS_REPO:-${GIT_BASE}/openstack/neutron-fwaas.git}
NEUTRON_FWAAS_BRANCH=${NEUTRON_FWAAS_BRANCH:-master}
NEUTRON_FWAAS_BRANCH=${NEUTRON_FWAAS_BRANCH:-stable/liberty}
# neutron lbaas service
NEUTRON_LBAAS_REPO=${NEUTRON_LBAAS_REPO:-${GIT_BASE}/openstack/neutron-lbaas.git}
NEUTRON_LBAAS_BRANCH=${NEUTRON_LBAAS_BRANCH:-master}
NEUTRON_LBAAS_BRANCH=${NEUTRON_LBAAS_BRANCH:-stable/liberty}
# neutron vpnaas service
NEUTRON_VPNAAS_REPO=${NEUTRON_VPNAAS_REPO:-${GIT_BASE}/openstack/neutron-vpnaas.git}
NEUTRON_VPNAAS_BRANCH=${NEUTRON_VPNAAS_BRANCH:-master}
NEUTRON_VPNAAS_BRANCH=${NEUTRON_VPNAAS_BRANCH:-stable/liberty}
# compute service
NOVA_REPO=${NOVA_REPO:-${GIT_BASE}/openstack/nova.git}
NOVA_BRANCH=${NOVA_BRANCH:-master}
NOVA_BRANCH=${NOVA_BRANCH:-stable/liberty}
# object storage service
SWIFT_REPO=${SWIFT_REPO:-${GIT_BASE}/openstack/swift.git}
SWIFT_BRANCH=${SWIFT_BRANCH:-master}
SWIFT_BRANCH=${SWIFT_BRANCH:-stable/liberty}
##############
#
@@ -244,7 +242,7 @@ SWIFT_BRANCH=${SWIFT_BRANCH:-master}
# consolidated openstack requirements
REQUIREMENTS_REPO=${REQUIREMENTS_REPO:-${GIT_BASE}/openstack/requirements.git}
REQUIREMENTS_BRANCH=${REQUIREMENTS_BRANCH:-master}
REQUIREMENTS_BRANCH=${REQUIREMENTS_BRANCH:-stable/liberty}
# Tempest test suite
TEMPEST_REPO=${TEMPEST_REPO:-${GIT_BASE}/openstack/tempest.git}
@@ -442,7 +440,7 @@ GITREPO["keystonemiddleware"]=${KEYSTONEMIDDLEWARE_REPO:-${GIT_BASE}/openstack/k
GITBRANCH["keystonemiddleware"]=${KEYSTONEMIDDLEWARE_BRANCH:-master}
# s3 support for swift
SWIFT3_REPO=${SWIFT3_REPO:-${GIT_BASE}/stackforge/swift3.git}
SWIFT3_REPO=${SWIFT3_REPO:-${GIT_BASE}/openstack/swift3.git}
SWIFT3_BRANCH=${SWIFT3_BRANCH:-master}
# ceilometer middleware
@@ -750,6 +748,16 @@ GIT_DEPTH=${GIT_DEPTH:-0}
# Use native SSL for servers in ``SSL_ENABLED_SERVICES``
USE_SSL=$(trueorfalse False USE_SSL)
# ebtables is inherently racey. If you run it by two or more processes
# simultaneously it will collide, badly, in the kernel and produce
# failures or corruption of ebtables. The only way around it is for
# all tools running ebtables to only ever do so with the --concurrent
# flag. This requires libvirt >= 1.2.11.
#
# If you don't have this then the following work around will replace
# ebtables with a wrapper script so that it is safe to run without
# that flag.
EBTABLES_RACE_FIX=$(trueorfalse False EBTABLES_RACE_FIX)
# Following entries need to be last items in file
+16
View File
@@ -9,6 +9,22 @@ source $TOP/functions
source $TOP/tests/unittest.sh
echo "Testing generate_hex_string()"
VAL=$(generate_hex_string 16)
if [[ ${#VAL} -eq 32 ]]; then
passed "OK"
else
failed "generate_hex_string 16 failed ${#VAL}"
fi
VAL=$(generate_hex_string 32)
if [[ ${#VAL} -eq 64 ]]; then
passed "OK"
else
failed "generate_hex_string 32 failed ${#VAL}"
fi
echo "Testing die_if_not_set()"
bash -c "source $TOP/functions; X=`echo Y && true`; die_if_not_set $LINENO X 'not OK'"
+475
View File
@@ -0,0 +1,475 @@
#!/usr/bin/env bash
#
# 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.
# Tests for DevStack INI functions
TOP=$(cd $(dirname "$0")/.. && pwd)
# Import config functions
source $TOP/inc/ini-config
source $TOP/tests/unittest.sh
echo "Testing INI local.conf functions"
# test that can determine if file has section in specified meta-section
function test_localconf_has_section {
local file_localconf
local file_conf1
local file_conf2
file_localconf=`mktemp`
file_conf1=`mktemp`
file_conf2=`mktemp`
cat <<- EOF > $file_localconf
[[local|localrc]]
LOCALRC_VAR1=localrc_val1
LOCALRC_VAR2=localrc_val2
LOCALRC_VAR3=localrc_val3
[[post-config|$file_conf1]]
[conf1_t1]
conf1_t1_opt1=conf1_t1_val1
conf1_t1_opt2=conf1_t1_val2
conf1_t1_opt3=conf1_t1_val3
[conf1_t2]
conf1_t2_opt1=conf1_t2_val1
conf1_t2_opt2=conf1_t2_val2
conf1_t2_opt3=conf1_t2_val3
[conf1_t3]
conf1_t3_opt1=conf1_t3_val1
conf1_t3_opt2=conf1_t3_val2
conf1_t3_opt3=conf1_t3_val3
[[post-extra|$file_conf2]]
[conf2_t1]
conf2_t1_opt1=conf2_t1_val1
conf2_t1_opt2=conf2_t1_val2
conf2_t1_opt3=conf2_t1_val3
EOF
localconf_has_section $file_localconf post-config $file_conf1 conf1_t1
assert_equal $? 0
localconf_has_section $file_localconf post-config $file_conf1 conf1_t2
assert_equal $? 0
localconf_has_section $file_localconf post-config $file_conf1 conf1_t3
assert_equal $? 0
localconf_has_section $file_localconf post-extra $file_conf2 conf2_t1
assert_equal $? 0
localconf_has_section $file_localconf post-config $file_conf1 conf1_t4
assert_equal $? 1
localconf_has_section $file_localconf post-install $file_conf1 conf1_t1
assert_equal $? 1
localconf_has_section $file_localconf local localrc conf1_t2
assert_equal $? 1
rm -f $file_localconf $file_conf1 $file_conf2
}
# test that can determine if file has option in specified meta-section and section
function test_localconf_has_option {
local file_localconf
local file_conf1
local file_conf2
file_localconf=`mktemp`
file_conf1=`mktemp`
file_conf2=`mktemp`
cat <<- EOF > $file_localconf
[[post-config|$file_conf1]]
[conf1_t1]
conf1_t1_opt1 = conf1_t1_val1
conf1_t1_opt2 = conf1_t1_val2
conf1_t1_opt3 = conf1_t1_val3
[conf1_t2]
conf1_t2_opt1=conf1_t2_val1
conf1_t2_opt2=conf1_t2_val2
conf1_t2_opt3=conf1_t2_val3
[conf1_t3]
conf1_t3_opt1=conf1_t3_val1
conf1_t3_opt2=conf1_t3_val2
conf1_t3_opt3=conf1_t3_val3
[[local|localrc]]
LOCALRC_VAR1=localrc_val1
LOCALRC_VAR2=localrc_val2
LOCALRC_VAR3=localrc_val3
[[post-extra|$file_conf2]]
[conf2_t1]
conf2_t1_opt1=conf2_t1_val1
conf2_t1_opt2=conf2_t1_val2
conf2_t1_opt3=conf2_t1_val3
EOF
localconf_has_option $file_localconf local localrc "" LOCALRC_VAR1
assert_equal $? 0
localconf_has_option $file_localconf local localrc "" LOCALRC_VAR2
assert_equal $? 0
localconf_has_option $file_localconf local localrc "" LOCALRC_VAR3
assert_equal $? 0
localconf_has_option $file_localconf post-config $file_conf1 conf1_t1 conf1_t1_opt1
assert_equal $? 0
localconf_has_option $file_localconf post-config $file_conf1 conf1_t2 conf1_t2_opt2
assert_equal $? 0
localconf_has_option $file_localconf post-config $file_conf1 conf1_t3 conf1_t3_opt3
assert_equal $? 0
localconf_has_option $file_localconf post-extra $file_conf2 conf2_t1 conf2_t1_opt2
assert_equal $? 0
localconf_has_option $file_localconf post-config $file_conf1 conf1_t1_opt4
assert_equal $? 1
localconf_has_option $file_localconf post-install $file_conf1 conf1_t1_opt1
assert_equal $? 1
localconf_has_option $file_localconf local localrc conf1_t2 conf1_t2_opt1
assert_equal $? 1
rm -f $file_localconf $file_conf1 $file_conf2
}
# test that update option in specified meta-section and section
function test_localconf_update_option {
local file_localconf
local file_localconf_expected
local file_conf1
local file_conf2
file_localconf=`mktemp`
file_localconf_expected=`mktemp`
file_conf1=`mktemp`
file_conf2=`mktemp`
cat <<- EOF > $file_localconf
[[local|localrc]]
LOCALRC_VAR1 = localrc_val1
LOCALRC_VAR2 = localrc_val2
LOCALRC_VAR3 = localrc_val3
[[post-config|$file_conf1]]
[conf1_t1]
conf1_t1_opt1=conf1_t1_val1
conf1_t1_opt2=conf1_t1_val2
conf1_t1_opt3=conf1_t1_val3
[conf1_t2]
conf1_t2_opt1=conf1_t2_val1
conf1_t2_opt2=conf1_t2_val2
conf1_t2_opt3=conf1_t2_val3
[conf1_t3]
conf1_t3_opt1=conf1_t3_val1
conf1_t3_opt2=conf1_t3_val2
conf1_t3_opt3=conf1_t3_val3
[[post-extra|$file_conf2]]
[conf2_t1]
conf2_t1_opt1=conf2_t1_val1
conf2_t1_opt2=conf2_t1_val2
conf2_t1_opt3=conf2_t1_val3
EOF
cat <<- EOF > $file_localconf_expected
[[local|localrc]]
LOCALRC_VAR1 = localrc_val1
LOCALRC_VAR2 = localrc_val2_update
LOCALRC_VAR3 = localrc_val3
[[post-config|$file_conf1]]
[conf1_t1]
conf1_t1_opt1=conf1_t1_val1_update
conf1_t1_opt2=conf1_t1_val2
conf1_t1_opt3=conf1_t1_val3
[conf1_t2]
conf1_t2_opt1=conf1_t2_val1
conf1_t2_opt2=conf1_t2_val2_update
conf1_t2_opt3=conf1_t2_val3
[conf1_t3]
conf1_t3_opt1=conf1_t3_val1
conf1_t3_opt2=conf1_t3_val2
conf1_t3_opt3=conf1_t3_val3_update
[[post-extra|$file_conf2]]
[conf2_t1]
conf2_t1_opt1=conf2_t1_val1
conf2_t1_opt2=conf2_t1_val2
conf2_t1_opt3=conf2_t1_val3_update
EOF
localconf_update_option "$SUDO" $file_localconf local localrc "" LOCALRC_VAR2 localrc_val2_update
localconf_update_option "$SUDO" $file_localconf post-config $file_conf1 conf1_t1 conf1_t1_opt1 conf1_t1_val1_update
localconf_update_option "$SUDO" $file_localconf post-config $file_conf1 conf1_t2 conf1_t2_opt2 conf1_t2_val2_update
localconf_update_option "$SUDO" $file_localconf post-config $file_conf1 conf1_t3 conf1_t3_opt3 conf1_t3_val3_update
localconf_update_option "$SUDO" $file_localconf post-extra $file_conf2 conf2_t1 conf2_t1_opt3 conf2_t1_val3_update
result=`cat $file_localconf`
result_expected=`cat $file_localconf_expected`
assert_equal "$result" "$result_expected"
localconf_update_option "$SUDO" $file_localconf post-config $file_conf1 conf1_t2 conf1_t3_opt1 conf1_t3_val1_update
localconf_update_option "$SUDO" $file_localconf post-extra $file_conf2 conf2_t1 conf2_t1_opt4 conf2_t1_val4_update
localconf_update_option "$SUDO" $file_localconf post-install $file_conf2 conf2_t1 conf2_t1_opt1 conf2_t1_val1_update
localconf_update_option "$SUDO" $file_localconf local localrc "" LOCALRC_VAR4 localrc_val4_update
result=`cat $file_localconf`
result_expected=`cat $file_localconf_expected`
assert_equal "$result" "$result_expected"
rm -f $file_localconf $file_localconf_expected $file_conf1 $file_conf2
}
# test that add option in specified meta-section and section
function test_localconf_add_option {
local file_localconf
local file_localconf_expected
local file_conf1
local file_conf2
file_localconf=`mktemp`
file_localconf_expected=`mktemp`
file_conf1=`mktemp`
file_conf2=`mktemp`
cat <<- EOF > $file_localconf
[[post-config|$file_conf1]]
[conf1_t1]
conf1_t1_opt1=conf1_t1_val1
conf1_t1_opt2=conf1_t1_val2
conf1_t1_opt3=conf1_t1_val3
[conf1_t2]
conf1_t2_opt1=conf1_t2_val1
conf1_t2_opt2=conf1_t2_val2
conf1_t2_opt3=conf1_t2_val3
[conf1_t3]
conf1_t3_opt1=conf1_t3_val1
conf1_t3_opt2=conf1_t3_val2
conf1_t3_opt3=conf1_t3_val3
[[local|localrc]]
LOCALRC_VAR1=localrc_val1
LOCALRC_VAR2=localrc_val2
LOCALRC_VAR3=localrc_val3
[[post-extra|$file_conf2]]
[conf2_t1]
conf2_t1_opt1 = conf2_t1_val1
conf2_t1_opt2 = conf2_t1_val2
conf2_t1_opt3 = conf2_t1_val3
EOF
cat <<- EOF > $file_localconf_expected
[[post-config|$file_conf1]]
[conf1_t1]
conf1_t1_opt4 = conf1_t1_val4
conf1_t1_opt1=conf1_t1_val1
conf1_t1_opt2=conf1_t1_val2
conf1_t1_opt3=conf1_t1_val3
[conf1_t2]
conf1_t2_opt4 = conf1_t2_val4
conf1_t2_opt1=conf1_t2_val1
conf1_t2_opt2=conf1_t2_val2
conf1_t2_opt3=conf1_t2_val3
[conf1_t3]
conf1_t3_opt4 = conf1_t3_val4
conf1_t3_opt1=conf1_t3_val1
conf1_t3_opt2=conf1_t3_val2
conf1_t3_opt3=conf1_t3_val3
[[local|localrc]]
LOCALRC_VAR4 = localrc_val4
LOCALRC_VAR1=localrc_val1
LOCALRC_VAR2=localrc_val2
LOCALRC_VAR3=localrc_val3
[[post-extra|$file_conf2]]
[conf2_t1]
conf2_t1_opt4 = conf2_t1_val4
conf2_t1_opt1 = conf2_t1_val1
conf2_t1_opt2 = conf2_t1_val2
conf2_t1_opt3 = conf2_t1_val3
EOF
localconf_add_option "$SUDO" $file_localconf local localrc "" LOCALRC_VAR4 localrc_val4
localconf_add_option "$SUDO" $file_localconf post-config $file_conf1 conf1_t1 conf1_t1_opt4 conf1_t1_val4
localconf_add_option "$SUDO" $file_localconf post-config $file_conf1 conf1_t2 conf1_t2_opt4 conf1_t2_val4
localconf_add_option "$SUDO" $file_localconf post-config $file_conf1 conf1_t3 conf1_t3_opt4 conf1_t3_val4
localconf_add_option "$SUDO" $file_localconf post-extra $file_conf2 conf2_t1 conf2_t1_opt4 conf2_t1_val4
result=`cat $file_localconf`
result_expected=`cat $file_localconf_expected`
assert_equal "$result" "$result_expected"
localconf_add_option "$SUDO" $file_localconf local localrc.conf "" LOCALRC_VAR4 localrc_val4_update
localconf_add_option "$SUDO" $file_localconf post-config $file_conf1 conf1_t4 conf1_t4_opt1 conf1_t4_val1
localconf_add_option "$SUDO" $file_localconf post-extra $file_conf2 conf2_t2 conf2_t2_opt4 conf2_t2_val4
localconf_add_option "$SUDO" $file_localconf post-install $file_conf2 conf2_t1 conf2_t1_opt4 conf2_t2_val4
result=`cat $file_localconf`
result_expected=`cat $file_localconf_expected`
assert_equal "$result" "$result_expected"
rm -f $file_localconf $file_localconf_expected $file_conf1 $file_conf2
}
# test that add section and option in specified meta-section
function test_localconf_add_section_and_option {
local file_localconf
local file_localconf_expected
local file_conf1
local file_conf2
file_localconf=`mktemp`
file_localconf_expected=`mktemp`
file_conf1=`mktemp`
file_conf2=`mktemp`
cat <<- EOF > $file_localconf
[[post-config|$file_conf1]]
[conf1_t1]
conf1_t1_opt1=conf1_t1_val1
conf1_t1_opt2=conf1_t1_val2
conf1_t1_opt3=conf1_t1_val3
[conf1_t2]
conf1_t2_opt1=conf1_t2_val1
conf1_t2_opt2=conf1_t2_val2
conf1_t2_opt3=conf1_t2_val3
[conf1_t3]
conf1_t3_opt1=conf1_t3_val1
conf1_t3_opt2=conf1_t3_val2
conf1_t3_opt3=conf1_t3_val3
[[local|localrc]]
LOCALRC_VAR1=localrc_val1
LOCALRC_VAR2=localrc_val2
LOCALRC_VAR3=localrc_val3
[[post-extra|$file_conf2]]
[conf2_t1]
conf2_t1_opt1=conf2_t1_val1
conf2_t1_opt2=conf2_t1_val2
conf2_t1_opt3=conf2_t1_val3
EOF
cat <<- EOF > $file_localconf_expected
[[post-config|$file_conf1]]
[conf1_t4]
conf1_t4_opt1 = conf1_t4_val1
[conf1_t1]
conf1_t1_opt1=conf1_t1_val1
conf1_t1_opt2=conf1_t1_val2
conf1_t1_opt3=conf1_t1_val3
[conf1_t2]
conf1_t2_opt1=conf1_t2_val1
conf1_t2_opt2=conf1_t2_val2
conf1_t2_opt3=conf1_t2_val3
[conf1_t3]
conf1_t3_opt1=conf1_t3_val1
conf1_t3_opt2=conf1_t3_val2
conf1_t3_opt3=conf1_t3_val3
[[local|localrc]]
LOCALRC_VAR1=localrc_val1
LOCALRC_VAR2=localrc_val2
LOCALRC_VAR3=localrc_val3
[[post-extra|$file_conf2]]
[conf2_t2]
conf2_t2_opt1 = conf2_t2_val1
[conf2_t1]
conf2_t1_opt1=conf2_t1_val1
conf2_t1_opt2=conf2_t1_val2
conf2_t1_opt3=conf2_t1_val3
EOF
localconf_add_section_and_option "$SUDO" $file_localconf post-config $file_conf1 conf1_t4 conf1_t4_opt1 conf1_t4_val1
localconf_add_section_and_option "$SUDO" $file_localconf post-extra $file_conf2 conf2_t2 conf2_t2_opt1 conf2_t2_val1
result=`cat $file_localconf`
result_expected=`cat $file_localconf_expected`
assert_equal "$result" "$result_expected"
localconf_add_section_and_option "$SUDO" $file_localconf post-install $file_conf2 conf2_t2 conf2_t2_opt1 conf2_t2_val1
result=`cat $file_localconf`
result_expected=`cat $file_localconf_expected`
assert_equal "$result" "$result_expected"
rm -f $file_localconf $file_localconf_expected $file_conf1 $file_conf2
}
# test that add section and option in specified meta-section
function test_localconf_set {
local file_localconf
local file_localconf_expected
local file_conf1
local file_conf2
file_localconf=`mktemp`
file_localconf_expected=`mktemp`
file_conf1=`mktemp`
file_conf2=`mktemp`
cat <<- EOF > $file_localconf
[[local|localrc]]
LOCALRC_VAR1=localrc_val1
LOCALRC_VAR2=localrc_val2
LOCALRC_VAR3=localrc_val3
[[post-config|$file_conf1]]
[conf1_t1]
conf1_t1_opt1=conf1_t1_val1
conf1_t1_opt2=conf1_t1_val2
conf1_t1_opt3=conf1_t1_val3
[conf1_t2]
conf1_t2_opt1=conf1_t2_val1
conf1_t2_opt2=conf1_t2_val2
conf1_t2_opt3=conf1_t2_val3
[conf1_t3]
conf1_t3_opt1=conf1_t3_val1
conf1_t3_opt2=conf1_t3_val2
conf1_t3_opt3=conf1_t3_val3
[[post-extra|$file_conf2]]
[conf2_t1]
conf2_t1_opt1=conf2_t1_val1
conf2_t1_opt2=conf2_t1_val2
conf2_t1_opt3=conf2_t1_val3
EOF
cat <<- EOF > $file_localconf_expected
[[local|localrc]]
LOCALRC_VAR1=localrc_val1
LOCALRC_VAR2=localrc_val2_update
LOCALRC_VAR3=localrc_val3
[[post-config|$file_conf1]]
[conf1_t4]
conf1_t4_opt1 = conf1_t4_val1
[conf1_t1]
conf1_t1_opt1=conf1_t1_val1
conf1_t1_opt2=conf1_t1_val2
conf1_t1_opt3=conf1_t1_val3
[conf1_t2]
conf1_t2_opt1=conf1_t2_val1
conf1_t2_opt2=conf1_t2_val2
conf1_t2_opt3=conf1_t2_val3
[conf1_t3]
conf1_t3_opt1=conf1_t3_val1
conf1_t3_opt2=conf1_t3_val2
conf1_t3_opt3=conf1_t3_val3
[[post-extra|$file_conf2]]
[conf2_t1]
conf2_t1_opt4 = conf2_t1_val4
conf2_t1_opt1=conf2_t1_val1
conf2_t1_opt2=conf2_t1_val2
conf2_t1_opt3=conf2_t1_val3
[[post-install|/etc/neutron/plugin/ml2/ml2_conf.ini]]
[ml2]
ml2_opt1 = ml2_val1
EOF
if [[ -n "$SUDO" ]]; then
SUDO_ARG="-sudo"
else
SUDO_ARG=""
fi
localconf_set $SUDO_ARG $file_localconf post-install /etc/neutron/plugin/ml2/ml2_conf.ini ml2 ml2_opt1 ml2_val1
localconf_set $SUDO_ARG $file_localconf local localrc "" LOCALRC_VAR2 localrc_val2_update
localconf_set $SUDO_ARG $file_localconf post-config $file_conf1 conf1_t4 conf1_t4_opt1 conf1_t4_val1
localconf_set $SUDO_ARG $file_localconf post-extra $file_conf2 conf2_t1 conf2_t1_opt4 conf2_t1_val4
result=`cat $file_localconf`
result_expected=`cat $file_localconf_expected`
assert_equal "$result" "$result_expected"
rm -f $file_localconf $file_localconf_expected $file_conf1 $file_conf2
}
test_localconf_has_section
test_localconf_has_option
test_localconf_update_option
test_localconf_add_option
test_localconf_add_section_and_option
test_localconf_set
+1 -1
View File
@@ -15,7 +15,7 @@
echo "Ensuring we don't have crazy refs"
REFS=`grep BRANCH stackrc | grep -v -- '-master'`
REFS=`grep BRANCH stackrc | grep -v -- '-master' | grep -v -- '-stable/liberty'`
rc=$?
if [[ $rc -eq 0 ]]; then
echo "Branch defaults must be master. Found:"
+47
View File
@@ -0,0 +1,47 @@
#!/usr/bin/env bash
# Tests for DevStack vercmp functionality
TOP=$(cd $(dirname "$0")/.. && pwd)
# Import common functions
source $TOP/functions
source $TOP/tests/unittest.sh
assert_true "numeric gt" vercmp 2.0 ">" 1.0
assert_true "numeric gte" vercmp 2.0 ">=" 1.0
assert_true "numeric gt" vercmp 1.0.1 ">" 1.0
assert_true "numeric gte" vercmp 1.0.1 ">=" 1.0
assert_true "alpha gt" vercmp 1.0.1b ">" 1.0.1a
assert_true "alpha gte" vercmp 1.0.1b ">=" 1.0.1a
assert_true "alpha gt" vercmp b ">" a
assert_true "alpha gte" vercmp b ">=" a
assert_true "alpha gt" vercmp 2.0-rc3 ">" 2.0-rc1
assert_true "alpha gte" vercmp 2.0-rc3 ">=" 2.0-rc1
assert_false "numeric gt fail" vercmp 1.0 ">" 1.0
assert_true "numeric gte" vercmp 1.0 ">=" 1.0
assert_false "numeric gt fail" vercmp 0.9 ">" 1.0
assert_false "numeric gte fail" vercmp 0.9 ">=" 1.0
assert_false "numeric gt fail" vercmp 0.9.9 ">" 1.0
assert_false "numeric gte fail" vercmp 0.9.9 ">=" 1.0
assert_false "numeric gt fail" vercmp 0.9a.9 ">" 1.0.1
assert_false "numeric gte fail" vercmp 0.9a.9 ">=" 1.0.1
assert_false "numeric lt" vercmp 1.0 "<" 1.0
assert_true "numeric lte" vercmp 1.0 "<=" 1.0
assert_true "numeric lt" vercmp 1.0 "<" 1.0.1
assert_true "numeric lte" vercmp 1.0 "<=" 1.0.1
assert_true "alpha lt" vercmp 1.0.1a "<" 1.0.1b
assert_true "alpha lte" vercmp 1.0.1a "<=" 1.0.1b
assert_true "alpha lt" vercmp a "<" b
assert_true "alpha lte" vercmp a "<=" b
assert_true "alpha lt" vercmp 2.0-rc1 "<" 2.0-rc3
assert_true "alpha lte" vercmp 2.0-rc1 "<=" 2.0-rc3
assert_true "eq" vercmp 1.0 "==" 1.0
assert_true "eq" vercmp 1.0.1 "==" 1.0.1
assert_false "eq fail" vercmp 1.0.1 "==" 1.0.2
assert_false "eq fail" vercmp 2.0-rc1 "==" 2.0-rc2
report_results
+45
View File
@@ -84,6 +84,51 @@ function assert_empty {
fi
}
# assert the arguments evaluate to true
# assert_true "message" arg1 arg2
function assert_true {
local lineno
lineno=`caller 0 | awk '{print $1}'`
local function
function=`caller 0 | awk '{print $2}'`
local msg=$1
shift
$@
if [ $? -eq 0 ]; then
PASS=$((PASS+1))
echo "PASS: $function:L$lineno - $msg"
else
FAILED_FUNCS+="$function:L$lineno\n"
echo "ERROR: test failed in $function:L$lineno!"
echo " $msg"
ERROR=$((ERROR+1))
fi
}
# assert the arguments evaluate to false
# assert_false "message" arg1 arg2
function assert_false {
local lineno
lineno=`caller 0 | awk '{print $1}'`
local function
function=`caller 0 | awk '{print $2}'`
local msg=$1
shift
$@
if [ $? -eq 0 ]; then
FAILED_FUNCS+="$function:L$lineno\n"
echo "ERROR: test failed in $function:L$lineno!"
echo " $msg"
ERROR=$((ERROR+1))
else
PASS=$((PASS+1))
echo "PASS: $function:L$lineno - $msg"
fi
}
# print a summary of passing and failing tests, exiting
# with an error if we have failed tests
# usage: report_results
-86
View File
@@ -1,86 +0,0 @@
#!/usr/bin/env bash
#
# **tools/build_wheels.sh** - Build a cache of Python wheels
#
# build_wheels.sh [package [...]]
#
# System package prerequisites listed in ``files/*/devlibs`` will be installed
#
# Builds wheels for all virtual env requirements listed in
# ``venv-requirements.txt`` plus any supplied on the command line.
#
# Assumes:
# - ``tools/install_pip.sh`` has been run and a suitable ``pip/setuptools`` is available.
# If ``TOP_DIR`` is set we're being sourced rather than running stand-alone
# or in a sub-shell
if [[ -z "$TOP_DIR" ]]; then
set -o errexit
set -o nounset
# Keep track of the DevStack directory
TOP_DIR=$(cd $(dirname "$0")/.. && pwd)
FILES=$TOP_DIR/files
# Import common functions
source $TOP_DIR/functions
GetDistro
source $TOP_DIR/stackrc
trap err_trap ERR
fi
# Get additional packages to build
MORE_PACKAGES="$@"
# Exit on any errors so that errors don't compound
function err_trap {
local r=$?
set +o xtrace
rm -rf $TMP_VENV_PATH
exit $r
}
# Get system prereqs
install_package $(get_packages devlibs)
# Get a modern ``virtualenv``
pip_install virtualenv
# Prepare the workspace
TMP_VENV_PATH=$(mktemp -d tmp-venv-XXXX)
virtualenv $TMP_VENV_PATH
# Install modern pip and wheel
PIP_VIRTUAL_ENV=$TMP_VENV_PATH pip_install -U pip wheel
# BUG: cffi has a lot of issues. It has no stable ABI, if installed
# code is built with a different ABI than the one that's detected at
# load time, it tries to compile on the fly for the new ABI in the
# install location (which will probably be /usr and not
# writable). Also cffi is often included via setup_requires by
# packages, which have different install rules (allowing betas) than
# pip has.
#
# Because of this we must pip install cffi into the venv to build
# wheels.
PIP_VIRTUAL_ENV=$TMP_VENV_PATH pip_install_gr cffi
# ``VENV_PACKAGES`` is a list of packages we want to pre-install
VENV_PACKAGE_FILE=$FILES/venv-requirements.txt
if [[ -r $VENV_PACKAGE_FILE ]]; then
VENV_PACKAGES=$(grep -v '^#' $VENV_PACKAGE_FILE)
fi
for pkg in ${VENV_PACKAGES,/ } ${MORE_PACKAGES}; do
$TMP_VENV_PATH/bin/pip wheel $pkg
done
# Clean up wheel workspace
rm -rf $TMP_VENV_PATH
+1
View File
@@ -0,0 +1 @@
pip<8
+2 -3
View File
@@ -30,7 +30,8 @@ def update_cpu_map(tree):
x86 = arch
break
if x86 is not None:
# Create a gate64 cpu model that is core2duo less monitor and pse36
# Create a gate64 cpu model that is core2duo less monitor, pse36,
# vme, and ssse3.
gate64 = ET.SubElement(x86, "model")
gate64.set("name", "gate64")
ET.SubElement(gate64, "vendor").set("name", "Intel")
@@ -51,13 +52,11 @@ def update_cpu_map(tree):
ET.SubElement(gate64, "feature").set("name", "fxsr")
ET.SubElement(gate64, "feature").set("name", "sse")
ET.SubElement(gate64, "feature").set("name", "sse2")
ET.SubElement(gate64, "feature").set("name", "vme")
ET.SubElement(gate64, "feature").set("name", "mtrr")
ET.SubElement(gate64, "feature").set("name", "mca")
ET.SubElement(gate64, "feature").set("name", "clflush")
ET.SubElement(gate64, "feature").set("name", "pni")
ET.SubElement(gate64, "feature").set("name", "nx")
ET.SubElement(gate64, "feature").set("name", "ssse3")
ET.SubElement(gate64, "feature").set("name", "syscall")
ET.SubElement(gate64, "feature").set("name", "lm")
+3 -3
View File
@@ -135,7 +135,7 @@ if is_fedora; then
fi
fi
if [[ "$os_RELEASE" -ge "21" ]]; then
if [[ "$os_VENDOR" == "Fedora" ]] && [[ "$os_RELEASE" -ge "21" ]]; then
# requests ships vendored version of chardet/urllib3, but on
# fedora these are symlinked back to the primary versions to
# avoid duplication of code on disk. This is fine when
@@ -152,9 +152,9 @@ if is_fedora; then
# https://bugs.launchpad.net/glance/+bug/1476770
# https://bugzilla.redhat.com/show_bug.cgi?id=1253823
base_path=/usr/lib/python2.7/site-packages/requests/packages
base_path=$(get_package_path requests)/packages
if [ -L $base_path/chardet -o -L $base_path/urllib3 ]; then
sudo rm -f /usr/lib/python2.7/site-packages/requests/packages/{chardet,urllib3}
sudo rm -f $base_path/{chardet,urllib3}
# install requests with the bundled urllib3 to avoid conflicts
pip_install --upgrade --force-reinstall requests
fi
+31
View File
@@ -0,0 +1,31 @@
#!/bin/bash -eu
#
# Copyright 2015 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 replaces the ebtables on your system with a wrapper script that
# does implicit locking. This is needed if libvirt < 1.2.11 on your platform.
EBTABLES=/sbin/ebtables
EBTABLESREAL=/sbin/ebtables.real
FILES=$TOP_DIR/files
if [[ -f "$EBTABLES" ]]; then
if file $EBTABLES | grep ELF; then
sudo mv $EBTABLES $EBTABLESREAL
sudo install -m 0755 $FILES/ebtables.workaround $EBTABLES
echo "Replaced ebtables with locking workaround"
fi
fi
+1 -1
View File
@@ -58,7 +58,7 @@ function install_get_pip {
die $LINENO "Download of get-pip.py failed"
touch $LOCAL_PIP.downloaded
fi
sudo -H -E python $LOCAL_PIP
sudo -H -E python $LOCAL_PIP -c $TOOLS_DIR/cap-pip.txt
}
+1 -1
View File
@@ -61,7 +61,7 @@ export_proxy_variables
# ================
# Install package requirements
PACKAGES=$(get_packages general $ENABLED_SERVICES)
PACKAGES=$(get_packages general,$ENABLED_SERVICES)
PACKAGES="$PACKAGES $(get_plugin_packages)"
if is_ubuntu && echo $PACKAGES | grep -q dkms ; then
+12 -10
View File
@@ -8,23 +8,25 @@ usedevelop = False
install_command = pip install {opts} {packages}
[testenv:bashate]
deps = bashate
deps =
{env:BASHATE_INSTALL_PATH:bashate==0.3.1}
whitelist_externals = bash
commands = bash -c "find {toxinidir} \
-not \( -type d -name .?\* -prune \) \ # prune all 'dot' dirs
-not \( -type d -name doc -prune \) \ # skip documentation
-not \( -type d -name shocco -prune \) \ # skip shocco
-type f \ # only files
-not -name \*~ \ # skip editors, readme, etc
-not \( -type d -name .?\* -prune \) \
-not \( -type d -name doc -prune \) \
-not \( -type d -name shocco -prune \) \
-type f \
-not -name \*~ \
-not -name \*.md \
\( \
-name \*.sh -or \
-name \*.orig -or \
-name \*rc -or \
-name functions\* -or \
-wholename \*/inc/\* -or \ # /inc files and
-wholename \*/lib/\* \ # /lib files are shell, but
\) \ # have no extension
-print0 | xargs -0 bashate -v"
-wholename \*/inc/\* -or \
-wholename \*/lib/\* \
\) \
-print0 | xargs -0 bashate -v -iE006"
[testenv:docs]
deps =