Bug 1806046 - rstrnt-backup/rstrnt-restore need updating
Summary: rstrnt-backup/rstrnt-restore need updating
Alias: None
Product: Restraint
Classification: Retired
Component: general
Version: 0.1.44
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: beaker-dev-list
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2020-02-21 21:25 UTC by Carol Bouchard
Modified: 2020-03-12 19:54 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2020-03-12 19:54:36 UTC

Attachments (Terms of Use)

Description Carol Bouchard 2020-02-21 21:25:38 UTC
Description of problem:
While preparing documentation for restraint, I observed that rstrnt-backup/rstrnt-restore are using ${HARNESS_PREFIX}RUNPATH))/backup as a default path.  There does not exist an environment variable ${HARNESS_PREFIX}RUNPATH so you end up creating a directory /backup.  Perhaps it would be better to put it in another well known restraint subdirectory.  Minimally remove reference to directories in the scripts which do not exist.
2) When running the backup script with 'bash -x rstrnt-backup', I observed the following error.  Let's fix this.  rstrnt-restore should also be reviewed.
+ mkdir -p /backup/tmp
+ true
+ cp -fac /tmp/cbouchar.txt /backup/tmp
cp: warning: option '-c' is deprecated, please use '--preserve=context' instead

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
These anomalies can be observed with the following tasks (the 2nd task in particular):
     <task name="/distribution/command" role="STANDALONE">
          <param name="CMDS_TO_RUN" value="set +x ; echo &quot;this is a test&quot; &gt;&gt; /tmp/cbouchar.txt"/>
      <task name="/distribution/command" role="STANDALONE">
          <param name="CMDS_TO_RUN" value="set +x ; bash -x rstrnt-backup /tmp/cbouchar.txt; echo $RSTRNT_RUNPATH; rm /tmp/cbouchar.txt"/>
      <task name="/distribution/command" role="STANDALONE">
          <param name="CMDS_TO_RUN" value="set +x ; cat /tmp/cbouchar.txt"/>

Actual results:

Expected results:

Additional info:

Comment 1 Daniel Rodríguez 2020-03-12 14:31:39 UTC
Regarding "${HARNESS_PREFIX}RUNPATH))/backup", as it looks like very legacy thing, and we don't know if there is anybody relying on it, I would suggest to keep it as it is, and in documentation state that:

  The default path for backup and restore is "/backup". To use a different path the "RSTRNT_BACKUP_DIR" environment variable must be set.

Comment 2 Carol Bouchard 2020-03-12 19:54:36 UTC
I agree.  I grepped the rhts scripts and didn't find anything but you don't know what introduced it in the first place. I'll add it to my rhts conversion documentation.  I'm next focusing on environment variables like this.  This will be difficult to identify but I'll do my best.  Closing with 'WONT FIX'.  I'd like to change this but I don't think we can.

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