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.
Reviewed: https:/ /review. openstack. org/165237 /git.openstack. org/cgit/ openstack/ neutron/ commit/ ?id=3b66a9ff77a 0c77075a1320d83 2f97de7aeab22a
Committed: https:/
Submitter: Jenkins
Branch: master
commit 3b66a9ff77a0c77 075a1320d832f97 de7aeab22a
Author: Ihar Hrachyshka <email address hidden>
Date: Wed Mar 18 14:21:57 2015 +0100
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 paste.ini. test.
version of configuration files. It means we need to maintain tests only
policy.json file too, in addition to neutron.conf.test and
api-
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 1404f33b50452d4 c0e0ef8c748011c e80303c2fd.
Conflicts: policy. py
neutron/
Related-Bug: #1433146 558d51025242117 99676068889
Change-Id: If1f5ebd981cf06