Commit aa9edc01 authored by anonym's avatar anonym
Browse files

Merge branch 'test/17842-require-Buster' into 'stable'

Require Buster or newer for running our test suite

Closes #17842

See merge request tails/tails!254
parents d9a23e20 a84a3653
......@@ -3,7 +3,7 @@
<currentMemory unit='KiB'>2097152</currentMemory>
<vcpu>2</vcpu>
<os>
<type arch='x86_64' machine='pc-q35-2.8'>hvm</type>
<type arch='x86_64' machine='pc-q35-5.0'>hvm</type>
<boot dev='cdrom'/>
</os>
<features>
......
#!/usr/bin/env python3
# XXX:Buster: when we drop support for Stretch we can remove this
# import.
from __future__ import print_function
import cv2
import os
import sys
......
......@@ -226,10 +226,8 @@ When /^I fill a (\d+) MiB file with a known pattern on the (persistent|root) fil
end
# Note that `yes` prints its own newline, so we have to skip it in
# `pattern` below.
# XXX:Stretch: once we drop support < Buster we can improve the
# expression below to `pattern[..-2]`.
$vm.execute_successfully(
"yes #{pattern[0, pattern.length - 1]} | " \
"yes #{pattern[0..-2]} | " \
"dd of=#{dest_file} bs=#{pattern.size} count=#{pattern_nb}"
)
end
......
......@@ -104,14 +104,7 @@ end
When /^I hotplug a network device( and wait for it to be initialized)?$/ do |wait|
initial_nr_nics = wait ? all_ethernet_nics.size : nil
# XXX:Buster: when we stop supporting the test suite on Stretch
# hosts, let's remove this workaround related to #14819 and just
# settle on a device that works on all supported platforms.
device = if cmd_helper('lsb_release --short --codename').chomp == 'stretch'
'virtio'
else
'pcnet'
end
device = 'pcnet'
debug_log("Hotplugging a '#{device}' network device")
xml = <<-XML
<interface type='network'>
......
......@@ -113,9 +113,7 @@ Given /^my XMPP friend goes online( and joins the multi-user chat)?$/ do |join_c
account['username'] + '@' + account['domain'],
account['password'],
account['otr_key'],
# XXX:Buster: once we stop supporting running our test suite on Stretch,
# replace this with: **(bot_opts.transform_keys(&:to_sym))
**(bot_opts.each_with_object({}) { |(k, v), a| a[k.to_sym] = v })
**(bot_opts.transform_keys(&:to_sym))
)
@chatbot.start
add_after_scenario_hook { @chatbot.stop }
......
......@@ -5,7 +5,7 @@ Given /^I create sample videos$/ do
@video_dir_on_host = "#{$config['TMPDIR']}/video_dir"
FileUtils.mkdir_p(@video_dir_on_host)
add_after_scenario_hook { FileUtils.rm_r(@video_dir_on_host) }
fatal_system("#{ffmpeg} -loop 1 -t 30 -f image2 " \
fatal_system('ffmpeg -loop 1 -t 30 -f image2 ' \
"-i 'features/images/USBTailsLogo.png' " \
'-an -vcodec libx264 -y ' \
'-filter:v "crop=in_w-mod(in_w\,2):in_h-mod(in_h\,2)" ' \
......
......@@ -117,8 +117,7 @@ module Dogtail
'False'
elsif value.class == String
"'#{value}'"
# XXX:Buster: drop the Fixnum line once we stop supporting Stretch
elsif [Fixnum, Integer, Float].include?(value.class) # rubocop:disable Lint/UnifiedInteger
elsif [Integer, Float].include?(value.class)
v.to_s
else
raise "#{self.class.name} does not know how to handle argument type " \
......
......@@ -35,14 +35,7 @@ end
def time_delta(start_time, now)
elapsed = now - start_time
# XXX: Drop this version check when we drop support for running the test suite
# on Debian Stretch.
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.4')
format('%<elapsed>.2f', elapsed: elapsed)
.chomp('.00').chomp('.0').chomp('0')
else
elapsed.ceil(2)
end
elapsed.ceil(2)
end
# Call block (ignoring any exceptions it may throw) repeatedly with
......@@ -394,8 +387,6 @@ def dbus_send_get_shellcommand(service, object_path, method, *args, **opts)
opts ||= {}
ruby_type_to_dbus_type = {
String => 'string',
# XXX:Buster: drop the Fixnum line once we stop supporting Stretch
Fixnum => 'int32', # rubocop:disable Lint/UnifiedInteger
Integer => 'int32',
}
typed_args = args.map do |arg|
......@@ -426,14 +417,6 @@ def dbus_send(*args, **opts)
dbus_send_ret_conv(ret)
end
def ffmpeg
if cmd_helper('lsb_release --short --codename').chomp == 'stretch'
'avconv'
else
'ffmpeg'
end
end
# This is IO.popen() that ensures that we wait() for the subprocess to
# finish. Please use this instead IO.popen() when running a subprocess
# inside a try_for() or other Timeout::timeout() block!
......
......@@ -4,12 +4,6 @@ class OpenCVInternalError < StandardError
end
module OpenCV
@python = if cmd_helper('lsb_release --short --codename').chomp == 'stretch'
'python2.7'
else
'python3'
end
def self.matchTemplate(image, screen, sensitivity, show_match)
assert(sensitivity < 1.0)
# Do a deep-copy so we don't mess up the outer environment
......@@ -20,7 +14,7 @@ module OpenCV
env['DISPLAY'] = ENV['USER_DISPLAY']
end
p = popen_wait(
[env, @python, "#{GIT_DIR}/features/scripts/opencv_match_template.py",
[env, 'python3', "#{GIT_DIR}/features/scripts/opencv_match_template.py",
screen, image, sensitivity.to_s, show_match.to_s,],
err: [:child, :out]
)
......
......@@ -224,7 +224,7 @@ Before('@product') do |scenario|
if $config['CAPTURE']
video_name = sanitize_filename("#{scenario.name}.mkv")
@video_path = "#{ARTIFACTS_DIR}/#{video_name}"
capture = IO.popen([ffmpeg,
capture = IO.popen(['ffmpeg',
'-f', 'x11grab',
'-s', '1024x768',
'-r', '15',
......
......@@ -10,6 +10,7 @@ GENERAL_DEPENDENCIES="
cucumber
devscripts
dnsmasq-base
ffmpeg
gawk
git
i18nspector
......@@ -23,6 +24,8 @@ obfs4proxy
openssh-server
ovmf
pry
python3-opencv
python3-pil
python-jabberbot
python-potr
qemu-system-x86
......@@ -44,20 +47,6 @@ xdotool
xvfb
"
if [ "$(lsb_release --short --codename)" = "stretch" ]; then
GENERAL_DEPENDENCIES="${GENERAL_DEPENDENCIES}
libav-tools
python-opencv
python-pil
"
else
GENERAL_DEPENDENCIES="${GENERAL_DEPENDENCIES}
ffmpeg
python3-opencv
python3-pil
"
fi
usage() {
echo "Usage: $NAME [OPTION]... [--] [CUCUMBER_ARGS]...
Sets up an appropriate environment and invokes cucumber. Note that this script
......
......@@ -18,7 +18,7 @@ Operating system
</p>
</div>
If you usually run another operating system than Debian Stretch,
If you usually run another operating system than Debian
Buster, Bullseye or Sid, then you need to:
1. Enable nested virtualization on your host system.
......@@ -46,7 +46,7 @@ To install the dependencies on our test suite:
2. Install the following packages:
dist=$(lsb_release --short --codename)
if [ "${dist}" != stretch -o "${dist}" != buster ]; then
if [ "${dist}" != buster ]; then
# For python-jabberbot and python-potr, that were removed after Buster
echo 'deb http://ftp.us.debian.org/debian/ buster main' \
| sudo tee /etc/apt/sources.list.d/buster.list
......@@ -103,17 +103,9 @@ To install the dependencies on our test suite:
x264 \
xdotool \
xvfb \
$(
if [ "${dist}" = stretch ]; then
echo "libav-tools
python-opencv
python-pil"
else
echo "ffmpeg
python3-opencv
python3-pil"
fi
) \
ffmpeg \
python3-opencv \
python3-pil \
&& \
sudo service libvirtd restart
......@@ -145,23 +137,9 @@ If you have AppArmor enabled:
to `/etc/apparmor.d/libvirt/TEMPLATE.qemu`, in the
`profile LIBVIRT_TEMPLATE` section; then delete
`/etc/apparmor.d/libvirt/libvirt-*` and restart the test suite.
On Debian Stretch, if you use a custom `TMPDIR` to run the test suite,
If you use a custom `TMPDIR` to run the test suite,
replace `/tmp/TailsToaster` with the value of that `$TMPDIR`.
Patched QEMU
------------
Due to [[!tails_ticket 12142]]
aka. [[!debbug 851694]], any test scenario that creates a persistent
volume will fail. To work around this problem, rebuild [[!debpts
qemu]] locally with the upstream fix applied. For example, the `qemu`
source package in this APT suite has the fix:
deb-src http://deb.tails.boum.org/ isotester-stretch main
This problem does not affect host systems that run Debian Buster
or newer.
Special use cases
=================
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment