summaryrefslogtreecommitdiffstats
path: root/cucumber/features/step_definitions/apt.rb
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2017-10-04 13:16:52 +0200
committerHolger Levsen <holger@layer-acht.org>2017-10-04 13:16:52 +0200
commit4d8dfa12768c22f137c236b6e47352afb869a4c8 (patch)
tree1134341bf7a7db322a1da1e24b0e4d6018129a40 /cucumber/features/step_definitions/apt.rb
parent213675aa5197309d93331f465297cfd53e0b01f3 (diff)
downloadjenkins.debian.net-4d8dfa12768c22f137c236b6e47352afb869a4c8.tar.xz
drop lvc stuff, now that openqa.debian.net is getting into shape
Signed-off-by: Holger Levsen <holger@layer-acht.org>
Diffstat (limited to 'cucumber/features/step_definitions/apt.rb')
-rw-r--r--cucumber/features/step_definitions/apt.rb124
1 files changed, 0 insertions, 124 deletions
diff --git a/cucumber/features/step_definitions/apt.rb b/cucumber/features/step_definitions/apt.rb
deleted file mode 100644
index 52ef9f7f..00000000
--- a/cucumber/features/step_definitions/apt.rb
+++ /dev/null
@@ -1,124 +0,0 @@
-require 'uri'
-
-Given /^the only hosts in APT sources are "([^"]*)"$/ do |hosts_str|
- hosts = hosts_str.split(',')
- apt_sources = $vm.execute_successfully(
- "cat /etc/apt/sources.list /etc/apt/sources.list.d/*"
- ).stdout.chomp
- apt_sources.each_line do |line|
- next if ! line.start_with? "deb"
- source_host = URI(line.split[1]).host
- if !hosts.include?(source_host)
- raise "Bad APT source '#{line}'"
- end
- end
-end
-
-Given /^no proposed-updates APT suite is enabled$/ do
- apt_sources = $vm.execute_successfully(
- 'cat /etc/apt/sources.list /etc/apt/sources.list.d/*'
- ).stdout
- assert_no_match(/\s\S+-proposed-updates\s/, apt_sources)
-end
-
-When /^I configure APT to use non-onion sources$/ do
- script = <<-EOF
- use strict;
- use warnings FATAL => "all";
- s{vwakviie2ienjx6t[.]onion}{ftp.us.debian.org};
- s{sgvtcaew4bxjd7ln[.]onion}{security.debian.org};
- s{sdscoq7snqtznauu[.]onion}{deb.torproject.org};
- s{jenw7xbd6tf7vfhp[.]onion}{deb.tails.boum.org};
-EOF
- # VMCommand:s cannot handle newlines, and they're irrelevant in the
- # above perl script any way
- script.delete!("\n")
- $vm.execute_successfully(
- "perl -pi -E '#{script}' /etc/apt/sources.list /etc/apt/sources.list.d/*"
- )
-end
-
-When /^I update APT using apt$/ do
- recovery_proc = Proc.new do
- step 'I kill the process "apt"'
- $vm.execute('rm -rf /var/lib/apt/lists/*')
- end
- retry_tor(recovery_proc) do
- Timeout::timeout(15*60) do
- $vm.execute_successfully("echo #{@sudo_password} | " +
- "sudo -S apt update", :user => LIVE_USER)
- end
- end
-end
-
-Then /^I install "(.+)" using apt$/ do |package_name|
- recovery_proc = Proc.new do
- step 'I kill the process "apt"'
- $vm.execute("apt purge #{package_name}")
- end
- retry_tor(recovery_proc) do
- Timeout::timeout(2*60) do
- $vm.execute_successfully("echo #{@sudo_password} | " +
- "sudo -S apt install #{package_name}",
- :user => LIVE_USER)
- end
- end
-end
-
-When /^I start Synaptic$/ do
- step 'I start "Synaptic Package Manager" via GNOME Activities Overview'
- deal_with_polkit_prompt(@sudo_password)
- @synaptic = Dogtail::Application.new('synaptic')
- # The seemingly spurious space is needed because that is how this
- # frame is named...
- @synaptic.child(
- 'Synaptic Package Manager ', roleName: 'frame', recursive: false
- )
-end
-
-When /^I update APT using Synaptic$/ do
- recovery_proc = Proc.new do
- step 'I kill the process "synaptic"'
- step "I start Synaptic"
- end
- retry_tor(recovery_proc) do
- @synaptic.button('Reload').click
- sleep 10 # It might take some time before APT starts downloading
- try_for(15*60, :msg => "Took too much time to download the APT data") {
- !$vm.has_process?("/usr/lib/apt/methods/tor+http")
- }
- assert_raise(RuntimeError) do
- @synaptic.child(roleName: 'dialog', recursive: false)
- .child('Error', roleName: 'icon', retry: false)
- end
- if !$vm.has_process?("synaptic")
- raise "Synaptic process vanished, did it segfault again?"
- end
- end
-end
-
-Then /^I install "(.+)" using Synaptic$/ do |package_name|
- recovery_proc = Proc.new do
- step 'I kill the process "synaptic"'
- $vm.execute("apt -y purge #{package_name}")
- step "I start Synaptic"
- end
- retry_tor(recovery_proc) do
- @synaptic.button('Search').click
- find_dialog = @synaptic.dialog('Find')
- find_dialog.child(roleName: 'text').typeText(package_name)
- find_dialog.button('Search').click
- package_list = @synaptic.child('Installed Version',
- roleName: 'table column header').parent
- package_entry = package_list.child(package_name, roleName: 'table cell')
- package_entry.doubleClick
- @synaptic.button('Apply').click
- apply_prompt = nil
- try_for(60) { apply_prompt = @synaptic.dialog('Summary'); true }
- apply_prompt.button('Apply').click
- try_for(4*60) do
- @synaptic.child('Changes applied', roleName: 'frame', recursive: false)
- true
- end
- end
-end