Test test_get_bind_addr_default_value picks up port value from system config file
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Glance |
Fix Released
|
Undecided
|
Kui Shi |
Bug Description
When I run the tests, eg with
$ tox -epy27
I see the following error:
=======
FAIL: glance.
-------
_StringException: Traceback (most recent call last):
File "/home/
self.
File "/home/
self.
File "/home/
raise MismatchError(
MismatchError: ('0.0.0.0', '123456') != ('0.0.0.0', 9291)
Slowest 5 tests took 70.04 secs:
21.68 TestScrubber.
21.66 TestScrubber.
16.27 TestScrubber.
6.56 TestBinGlanceCa
3.87 TestRootApi.
-------
Ran 1530 tests in 300.360s
Port 9291 [sic] is being picked up from /etc/glance/
$ grep 9291 /etc/glance/
bind_port = 9291
The unit test should be independent of any config files present on the system.
Changed in glance: | |
status: | New → Confirmed |
Changed in glance: | |
assignee: | nobody → Kui Shi (skuicloud) |
Changed in glance: | |
milestone: | none → havana-3 |
status: | Fix Committed → Fix Released |
Changed in glance: | |
milestone: | havana-3 → 2013.2 |
Funnily enough I'm only able to reproduce this by running all the tests, eg if I run:
$ tox -evenv -- nosetests --tests= glance. tests.unit. common. test_wsgi: JSONRequestDese rializerTest. test_get_ bind_addr_ default_ value git/glance. new/glance/ setup.py git/glance. new/glance/ .tox/dist/ glance- 2013.2. a20.g0f669d5. zip glance. tests.unit. common. test_wsgi: JSONRequestDese rializerTest. test_get_ bind_addr_ default_ value
GLOB sdist-make: /home/ubuntu/
venv inst-nodeps: /home/ubuntu/
venv runtests: commands[0] | nosetests --tests=
JSONRequestDese rializerTest get_bind_ addr_default_ value OK 0.00
test_
------- ------- ------- ------- ------- ------- ------- ------- ------- -------
Ran 1 test in 0.004s
OK _______ _______ _______ _______ _______ _______ _______ _______ _______ _______ _____ summary _______ _______ _______ _______ _______ _______ _______ _______ _______ _______ _______ ______
_______
venv: commands succeeded
congratulations :)
It seems to work ok.
Just
$ tox -evenv
reproduces
I'm not sure if there's a 'better' way to run a single test which would reproduce without having to run all tests.