90 Commits

Author SHA1 Message Date
Ian Wienand
ca7e4f285c Fix error detection & exit in report_results
We wish to fail if we have >0 zero errors, not >1 errors (i.e. exactly
one error did not trigger a failure!)

This change also brings consistency to the pass & failure paths by
ensuring report_results exits in both cases, since report_results is
supposed to be the last thing run in a test file.

Change-Id: Id4721dffe13721e6c3cd71bca40c3395627e98bf
2015-11-16 15:47:51 +11:00
Jenkins
73de4a42d9 Merge "Provide an error message on bogus config file spec" 2015-11-04 15:39:03 +00:00
Thomas Morin
85f42f698c Provide an error message on bogus config file spec
If local.conf specifies a config file addition in the following way...

[[post-config|$MY_CONF_FILE]]
[xyz]
foo=bar

...and $MY_CONF_FILE points to a file whose directory is not writable by
the user running the script, then stack.sh aborts with the following
obscure message:

  2015-09-01 08:20:08.113 | touch: setting times of '/': Permission denied

This patch modifies inc/meta-config to provide a useful error message,
such as:

  2015-09-01 08:20:08.114 | could not create config file / ($MY_CONF_FILE)

This patch also modifies inc/meta-config so that it provides an error
message if $MY_CONF_FILE is empty (instead of silently ignoring this local.conf
statement):

  2015-09-01 09:38:53.406 | bogus config file specification: $MY_CONF_FILE
  is undefined

Change-Id: I9b78407420318548561012a8672762bc7fdd6db6
Closes-Bug: 1490881
2015-11-02 15:35:01 +01:00
Jenkins
c77fc2e196 Merge "Add new oslo.privsep library to oslo repos" 2015-10-29 03:00:30 +00:00
Jenkins
83a2a42ac0 Merge "Add export_proxy_variables() tests to test_functions.sh" 2015-10-29 00:44:54 +00:00
Tony Breeds
7792bc39d4 Add new oslo.privsep library to oslo repos
A new project olos.privsep has been created but failes sdvm testing as
even though the library is added ro PROJECTS and LIBS_FROM_GIT it isn't
installed by devstack.

Add oslo.privsep to the install_oslo function

Change-Id: Ia4d56747d56dcfe50889ebbdf9d553df13e1b950
2015-10-25 17:39:37 +11:00
Jenkins
6e9bee1ae5 Merge "Detect blank variable in trueorfalse" 2015-10-15 02:56:19 +00:00
Ian Wienand
e82bac0498 Detect blank variable in trueorfalse
As a follow-on to I8cefb58f49dcd2cb2def8a5071d0892af520e7f7, put in
some detection around missing variable-to-test arguments in
trueorfalse.

Correct a couple of places where we were passing in blank strings,
resulting in the default always being applied.

Add test-cases and enhance the documentation a little.

Depends-On: I8cefb58f49dcd2cb2def8a5071d0892af520e7f7
Change-Id: Icc0eb3808a2b6583828d8c47f0af4181e7e2c75a
2015-10-09 19:07:50 +11:00
Ian Wienand
ada886dd43 Don't mix declaration and set of locals
Ia0957b47187c3dcadd46154b17022c4213781112 proposes to have bashate
find instances of setting a local value.  The issue is that "local"
always returns 0, thus hiding any failure in the commands running to
set the variable.

This is an automated replacement of such instances

Depends-On: I676c805e8f0401f75cc5367eee83b3d880cdef81
Change-Id: I9c8912a8fd596535589b207d7fc553b9d951d3fe
2015-10-07 17:03:32 +11:00
Chris Dent
e9a4750fe1 Remove ceilometer in favor of plugin
The ceilometer project is moving to using a devstack plugin rather
than having ceilometer in the base devstack. This is to allow
greater control and flexibility.

Change-Id: I413ab159474b7d7231ad66d3a482201f74efe8a8
2015-09-09 16:44:29 +00:00
Jenkins
3f249b1e21 Merge "Support installing ironic-lib" 2015-09-01 18:21:00 +00:00
Jenkins
9f52d648fb Merge "Add file creation test" 2015-08-29 00:38:16 +00:00
Jenkins
a30a98099b Merge "Add -sudo option to ini setting options" 2015-08-27 22:15:30 +00:00
Dmitry Tantsur
869b72b851 Support installing ironic-lib
ironic-lib will soon become a dependency of ironic, make sure we can
write dsvm gates against it.

