Skip to content

Commit

Permalink
Add SecureDrop installation test
Browse files Browse the repository at this point in the history
  • Loading branch information
deeplow committed Sep 12, 2024
1 parent 7242736 commit 2008e3f
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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:
43 changes: 43 additions & 0 deletions tests/securedrop/install.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# The Qubes OS Project, https://www.qubes-os.org/
#
# Copyright (C) 2024 Francisco Rocha <francisco@freedom.press>
#
# 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 <https://www.gnu.org/licenses/>.

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:

0 comments on commit 2008e3f

Please sign in to comment.