Move shared devstack functions to functions-common

Syncing devstack/functions-common -> grenade/functions is confusing,
and as a result grenade/functions has been updated with grenade-specific
stuff.  This moves existing functions to 'functions-common' and isolates
grenade specific things to 'functions'.  'functions' sources 'functions-common'
so this should not require any other changes and will make it easier to keep
code synced with devstack.

Change-Id: I3b6324fc3067833075fc5487684d31593627b779
Sync functions-common from devstack

This is a sync of shared functions-common from devstack.

Change-Id: If2683698ea432addd42b9f97ad5ce03de4774f0f
Merge "Move shared devstack functions to functions-common"
Merge "Sync functions-common from devstack"
Add comment explaining where javelin logs are found

Document where javelin2 logs are kept to make it easier to
debug issues.

Change-Id: I3dc04e854a2166351958eb8b86f4645cc809460a
Source lib/nova when upgrading tempest

In lib/nova is set variable NOVA_BIN_DIR which is later used for setting
cli_dir in tempest.conf. Without including lib/nova the variable is
evaluated as empty string.

Change-Id: I74f0cf8a3af287b072acefab92ac9a3facb443f5
Closes-Bug: 1391436
Generate javelin config dynamically

The current javelin config makes assumptions about what services
devstack has actually deployed and will fail if those assumptions
are not correct. We're now testing more than just the default devstack
topology. The list of resources grenade expects javelin to act on needs to
be flexible if we want it to support these non-standard configs. This adds
a tool to dynamically generate the javelin resources yaml depending on
what services devstack has deployed, using the existing resources.yaml
has a base.

Change-Id: Iaf9381e185d4875e6098fe5f3573b5bb61c01e33
generate_javelin_resources: generate server networks as list

One server can be attached to multiple networks. This patch adds back
networks per server and if neutron is not enabled, networks are removed.

Change-Id: Ia65b92891419fde908423e9806fe7281c25c6378
Closes-Bug: 1392641
Remove commented out codes and files related to upgrade-packages

This commit removes some unnecessary commented out codes and files they
are related to upgrade-packages. Upgrading package was part of the
original vision of Grenade. However the scope of upgrades was cut back
now. Because any package upgrades required should be handled in the
service that requires them as Dean Troyer said.

Change-Id: Ic1b6ee2e2b668c0c76c2a1425475651bf8a8bd73
Remove use of GRENADE_PHASE

Recently, devstack-gate accidentally stopped setting these values and
there appeared to be no fallout.  Looking closer, they appear to be
no longer used by Grenade.  This removes them from sample localrcs
and docs.

Change-Id: I4d1ec41bac5a05241069963d1bcd2df4070f5ea2
change the javelin guests to be smaller

Creating 2 surviving resources as m1.small and m1.medium means locking
up 6GB of ram in surviving guests, which is *way* too much to
consistently work.

Tune this back down to m1.tiny and m1.micro.

Closes-Bug: #1398074

Change-Id: Ia9d679d82ffae951273f62c7beee67007b2ad080
don't uninstall oslo.config

There is a totally crazy sequencing issue that happens by uninstall
oslo.config here, don't do it. It's an incredibly old work around from
before we installed oslo.config as a non editable install.

Change-Id: Ic2364681e51e82e0d7b374728c177a47e04cbd1b
Fix worlddump call

Change I8db9dc99da8bb486a07d7ead77031e1c0b419857 modified failure
paths to call worlddump.py, but this instance is looking in the wrong
path; e.g.

---
2014-12-02 20:29:21.371 | The following services are not running after upgrade:  swift-proxy-server
2014-12-02 20:29:21.372 | /opt/stack/new/grenade/check-sanity: line 117: /opt/stack/new/grenade/tools/worlddump.py: No such file or directory
2014-12-02 20:29:21.373 | + die 377 'Failure in check-sanity'
---

Also, ${LOGDIR} isn't defined here, so output to the devstack screen
log dir

[1] http://logs.openstack.org/28/136328/2/check/check-grenade-dsvm/0328b64/logs/grenade.sh.txt.gz

Change-Id: I18d96a47469d34e0df51f0a6b9b9e16925a3c3df
Merge "Fix worlddump call"
remove sourcing of nova baremetal driver

nova baremetal driver is removed, remove references in grenade so we
can pull them from devstack.

Change-Id: I7c8474bd46bad4a8418c6947ea63b4e1ffb1f12e
Rename apts to debs

In change I0416180db5b6add996ce5b48c6966c1b68adbcb0, devstack renames
apts to debs.  This updates grenade to look for packages in the correct
'files/debs' directory.

Change-Id: I915f0e59c13d8cf5fb3549c6202f8aa2f8be0856
Merge "Rename apts to debs"
Remove call to inexistent unfubar_testtools function

The function was removed here I5554514dd862a2004454daf295abbcf9cf9f2bfb
and since icehouse is not target in grenade job the call it's no longer needed
here we can remove it - wasn't causing any big issue besides a 'command
not found' but at least closes a bug.

Change-Id: Ib7560bb4f19d4593b5958b1f94a462c09a23cee7
Closes-bug: #1356178
Merge "Remove use of GRENADE_PHASE"
Merge "Remove call to inexistent unfubar_testtools function"