Change-Id: I6e66ae770cf5065980848e7e987bfd75765a5ac6
2015-08-26 17:34:46 +02:00
Jenkins
5cbd85738e Merge "Cleanup of ini test-case" 2015-07-27 20:43:50 +00:00
Jenkins
3805b3770c Merge "Allow installing keystoneauth from git" 2015-07-23 14:17:49 +00:00
Ian Wienand
cede787482 Add file creation test
Ensure that iniadd is creating files that don't exist, as it has
historically done.

Change-Id: I2798996f3d46ff1dce410b815a87395f1bf729f9
2015-07-23 06:46:24 +10:00
Ian Wienand
f44a024f02 Add -sudo option to ini setting options
Add a -sudo option to allow these functions to operate on root-owned
files.  Test-case is updated, but not enabled by default as we can't
expect test-runner to have sudo access.

Change-Id: I134c3397314c7d9395996eb6c825ecb7e7fdfc69
2015-07-23 06:46:24 +10:00
Ian Wienand
b997db602e Cleanup of ini test-case
Various cleanup to this file.

Firstly create a temporary space to test, rather than working in the
source directory.

We have "assert_equal" which simplifies a lot.  Add "assert_empty"
that is used in a couple of tests too.  Remove a couple of duplicate
tests.

Change-Id: I7fd476ed63026e67d66a8ac2891b2e4a6687d09c
2015-07-23 06:46:24 +10:00
Jenkins
f0e86a7ac7 Merge "Add worlddump unit test" 2015-07-16 23:55:34 +00:00
Mahito OGURA
54dc19ecad Add export_proxy_variables() tests to test_functions.sh
In test_functions.sh, There aren't export_proxy_variables() tests.
This patch add test of export_proxy_variables to test_funstions.sh.

Change-Id: I76f2bab84f4019961e612b0bff0ab66646b6e160
2015-07-15 23:31:51 +09:00
Jamie Lennox
21a9077d7c Allow installing keystoneauth from git
Keystoneauth is not marked as stable yet however to ensure that the
integration between it, keystoneclient and other services don't break
compatibility we want to test it with tempest.

Unfortunately you can't put -e links in requirements.txt files so add
it to devstack so we can set the test environment. This will also make
it available when keystoneauth is released.

Change-Id: I43ca1df9c6ae2f0ac1a687c9ce1e2ccb97e81652
2015-07-06 23:17:15 +00:00
Jenkins
fee742ba72 Merge "Move Sahara into in-tree plugin" 2015-07-02 18:39:38 +00:00
Sergey Lukjanov
3381e09f72 Move Sahara into in-tree plugin
Once the Sahara related code moved to Sahara repo and used, we can
remove Sahara specific code from Devstack.

Partial-Implements: bp sahara-devstack-intree

Change-Id: I34412b5cb2e86944b8555b8fd04b43556eb2bbe6
Depends-on: I2e00b2ebc59dd3be6a0539dea2985f2e801a1bd7
Depends-on: I07c3fede473030e8a110cbf5a08309f890905abf
2015-07-01 16:09:56 +00:00
Ian Wienand
5c7f39fdcd Add worlddump unit test
Add a worlddump unit test to avoid simple breakages

Change-Id: I6b87d4dbe22da2c1ca5ceb13134e9bb570f5cef2
2015-07-01 06:29:27 +10:00
Davanum Srinivas
77a7d11dfa Add new oslo libraries
Full list for liberty is as follows:
* oslo.service
* oslo.reports
* automaton
* futurist

oslo.cache was already added in the earlier review

Some of the entries are already there, though automaton was
missing in one spot. Made sure all references have all five
libraries.

Change-Id: Iffb720d46058424924469695a3ae1e4f20655f99
2015-06-30 18:43:56 +00:00
Steve Martinelli
531017cf3e Add oslo.cache to devstack
as part of the graduation process, add oslo.cache to lib/oslo
and stackrc.

