From 17cc36f0555acafb4867a3204d15c81b8517a746 Mon Sep 17 00:00:00 2001 From: Conor Schaefer Date: Mon, 19 Oct 2020 09:48:54 -0700 Subject: [PATCH] Updates sd-app gpg config tests Follow-up to [0]. Post-consolidation, we can expect the /etc/profile.d/ path to be present on all systems, but only on sd-app should it return "sd-gpg" rather than an empty string. [0] https://github.com/freedomofpress/securedrop-workstation/pull/623 --- tests/base.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/tests/base.py b/tests/base.py index 2b977395..e499df6d 100644 --- a/tests/base.py +++ b/tests/base.py @@ -137,19 +137,12 @@ def qubes_gpg_domain_configured(self, vmname=False): sd-app should have it set to sd-gpg. All other AppVMs should not have this configured. """ - expected_profile_app = 'if [ "$(qubesdb-read /name)" = "sd-app" ]; then export QUBES_GPG_DOMAIN="sd-gpg"; fi\n' # noqa: E501 - expected_env_app = "sd-gpg" - expected_env_all = "" - profile_path = "/etc/profile.d/sd-app-qubes-gpg-domain.sh" - env_cmd = 'echo "$QUBES_GPG_DOMAIN"' env_contents = self._run(env_cmd) if vmname == "sd-app": - self.assertTrue(self._fileExists(profile_path)) - profile_contents = self._get_file_contents(profile_path) - self.assertEqual(profile_contents, expected_profile_app) - self.assertEqual(env_contents, expected_env_app) + expected_env = "sd-gpg" else: - self.assertFalse(self._fileExists(profile_path)) - self.assertEqual(env_contents, expected_env_all) + expected_env = "" + + self.assertEqual(env_contents, expected_env)