Bug 731322 - network test gives 404 when trying fetching files from servers
Summary: network test gives 404 when trying fetching files from servers
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Hardware Certification Program
Classification: Red Hat
Component: Test Suite (tests)
Version: 1.3
Hardware: All
OS: Linux
high
high
Target Milestone: ---
: ---
Assignee: Greg Nichols
QA Contact: Guangze Bai
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-08-17 10:49 UTC by Caspar Zhang
Modified: 2015-02-08 21:36 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
An enhancement has been made in v7 1.4 that v7 server stores http transfer file in a new directory "/var/www/v7/transfer" on server side in network testing instead of original place: "/var/v7/store". Note that this enhancement causes v7 configuration file change, user should remove /etc/v7.xml on both server side and SUT side before executing v7 tests.
Clone Of:
Environment:
Last Closed: 2011-11-08 15:43:48 UTC


Attachments (Terms of Use)
a simple patch to fix 404 error (930 bytes, patch)
2011-08-18 04:08 UTC, Caspar Zhang
no flags Details | Diff
a more complex version of fix (3.89 KB, patch)
2011-08-18 04:24 UTC, Caspar Zhang
no flags Details | Diff
A patch to change the network test to use its own transfer area (2.54 KB, patch)
2011-08-18 14:35 UTC, Greg Nichols
no flags Details | Diff
Patch to change the network test to uses it's own transfer area (corrected) (4.03 KB, patch)
2011-08-18 14:39 UTC, Greg Nichols
no flags Details | Diff


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1436 normal SHIPPED_LIVE v7 bug fix and enhancement update 2011-11-08 23:28:41 UTC

Description Caspar Zhang 2011-08-17 10:49:05 UTC
Description of problem:

network test gives following error in HTTP transfer testing.

<output name="HTTP" description="HTTP file transfer test">
sending file /var/www/html/httptest.file hash: a8598ed76362cec7ff3170912b694b31
response: 
    Saved: /var/v7/store/10.16.65.145/httptest.file
    From IP: 10.16.65.145
    checksum: a8598ed76362cec7ff3170912b694b31

Upload took 3.11 seconds, 7.12 MB/sec
getting file http://ibm-z10-06.rhts.eng.bos.redhat.com/v7/store/10.16.65.145/httptest.file 
Error: test raised exception:
HTTP Error 404: Not Found

A similar instance is in Beaker:

https://beaker.engineering.redhat.com/jobs/120847

http://beaker-archive.app.eng.bos.redhat.com/beaker-logs/2011/08/1208/120847/248661/2693085/13656829//test_log-v7-network.log

http://beaker-archive.app.eng.bos.redhat.com/beaker-logs/2011/08/1208/120847/248662/2693088/13656347//test_log-v7-network.log

besides the 404, the response message was malformed.

Version-Release number of selected component (if applicable):
1.4 R16 (both server and client)

How reproducible:
always

Comment 1 Greg Nichols 2011-08-17 13:45:57 UTC
Is selinux on ibm-z10-06.rhts.eng.bos.redhat.com enforcing?

Comment 2 Caspar Zhang 2011-08-17 13:50:04 UTC
permissive

Comment 3 Caspar Zhang 2011-08-18 04:08:36 UTC
Created attachment 518792 [details]
a simple patch to fix 404 error

I find what happened to produce the 404. it was caused due to store directory path error.

A simple fix is attached.

Comment 4 Caspar Zhang 2011-08-18 04:24:28 UTC
Created attachment 518798 [details]
a more complex version of fix

However, we could think someway to avoid such mistake happen again in codes. I find "store" dir is similar to "export" dir, they were both under /var/v7 and then moved to /var/www/v7 later. In environment.py, export was used as an element for v7ServerDirectory key, but store used as the same level of v7ServerDirectory key. Could we convert it to an element as well?

Here is a new patch to convert v7 store as an element.

Comment 5 Greg Nichols 2011-08-18 14:20:21 UTC
That patch would break the "save" command on the SUT, as it currently saves copies of results to /var/v7/store.

This issue here is that currently, the server uses /var/www/v7 while the SUT uses /var/v7.  The server uses /var/www/v7 because it needs httpd to serve files and run cgi from there. 

There are a few different options for fixing this bug:

1) make both SUT and server use /var/www/v7.   This will make the code simpler and more maintainable, but my cause users some confusion.

2) remove the getStoreDirectory function from environment.py, as the caller (server vs. SUT) needs to use getServerDirectory vs. getDataDirectory depending on whether it's server-side or SUT-side code.

3) It seems arbirary that both the server-side of the network test, and the SUT's save (local) command use the "store" directory.  Perhaps the server-side of the network test (v7/server/cgi/networkTest.py), and the URL used by the SUT network test should use a separate area for http transfers.  Perhaps /var/www/v7/transfer (httpd configured as /v7/transfer) would be for the network file transfer test.

I'd recommend option 3) as it seems to me to be the clearest and most maintainable.

Comment 6 Greg Nichols 2011-08-18 14:35:53 UTC
Created attachment 518883 [details]
A patch to change the network test to use its own transfer area

Per option 3 of the above comment.

Comment 7 Greg Nichols 2011-08-18 14:39:56 UTC
Created attachment 518885 [details]
Patch to change the network test to uses it's own transfer area (corrected)

Comment 9 Greg Nichols 2011-08-18 19:06:57 UTC
Committed to R17

Comment 15 Caspar Zhang 2011-10-21 15:32:35 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
An enhancement has been made in v7 1.4 that v7 server stores http transfer file in a new directory "/var/www/v7/transfer" on server side in network testing instead of original place: "/var/v7/store".

Note that this enhancement causes v7 configuration file change, user should remove /etc/v7.xml on both server side and SUT side before executing v7 tests.

Comment 16 errata-xmlrpc 2011-11-08 15:43:48 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2011-1436.html

Comment 17 errata-xmlrpc 2011-11-08 18:31:30 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2011-1436.html


Note You need to log in before you can comment on or make changes to this bug.