Change-Id: I2baf0384dd5d71d234a95b7acd0bfe5534f2732c
2015-06-27 15:10:51 +00:00
Davanum Srinivas
18d1cca6cb Add oslo.service to devstack
Add the ability to switch on oslo.service master using
LIBS_FROM_GIT

Change-Id: I00fe7776aea005b6d4e0a84fce54f33a862b57e3
2015-06-18 06:32:04 -04:00
Joshua Harlow
e3a640d573 Add futurist to lib/oslo and stackrc
Part of blueprint adopt-futurist

Change-Id: I17e27a085c7c509bad6018016e90d0114543b073
2015-06-10 11:57:41 -07:00
Joshua Harlow
96c6b2deb3 Add automaton to lib/oslo and stackrc
Part of blueprint adopt-automaton

Change-Id: I520643b74aced431f7a46b7d7b94616bb2e6bf8e
2015-06-10 11:48:50 -07:00
Ramy Asselin
10e1fd420d Allow override of os-brick library used by cinder
os-brick code was pulled out of cinder and made into its own library
https://review.openstack.org/#/c/155552/

added to requirements:
https://review.openstack.org/#/c/177372/

Integration tests were added
https://review.openstack.org/#/c/188156/

But they still use the version of os-brick from pip.

This change updates devstack to pull in the changes from
os-brick patch sets instead, when configured to do so.

Needed-by: Id2bc10782847861fe4bb5e9e46245654450e38fd

Change-Id: I5359dd37dfe94bd469d5ca35f9fbaeda61b5fac4
2015-06-08 09:54:16 -07:00
Ian Wienand
dd363a182f Cleanup test_ip.sh to give more consistent output
Minor changes to give more consistent output; no functional changes to
tests.

Change-Id: I6c4ef74587c59b786761735c7bd528f3d7f94905
2015-05-28 10:40:55 +10:00
Jenkins
cfdb6fa940 Merge "Add test case to 'cidr2netmask'" 2015-05-27 15:43:26 +00:00
Jenkins
3fa092bc1c Merge "Fix msg argument to assert_equal" 2015-05-27 15:43:21 +00:00
Mahito
d82d3f1340 Add test case to 'cidr2netmask'
'cidr2netmask' of function doesn't have enough test case
and test code isn't smart.
This patch adds test case and refactors test code.

Change-Id: Iab20ef06fe78316a78198ab75c0afe738a577dd6
Closes-bug: #1457989
2015-05-26 15:33:32 +09:00
fumihiko kakuma
8606c98c53 Fix remove_disabled_extensions to remove an extension at the last position
remove_disabled_extensions do matching by '$ext_to_remove","'. So it doesn't
match an extension at the last position in extensions_list.
This patch fixes that.

Closes-Bug: #1443254
Change-Id: I194b483de797697ba06b320cf33f1bac67fc0cc7
2015-05-26 12:38:35 +09:00
Ian Wienand
165afa2377 Fix msg argument to assert_equal
I noticed this was taking an argument but not dealing with it.  In
general the functions were undocumented, so I added some terse usage.

Also, the intent of the test-case was to expand the values before
using them as the message; make sure this happens by using a temp
variable.

Change-Id: Ib317ad1e9dd2a5d2232b9c64541fe4a601a2b8da
2015-05-25 11:29:48 +10:00
James E. Blair
9e220b9b2b Move trove into in-tree plugin
Once the trove code is copied into the trove repo and it is used
as a devstack-plugin, we can remove trove-specific code from
devstack.

Change-Id: I8f9f1a015edb7ec1033e2eaf0b29ab15d89384ce
Depends-On: I3506dec0e6097f9c2e9267110fdfb768faa23c85
2015-05-14 07:57:23 -07:00
Mahito OGURA
98f59aafaf Fix function and test for 'trueorfalse'.
The function's comment is written as follow, however the function accepts
other values (ex. "e", "t", "T", "f", "F", etc...).

---
Accepts as False: 0 no No NO false False FALSE
Accepts as True: 1 yes Yes YES true True TRUE
---

Moreover if testval mach True or False, the function exits without resetting
xtrace.

This patch fixes the issue and add test patterns.

