Running api_sample tests fails when doc is in a splitted path

Bug #1186775 reported by Dirk Mueller
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Dirk Mueller

Bug Description

When the nova module tests are installed in a different path than the integrated tests, running the tests fails with this error message:

15:34:11 Traceback (most recent call last):
15:34:11 File "/var/lib/openstack-nova-test/nova/tests/integrated/test_api_samples.py", line 2026, in setUp
15:34:11 self._post_server()
15:34:11 File "/var/lib/openstack-nova-test/nova/tests/integrated/test_api_samples.py", line 450, in _post_server
15:34:11 return self._verify_response('server-post-resp', subs, response)
15:34:11 File "/var/lib/openstack-nova-test/nova/tests/integrated/test_api_samples.py", line 288, in _verify_response
15:34:11 with file(self._get_sample(name)) as sample:
15:34:11 IOError: [Errno 2] No such file or directory: '/var/lib/openstack-nova-test/nova/tests/integrated/../../../doc/api_samples/os-simple-tenant-usage/server-post-resp.xml'
15:34:11

This is due to symlink backlinks "/../../../" traversing into the wrong directory tree, and therefore never finding the doc/ subdir.

This regression was introduced by https://review.openstack.org/#/c/12246/

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/31450

Changed in nova:
assignee: nobody → Dirk Mueller (dmllr)
status: New → In Progress
Revision history for this message
Dirk Mueller (dmllr) wrote :

/var/lib/openstack-nova-test/

is a subdirectory that contains these symlinks:

nova -> pointing to /usr/lib64/python*/site-packages/nova
doc -> pointing to /usr/share/doc/packages/nova/

the mentioned change makes test_integrated look into /usr/lib64/python*/site-packages/doc/api_samples for the api dumps. it should rather look into /var/lib/openstack-nova-test/doc/api_samples.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/31450
Committed: http://github.com/openstack/nova/commit/659d7730baa9f8702914b7e084aafb0e99fb48f5
Submitter: Jenkins
Branch: master

commit 659d7730baa9f8702914b7e084aafb0e99fb48f5
Author: Dirk Mueller <email address hidden>
Date: Sun Jun 2 17:15:34 2013 +0200

    Normalize path for finding api_samples dir

    When nova/tests/integrated and doc/api_samples are installed
    in different subtrees and are only combined via symlinks,
    running test_api_sample fails due to traversing into the
    wrong tree. Use path normalization to avoid this problem.

    Fixes: LP Bug #1186775

    Change-Id: Ibe9e2442dc9bf3ba7bcb429cbac124dcaeea2cef

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → havana-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: havana-2 → 2013.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.