Bug #17547

Test suite doesn't like symlinks

Added by CyrilBrulebois 2020-03-24 09:42:17 . Updated 2020-03-25 10:28:55 .

Status:
Confirmed
Priority:
Normal
Assignee:
Category:
Test suite
Target version:
Start date:
Due date:
% Done:

0%

Feature Branch:
Type of work:
Code
Blueprint:

Starter:
Affected tool:
Deliverable for:

Description

Context: I was wondering whether I could avoid some duplication, and stash built IMG/ISO files directly into my isos.git git-annex repository, and work from there.

It’s mostly OK, except for a little tweak to release_process.mdwn just pushed to master (commit:61192a254769651fae3b6fbf5102407250fe9bc0).

The other issue is the test suite, which doesn’t like those symlinks:

kibi@armor:~/work/clients/tails/release/release-checkout$ sudo TMPDIR=~/TT ./run_test_suite --view --capture --iso ../isos.git/tails-amd64-4.4.1/tails-amd64-4.4.1.iso -- features/torified_browsing.feature
Virtual X framebuffer started on display :2
VNC server running on: localhost:5900
[info] runcmd: lsb_release -i -r -s 
@product
Feature: Browsing the web using the Tor Browser
  As a Tails user
  when I browse the web using the Tor Browser
  all Internet traffic should flow only through Tor

The specified Tails IMG image '/home/kibi/work/clients/tails/release/isos.git/.git/annex/objects/Kq/55/SHA256E-s1151539200--2809f0a1a2e7e911324c77b4a77e4c21a966a50ea9d8db9b0d1a6541fc8c4ca2.1.img/SHA256E-s1151539200--2809f0a1a2e7e911324c77b4a77e4c21a966a50ea9d8db9b0d1a6541fc8c4ca2.1.iso' does not exist (RuntimeError)
/home/kibi/work/clients/tails/release/release-checkout/features/support/hooks.rb:185:in `block (2 levels) in <top (required)>'
/home/kibi/work/clients/tails/release/release-checkout/features/support/hooks.rb:165:in `each'
/home/kibi/work/clients/tails/release/release-checkout/features/support/hooks.rb:165:in `block in <top (required)>'
/home/kibi/work/clients/tails/release/release-checkout/features/support/extra_hooks.rb:32:in `invoke'
/home/kibi/work/clients/tails/release/release-checkout/features/support/extra_hooks.rb:103:in `block in before_feature'
/home/kibi/work/clients/tails/release/release-checkout/features/support/extra_hooks.rb:102:in `each'
/home/kibi/work/clients/tails/release/release-checkout/features/support/extra_hooks.rb:102:in `before_feature'
[…]

and indeed, the “let’s assume IMG and ISO only differ by their suffix” assumption I’ve implemented when working on test suite support for USB images doesn’t hold once one has dereferenced links:

kibi@armor:~/work/clients/tails/release/release-checkout$ readlink ../isos.git/tails-amd64-4.4.1/tails-amd64-4.4.1.{img,iso}
../.git/annex/objects/3w/gX/SHA256E-s1161822208--676fb78a34fe2d75e84ed51fb695c286c15652f1d90fc8cfd0729a846e00d5ab.1.img/SHA256E-s1161822208--676fb78a34fe2d75e84ed51fb695c286c15652f1d90fc8cfd0729a846e00d5ab.1.img
../.git/annex/objects/Kq/55/SHA256E-s1151539200--2809f0a1a2e7e911324c77b4a77e4c21a966a50ea9d8db9b0d1a6541fc8c4ca2.1.iso/SHA256E-s1151539200--2809f0a1a2e7e911324c77b4a77e4c21a966a50ea9d8db9b0d1a6541fc8c4ca2.1.iso

Relevant code excerpts are likely:

features/support/config.rb:TAILS_ISO = ENV['TAILS_ISO']
features/support/config.rb:TAILS_IMG = TAILS_ISO.sub(/\.iso/, '.img')
features/support/config.rb:OLD_TAILS_ISO = ENV['OLD_TAILS_ISO'] || TAILS_ISO
features/support/config.rb:OLD_TAILS_IMG = OLD_TAILS_ISO.sub(/\.iso/, '.img')

run_test_suite:            export TAILS_ISO="$(readlink -f $1)"
run_test_suite:            export OLD_TAILS_ISO="$(readlink -f $1)"

An (untested) approach might be to defer the readlink -f code from run_test_suite to after the dance involving {,OLD_}TAILS_{IMG,ISO} variables?

intrigeri, anonym: why do you think?


Subtasks


Related issues

Blocks Tails - Feature #16209: Core work: Foundations Team Confirmed

History

#1 Updated by intrigeri 2020-03-25 10:28:55

Hi,

> An (untested) approach might be to defer the readlink -f code from run_test_suite to after the dance involving {,OLD_}TAILS_{IMG,ISO} variables?

Sounds good to me.
And in principle, moving code from shell to Ruby is a good move IMO.

#2 Updated by intrigeri 2020-03-25 10:29:00