Bug #8697
Step "I update APT using apt-get" succeeds even if apt-get update failed
100%
Description
Apparently, on apt-get
failure we display STDERR but don’t fail the step:
Scenario: Install packages using apt-get # features/apt.feature:25
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
[sudo] password for amnesia: W: Failed to fetch http://ftp.us.debian.org/debian/dists/experimental/main/i18n/Translation-en Hash Sum mismatch
E: Some index files failed to download. They have been ignored, or old ones used instead.
When I update APT using apt-get # features/step_definitions/apt.rb:15
… and the test passes.
Subtasks
History
#1 Updated by intrigeri 2015-01-14 13:22:21
- blocks #8538 added
#2 Updated by kytv 2015-01-16 12:23:25
- Status changed from Confirmed to In Progress
- Assignee set to kytv
#3 Updated by kytv 2015-01-16 13:28:38
- Assignee changed from kytv to anonym
- QA Check set to Ready for QA
- Feature Branch set to kytv:test/8697-update-apt-get
#4 Updated by kytv 2015-01-16 13:31:57
Confirmed with a buggy ISO: With this change the test will fail if the apt-get update step fails.
#5 Updated by kytv 2015-01-16 15:22:40
- Target version changed from Tails_1.4 to Tails_1.3
#6 Updated by intrigeri 2015-01-21 10:09:35
- Assignee changed from anonym to kytv
- % Done changed from 0 to 50
- QA Check changed from Ready for QA to Info Needed
Looks good, but is there any reason to keep the two
if !cmd.success?
STDERR.puts cmd.stderr
end
blocks?
It seems that execute_successfully
does it anyway, via assert_vmcommand_success
.
#7 Updated by kytv 2015-01-21 13:24:44
- Assignee changed from kytv to anonym
- QA Check changed from Info Needed to Ready for QA
intrigeri wrote:
> Looks good, but is there any reason to keep the two
>
> […]
>
> blocks?
>
> It seems that execute_successfully
does it anyway, via assert_vmcommand_success
.
You’re right, there’s no need for them; I removed them and ran the test. Due to a transient problem (woohoo!) the test failed.
debian.org/debian/dists/wheezy-backports/non-free/i18n/Translation-en Something wicked happened resolving 'ftp.us.debian.org:http' (-4 - Non-recoverable failure in name resolution)\n\nE: Some index files failed to download. They have been ignored, or old ones used instead.\n"]
When I update APT using apt-get # features/step_definitions/apt.rb:15
Command failed: echo asdf | sudo -S apt-get update
error code: 100
stderr:
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
[sudo] password for amnesia: [Jan 21 13:04:00] ERROR torsocks[5262]: Unable to resolve. Status reply: 4 (in socks5_recv_resolve_reply() at socks5.c:657)
[Jan 21 13:04:00] ERROR torsocks[5262]: Unable to resolve. Status reply: 4 (in socks5_recv_resolve_reply() at socks5.c:657)
[....lots of duplicate (other than timestamp) lines snipped....]
[Jan 21 13:04:50] ERROR torsocks[5262]: Unable to resolve. Status reply: 4 (in socks5_recv_resolve_reply() at socks5.c:657)
W: Failed to fetch tor+http://ftp.us.debian.org/debian/dists/wheezy/Release.gpg Something wicked happened resolving 'ftp.us.debian.org:http' (-4 - Non-recoverable failure in name resolution)
W: Failed to fetch tor+http://ftp.us.debian.org/debian/dists/experimental/Release.gpg Something wicked happened resolving 'ftp.us.debian.org:http' (-4 - Non-recoverable failure in name resolution)
W: Failed to fetch tor+http://ftp.us.debian.org/debian/dists/unstable/Release.gpg Something wicked happened resolving 'ftp.us.debian.org:http' (-4 - Non-recoverable failure in name resolution)
W: Failed to fetch tor+http://ftp.us.debian.org/debian/dists/testing/Release.gpg Something wicked happened resolving 'ftp.us.debian.org:http' (-4 - Non-recoverable failure in name resolution)
W: Failed to fetch tor+http://ftp.us.debian.org/debian/dists/wheezy-backports/Release.gpg Something wicked happened resolving 'ftp.us.debian.org:http' (-4 - Non-recoverable failure in name resolution)
W: Failed to fetch tor+http://ftp.us.debian.org/debian/dists/wheezy/main/binary-i386/Packages Something wicked happened resolving 'ftp.us.debian.org:http' (-4 - Non-recoverable failure in name resolution)
W: Failed to fetch tor+http://ftp.us.debian.org/debian/dists/wheezy/contrib/binary-i386/Packages Something wicked happened resolving 'ftp.us.debian.org:http' (-4 - Non-recoverable failure in name resolution)
W: Failed to fetch tor+http://ftp.us.debian.org/debian/dists/wheezy/non-free/binary-i386/Packages Something wicked happened resolving 'ftp.us.debian.org:http' (-4 - Non-recoverable failure in name resolution)
W: Failed to fetch tor+http://ftp.us.debian.org/debian/dists/wheezy/contrib/i18n/Translation-en Something wicked happened resolving 'ftp.us.debian.org:http' (-4 - Non-recoverable failure in name resolution)
W: Failed to fetch tor+http://ftp.us.debian.org/debian/dists/wheezy/main/i18n/Translation-en Something wicked happened resolving 'ftp.us.debian.org:http' (-4 - Non-recoverable failure in name resolution)
W: Failed to fetch tor+http://ftp.us.debian.org/debian/dists/wheezy/non-free/i18n/Translation-en Something wicked happened resolving 'ftp.us.debian.org:http' (-4 - Non-recoverable failure in name resolution)
W: Failed to fetch tor+http://ftp.us.debian.org/debian/dists/experimental/main/binary-i386/Packages Something wicked happened resolving 'ftp.us.debian.org:http' (-4 - Non-recoverable failure in name resolution)
W: Failed to fetch tor+http://ftp.us.debian.org/debian/dists/experimental/main/i18n/Translation-en Something wicked happened resolving 'ftp.us.debian.org:http' (-4 - Non-recoverable failure in name resolution)
W: Failed to fetch tor+http://ftp.us.debian.org/debian/dists/unstable/main/binary-i386/Packages Something wicked happened resolving 'ftp.us.debian.org:http' (-4 - Non-recoverable failure in name resolution)
W: Failed to fetch tor+http://ftp.us.debian.org/debian/dists/unstable/contrib/binary-i386/Packages Something wicked happened resolving 'ftp.us.debian.org:http' (-4 - Non-recoverable failure in name resolution)
W: Failed to fetch tor+http://ftp.us.debian.org/debian/dists/unstable/non-free/binary-i386/Packages Something wicked happened resolving 'ftp.us.debian.org:http' (-4 - Non-recoverable failure in name resolution)
W: Failed to fetch tor+http://ftp.us.debian.org/debian/dists/unstable/contrib/i18n/Translation-en Something wicked happened resolving 'ftp.us.debian.org:http' (-4 - Non-recoverable failure in name resolution)
W: Failed to fetch tor+http://ftp.us.debian.org/debian/dists/unstable/main/i18n/Translation-en Something wicked happened resolving 'ftp.us.debian.org:http' (-4 - Non-recoverable failure in name resolution)
W: Failed to fetch tor+http://ftp.us.debian.org/debian/dists/unstable/non-free/i18n/Translation-en Something wicked happened resolving 'ftp.us.debian.org:http' (-4 - Non-recoverable failure in name resolution)
W: Failed to fetch tor+http://ftp.us.debian.org/debian/dists/testing/main/binary-i386/Packages Something wicked happened resolving 'ftp.us.debian.org:http' (-4 - Non-recoverable failure in name resolution)
W: Failed to fetch tor+http://ftp.us.debian.org/debian/dists/testing/contrib/binary-i386/Packages Something wicked happened resolving 'ftp.us.debian.org:http' (-4 - Non-recoverable failure in name resolution)
W: Failed to fetch tor+http://ftp.us.debian.org/debian/dists/testing/non-free/binary-i386/Packages Something wicked happened resolving 'ftp.us.debian.org:http' (-4 - Non-recoverable failure in name resolution)
W: Failed to fetch tor+http://ftp.us.debian.org/debian/dists/testing/contrib/i18n/Translation-en Something wicked happened resolving 'ftp.us.debian.org:http' (-4 - Non-recoverable failure in name resolution)
W: Failed to fetch tor+http://ftp.us.debian.org/debian/dists/testing/main/i18n/Translation-en Something wicked happened resolving 'ftp.us.debian.org:http' (-4 - Non-recoverable failure in name resolution)
W: Failed to fetch tor+http://ftp.us.debian.org/debian/dists/testing/non-free/i18n/Translation-en Something wicked happened resolving 'ftp.us.debian.org:http' (-4 - Non-recoverable failure in name resolution)
W: Failed to fetch tor+http://ftp.us.debian.org/debian/dists/wheezy-backports/main/binary-i386/Packages Something wicked happened resolving 'ftp.us.debian.org:http' (-4 - Non-recoverable failure in name resolution)
W: Failed to fetch tor+http://ftp.us.debian.org/debian/dists/wheezy-backports/contrib/binary-i386/Packages Something wicked happened resolving 'ftp.us.debian.org:http' (-4 - Non-recoverable failure in name resolution)
W: Failed to fetch tor+http://ftp.us.debian.org/debian/dists/wheezy-backports/non-free/binary-i386/Packages Something wicked happened resolving 'ftp.us.debian.org:http' (-4 - Non-recoverable failure in name resolution)
W: Failed to fetch tor+http://ftp.us.debian.org/debian/dists/wheezy-backports/contrib/i18n/Translation-en Something wicked happened resolving 'ftp.us.debian.org:http' (-4 - Non-recoverable failure in name resolution)
W: Failed to fetch tor+http://ftp.us.debian.org/debian/dists/wheezy-backports/main/i18n/Translation-en Something wicked happened resolving 'ftp.us.debian.org:http' (-4 - Non-recoverable failure in name resolution)
W: Failed to fetch tor+http://ftp.us.debian.org/debian/dists/wheezy-backports/non-free/i18n/Translation-en Something wicked happened resolving 'ftp.us.debian.org:http' (-4 - Non-recoverable failure in name resolution)
E: Some index files failed to download. They have been ignored, or old ones used instead.
(MiniTest::Assertion)
./features/support/helpers/misc_helpers.rb:9:in `assert_vmcommand_success'
./features/support/helpers/vm_helper.rb:335:in `execute_successfully'
./features/step_definitions/apt.rb:18:in `block (2 levels) in <top (required)>'
/usr/lib/ruby/1.9.1/timeout.rb:68:in `timeout'
./features/step_definitions/apt.rb:17:in `/^I update APT using apt-get$/'
features/apt.feature:26:in `When I update APT using apt-get'
Then I should be able to install a package using apt-get # features/step_definitions/apt.rb:23
And all Internet traffic has only flowed through Tor
#8 Updated by Tails 2015-01-23 10:29:48
- Status changed from In Progress to Fix committed
- % Done changed from 50 to 100
Applied in changeset commit:1c69c4f7cb18bb98002b9e815acfb163b9189db7.
#9 Updated by anonym 2015-01-23 10:36:07
- Assignee deleted (
anonym) - QA Check deleted (
Ready for QA)
I took the liberty of pushing a small fixup that removes the now unused variable cmd
. Then I tested both the success and failure mode. Merged!
#10 Updated by BitingBird 2015-01-26 14:59:03
- QA Check set to Pass
#11 Updated by kytv 2015-02-09 20:40:58
anonym wrote:
> I took the liberty of pushing a small fixup that removes the now unused variable cmd
.
Thank you for that.
> Then I tested both the success and failure mode. Merged!
Woohoo
#12 Updated by BitingBird 2015-02-24 22:44:41
- Status changed from Fix committed to Resolved