Commit 6c092dd5 authored by anonym's avatar anonym
Browse files

Remove all background snapshot cruft.

parent c8e39833
require 'uri'
Given /^the only hosts in APT sources are "([^"]*)"$/ do |hosts_str|
next if @skip_steps_while_restoring_background
hosts = hosts_str.split(',')
$vm.file_content("/etc/apt/sources.list /etc/apt/sources.list.d/*").chomp.each_line { |line|
next if ! line.start_with? "deb"
......@@ -13,7 +12,6 @@ Given /^the only hosts in APT sources are "([^"]*)"$/ do |hosts_str|
end
When /^I update APT using apt-get$/ do
next if @skip_steps_while_restoring_background
Timeout::timeout(30*60) do
$vm.execute_successfully("echo #{@sudo_password} | " +
"sudo -S apt-get update", LIVE_USER)
......@@ -21,7 +19,6 @@ When /^I update APT using apt-get$/ do
end
Then /^I should be able to install a package using apt-get$/ do
next if @skip_steps_while_restoring_background
package = "cowsay"
Timeout::timeout(120) do
$vm.execute_successfully("echo #{@sudo_password} | " +
......@@ -31,7 +28,6 @@ Then /^I should be able to install a package using apt-get$/ do
end
When /^I update APT using Synaptic$/ do
next if @skip_steps_while_restoring_background
# Upon start the interface will be frozen while Synaptic loads the
# package list. Since the frozen GUI is so similar to the unfrozen
# one there's no easy way to reliably wait for the latter. Hence we
......@@ -46,7 +42,6 @@ When /^I update APT using Synaptic$/ do
end
Then /^I should be able to install a package using Synaptic$/ do
next if @skip_steps_while_restoring_background
package = "cowsay"
@screen.type("f", Sikuli::KeyModifier.CTRL) # Find key
@screen.wait_and_click('SynapticSearch.png', 10)
......@@ -63,7 +58,6 @@ Then /^I should be able to install a package using Synaptic$/ do
end
When /^I start Synaptic$/ do
next if @skip_steps_while_restoring_background
step 'I start "Synaptic" via the GNOME "System"/"Administration" applications menu'
deal_with_polkit_prompt('SynapticPolicyKitAuthPrompt.png', @sudo_password)
end
Then /^the shipped Tails (signing|Debian repository) key will be valid for the next (\d+) months$/ do |key_type, max_months|
next if @skip_steps_while_restoring_background
case key_type
when 'signing'
sig_key_fingerprint = TAILS_SIGNING_KEY
......@@ -19,12 +18,10 @@ Then /^the shipped Tails (signing|Debian repository) key will be valid for the n
end
Then /^I double-click the Report an Error launcher on the desktop$/ do
next if @skip_steps_while_restoring_background
@screen.wait_and_double_click('DesktopReportAnError.png', 30)
end
Then /^the live user has been setup by live\-boot$/ do
next if @skip_steps_while_restoring_background
assert($vm.execute("test -e /var/lib/live/config/user-setup").success?,
"live-boot failed its user-setup")
actual_username = $vm.execute(". /etc/live/config/username.conf; " +
......@@ -33,7 +30,6 @@ Then /^the live user has been setup by live\-boot$/ do
end
Then /^the live user is a member of only its own group and "(.*?)"$/ do |groups|
next if @skip_steps_while_restoring_background
expected_groups = groups.split(" ") << LIVE_USER
actual_groups = $vm.execute("groups #{LIVE_USER}").stdout.chomp.sub(/^#{LIVE_USER} : /, "").split(" ")
unexpected = actual_groups - expected_groups
......@@ -45,7 +41,6 @@ Then /^the live user is a member of only its own group and "(.*?)"$/ do |groups|
end
Then /^the live user owns its home dir and it has normal permissions$/ do
next if @skip_steps_while_restoring_background
home = "/home/#{LIVE_USER}"
assert($vm.execute("test -d #{home}").success?,
"The live user's home doesn't exist or is not a directory")
......@@ -56,14 +51,12 @@ Then /^the live user owns its home dir and it has normal permissions$/ do
end
Given /^I wait between (\d+) and (\d+) seconds$/ do |min, max|
next if @skip_steps_while_restoring_background
time = rand(max.to_i - min.to_i + 1) + min.to_i
puts "Slept for #{time} seconds"
sleep(time)
end
Then /^no unexpected services are listening for network connections$/ do
next if @skip_steps_while_restoring_background
netstat_cmd = $vm.execute("netstat -ltupn")
assert netstat_cmd.success?
for line in netstat_cmd.stdout.chomp.split("\n") do
......@@ -92,13 +85,11 @@ Then /^no unexpected services are listening for network connections$/ do
end
When /^Tails has booted a 64-bit kernel$/ do
next if @skip_steps_while_restoring_background
assert($vm.execute("uname -r | grep -qs 'amd64$'").success?,
"Tails has not booted a 64-bit kernel.")
end
Then /^GNOME Screenshot is configured to save files to the live user's home directory$/ do
next if @skip_steps_while_restoring_background
home = "/home/#{LIVE_USER}"
save_path = $vm.execute_successfully(
"gsettings get org.gnome.gnome-screenshot auto-save-directory",
......@@ -108,14 +99,12 @@ Then /^GNOME Screenshot is configured to save files to the live user's home dire
end
Then /^there is no screenshot in the live user's home directory$/ do
next if @skip_steps_while_restoring_background
home = "/home/#{LIVE_USER}"
assert($vm.execute("find '#{home}' -name 'Screenshot*.png' -maxdepth 1").stdout.empty?,
"Existing screenshots were found in the live user's home directory.")
end
Then /^a screenshot is saved to the live user's home directory$/ do
next if @skip_steps_while_restoring_background
home = "/home/#{LIVE_USER}"
try_for(10, :msg=> "No screenshot was created in #{home}") {
!$vm.execute("find '#{home}' -name 'Screenshot*.png' -maxdepth 1").stdout.empty?
......@@ -123,13 +112,11 @@ Then /^a screenshot is saved to the live user's home directory$/ do
end
Then /^the VirtualBox guest modules are available$/ do
next if @skip_steps_while_restoring_background
assert($vm.execute("modinfo vboxguest").success?,
"The vboxguest module is not available.")
end
Given /^I setup a filesystem share containing a sample PDF$/ do
next if @skip_steps_while_restoring_background
shared_pdf_dir_on_host = "#{$config["TMPDIR"]}/shared_pdf_dir"
@shared_pdf_dir_on_guest = "/tmp/shared_pdf_dir"
FileUtils.mkdir_p(shared_pdf_dir_on_host)
......@@ -141,12 +128,10 @@ Given /^I setup a filesystem share containing a sample PDF$/ do
end
Then /^the support documentation page opens in Tor Browser$/ do
next if @skip_steps_while_restoring_background
@screen.wait("SupportDocumentation#{@language}.png", 120)
end
Then /^MAT can clean some sample PDF file$/ do
next if @skip_steps_while_restoring_background
for pdf_on_host in Dir.glob("#{MISC_FILES_DIR}/*.pdf") do
pdf_name = File.basename(pdf_on_host)
pdf_on_guest = "/home/#{LIVE_USER}/#{pdf_name}"
......@@ -181,7 +166,6 @@ def get_seccomp_status(process)
end
Then /^the running process "(.+)" is confined with Seccomp in (filter|strict) mode$/ do |process,mode|
next if @skip_steps_while_restoring_background
status = get_seccomp_status(process)
if mode == 'strict'
assert_equal(1, status, "#{process} not confined with Seccomp in strict mode")
......
This diff is collapsed.
Then /^the hostname should not have been leaked on the network$/ do
next if @skip_steps_while_restoring_background
hostname = $vm.execute("hostname").stdout.chomp
packets = PacketFu::PcapFile.new.file_to_array(:filename => @sniffer.pcap_file)
packets.each do |p|
......
Then /^I start Electrum through the GNOME menu$/ do
next if @skip_steps_while_restoring_background
step "I start \"Electrum\" via the GNOME \"Internet\" applications menu"
end
When /^a bitcoin wallet is (|not )present$/ do |existing|
next if @skip_steps_while_restoring_background
wallet = "/home/#{LIVE_USER}/.electrum/wallets/default_wallet"
case existing
when ""
......@@ -17,7 +15,6 @@ When /^a bitcoin wallet is (|not )present$/ do |existing|
end
When /^I create a new bitcoin wallet$/ do
next if @skip_steps_while_restoring_background
@screen.wait("ElectrumNoWallet.png", 10)
@screen.wait_and_click("ElectrumNextButton.png", 10)
@screen.wait("ElectrumWalletGenerationSeed.png", 15)
......@@ -38,21 +35,17 @@ When /^I create a new bitcoin wallet$/ do
end
Then /^I see a warning that Electrum is not persistent$/ do
next if @skip_steps_while_restoring_background
@screen.wait('ElectrumStartVerification.png', 30)
end
Then /^I am prompted to create a new wallet$/ do
next if @skip_steps_while_restoring_background
@screen.wait('ElectrumNoWallet.png', 60)
end
Then /^I see the main Electrum client window$/ do
next if @skip_steps_while_restoring_background
@screen.wait('ElectrumPreferencesButton.png', 20)
end
Then /^Electrum successfully connects to the network$/ do
next if @skip_steps_while_restoring_background
@screen.wait('ElectrumStatus.png', 180)
end
Given /^I generate an OpenPGP key named "([^"]+)" with password "([^"]+)"$/ do |name, pwd|
@passphrase = pwd
@key_name = name
next if @skip_steps_while_restoring_background
gpg_key_recipie = <<EOF
Key-Type: RSA
Key-Length: 4096
......@@ -22,7 +21,6 @@ EOF
end
When /^I type a message into gedit$/ do
next if @skip_steps_while_restoring_background
step 'I start "Gedit" via the GNOME "Accessories" applications menu'
@screen.wait_and_click("GeditWindow.png", 10)
sleep 0.5
......@@ -72,33 +70,28 @@ def decrypt_verify_helper(icon)
end
When /^I encrypt the message using my OpenPGP key$/ do
next if @skip_steps_while_restoring_background
encrypt_sign_helper do
@screen.type(@key_name + Sikuli::Key.ENTER + Sikuli::Key.ENTER)
end
end
Then /^I can decrypt the encrypted message$/ do
next if @skip_steps_while_restoring_background
decrypt_verify_helper("GpgAppletIconEncrypted.png")
@screen.wait("GpgAppletResultsEncrypted.png", 10)
end
When /^I sign the message using my OpenPGP key$/ do
next if @skip_steps_while_restoring_background
encrypt_sign_helper do
@screen.type(Sikuli::Key.TAB + Sikuli::Key.DOWN + Sikuli::Key.ENTER)
end
end
Then /^I can verify the message's signature$/ do
next if @skip_steps_while_restoring_background
decrypt_verify_helper("GpgAppletIconSigned.png")
@screen.wait("GpgAppletResultsSigned.png", 10)
end
When /^I both encrypt and sign the message using my OpenPGP key$/ do
next if @skip_steps_while_restoring_background
encrypt_sign_helper do
@screen.type(@key_name + Sikuli::Key.ENTER)
@screen.type(Sikuli::Key.TAB + Sikuli::Key.DOWN + Sikuli::Key.ENTER)
......@@ -106,7 +99,6 @@ When /^I both encrypt and sign the message using my OpenPGP key$/ do
end
Then /^I can decrypt and verify the encrypted message$/ do
next if @skip_steps_while_restoring_background
decrypt_verify_helper("GpgAppletIconEncrypted.png")
@screen.wait("GpgAppletResultsEncrypted.png", 10)
@screen.wait("GpgAppletResultsSigned.png", 10)
......@@ -114,7 +106,6 @@ end
When /^I symmetrically encrypt the message with password "([^"]+)"$/ do |pwd|
@passphrase = pwd
next if @skip_steps_while_restoring_background
gedit_copy_all_text
@screen.click("GpgAppletIconNormal.png")
@screen.wait_and_click("GpgAppletEncryptPassphrase.png", 10)
......
Given /^the computer is a modern 64-bit system$/ do
next if @skip_steps_while_restoring_background
$vm.set_arch("x86_64")
$vm.drop_hypervisor_feature("nonpae")
$vm.add_hypervisor_feature("pae")
end
Given /^the computer is an old pentium without the PAE extension$/ do
next if @skip_steps_while_restoring_background
$vm.set_arch("i686")
$vm.drop_hypervisor_feature("pae")
# libvirt claim the following feature doesn't exit even though
......@@ -22,13 +20,11 @@ def which_kernel
end
Given /^the PAE kernel is running$/ do
next if @skip_steps_while_restoring_background
kernel = which_kernel
assert_equal("vmlinuz2", kernel)
end
Given /^the non-PAE kernel is running$/ do
next if @skip_steps_while_restoring_background
kernel = which_kernel
assert_equal("vmlinuz", kernel)
end
......@@ -43,7 +39,6 @@ end
Given /^at least (\d+) ([[:alpha:]]+) of RAM was detected$/ do |min_ram, unit|
@detected_ram_m = detected_ram_in_MiB
next if @skip_steps_while_restoring_background
puts "Detected #{@detected_ram_m} MiB of RAM"
min_ram_m = convert_to_MiB(min_ram.to_i, unit)
# All RAM will not be reported by `free`, so we allow a 196 MB gap
......@@ -76,7 +71,6 @@ end
Given /^I fill the guest's memory with a known pattern(| without verifying)$/ do |dont_verify|
verify = dont_verify.empty?
next if @skip_steps_while_restoring_background
# Free some more memory by dropping the caches etc.
$vm.execute("echo 3 > /proc/sys/vm/drop_caches")
......@@ -136,7 +130,6 @@ Given /^I fill the guest's memory with a known pattern(| without verifying)$/ do
end
Then /^I find very few patterns in the guest's memory$/ do
next if @skip_steps_while_restoring_background
coverage = pattern_coverage_in_guest_ram()
max_coverage = 0.005
assert(coverage < max_coverage,
......@@ -145,7 +138,6 @@ Then /^I find very few patterns in the guest's memory$/ do
end
Then /^I find many patterns in the guest's memory$/ do
next if @skip_steps_while_restoring_background
coverage = pattern_coverage_in_guest_ram()
min_coverage = 0.7
assert(coverage > min_coverage,
......@@ -154,13 +146,11 @@ Then /^I find many patterns in the guest's memory$/ do
end
When /^I reboot without wiping the memory$/ do
next if @skip_steps_while_restoring_background
$vm.reset
@screen.wait('TailsBootSplash.png', 30)
end
When /^I shutdown and wait for Tails to finish wiping the memory$/ do
next if @skip_steps_while_restoring_background
$vm.execute("halt")
nr_gibs_of_ram = (@detected_ram_m.to_f/(2**10)).ceil
try_for(nr_gibs_of_ram*5*60, { :msg => "memory wipe didn't finish, probably the VM crashed" }) do
......
When /^I(?:| try to) open "([^"]+)" with Evince$/ do |filename|
next if @skip_steps_while_restoring_background
step "I run \"evince #{filename}\" in GNOME Terminal"
end
Then /^I can print the current document to "([^"]+)"$/ do |output_file|
next if @skip_steps_while_restoring_background
@screen.type("p", Sikuli::KeyModifier.CTRL)
@screen.wait("EvincePrintDialog.png", 10)
@screen.wait_and_click("PrintToFile.png", 10)
......
Then(/^the firewall leak detector has detected (.*?) leaks$/) do |type|
next if @skip_steps_while_restoring_background
leaks = FirewallLeakCheck.new(@sniffer.pcap_file, get_all_tor_nodes)
case type.downcase
when 'ipv4 tcp'
......@@ -28,7 +27,6 @@ Then(/^the firewall leak detector has detected (.*?) leaks$/) do |type|
end
Given(/^I disable Tails' firewall$/) do
next if @skip_steps_while_restoring_background
$vm.execute("do_not_ever_run_me")
iptables = $vm.execute("iptables -L -n -v").stdout.chomp.split("\n")
for line in iptables do
......@@ -41,19 +39,16 @@ Given(/^I disable Tails' firewall$/) do
end
When(/^I do a TCP DNS lookup of "(.*?)"$/) do |host|
next if @skip_steps_while_restoring_background
lookup = $vm.execute("host -T #{host} #{SOME_DNS_SERVER}", LIVE_USER)
assert(lookup.success?, "Failed to resolve #{host}:\n#{lookup.stdout}")
end
When(/^I do a UDP DNS lookup of "(.*?)"$/) do |host|
next if @skip_steps_while_restoring_background
lookup = $vm.execute("host #{host} #{SOME_DNS_SERVER}", LIVE_USER)
assert(lookup.success?, "Failed to resolve #{host}:\n#{lookup.stdout}")
end
When(/^I send some ICMP pings$/) do
next if @skip_steps_while_restoring_background
# We ping an IP address to avoid a DNS lookup
ping = $vm.execute("ping -c 5 #{SOME_DNS_SERVER}", LIVE_USER)
assert(ping.success?, "Failed to ping #{SOME_DNS_SERVER}:\n#{ping.stderr}")
......
Then /^the Git repository "([\S]+)" has been cloned successfully$/ do |repo|
next if @skip_steps_while_restoring_background
assert($vm.directory_exist?("/home/#{LIVE_USER}/#{repo}/.git"))
assert($vm.file_exist?("/home/#{LIVE_USER}/#{repo}/.git/config"))
$vm.execute_successfully("cd '/home/#{LIVE_USER}/#{repo}/' && git status", LIVE_USER)
......
Given /^I2P is running$/ do
next if @skip_steps_while_restoring_background
try_for(30) do
$vm.execute('service i2p status').success?
end
end
Given /^the I2P router console is ready$/ do
next if @skip_steps_while_restoring_background
try_for(120) do
$vm.execute('. /usr/local/lib/tails-shell-library/i2p.sh; ' +
'i2p_router_console_is_ready').success?
......@@ -14,12 +12,10 @@ Given /^the I2P router console is ready$/ do
end
When /^I start the I2P Browser through the GNOME menu$/ do
next if @skip_steps_while_restoring_background
step 'I start "I2PBrowser" via the GNOME "Internet" applications menu'
end
Then /^the I2P Browser desktop file is (|not )present$/ do |mode|
next if @skip_steps_while_restoring_background
file = '/usr/share/applications/i2p-browser.desktop'
if mode == ''
assert($vm.execute("test -e #{file}").success?)
......@@ -31,7 +27,6 @@ Then /^the I2P Browser desktop file is (|not )present$/ do |mode|
end
Then /^the I2P Browser sudo rules are (enabled|not present)$/ do |mode|
next if @skip_steps_while_restoring_background
file = '/etc/sudoers.d/zzz_i2pbrowser'
if mode == 'enabled'
assert($vm.execute("test -e #{file}").success?)
......@@ -43,7 +38,6 @@ Then /^the I2P Browser sudo rules are (enabled|not present)$/ do |mode|
end
Then /^the I2P firewall rules are (enabled|disabled)$/ do |mode|
next if @skip_steps_while_restoring_background
i2p_username = 'i2psvc'
i2p_uid = $vm.execute("getent passwd #{i2p_username} | awk -F ':' '{print $3}'").stdout.chomp
accept_rules = $vm.execute("iptables -L -n -v | grep -E '^\s+[0-9]+\s+[0-9]+\s+ACCEPT.*owner UID match #{i2p_uid}$'").stdout
......
......@@ -19,7 +19,6 @@ EOF
end
When /^I create my XMPP account$/ do
next if @skip_steps_while_restoring_background
account = xmpp_account("Tails_account")
@screen.click("PidginAccountManagerAddButton.png")
@screen.wait("PidginAddAccountWindow.png", 20)
......@@ -41,13 +40,11 @@ When /^I create my XMPP account$/ do
end
Then /^Pidgin automatically enables my XMPP account$/ do
next if @skip_steps_while_restoring_background
$vm.focus_window('Buddy List')
@screen.wait("PidginAvailableStatus.png", 60*3)
end
Given /^my XMPP friend goes online( and joins the multi-user chat)?$/ do |join_chat|
next if @skip_steps_while_restoring_background
account = xmpp_account("Friend_account", ["otr_key"])
bot_opts = account.select { |k, v| ["connect_server"].include?(k) }
if join_chat
......@@ -63,7 +60,6 @@ Given /^my XMPP friend goes online( and joins the multi-user chat)?$/ do |join_c
end
When /^I start a conversation with my friend$/ do
next if @skip_steps_while_restoring_background
$vm.focus_window('Buddy List')
# Clicking the middle, bottom of this image should query our
# friend, given it's the only subscribed user that's online, which
......@@ -80,7 +76,6 @@ When /^I start a conversation with my friend$/ do
end
And /^I say something to my friend( in the multi-user chat)?$/ do |multi_chat|
next if @skip_steps_while_restoring_background
msg = "ping" + Sikuli::Key.ENTER
if multi_chat
$vm.focus_window(@chat_room_jid.split("@").first)
......@@ -92,7 +87,6 @@ And /^I say something to my friend( in the multi-user chat)?$/ do |multi_chat|
end
Then /^I receive a response from my friend( in the multi-user chat)?$/ do |multi_chat|
next if @skip_steps_while_restoring_background
if multi_chat
$vm.focus_window(@chat_room_jid.split("@").first)
else
......@@ -102,7 +96,6 @@ Then /^I receive a response from my friend( in the multi-user chat)?$/ do |multi
end
When /^I start an OTR session with my friend$/ do
next if @skip_steps_while_restoring_background
$vm.focus_window(@friend_name)
@screen.click("PidginConversationOTRMenu.png")
@screen.hide_cursor
......@@ -110,13 +103,11 @@ When /^I start an OTR session with my friend$/ do
end
Then /^Pidgin automatically generates an OTR key$/ do
next if @skip_steps_while_restoring_background
@screen.wait("PidginOTRKeyGenPrompt.png", 30)
@screen.wait_and_click("PidginOTRKeyGenPromptDoneButton.png", 30)
end
Then /^an OTR session was successfully started with my friend$/ do
next if @skip_steps_while_restoring_background
$vm.focus_window(@friend_name)
@screen.wait("PidginConversationOTRUnverifiedSessionStarted.png", 10)
end
......@@ -125,7 +116,6 @@ end
# up messages/events from other users with the ones we expect from the
# bot.
When /^I join some empty multi-user chat$/ do
next if @skip_steps_while_restoring_background
$vm.focus_window('Buddy List')
@screen.click("PidginBuddiesMenu.png")
@screen.wait_and_click("PidginBuddiesMenuJoinChat.png", 10)
......@@ -167,14 +157,12 @@ end
# it's safer to clear it so we do not get false positives from old
# messages when looking for a particular response, or similar.
When /^I clear the multi-user chat's scrollback$/ do
next if @skip_steps_while_restoring_background
$vm.focus_window(@chat_room_jid)
@screen.click("PidginConversationMenu.png")
@screen.wait_and_click("PidginConversationMenuClearScrollback.png", 10)
end
Then /^I can see that my friend joined the multi-user chat$/ do
next if @skip_steps_while_restoring_background
$vm.focus_window(@chat_room_jid)
@screen.wait("PidginChat2UsersInRoom.png", 60)
end
......@@ -228,7 +216,6 @@ def pidgin_otr_keys
end
Given /^Pidgin has the expected accounts configured with random nicknames$/ do
next if @skip_steps_while_restoring_background
expected = [
["irc.oftc.net", "prpl-irc", "6697"],
["127.0.0.1", "prpl-irc", "6668"],
......@@ -250,28 +237,23 @@ Given /^Pidgin has the expected accounts configured with random nicknames$/ do
end
When /^I start Pidgin through the GNOME menu$/ do
next if @skip_steps_while_restoring_background
step 'I start "Pidgin" via the GNOME "Internet" applications menu'
end
When /^I open Pidgin's account manager window$/ do
next if @skip_steps_while_restoring_background
@screen.type("a", Sikuli::KeyModifier.CTRL) # shortcut for "manage accounts"
step "I see Pidgin's account manager window"
end
When /^I see Pidgin's account manager window$/ do
next if @skip_steps_while_restoring_background
@screen.wait("PidginAccountWindow.png", 40)
end
When /^I close Pidgin's account manager window$/ do
next if @skip_steps_while_restoring_background
@screen.wait_and_click("PidginAccountManagerCloseButton.png", 10)
end
When /^I activate the "([^"]+)" Pidgin account$/ do |account|
next if @skip_steps_while_restoring_background
@screen.click("PidginAccount_#{account}.png")
@screen.type(Sikuli::Key.LEFT + Sikuli::Key.SPACE)
# wait for the Pidgin to be connecting, otherwise sometimes the step
......@@ -281,7 +263,6 @@ When /^I activate the "([^"]+)" Pidgin account$/ do |account|
end
Then /^Pidgin successfully connects to the "([^"]+)" account$/ do |account|
next if @skip_steps_while_restoring_background
expected_channel_entry = chan_image(account, default_chan(account), 'roaster')
# Sometimes the OFTC welcome notice window pops up over the buddy list one...
$vm.focus_window('Buddy List')
......@@ -289,7 +270,6 @@ Then /^Pidgin successfully connects to the "([^"]+)" account$/ do |account|
end
Then /^the "([^"]*)" account only responds to PING and VERSION CTCP requests$/ do |irc_server|
next if @skip_steps_while_restoring_background
ctcp_cmds = [
"CLIENTINFO", "DATE", "ERRMSG", "FINGER", "PING", "SOURCE", "TIME",
"USERINFO", "VERSION"
......@@ -305,24 +285,20 @@ Then /^the "([^"]*)" account only responds to PING and VERSION CTCP requests$/ d
end
Then /^I can join the "([^"]+)" channel on "([^"]+)"$/ do |channel, account|
next if @skip_steps_while_restoring_background
@screen.doubleClick( chan_image(account, channel, 'roaster'))
@screen.wait_and_click(chan_image(account, channel, 'conversation_tab'), 10)
@screen.wait( chan_image(account, channel, 'welcome'), 10)
end
Then /^I take note of the configured Pidgin accounts$/ do
next if @skip_steps_while_restoring_background
@persistent_pidgin_accounts = configured_pidgin_accounts
end
Then /^I take note of the OTR key for Pidgin's "([^"]+)" account$/ do |account_name|
next if @skip_steps_while_restoring_background
@persistent_pidgin_otr_keys = pidgin_otr_keys
end
Then /^Pidgin has the expected persistent accounts configured$/ do
next if @skip_steps_while_restoring_background
current_accounts = configured_pidgin_accounts
assert(current_accounts <=> @persistent_pidgin_accounts,
"Currently configured Pidgin accounts do not match the persistent ones:\n" +
......@@ -332,7 +308,6 @@ Then /^Pidgin has the expected persistent accounts configured$/ do
end
Then /^Pidgin has the expected persistent OTR keys$/ do
next if @skip_steps_while_restoring_background
assert_equal(pidgin_otr_keys, @persistent_pidgin_otr_keys)
end
......@@ -359,7 +334,6 @@ def pidgin_add_certificate_from (cert_file)
end
Then /^I can add a certificate from the "([^"]+)" directory to Pidgin$/ do |cert_dir|
next if @skip_steps_while_restoring_background
pidgin_add_certificate_from("#{cert_dir}/test.crt")
@screen.wait('PidginCertificateAddHostnameDialog.png', 10)
@screen.type("XXX test XXX" + Sikuli::Key.ENTER)
......@@ -367,7 +341,6 @@ Then /^I can add a certificate from the "([^"]+)" directory to Pidgin$/ do |cert
end
Then /^I cannot add a certificate from the "([^"]+)" directory to Pidgin$/ do |cert_dir|
next if @skip_steps_while_restoring_background
pidgin_add_certificate_from("#{cert_dir}/test.crt")
@screen.wait('PidginCertificateImportFailed.png', 10)
end
......
Then /^I should be able to run administration commands as the live user$/ do
next if @skip_steps_while_restoring_background
stdout = $vm.execute("echo #{@sudo_password} | sudo -S whoami", LIVE_USER).stdout