diff --git a/main.pm b/main.pm index 0790fc98..639b8d0c 100644 --- a/main.pm +++ b/main.pm @@ -211,6 +211,10 @@ if (get_var("STORE_HDD_1") || get_var("PUBLISH_HDD_1")) { autotest::loadtest "tests/shutdown.pm"; } +if (check_var('TEST_SECUREDROP', '1')) { + autotest::loadtest "tests/securedrop/install.pm"; +} + 1; # vim: set sw=4 et: diff --git a/tests/securedrop/install.pm b/tests/securedrop/install.pm new file mode 100644 index 00000000..15986d54 --- /dev/null +++ b/tests/securedrop/install.pm @@ -0,0 +1,43 @@ +# The Qubes OS Project, https://www.qubes-os.org/ +# +# Copyright (C) 2024 Francisco Rocha +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +use base "installedtest"; +use strict; +use testapi; + +sub run { + my ($self) = @_; + + $self->select_gui_console; + assert_screen "desktop"; + x11_start_program('xterm'); + + # NOTE: These are done via qvm-run instead of gnome-terminal so that we + # can know in case they failed. + assert_script_run('qvm-run -p work -- gpg --keyserver hkps://keys.openpgp.org --recv-key "2359 E653 8C06 13E6 5295 5E6C 188E DD3B 7B22 E6A3"'); + assert_script_run('qvm-run -p work -- "gpg --armor --export 2359E6538C0613E652955E6C188EDD3B7B22E6A3 > securedrop-release-key.pub"'); + assert_script_run('qvm-run -p work -- sudo rpmkeys --import securedrop-release-key.pub'); + assert_script_run('qvm-run -p work -- "echo -e \"[sd]\nenabled=1\nbaseurl=https://yum.securedrop.org/workstation/dom0/f37\nname=boostrap\" | sudo tee /etc/yum.repos.d/securedrop-temp.repo"'); + assert_script_run('qvm-run -p work -- dnf download -y securedrop-workstation-dom0-config'); + assert_script_run('qvm-run -p work -- rpm -Kv securedrop-workstation-dom0-config-*.rpm'); # TODO confirm output is correct + assert_script_run('qvm-run -p work -- "cat /home/user/securedrop-workstation-dom0-config-*.rpm" > securedrop-workstation.rpm'); + assert_script_run('sudo dnf install securedrop-workstation.rpm'); +} + +1; + +# vim: set sw=4 et: