From 9a15d7234efbc349c971dab8abb2049797aa3845 Mon Sep 17 00:00:00 2001
From: intrigeri
Date: Tue, 17 Nov 2020 17:07:49 +0000
Subject: [PATCH 1/4] Test suite doc: drop support for Stretch
---
.../release_process/test/setup.mdwn | 34 ++++---------------
1 file changed, 6 insertions(+), 28 deletions(-)
diff --git a/wiki/src/contribute/release_process/test/setup.mdwn b/wiki/src/contribute/release_process/test/setup.mdwn
index d2dd800a9b..bec91fea79 100644
--- a/wiki/src/contribute/release_process/test/setup.mdwn
+++ b/wiki/src/contribute/release_process/test/setup.mdwn
@@ -18,7 +18,7 @@ Operating system
-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
=================
--
GitLab
From ce674af9c5b8206cdf94154d53931c45a33de4b1 Mon Sep 17 00:00:00 2001
From: intrigeri
Date: Tue, 17 Nov 2020 17:09:47 +0000
Subject: [PATCH 2/4] run_test_suite: drop support for Stretch
---
run_test_suite | 17 +++--------------
1 file changed, 3 insertions(+), 14 deletions(-)
diff --git a/run_test_suite b/run_test_suite
index 38ebb945b8..dfaf621577 100755
--- a/run_test_suite
+++ b/run_test_suite
@@ -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
--
GitLab
From 9e3de2283a28faa9ae0d73121ab1d7bb79fa87d9 Mon Sep 17 00:00:00 2001
From: intrigeri
Date: Tue, 17 Nov 2020 17:22:03 +0000
Subject: [PATCH 3/4] Test suite: drop workarounds for running on Stretch
---
features/scripts/opencv_match_template.py | 4 ----
features/step_definitions/erase_memory.rb | 4 +---
features/step_definitions/mac_spoofing.rb | 9 +--------
features/step_definitions/pidgin.rb | 4 +---
features/step_definitions/totem.rb | 2 +-
features/support/helpers/dogtail.rb | 3 +--
features/support/helpers/misc_helpers.rb | 19 +------------------
features/support/helpers/opencv.rb | 8 +-------
features/support/hooks.rb | 2 +-
9 files changed, 8 insertions(+), 47 deletions(-)
diff --git a/features/scripts/opencv_match_template.py b/features/scripts/opencv_match_template.py
index 7047fb73d5..e544e1a726 100755
--- a/features/scripts/opencv_match_template.py
+++ b/features/scripts/opencv_match_template.py
@@ -1,9 +1,5 @@
#!/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
diff --git a/features/step_definitions/erase_memory.rb b/features/step_definitions/erase_memory.rb
index e19ec252af..5d5f5d3f88 100644
--- a/features/step_definitions/erase_memory.rb
+++ b/features/step_definitions/erase_memory.rb
@@ -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
diff --git a/features/step_definitions/mac_spoofing.rb b/features/step_definitions/mac_spoofing.rb
index c8cc558ab6..a9a24fbfe3 100644
--- a/features/step_definitions/mac_spoofing.rb
+++ b/features/step_definitions/mac_spoofing.rb
@@ -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
diff --git a/features/step_definitions/pidgin.rb b/features/step_definitions/pidgin.rb
index d84b24fd60..f9497a2014 100644
--- a/features/step_definitions/pidgin.rb
+++ b/features/step_definitions/pidgin.rb
@@ -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 }
diff --git a/features/step_definitions/totem.rb b/features/step_definitions/totem.rb
index a5a87d4e4a..0a644d096d 100644
--- a/features/step_definitions/totem.rb
+++ b/features/step_definitions/totem.rb
@@ -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)" ' \
diff --git a/features/support/helpers/dogtail.rb b/features/support/helpers/dogtail.rb
index a112fb9138..0c7aa6b61e 100644
--- a/features/support/helpers/dogtail.rb
+++ b/features/support/helpers/dogtail.rb
@@ -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 " \
diff --git a/features/support/helpers/misc_helpers.rb b/features/support/helpers/misc_helpers.rb
index b44d4b2aab..cf451dbafd 100644
--- a/features/support/helpers/misc_helpers.rb
+++ b/features/support/helpers/misc_helpers.rb
@@ -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('%.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!
diff --git a/features/support/helpers/opencv.rb b/features/support/helpers/opencv.rb
index 5e79876d7f..0eabfba540 100644
--- a/features/support/helpers/opencv.rb
+++ b/features/support/helpers/opencv.rb
@@ -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]
)
diff --git a/features/support/hooks.rb b/features/support/hooks.rb
index 5389090b11..d50fcf0859 100644
--- a/features/support/hooks.rb
+++ b/features/support/hooks.rb
@@ -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',
--
GitLab
From a84a36531baac0504eed4165d0a22836642a7f79 Mon Sep 17 00:00:00 2001
From: intrigeri
Date: Wed, 18 Nov 2020 07:39:26 +0000
Subject: [PATCH 4/4] Test suite: run a Q35 5.0 machine
We can now assume QEMU 5.0 or newer.
---
features/domains/default.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/features/domains/default.xml b/features/domains/default.xml
index 52247fb98f..2c99931dd6 100644
--- a/features/domains/default.xml
+++ b/features/domains/default.xml
@@ -3,7 +3,7 @@
2097152
2
- hvm
+ hvm
--
GitLab