summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2016-05-17 17:19:27 +0000
committerintrigeri <intrigeri@boum.org>2016-05-17 17:21:52 +0000
commit767bd2d80c52723da05f6701df0b88507e065a41 (patch)
tree59d81b58a828d10b9ca7cd7816fff24b96e3c6e3
parenta4b809d933db8bf7698e44cbb6f67ffb0515a36c (diff)
Implement scenarios + corresponding code for the APT mirror selection: devel branch, and branches based on devel.
-rwxr-xr-xauto/scripts/apt-mirror5
-rw-r--r--features/build.feature44
-rw-r--r--features/step_definitions/build.rb2
3 files changed, 50 insertions, 1 deletions
diff --git a/auto/scripts/apt-mirror b/auto/scripts/apt-mirror
index 4eab9f8..93ef848 100755
--- a/auto/scripts/apt-mirror
+++ b/auto/scripts/apt-mirror
@@ -49,6 +49,11 @@ if [ "$(base_branch)" = stable ]; then
fi
esac
fi
+elif [ "$(base_branch)" = devel ]; then
+ [ "$SERIAL" = latest ] \
+ || fatal "APT snapshots are frozen, which should not happen on a branch" \
+ "based on the devel one"
+ output_time_based_snapshot "$ARCHIVE" "$RESOLVED_SERIAL"
else
output_time_based_snapshot "$ARCHIVE" "$RESOLVED_SERIAL"
fi
diff --git a/features/build.feature b/features/build.feature
index 6206365..a72309e 100644
--- a/features/build.feature
+++ b/features/build.feature
@@ -216,6 +216,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 run "apt-mirror debian-security"
+ Then it should fail
+
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
@@ -244,6 +266,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 run "apt-mirror debian-security"
+ Then it should fail
+
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 4b88324..64791ff 100644
--- a/features/step_definitions/build.rb
+++ b/features/step_definitions/build.rb
@@ -92,7 +92,7 @@ When /^I successfully run "?([[:alnum:] -]+)"?$/ do |command|
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