From a6f41c35e337db192e612ee6e1545fcae4c69ac7 Mon Sep 17 00:00:00 2001 From: Philip Hands Date: Thu, 29 Jun 2017 22:11:09 +0200 Subject: lvc: grab updates from tails (01371c19bd..6ae59c49e5) Signed-off-by: Holger Levsen --- cucumber/features/step_definitions/build.rb | 46 ++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 4 deletions(-) (limited to 'cucumber/features/step_definitions/build.rb') diff --git a/cucumber/features/step_definitions/build.rb b/cucumber/features/step_definitions/build.rb index fd001ff4..e02edc62 100644 --- a/cucumber/features/step_definitions/build.rb +++ b/cucumber/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? @@ -54,6 +79,11 @@ Given %r{I am working on the ([[:alnum:]./_-]+) base branch$} do |branch| end end +Given %r{^I checkout the ([[:alnum:]~.-]+) tag$} do |tag| + create_git unless git_exists? + fatal_system "git checkout --quiet #{tag}" +end + Given %r{I am working on the ([[:alnum:]./_-]+) branch based on ([[:alnum:]./_-]+)$} do |branch, base| create_git unless git_exists? @@ -66,12 +96,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 +143,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 -- cgit v1.2.3-70-g09d2