Skip to content

Commit

Permalink
Fix deb tests
Browse files Browse the repository at this point in the history
  • Loading branch information
emkll committed Feb 1, 2021
1 parent f375bd7 commit 05b2106
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
22 changes: 16 additions & 6 deletions molecule/builder-xenial/tests/test_securedrop_deb_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,11 @@ def make_deb_paths() -> Dict[str, Path]:
if SECUREDROP_TARGET_PLATFORM == "focal":
grsec_version = grsec_version+"+focal"

config_version = securedrop_test_vars["config_version"]
config_version = "{}+{}".format(securedrop_test_vars["config_version"],
securedrop_test_vars["securedrop_version"])

if SECUREDROP_TARGET_PLATFORM == "focal":
config_version = config_version+"+focal"
config_version += "+focal"

substitutions = dict(
securedrop_version=securedrop_test_vars["securedrop_version"],
Expand Down Expand Up @@ -546,10 +548,18 @@ def test_config_package_contains_expected_files(host: Host) -> None:
Inspect the package contents to ensure all config files are included in
the package.
"""
wanted_files = [
"/etc/cron-apt/action.d/9-remove",
"/etc/profile.d/securedrop_additions.sh",
]
if SECUREDROP_TARGET_PLATFORM == "xenial":
wanted_files = [
"/etc/cron-apt/action.d/9-remove",
"/etc/profile.d/securedrop_additions.sh",
]
else:
wanted_files = [
"/etc/profile.d/securedrop_additions.sh",
"/opt/securedrop/20auto-upgrades",
"/opt/securedrop/50unattended-upgrades",
"/opt/securedrop/reboot-flag",
]
c = host.run("dpkg-deb --contents {}".format(deb_paths["securedrop_config"]))
for wanted_file in wanted_files:
assert re.search(
Expand Down
2 changes: 1 addition & 1 deletion molecule/builder-xenial/tests/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ deb_paths:
ossec_server: /tmp/build/ossec-server-{ossec_version}-amd64.deb
ossec_agent: /tmp/build/ossec-agent-{ossec_version}-amd64.deb
securedrop_keyring: /tmp/build/securedrop-keyring-{keyring_version}+{securedrop_version}-amd64.deb
securedrop_config: /tmp/build/securedrop-config-{config_version}+{securedrop_version}-amd64.deb
securedrop_config: /tmp/build/securedrop-config-{config_version}-amd64.deb
securedrop_grsec: /tmp/build/securedrop-grsec-{grsec_version}-amd64.deb

lintian_tags:
Expand Down

0 comments on commit 05b2106

Please sign in to comment.