Skip to content

Commit c33819e

Browse files
committed
SECUREDROP_ENV: add 'prod-qa' option
Adds an option to do the final testing prior to a release
1 parent ecf3440 commit c33819e

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,4 @@ Variables used in tests:
7676
SecureDrop variables used in tests:
7777
- `SECUREDROP_INSTALL` - when set to `1`, SecureDrop Workstation is installed
7878
- `SECUREDROP_TEST` - when set with a value, SecureDrop tests are run on top of an existing installation
79-
- `SECUREDROP_ENV` - target envionment ('dev', 'staging', 'prod')
79+
- `SECUREDROP_ENV` - target envionment ('dev', 'staging', 'prod', 'prod-qa')

tests/securedrop/install_workstation.pm

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,19 @@ sub download_repo {
3232

3333
# Following instructions at https://github.com/freedomofpress/securedrop-workstation-docs/blob/aa89494/docs/admin/install/install.rst#download-securedrop-workstation-packages
3434
sub qubes_contrib_keyring_bootstrap() {
35+
my ($environment) = @_;
3536

3637
assert_script_run('sudo qubes-dom0-update -y qubes-repo-contrib', timeout => 120);
3738
assert_script_run('sudo qubes-dom0-update --clean -y securedrop-workstation-keyring', timeout => 120);
3839

3940
sleep(15); # sleep for securedrop-workstation-keyring key to be imported,
4041

4142
assert_script_run('sudo dnf -y remove qubes-repo-contrib');
43+
44+
# QA: just replace the repo URL to keep it as close as possible to prod
45+
if ($environment eq "prod-qa") {
46+
assert_script_run("sudo sed -i -e 's|yum.|yum-qa.|g' /etc/yum.repos.d/securedrop-workstation-keyring-dev.repo'");
47+
}
4248
};
4349

4450
sub install {
@@ -49,15 +55,14 @@ sub install {
4955
# Install prod keyring package through Qubes-contrib to simulate end-user
5056
# path, regardless of environment. This should be OK because staging / dev
5157
# packages will override any prod packages due to higher version numbers
52-
qubes_contrib_keyring_bootstrap();
58+
qubes_contrib_keyring_bootstrap($environment);
5359

5460
if ($environment eq "dev") {
5561
build_rpm();
5662
}
5763

58-
5964
my $installation_cmd;
60-
if ($environment eq "prod") {
65+
if ($environment eq "prod" || $environment eq "prod-qa") {
6166
assert_script_run("sudo qubes-dom0-update --clean -y securedrop-workstation-dom0-config");
6267
$installation_cmd = "sdw-admin --apply";
6368
} else {
@@ -78,7 +83,7 @@ sub copy_config {
7883
my $target_dir;
7984
my $sudo_modifier;
8085

81-
if ($environment eq "prod") {
86+
if ($environment eq "prod" || $environment eq "prod-qa") {
8287
# Place configuration files directly in final directory
8388
$target_dir = "/usr/share/securedrop-workstation-dom0-config";
8489
assert_script_run("sudo mkdir -p $target_dir");

0 commit comments

Comments
 (0)