Unit tests for scrubber

This patch adds a place for unit tests for the scrubber. The test in
it addresses the change made at:
https://review.openstack.org/#/c/29405/

addresses bug: 1195423
blueprint: refactoring-better-faster-stronger-functional-tests

Change-Id: I02da0847c3f93474f478c8740e4649280a02eae1
Add v1 API x-image-meta- header whitelist

Add a whitelist of allowed 'x-image-meta-xxx' style
headers. Attempts to supply other, unexpected headers
will return 400.

This prevents cases such as 'x-image-meta-locations'
being processed, which were not being handled correctly.

Addresses bug 1205018.

Change-Id: I771bb6ae2a4f9cbd7726f952c7a71da99162b490
Sync models with migrations

Models should be the same as the state in DB after migration
blueprint db-sync-models-with-migrations

Change-Id: Iea57866206776c14677dfa78e868143b6fb153a9
Text formatting changes

These are some text fixes in document, scripts and functions,
including variable usage, text aligning, adding new store class in
document

Change-Id: I98e226969d86698972870a7b3a042cb00c2206e9
Update .mailmap

Change-Id: I5dc51c7aeb080945201376c42250502de601384a
Adding metadata checking to image location proxy layer

Enable image locaton proxy checking metadata when the location changing.
Implemented bp: location-proxy-metadata-checking

Change-Id: If411a454cd2c3e277ea9840cc3d83ec5125bb372
Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
Remove glance CLI man page.

glanceclient CLI man page is provided by glanceclient.

Fixes bug 1212300

Change-Id: I61f61b50cb74d71331fadb89659a3cee2b13a359
Allow tests to run without installation

This patch makes modifications to the way that programs which the various
tests depend on are forked and executed.  This will allow the tests to be
run without installing glance to a python installation (ie: python setup.py
{develop/install} will not be needed).

fixes bug: 1197800

Change-Id: I9687cb7a5b22747d9cea0a1c24057383a8901476
remove flake8 option in run_tests.sh

flake8 read [flake8] section of tox.ini as options.

function run_flake8 in run_tests.sh should be kept simple,
and tox.ini controls the behavior of flake8.

Fixes Bug #1212988

Change-Id: I35d434ccea1ca2f3ff93657e4ca6dde93bbbf29e
Merge "Unit tests for scrubber"
Removes duplicate options registration in registry clients

Fixes bug #1204359

Change-Id: I5b8bd9e4465d9fe70e9311474bc2b00d9afcf046
Add space in etc/glance-cache.conf

Add space in "known_stores" block in etc/glance-cache.conf,
and keep glance code tidy and pleasing.

Change-Id: If112db41bfbce9f78013fe33229043f0f626f3f9
Make disk and container formats configurable

* Add disk_formats config attribute
* Add container_formats config attribute
* Implement bp configurable-formats

Change-Id: Ic52ffb46df9438c247ba063748cadd69b9c90bcd
glance-replicator: enable logging exceptions into log file

bug 1213779

Currently, glance-replicator provides option to enable logging
information into a specified file. But exceptions are not logged
into the log file when they are thrown.

Reproduce steps:

When setting a wrong source or target address, exceptions would be
thrown, but not logged into log file.

Change-Id: Ic2c59e04aa6099f3ede0c6b8579c31a3dfff895c
image-delete fires multiple queries to delete its child entries

1. Changed individual query calls for soft-deleting the image's
   child entries to one db query call for all child entries of a
   given type.
2. Added a fix to simple db's 'image_destroy' api to clear
   the location entries.

Fixes bug 1201758

Change-Id: Ib673de5460d59ea3af74553048ffcf74dccbdc36
Make sure owner column doesn't get dropped during downgrade

Fixes bug 1204941

The owner column was missing from the table schema. Because of limitations
of sqlite and implementation details in SQLAlchemy-migrate, this would end
up dropping the owner column during a downgrade when using sqlite.

Change-Id: If8f7f16c9b6fb059f0fcfdf8967afd37f19864b6
redundant conditions in paginate-query

For a list call on images, when a sort_key is applied, the query
generated has redundant values for 'created_at' condition. This happens
when the sort_key list has duplicate values.

Fixes Bug #1212994

Change-Id: Icd62c2886d9ab608418ba9b4dc25cd06a4146992
Perform database migration snake walk test correctly

Fixes bug 1204940

The database migration snake walk test would not properly perform downgrades
leaving that part of the test non-functional.

Also, if downgrade was True, the test wouldn't downgrade all of the way to
the first migration because of a fence post error.

Change-Id: I44873fc9bb0b159c941a90ce19b74e1afba8b6a8
Use _pre_upgrade_### instead of _prerun_###

Other projects, including nova and oslo.db, use _pre_upgrade_### as the
function to run before a DB migration test. This is to differentiate it
from the downgrade tests.

Change-Id: I0da30f7c5a1c76a7ff0e735c36b753ef7a624db9
Call _post_downgrade_### after downgrade migration is run

Fixes bug 1195470

Tests are currently only run after a upgrade during the database migration
unit tests and never during a downgrade. This change calls an optional
_post_downgrade_### method after running the downgrade migration to allow
it to be tested as well.

Change-Id: I592424b464b91c2be9e253402986e673ce33c8d0