summaryrefslogtreecommitdiffstats
path: root/features
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2016-05-23 08:54:23 +0000
committerintrigeri <intrigeri@boum.org>2016-05-23 08:54:23 +0000
commitcb1196fd388f053a0d651bc1400e2908b8cfe596 (patch)
tree4dc15fd6cec5cd87aaf38b7c14cb6a03d8e271ea /features
parentd84fd618179a7401f0ff028da976437d819c254a (diff)
parent76257e673e0602de009280842d1af78c1ea50ad6 (diff)
Merge branch 'test/10497-tor-bootstrap-is-fragile' into test/10381-fix-I-open-the-address-test-is-fragile
Diffstat (limited to 'features')
-rw-r--r--features/apt.feature2
-rw-r--r--features/build.feature210
-rw-r--r--features/step_definitions/build.rb41
-rw-r--r--features/support/env.rb36
4 files changed, 284 insertions, 5 deletions
diff --git a/features/apt.feature b/features/apt.feature
index 1a9587d..b0ece1f 100644
--- a/features/apt.feature
+++ b/features/apt.feature
@@ -9,7 +9,7 @@ Feature: Installing packages through APT
Given I have started Tails from DVD and logged in with an administration password and the network is connected
Scenario: APT sources are configured correctly
- Then the only hosts in APT sources are "ftp.us.debian.org,security.debian.org,backports.debian.org,deb.tails.boum.org,deb.torproject.org,mozilla.debian.net"
+ Then the only hosts in APT sources are "ftp.us.debian.org,security.debian.org,deb.tails.boum.org,deb.torproject.org"
#10496: apt-get scenarios are fragile
@check_tor_leaks @fragile
diff --git a/features/build.feature b/features/build.feature
index 583a214..9042476 100644
--- a/features/build.feature
+++ b/features/build.feature
@@ -24,6 +24,34 @@ Feature: custom APT sources to build branches
And I should see the 'bugfix-bar' suite
But I should not see the '1.0' suite
+ Scenario: build from an untagged stable branch with no encoded time-based snapshot
+ Given I am working on the stable base branch
+ And Tails 0.10 has been released
+ And the last versions mentioned in debian/changelog are 0.10 and 1.0
+ And Tails 1.0 has not been released yet
+ And no frozen APT snapshot is encoded in config/APT_snapshots.d
+ When I successfully run "apt-snapshots-serials prepare-build"
+ And I successfully run "apt-mirror debian"
+ Then I should see the 0.10 tagged snapshot
+ When I successfully run "apt-mirror torproject"
+ Then I should see the 0.10 tagged snapshot
+ When I successfully run "apt-mirror debian-security"
+ Then I should see a time-based snapshot
+
+ Scenario: build from an untagged stable branch with encoded time-based snapshots
+ Given I am working on the stable base branch
+ And Tails 0.10 has been released
+ And the last versions mentioned in debian/changelog are 0.10 and 1.0
+ And Tails 1.0 has not been released yet
+ And frozen APT snapshots are encoded in config/APT_snapshots.d
+ When I successfully run "apt-snapshots-serials prepare-build"
+ And I successfully run "apt-mirror debian"
+ Then I should see a time-based snapshot
+ When I successfully run "apt-mirror torproject"
+ Then I should see a time-based snapshot
+ When I successfully run "apt-mirror debian-security"
+ Then I should see a time-based snapshot
+
Scenario: build from a tagged stable branch where the config/APT_overlays.d directory is empty
Given Tails 0.10 has been released
And the last version mentioned in debian/changelog is 0.10
@@ -40,6 +68,32 @@ Feature: custom APT sources to build branches
When I run tails-custom-apt-sources
Then it should fail
+ Scenario: build from a tagged stable branch with no encoded time-based snapshot
+ Given I am working on the stable base branch
+ And Tails 0.10 has been released
+ And the last version mentioned in debian/changelog is 0.10
+ And no frozen APT snapshot is encoded in config/APT_snapshots.d
+ When I successfully run "apt-snapshots-serials prepare-build"
+ And I successfully run "apt-mirror debian"
+ Then I should see the 0.10 tagged snapshot
+ When I successfully run "apt-mirror torproject"
+ Then I should see the 0.10 tagged snapshot
+ When I successfully run "apt-mirror debian-security"
+ Then I should see the 0.10 tagged snapshot
+
+ Scenario: build from a tagged stable branch with encoded time-based snapshots
+ Given I am working on the stable base branch
+ And Tails 0.10 has been released
+ And the last version mentioned in debian/changelog is 0.10
+ And frozen APT snapshots are encoded in config/APT_snapshots.d
+ When I successfully run "apt-snapshots-serials prepare-build"
+ And I successfully run "apt-mirror debian"
+ Then I should see the 0.10 tagged snapshot
+ When I successfully run "apt-mirror torproject"
+ Then I should see the 0.10 tagged snapshot
+ When I successfully run "apt-mirror debian-security"
+ Then I should see the 0.10 tagged snapshot
+
Scenario: build from a bugfix branch without overlays for a stable release
Given Tails 0.10 has been released
And the last version mentioned in debian/changelog is 0.10.1
@@ -62,6 +116,34 @@ Feature: custom APT sources to build branches
And I should see the 'bugfix-bar' suite
But I should not see the '0.10' suite
+ Scenario: build from a bugfix branch with no encoded time-based snapshot for a stable release
+ Given Tails 0.10 has been released
+ And the last version mentioned in debian/changelog is 0.10.1
+ And Tails 0.10.1 has not been released yet
+ And I am working on the bugfix/disable_gdomap branch based on stable
+ And no frozen APT snapshot is encoded in config/APT_snapshots.d
+ When I successfully run "apt-snapshots-serials prepare-build"
+ And I successfully run "apt-mirror debian"
+ Then I should see the 0.10 tagged snapshot
+ When I successfully run "apt-mirror torproject"
+ Then I should see the 0.10 tagged snapshot
+ When I successfully run "apt-mirror debian-security"
+ Then I should see a time-based snapshot
+
+ Scenario: build from a bugfix branch with encoded time-based snapshots for a stable release
+ Given Tails 0.10 has been released
+ And the last version mentioned in debian/changelog is 0.10.1
+ And Tails 0.10.1 has not been released yet
+ And I am working on the bugfix/disable_gdomap branch based on stable
+ And frozen APT snapshots are encoded in config/APT_snapshots.d
+ When I successfully run "apt-snapshots-serials prepare-build"
+ And I successfully run "apt-mirror debian"
+ Then I should see a time-based snapshot
+ When I successfully run "apt-mirror torproject"
+ Then I should see a time-based snapshot
+ When I successfully run "apt-mirror debian-security"
+ Then I should see a time-based snapshot
+
Scenario: build from an untagged testing branch where the config/APT_overlays.d directory is empty
Given I am working on the testing base branch
And the last version mentioned in debian/changelog is 0.11
@@ -85,6 +167,34 @@ Feature: custom APT sources to build branches
And I should see the 'bugfix-bar' suite
But I should not see the '0.11' suite
+ Scenario: build from an untagged testing branch with no encoded time-based snapshot
+ Given I am working on the testing base branch
+ And Tails 0.10 has been released
+ And the last versions mentioned in debian/changelog are 0.10 and 1.0
+ And Tails 1.0 has not been released yet
+ And no frozen APT snapshot is encoded in config/APT_snapshots.d
+ When I successfully run "apt-snapshots-serials prepare-build"
+ And I successfully run "apt-mirror debian"
+ Then I should see a time-based snapshot
+ When I successfully run "apt-mirror torproject"
+ Then I should see a time-based snapshot
+ When I successfully run "apt-mirror debian-security"
+ Then I should see a time-based snapshot
+
+ Scenario: build from an untagged testing branch with encoded time-based snapshots
+ Given I am working on the testing base branch
+ And Tails 0.10 has been released
+ And the last versions mentioned in debian/changelog are 0.10 and 1.0
+ And Tails 1.0 has not been released yet
+ And frozen APT snapshots are encoded in config/APT_snapshots.d
+ When I successfully run "apt-snapshots-serials prepare-build"
+ And I successfully run "apt-mirror debian"
+ Then I should see a time-based snapshot
+ When I successfully run "apt-mirror torproject"
+ Then I should see a time-based snapshot
+ When I successfully run "apt-mirror debian-security"
+ Then I should see a time-based snapshot
+
Scenario: build from a tagged testing branch where the config/APT_overlays.d directory is empty
Given I am working on the testing base branch
And the last version mentioned in debian/changelog is 0.11
@@ -101,6 +211,32 @@ Feature: custom APT sources to build branches
When I run tails-custom-apt-sources
Then it should fail
+ Scenario: build from a tagged testing branch with no encoded time-based snapshot
+ Given I am working on the testing base branch
+ And the last version mentioned in debian/changelog is 0.11
+ And Tails 0.11 has been released
+ And no frozen APT snapshot is encoded in config/APT_snapshots.d
+ When I successfully run "apt-snapshots-serials prepare-build"
+ And I run "apt-mirror debian"
+ Then it should fail
+ When I run "apt-mirror torproject"
+ Then it should fail
+ When I successfully run "apt-mirror debian-security"
+ Then I should see the 0.11 tagged snapshot
+
+ Scenario: build from a tagged testing branch with encoded time-based snapshots
+ Given I am working on the testing base branch
+ And the last version mentioned in debian/changelog is 0.11
+ And Tails 0.11 has been released
+ And frozen APT snapshots are encoded in config/APT_snapshots.d
+ When I successfully run "apt-snapshots-serials prepare-build"
+ And I successfully run "apt-mirror debian"
+ Then I should see the 0.11 tagged snapshot
+ When I successfully run "apt-mirror torproject"
+ Then I should see the 0.11 tagged snapshot
+ When I successfully run "apt-mirror debian-security"
+ Then I should see the 0.11 tagged snapshot
+
Scenario: build a release candidate from a tagged testing branch
Given I am working on the testing base branch
And Tails 0.11 has been released
@@ -119,6 +255,36 @@ Feature: custom APT sources to build branches
When I run tails-custom-apt-sources
Then it should fail
+ Scenario: build from a bugfix branch with no encoded time-based snapshot for a major release
+ Given I am working on the testing base branch
+ And Tails 0.10~rc1 has been released
+ And the last versions mentioned in debian/changelog are 0.10~rc1 and 0.10
+ And Tails 0.10 has not been released yet
+ And I am working on the bugfix/disable_gdomap branch based on testing
+ And no frozen APT snapshot is encoded in config/APT_snapshots.d
+ When I successfully run "apt-snapshots-serials prepare-build"
+ And I successfully run "apt-mirror debian"
+ Then I should see a time-based snapshot
+ When I successfully run "apt-mirror torproject"
+ Then I should see a time-based snapshot
+ When I successfully run "apt-mirror debian-security"
+ Then I should see a time-based snapshot
+
+ Scenario: build from a bugfix branch with encoded time-based snapshots for a major release
+ Given I am working on the testing base branch
+ And Tails 0.10~rc1 has been released
+ And the last versions mentioned in debian/changelog are 0.10~rc1 and 0.10
+ And Tails 0.10 has not been released yet
+ And I am working on the bugfix/disable_gdomap branch based on testing
+ And frozen APT snapshots are encoded in config/APT_snapshots.d
+ When I successfully run "apt-snapshots-serials prepare-build"
+ And I successfully run "apt-mirror debian"
+ Then I should see a time-based snapshot
+ When I successfully run "apt-mirror torproject"
+ Then I should see a time-based snapshot
+ When I successfully run "apt-mirror debian-security"
+ Then I should see a time-based snapshot
+
Scenario: build from the devel branch without overlays
Given I am working on the devel base branch
And the config/APT_overlays.d directory is empty
@@ -134,6 +300,28 @@ Feature: custom APT sources to build branches
And I should see the 'feature-foo' suite
And I should see the 'bugfix-bar' suite
+ Scenario: build from the devel branch with no encoded time-based snapshot
+ Given I am working on the devel base branch
+ And no frozen APT snapshot is encoded in config/APT_snapshots.d
+ When I successfully run "apt-snapshots-serials prepare-build"
+ And I successfully run "apt-mirror debian"
+ Then I should see a time-based snapshot
+ When I successfully run "apt-mirror torproject"
+ Then I should see a time-based snapshot
+ When I successfully run "apt-mirror debian-security"
+ Then I should see a time-based snapshot
+
+ Scenario: build from the devel branch with encoded time-based snapshots
+ Given I am working on the devel base branch
+ And frozen APT snapshots are encoded in config/APT_snapshots.d
+ When I successfully run "apt-snapshots-serials prepare-build"
+ And I run "apt-mirror debian"
+ Then it should fail
+ When I run "apt-mirror torproject"
+ Then it should fail
+ When I successfully run "apt-mirror debian-security"
+ Then I should see a time-based snapshot
+
Scenario: build from the feature/jessie branch without overlays
Given I am working on the feature/jessie base branch
And the config/APT_overlays.d directory is empty
@@ -162,6 +350,28 @@ Feature: custom APT sources to build branches
When I successfully run tails-custom-apt-sources
Then I should see only the 'devel' suite
+ Scenario: build from a feature branch based on devel with no encoded time-based snapshot
+ Given I am working on the feature/icedove branch based on devel
+ And no frozen APT snapshot is encoded in config/APT_snapshots.d
+ When I successfully run "apt-snapshots-serials prepare-build"
+ And I successfully run "apt-mirror debian"
+ Then I should see a time-based snapshot
+ When I successfully run "apt-mirror torproject"
+ Then I should see a time-based snapshot
+ When I successfully run "apt-mirror debian-security"
+ Then I should see a time-based snapshot
+
+ Scenario: build from a feature branch based on devel with encoded time-based snapshots
+ Given I am working on the feature/icedove branch based on devel
+ And frozen APT snapshots are encoded in config/APT_snapshots.d
+ When I successfully run "apt-snapshots-serials prepare-build"
+ And I run "apt-mirror debian"
+ Then it should fail
+ When I run "apt-mirror torproject"
+ Then it should fail
+ When I successfully run "apt-mirror debian-security"
+ Then I should see a time-based snapshot
+
Scenario: build from a feature branch with overlays based on feature/jessie
Given I am working on the feature/7756-reintroduce-whisperback branch based on feature/jessie
And config/APT_overlays.d contains 'feature-7756-reintroduce-whisperback'
diff --git a/features/step_definitions/build.rb b/features/step_definitions/build.rb
index fd001ff..a706430 100644
--- a/features/step_definitions/build.rb
+++ b/features/step_definitions/build.rb
@@ -1,4 +1,4 @@
-Given /^Tails ([[:alnum:].]+) has been released$/ do |version|
+Given /^Tails ([[:alnum:]~.]+) has been released$/ do |version|
create_git unless git_exists?
old_branch = current_branch
@@ -17,7 +17,7 @@ tails (#{version}) stable; urgency=low
END_OF_CHANGELOG
end
fatal_system "git commit --quiet debian/changelog -m 'Release #{version}'"
- fatal_system "git tag '#{version}'"
+ fatal_system "git tag '#{version.gsub('~', '-')}'"
if old_branch != 'stable'
fatal_system "git checkout --quiet '#{old_branch}'"
@@ -42,6 +42,31 @@ Given /^the last version mentioned in debian\/changelog is ([[:alnum:]~.]+)$/ do
end
end
+Given /^the last versions mentioned in debian\/changelog are ([[:alnum:]~.]+) and ([[:alnum:]~.]+)$/ do |version_a, version_b|
+ step "the last version mentioned in debian/changelog is #{version_a}"
+ step "the last version mentioned in debian/changelog is #{version_b}"
+end
+
+Given(/^no frozen APT snapshot is encoded in config\/APT_snapshots\.d$/) do
+ ['debian', 'debian-security', 'torproject'].map do |origin|
+ File.open("config/APT_snapshots.d/#{origin}/serial", 'w+') do |serial|
+ serial.write("latest\n")
+ end
+ end
+end
+
+Given(/^frozen APT snapshots are encoded in config\/APT_snapshots\.d$/) do
+ ['debian', 'torproject'].map do |origin|
+ File.open("config/APT_snapshots.d/#{origin}/serial", 'w+') do |serial|
+ serial.write("2016060602\n")
+ end
+ end
+ # We never freeze debian-security
+ File.open("config/APT_snapshots.d/debian-security/serial", 'w+') do |serial|
+ serial.write("latest\n")
+ end
+end
+
Given %r{I am working on the ([[:alnum:]./_-]+) base branch$} do |branch|
create_git unless git_exists?
@@ -66,12 +91,12 @@ Given %r{I am working on the ([[:alnum:]./_-]+) branch based on ([[:alnum:]./_-]
end
end
-When /^I successfully run ([[:alnum:]-]+)$/ do |command|
+When /^I successfully run "?([[:alnum:] -]+)"?$/ do |command|
@output = `#{File.expand_path("../../../auto/scripts/#{command}", __FILE__)}`
raise StandardError.new("#{command} failed. Exit code: #{$?}") if $? != 0
end
-When /^I run ([[:alnum:]-]+)$/ do |command|
+When /^I run "?([[:alnum:] -]+)"?$/ do |command|
@output = `#{File.expand_path("../../../auto/scripts/#{command}", __FILE__)}`
@exit_code = $?.exitstatus
end
@@ -113,3 +138,11 @@ end
Given(/^the config\/base_branch file is empty$/) do
File.truncate('config/base_branch', 0)
end
+
+Then(/^I should see the ([[:alnum:].-]+) tagged snapshot$/) do |tag|
+ @output.should have_tagged_snapshot(tag)
+end
+
+Then(/^I should see a time\-based snapshot$/) do
+ @output.should have_time_based_snapshot()
+end
diff --git a/features/support/env.rb b/features/support/env.rb
index f70f6b4..e3f039b 100644
--- a/features/support/env.rb
+++ b/features/support/env.rb
@@ -23,6 +23,10 @@ def create_git
Dir.mkdir 'config'
FileUtils.touch('config/base_branch')
Dir.mkdir('config/APT_overlays.d')
+ Dir.mkdir('config/APT_snapshots.d')
+ ['debian', 'debian-security', 'torproject'].map do |origin|
+ Dir.mkdir("config/APT_snapshots.d/#{origin}")
+ end
Dir.mkdir 'debian'
File.open('debian/changelog', 'w') do |changelog|
changelog.write(<<END_OF_CHANGELOG)
@@ -88,3 +92,35 @@ RSpec::Matchers.define :have_suite do |suite|
"expected an output with #{suite}"
end
end
+
+RSpec::Matchers.define :have_tagged_snapshot do |tag|
+ match do |string|
+ # e.g.: `http://tagged.snapshots.deb.tails.boum.org/0.10`
+ %r{^http://tagged\.snapshots\.deb\.tails\.boum\.org/#{Regexp.escape(tag)}/[a-z-]+$}.match(string)
+ end
+ failure_message_for_should do |string|
+ "expected the mirror to be #{tag}\nCurrent mirror: #{string}"
+ end
+ failure_message_for_should_not do |string|
+ "expected the mirror not to be #{tag}\nCurrent mirror: #{string}"
+ end
+ description do
+ "expected an output with #{tag}"
+ end
+end
+
+RSpec::Matchers.define :have_time_based_snapshot do |tag|
+ match do |string|
+ # e.g.: `http://time-based.snapshots.deb.tails.boum.org/debian/2016060602`
+ %r{^http://time\-based\.snapshots\.deb\.tails\.boum\.org/[^/]+/\d+}.match(string)
+ end
+ failure_message_for_should do |string|
+ "expected the mirror to be a time-based snapshot\nCurrent mirror: #{string}"
+ end
+ failure_message_for_should_not do |string|
+ "expected the mirror not to be a time-based snapshot\nCurrent mirror: #{string}"
+ end
+ description do
+ "expected a time-based snapshot"
+ end
+end