The test shell preserves $HOME

Bug #1660174 reported by Naël
4
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Déjà Dup
Fix Released
Low
Naël

Bug Description

The test shell (deja-dup/tests/shell) states that it "[points] at a custom dconf location and $HOME". It does indeed setup a directory for storing the schema org.gnome.DejaDup, in the so-called "data playground" it creates in /tmp, but it does not touch $HOME (check with e.g. "printenv HOME").

Is this intentional? I expected $HOME to be adjusted to point to the so-called data playground.

The drawbacks of not adjusting $HOME are, in my opinion:

* backup tests using the default include-list ['$HOME'] backup the user's potentially very large home directory, instead of the much smaller data in the data playground

* backup tests using the default backup repository ($HOME/deja-dup) write data out of the data playground, leading at best to leftover data in $HOME after exiting the test shell, at worst to messing up with the user's backups if he actually stores them in the default location

Wouldn't adjusting $HOME to the data playground bring more peace of mind to hacking and testing, and be less prone to accidents? Would it cause problems I am not foreseeing?

This can be done by simply adding HOME="${ROOTDIR}" to the test shell's script, in the section "Create fake home environment" or "If we are in local mode, point at our own data files and built objects". I'm not sure of what is the non-local mode and what should happen for it.

Included is a trivial patch that can be applied on top of Déjà Dup's current revision 1570. All the tests (make check) pass. One can also check that the two drawbacks I mentioned are now avoided with "DEJA_DUP_DEBUG=1 deja-dup --backup > patch.log" and the default settings.

Related branches

Revision history for this message
Naël (nathanael-naeri) wrote :
Revision history for this message
Vej (vej) wrote :

I can confirm this as well.

Changed in deja-dup:
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Vej (vej) wrote :

@Nathanaël: The bug has been tested by me and seems to be fine. Thanks for taking the time to fix this.

I uploaded the patch to the branch lp:~vej/deja-dup/fix-home-in-test and will propose for merging.

Vej (vej)
Changed in deja-dup:
status: Triaged → Fix Committed
Revision history for this message
Naël (nathanael-naeri) wrote :

Thanks Vej!

Can't really tell it's Fix Committed until the merge is performed though. Looking forward to it!

Changed in deja-dup:
status: Fix Committed → In Progress
Naël (nathanael-naeri)
Changed in deja-dup:
assignee: nobody → Naël (nathanael-naeri)
Michael Terry (mterry)
Changed in deja-dup:
status: In Progress → Fix Committed
Revision history for this message
Vej (vej) wrote :

This had been released as a part of Déjà Dup 34.4.

Changed in deja-dup:
status: Fix Committed → Fix Released
assignee: Nathanaël Naeri (Naël) (nathanael-naeri) → nobody
Naël (nathanael-naeri)
Changed in deja-dup:
assignee: nobody → Nathanaël Naeri (Naël) (nathanael-naeri)
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.