-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #260 from freedomofpress/157-install-sd-workstatio…
…n-template-from-rpm Installs SD workstation TemplateVM from RPM
- Loading branch information
Showing
13 changed files
with
92 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,18 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: set syntax=yaml ts=2 sw=2 sts=2 et : | ||
|
||
## | ||
# qvm.work | ||
# ======== | ||
# | ||
# Installs 'sd-journlist' AppVM, for hosting the securedrop workstation app | ||
# | ||
## | ||
|
||
include: | ||
- sd-dom0-files | ||
|
||
# Sets virt_mode and kernel to use custom hardened kernel. | ||
sd-workstation-template: | ||
qvm.vm: | ||
- name: sd-workstation-template | ||
- clone: | ||
- source: debian-9 | ||
- label: yellow | ||
- name: securedrop-workstation | ||
- prefs: | ||
- virt-mode: hvm | ||
- kernel: '' | ||
- tags: | ||
- add: | ||
- sd-workstation | ||
- require: | ||
- pkg: dom0-install-securedrop-workstation-template |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import unittest | ||
|
||
|
||
class SD_Dom0_Rpm_Repo_Tests(unittest.TestCase): | ||
|
||
def setUp(self): | ||
# Enable full diff output in test report, to aid in debugging | ||
self.maxDiff = None | ||
|
||
def test_rpm_repo_public_key(self): | ||
pubkey_actual = "/etc/pki/rpm-gpg/RPM-GPG-KEY-securedrop-workstation-test" # noqa | ||
pubkey_wanted = "sd-workstation/apt-test-pubkey.asc" | ||
|
||
with open(pubkey_actual, "r") as f: | ||
pubkey_actual_contents = f.readlines() | ||
|
||
with open(pubkey_wanted, "r") as f: | ||
pubkey_wanted_contents = f.readlines() | ||
|
||
self.assertEqual(pubkey_actual_contents, pubkey_wanted_contents) | ||
|
||
def test_rpm_repo_config(self): | ||
repo_file = "/etc/yum.repos.d/securedrop-workstation-dom0.repo" | ||
wanted_lines = [ | ||
"[securedrop-workstation-dom0]", | ||
"gpgcheck=1", | ||
"gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-securedrop-workstation-test", # noqa | ||
"enabled=1", | ||
"baseurl=https://dev-bin.ops.securedrop.org/dom0-rpm-repo/", | ||
"name=SecureDrop Workstation Qubes dom0 repo", | ||
] | ||
with open(repo_file, "r") as f: | ||
found_lines = [x.strip() for x in f.readlines()] | ||
|
||
self.assertEqual(found_lines, wanted_lines) | ||
|
||
|
||
def load_tests(loader, tests, pattern): | ||
suite = unittest.TestLoader().loadTestsFromTestCase(SD_Dom0_Rpm_Repo_Tests) | ||
return suite |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import unittest | ||
|
||
from base import SD_VM_Local_Test | ||
|
||
|
||
class SD_Sys_Firewall_Tests(SD_VM_Local_Test): | ||
|
||
def setUp(self): | ||
self.vm_name = "sys-firewall" | ||
super(SD_Sys_Firewall_Tests, self).setUp() | ||
|
||
def test_rpm_repo_public_key(self): | ||
self.assertFilesMatch("/etc/pki/rpm-gpg/RPM-GPG-KEY-securedrop-workstation-test", # noqa | ||
"sd-workstation/apt-test-pubkey.asc") | ||
|
||
|
||
def load_tests(loader, tests, pattern): | ||
suite = unittest.TestLoader().loadTestsFromTestCase(SD_Sys_Firewall_Tests) | ||
return suite |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters