]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
tests: don't rely on configuration files outside tests directory
authorIhar Hrachyshka <ihrachys@redhat.com>
Wed, 18 Mar 2015 13:21:57 +0000 (14:21 +0100)
committerIhar Hrachyshka <ihrachys@redhat.com>
Mon, 30 Mar 2015 15:20:06 +0000 (17:20 +0200)
commit3b66a9ff77a0c77075a1320d832f97de7aeab22a
tree463d67fceb90af32010f6a15ba52abe4bd90eb16
parent2665b7592e751a69a8719414d1bda69b70a1fb94
tests: don't rely on configuration files outside tests directory

etc/... may be non existent in some build environments. It's also pip
does not install those files under site-packages neutron module, so
paths relative to python files don't work.

So instead of using relative paths to etc/... contents, maintain our own
version of configuration files. It means we need to maintain tests only
policy.json file too, in addition to neutron.conf.test and
api-paste.ini.test.

Ideally, we would make etc/policy.json copied under site-packages in
addition to /etc/neutron/. In that way, we would not maintain a copy of
policy.json file in two places.

Though it seems that setuputils does not have a good way to install
files under site-packages that would consider all the differences
between python environments (specifically, different prefixes used in
different systems).

Note: it's not *absolutely* needed to update the test policy.json file
on each next policy update, though it will be needed in cases when we
want to test policy changes in unit tests. So adding a check to make
sure files are identical.

This partially reverts commit 1404f33b50452d4c0e0ef8c748011ce80303c2fd.

Conflicts:
neutron/policy.py

Related-Bug: #1433146
Change-Id: If1f5ebd981cf06558d5102524211799676068889
neutron/tests/base.py
neutron/tests/etc/policy.json [new file with mode: 0644]
tools/misc-sanity-checks.sh