diff options
author | Philip Hands <phil@hands.com> | 2017-06-29 22:11:09 +0200 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2017-08-01 00:53:58 -0400 |
commit | a6f41c35e337db192e612ee6e1545fcae4c69ac7 (patch) | |
tree | 3d03ff353fee11bb00de060f73c6b4d040173e9a /cucumber/features/support/env.rb | |
parent | c49069662ccf276a7b97f77524f3e2638c9fa152 (diff) | |
download | jenkins.debian.net-a6f41c35e337db192e612ee6e1545fcae4c69ac7.tar.xz |
lvc: grab updates from tails (01371c19bd..6ae59c49e5)
Signed-off-by: Holger Levsen <holger@layer-acht.org>
Diffstat (limited to 'cucumber/features/support/env.rb')
-rw-r--r-- | cucumber/features/support/env.rb | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/cucumber/features/support/env.rb b/cucumber/features/support/env.rb index 53f502e1..c52affff 100644 --- a/cucumber/features/support/env.rb +++ b/cucumber/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 |