Opened 8 weeks ago

Closed 7 weeks ago

Last modified 4 weeks ago

#28562 closed defect (fixed)

test: test_rebind.py doesn't use a temporary a DataDirectory

Reported by: dgoulet Owned by:
Priority: Medium Milestone: Tor: 0.4.0.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: tor-test
Cc: Actual Points:
Parent ID: Points:
Reviewer: dgoulet Sponsor:

Description

Riastradh on IRC reported this with test_rebind.sh:

Tor logged: "Nov 21 20:08:11.296 [warn] Error creating directory /home/riastradh/.tor:

That test is not using a temporary dir (example: mktemp -d) so tor is using the default one which is ~/.tor.

Really not good, out tests should not poke $HOME whatsoever unless we change it. Solution would be to create a temp dir, spawn Tor pointing it to that path and then remove it.

Child Tickets

Attachments (1)

test_rebind.patch (2.4 KB) - added by riastradh 8 weeks ago.
patch

Download all attachments as: .zip

Change History (9)

comment:1 Changed 8 weeks ago by teor

Let's make sure that all our tests are using a temporary data directory

Changed 8 weeks ago by riastradh

Attachment: test_rebind.patch added

patch

comment:2 Changed 8 weeks ago by riastradh

This is the only test that failed when I ran make check with a nonwritable $HOME. With the attached patch, the tests pass.

comment:3 Changed 8 weeks ago by teor

Status: newneeds_review

Thanks, someone should review this patch in the next week or so.

comment:4 Changed 8 weeks ago by dgoulet

Milestone: Tor: 0.3.5.x-finalTor: 0.4.0.x-final
Status: needs_reviewmerge_ready

I've put the patch in branch ticket28562_040_01
PR: https://github.com/torproject/tor/pull/539

Works good for me, lgtm; Lets feed Travis before any merge.

comment:5 Changed 7 weeks ago by dgoulet

Reviewer: dgoulet

comment:6 Changed 7 weeks ago by nickm

travis passes; merging.

comment:7 Changed 7 weeks ago by nickm

Resolution: fixed
Status: merge_readyclosed

comment:8 Changed 4 weeks ago by nickm

Cherry-picked this back to 0.3.5, and added a changes file.

Note: See TracTickets for help on using tickets.