Bug 1474490 - directory structure flattened for task tarballs fetched via http
directory structure flattened for task tarballs fetched via http
Status: CLOSED CURRENTRELEASE
Product: Restraint
Classification: Community
Component: general (Show other bugs)
0.1.30
Unspecified Unspecified
unspecified Severity unspecified
: 0.1.31
: ---
Assigned To: Bill Peck
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-24 14:14 EDT by Merlin Mathesius
Modified: 2017-08-17 02:44 EDT (History)
4 users (show)

See Also:
Fixed In Version: 0.1.31
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-08-14 08:15:07 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Merlin Mathesius 2017-07-24 14:14:51 EDT
Description of problem:

When a restraint task is fetched as a tarball using http(s), and that tarball contains one or more nested subdirectories, the directory structure gets flattened so that everything is unpacked into a single directory. However, the contained 'runtesk.sh' most likely expects the original directory hierarchy.

Version-Release number of selected component (if applicable):
restraint-0.1.30-1.git.7.37b1b04.fc26.x86_64

How reproducible:
Always

Steps to Reproduce:

1. Create a test tarball containing hierarchical directory structure. For example (from https://upstreamfirst.fedorainfracloud.org/cronie/blob/master/f/anacron-segfaults-with-certain-config-data-2):

----------
$ tar tzvf /var/www-test/anacron-segfaults-with-certain-config-data-2.tgz
drwxr-xr-x root/root         0 2017-07-24 14:35 anacron-segfaults-with-certain-config-data-2/
drwxr-xr-x root/root         0 2017-07-24 14:35 anacron-segfaults-with-certain-config-data-2/configs/
-rw-r--r-- root/root       600 2017-07-24 14:35 anacron-segfaults-with-certain-config-data-2/configs/scenario-02_0
-rw-r--r-- root/root       526 2017-07-24 14:35 anacron-segfaults-with-certain-config-data-2/configs/scenario-05_1
-rw-r--r-- root/root       630 2017-07-24 14:35 anacron-segfaults-with-certain-config-data-2/configs/scenario-03_1
-rw-r--r-- root/root       598 2017-07-24 14:35 anacron-segfaults-with-certain-config-data-2/configs/scenario-01_1
-rw-r--r-- root/root       616 2017-07-24 14:35 anacron-segfaults-with-certain-config-data-2/configs/scenario-04_1
-rw-r--r-- root/root       197 2017-07-24 14:35 anacron-segfaults-with-certain-config-data-2/PURPOSE
-rw-r--r-- root/root      2520 2017-07-24 14:35 anacron-segfaults-with-certain-config-data-2/runtest.sh
-rw-r--r-- root/root      2270 2017-07-24 14:35 anacron-segfaults-with-certain-config-data-2/Makefile
$
----------

2. Place that tarball on a web server and reference it as a task in a job.xml file.

3. Run the task using restraint client.

4. The runtest.sh contained in this example fails because it cannot find the expected contents in the "configs" subdirectory.

5. The tarball that was unpacked by restraintd can be found on the filesystem:

--------
$ cd /mnt/tests/localhost:8888/anacron-segfaults-with-certain-config-data-2.tgz
$ find . -ls
   917560      4 drwxr-xr-x   4  root     root         4096 Jul 24 14:36 .
   917562      4 drwxr-xr-x   2  root     root         4096 Jul 24 14:36 ./configs
   917568      4 -rw-r--r--   1  root     root          197 Jul 24 14:36 ./PURPOSE
   917563      4 -rw-r--r--   1  root     root          600 Jul 24 14:36 ./scenario-02_0
   917569      4 -rwxr-xr-x   1  root     root         2520 Jul 24 14:36 ./runtest.sh
   917570      4 -rw-r--r--   1  root     root         2270 Jul 24 14:36 ./Makefile
   917564      4 -rw-r--r--   1  root     root          526 Jul 24 14:36 ./scenario-05_1
   917565      4 -rw-r--r--   1  root     root          630 Jul 24 14:36 ./scenario-03_1
   917571      4 -rw-r--r--   1  root     root          519 Jul 24 14:36 ./testinfo.desc
   917561      4 drwxr-xr-x   2  root     root         4096 Jul 24 14:36 ./anacron-segfaults-with-certain-config-data-2
   917566      4 -rw-r--r--   1  root     root          598 Jul 24 14:36 ./scenario-01_1
   917567      4 -rw-r--r--   1  root     root          616 Jul 24 14:36 ./scenario-04_1
$
--------

Actual results:
The directory structure of the fetched and expanded tarball has been flattened.

Expected results:
The directory structure of the fetched and expanded tarball is preserved.

Additional info:
Comment 1 Bill Peck 2017-07-25 10:15:13 EDT
https://gerrit.beaker-project.org/#/c/5763/

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