Change-Id: Ie48a859476faff22a4dfef466516e2d7d62ef0c0
Closes-bug: #1453687
2015-05-11 18:23:07 +09:00
Jenkins
641dd9ff23 Merge "Fix negated services with common prefix" 2015-05-07 02:48:20 +00:00
Sean Dague
7efba991f7 don't source openrc
There is actually no reason why we need openrc for these tests, don't
source it as it prevents some ip math errors from randomly killing
tests.

Change-Id: Iface7c21898d92e14e840379938b25844cd85565
2015-04-28 13:15:22 -04:00
Ian Wienand
2796a82ab4 Fix negated services with common prefix
The current sed matching mixes up common-prefix matching;
e.g. "-q-lbaas,q-lbaasv2" is changed into just "v2"

This is more verbose, but I think more reliable.  See also
Ib50f782824f89ae4eb9787f11d42416704babd90.

Change-Id: I3faad0841834e24acc811c05015625cf7f848b19
2015-04-23 15:10:25 +10:00
Ian Wienand
fa3e841286 Create config file in merge_config_file
Change If132a94e53545d9134859aa508da7b9819ede2f8 introduced a small
regression; it added an "inidelete" which looks in the config file to
delete rows.

However, at least for the test-case, the config file isn't created
yet.  The end result is that the test fails but we don't notice.

 2015-04-17 00:55:03.169 | merge_config_file test-multiline: sed: can't read test-multiline.conf: No such file or directory
 2015-04-17 00:55:03.195 | OK

So fix this up by creating the config-file if it isn't there.

Also, add "-e" to the test file so we catch things like this in the
future.

Change-Id: I43a4ecc247f19cccf51d5931dfb687adbd23d6b1
2015-04-17 13:23:25 +10:00
Ian Wienand
09f4ad2279 Convert test_functions.sh to use unittest helpers
This currently does not exit with any failure code when tests are
failing.  Convert it to use the helper functions from unittest.sh so
it correctly reports failures.

Change-Id: I2062d9c00ebffcc98ba75a12f480e4dd728ee080
2015-04-17 13:23:25 +10:00
Ian Wienand
9b845da478 Fix die_if_not_set tests
The "die_if_not_set" test has the LINENO as a positional argument.
The existing tests are not passing this in, so they are failing.

Along with this, remove the "-x" from the invocation and hide the
output of the tests that are expected to fail to avoid confusion.

Change-Id: Ibf6b9d7bb72b9f92831e1a90292ff8b0bec7faea
2015-04-17 13:23:25 +10:00
Ian Wienand
9b0ebc44f4 Move function.sh to test_functions.sh
run_tests.sh runs tests starting with test_*

The existing test_functions.sh is really testing true/false.  Move
that to test_truefalse.sh

Then move functions.sh to test_functions.sh.  This will ensure it is
run during unit testing from run-tests.sh

Change-Id: I959ac38c946da1fb47458b8c4f09157f74f0e644
2015-04-17 13:23:25 +10:00
Ian Wienand
fcdca05de5 Fix return of test_ini_config & test_meta_config
Convert test_ini_config to use the "passed / failed" functions in
unittest.sh.  test_meta_config wraps everything into a function; it's
not work unrolling this so just make sure it exits with non-zero if a
test fails.

Change-Id: I9e9883fdad42358255383eede9121b1d361799c8
2015-04-17 13:23:25 +10:00
Ian Wienand
f56348bcb2 Use unittest help in test_ip.sh
Use the unittest helper to track test runs and correctly exit with a
failure code if there is a problem

Change-Id: Ie62f354a8cd3b8fd5986e6943a073f7955fb55ba
2015-04-17 13:23:25 +10:00
Ian Wienand
1cb809d8ef Add "passed" and "failed" functions
Add two generic "passed" and "failed" functions to the unittest
helper.  Also keep a count of passed and failed tests.  Later changes
will use these functions to ensure they exit with a correct return
code.

Change-Id: I8574dcb1447b04fcda3d72df0bf8605cf7488d3c
2015-04-17 13:23:20 +10:00
Attila Fazekas
1bd79596c3 Move back isset to the functions-common
isset function was moved to config file related functions by accident,
this change also simplfies the isset in a bash >=4.2 way.

All supported distro has at least bash 4.2. (RHEL6 used 4.1)

Change-Id: Id644b46ff9cdbe18cde46e96aa72764e1c8653ac
2015-03-26 14:00:02 +01:00