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 !254
parents d9a23e20 a84a3653
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<currentMemory unit='KiB'>2097152</currentMemory> <currentMemory unit='KiB'>2097152</currentMemory>
<vcpu>2</vcpu> <vcpu>2</vcpu>
<os> <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'/> <boot dev='cdrom'/>
</os> </os>
<features> <features>
......
#!/usr/bin/env python3 #!/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 cv2
import os import os
import sys import sys
......
...@@ -226,10 +226,8 @@ When /^I fill a (\d+) MiB file with a known pattern on the (persistent|root) fil ...@@ -226,10 +226,8 @@ When /^I fill a (\d+) MiB file with a known pattern on the (persistent|root) fil
end end
# Note that `yes` prints its own newline, so we have to skip it in # Note that `yes` prints its own newline, so we have to skip it in
# `pattern` below. # `pattern` below.
# XXX:Stretch: once we drop support < Buster we can improve the
# expression below to `pattern[..-2]`.
$vm.execute_successfully( $vm.execute_successfully(
"yes #{pattern[0, pattern.length - 1]} | " \ "yes #{pattern[0..-2]} | " \
"dd of=#{dest_file} bs=#{pattern.size} count=#{pattern_nb}" "dd of=#{dest_file} bs=#{pattern.size} count=#{pattern_nb}"
) )
end end
......
...@@ -104,14 +104,7 @@ end ...@@ -104,14 +104,7 @@ end
When /^I hotplug a network device( and wait for it to be initialized)?$/ do |wait| When /^I hotplug a network device( and wait for it to be initialized)?$/ do |wait|
initial_nr_nics = wait ? all_ethernet_nics.size : nil initial_nr_nics = wait ? all_ethernet_nics.size : nil
# XXX:Buster: when we stop supporting the test suite on Stretch device = 'pcnet'
# 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
debug_log("Hotplugging a '#{device}' network device") debug_log("Hotplugging a '#{device}' network device")
xml = <<-XML xml = <<-XML
<interface type='network'> <interface type='network'>
......
...@@ -113,9 +113,7 @@ Given /^my XMPP friend goes online( and joins the multi-user chat)?$/ do |join_c ...@@ -113,9 +113,7 @@ Given /^my XMPP friend goes online( and joins the multi-user chat)?$/ do |join_c
account['username'] + '@' + account['domain'], account['username'] + '@' + account['domain'],
account['password'], account['password'],
account['otr_key'], account['otr_key'],
# XXX:Buster: once we stop supporting running our test suite on Stretch, **(bot_opts.transform_keys(&:to_sym))
# replace this with: **(bot_opts.transform_keys(&:to_sym))
**(bot_opts.each_with_object({}) { |(k, v), a| a[k.to_sym] = v })
) )
@chatbot.start @chatbot.start
add_after_scenario_hook { @chatbot.stop } add_after_scenario_hook { @chatbot.stop }
......
...@@ -5,7 +5,7 @@ Given /^I create sample videos$/ do ...@@ -5,7 +5,7 @@ Given /^I create sample videos$/ do
@video_dir_on_host = "#{$config['TMPDIR']}/video_dir" @video_dir_on_host = "#{$config['TMPDIR']}/video_dir"
FileUtils.mkdir_p(@video_dir_on_host) FileUtils.mkdir_p(@video_dir_on_host)
add_after_scenario_hook { FileUtils.rm_r(@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' " \ "-i 'features/images/USBTailsLogo.png' " \
'-an -vcodec libx264 -y ' \ '-an -vcodec libx264 -y ' \
'-filter:v "crop=in_w-mod(in_w\,2):in_h-mod(in_h\,2)" ' \ '-filter:v "crop=in_w-mod(in_w\,2):in_h-mod(in_h\,2)" ' \
......
...@@ -117,8 +117,7 @@ module Dogtail ...@@ -117,8 +117,7 @@ module Dogtail
'False' 'False'
elsif value.class == String elsif value.class == String
"'#{value}'" "'#{value}'"
# XXX:Buster: drop the Fixnum line once we stop supporting Stretch elsif [Integer, Float].include?(value.class)
elsif [Fixnum, Integer, Float].include?(value.class) # rubocop:disable Lint/UnifiedInteger
v.to_s v.to_s
else else
raise "#{self.class.name} does not know how to handle argument type " \ raise "#{self.class.name} does not know how to handle argument type " \
......
...@@ -35,14 +35,7 @@ end ...@@ -35,14 +35,7 @@ end
def time_delta(start_time, now) def time_delta(start_time, now)
elapsed = now - start_time elapsed = now - start_time
# XXX: Drop this version check when we drop support for running the test suite elapsed.ceil(2)
# 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
end end
# Call block (ignoring any exceptions it may throw) repeatedly with # 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) ...@@ -394,8 +387,6 @@ def dbus_send_get_shellcommand(service, object_path, method, *args, **opts)
opts ||= {} opts ||= {}
ruby_type_to_dbus_type = { ruby_type_to_dbus_type = {
String => 'string', String => 'string',
# XXX:Buster: drop the Fixnum line once we stop supporting Stretch
Fixnum => 'int32', # rubocop:disable Lint/UnifiedInteger
Integer => 'int32', Integer => 'int32',
} }
typed_args = args.map do |arg| typed_args = args.map do |arg|
...@@ -426,14 +417,6 @@ def dbus_send(*args, **opts) ...@@ -426,14 +417,6 @@ def dbus_send(*args, **opts)
dbus_send_ret_conv(ret) dbus_send_ret_conv(ret)
end 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 # This is IO.popen() that ensures that we wait() for the subprocess to
# finish. Please use this instead IO.popen() when running a subprocess # finish. Please use this instead IO.popen() when running a subprocess
# inside a try_for() or other Timeout::timeout() block! # inside a try_for() or other Timeout::timeout() block!
......
...@@ -4,12 +4,6 @@ class OpenCVInternalError < StandardError ...@@ -4,12 +4,6 @@ class OpenCVInternalError < StandardError
end end
module OpenCV 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) def self.matchTemplate(image, screen, sensitivity, show_match)
assert(sensitivity < 1.0) assert(sensitivity < 1.0)
# Do a deep-copy so we don't mess up the outer environment # Do a deep-copy so we don't mess up the outer environment
...@@ -20,7 +14,7 @@ module OpenCV ...@@ -20,7 +14,7 @@ module OpenCV
env['DISPLAY'] = ENV['USER_DISPLAY'] env['DISPLAY'] = ENV['USER_DISPLAY']
end end
p = popen_wait( 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,], screen, image, sensitivity.to_s, show_match.to_s,],
err: [:child, :out] err: [:child, :out]
) )
......
...@@ -224,7 +224,7 @@ Before('@product') do |scenario| ...@@ -224,7 +224,7 @@ Before('@product') do |scenario|
if $config['CAPTURE'] if $config['CAPTURE']
video_name = sanitize_filename("#{scenario.name}.mkv") video_name = sanitize_filename("#{scenario.name}.mkv")
@video_path = "#{ARTIFACTS_DIR}/#{video_name}" @video_path = "#{ARTIFACTS_DIR}/#{video_name}"
capture = IO.popen([ffmpeg, capture = IO.popen(['ffmpeg',
'-f', 'x11grab', '-f', 'x11grab',
'-s', '1024x768', '-s', '1024x768',
'-r', '15', '-r', '15',
......
...@@ -10,6 +10,7 @@ GENERAL_DEPENDENCIES=" ...@@ -10,6 +10,7 @@ GENERAL_DEPENDENCIES="
cucumber cucumber
devscripts devscripts
dnsmasq-base dnsmasq-base
ffmpeg
gawk gawk
git git
i18nspector i18nspector
...@@ -23,6 +24,8 @@ obfs4proxy ...@@ -23,6 +24,8 @@ obfs4proxy
openssh-server openssh-server
ovmf ovmf
pry pry
python3-opencv
python3-pil
python-jabberbot python-jabberbot
python-potr python-potr
qemu-system-x86 qemu-system-x86
...@@ -44,20 +47,6 @@ xdotool ...@@ -44,20 +47,6 @@ xdotool
xvfb 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() { usage() {
echo "Usage: $NAME [OPTION]... [--] [CUCUMBER_ARGS]... echo "Usage: $NAME [OPTION]... [--] [CUCUMBER_ARGS]...
Sets up an appropriate environment and invokes cucumber. Note that this script Sets up an appropriate environment and invokes cucumber. Note that this script
......
...@@ -18,7 +18,7 @@ Operating system ...@@ -18,7 +18,7 @@ Operating system
</p> </p>
</div> </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: Buster, Bullseye or Sid, then you need to:
1. Enable nested virtualization on your host system. 1. Enable nested virtualization on your host system.
...@@ -46,7 +46,7 @@ To install the dependencies on our test suite: ...@@ -46,7 +46,7 @@ To install the dependencies on our test suite:
2. Install the following packages: 2. Install the following packages:
dist=$(lsb_release --short --codename) 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 # For python-jabberbot and python-potr, that were removed after Buster
echo 'deb http://ftp.us.debian.org/debian/ buster main' \ echo 'deb http://ftp.us.debian.org/debian/ buster main' \
| sudo tee /etc/apt/sources.list.d/buster.list | sudo tee /etc/apt/sources.list.d/buster.list
...@@ -103,17 +103,9 @@ To install the dependencies on our test suite: ...@@ -103,17 +103,9 @@ To install the dependencies on our test suite:
x264 \ x264 \
xdotool \ xdotool \
xvfb \ xvfb \
$( ffmpeg \
if [ "${dist}" = stretch ]; then python3-opencv \
echo "libav-tools python3-pil \
python-opencv
python-pil"
else
echo "ffmpeg
python3-opencv
python3-pil"
fi
) \
&& \ && \
sudo service libvirtd restart sudo service libvirtd restart
...@@ -145,23 +137,9 @@ If you have AppArmor enabled: ...@@ -145,23 +137,9 @@ If you have AppArmor enabled:
to `/etc/apparmor.d/libvirt/TEMPLATE.qemu`, in the to `/etc/apparmor.d/libvirt/TEMPLATE.qemu`, in the
`profile LIBVIRT_TEMPLATE` section; then delete `profile LIBVIRT_TEMPLATE` section; then delete
`/etc/apparmor.d/libvirt/libvirt-*` and restart the test suite. `/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`. 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 Special use cases
================= =================
......
Supports Markdown
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