summaryrefslogtreecommitdiffstatshomepage
path: root/tests/test_canonical.py
diff options
context:
space:
mode:
authorsommerfeld <sommerfeld@sommerfeld.dev>2026-09-22 13:57:08 +0100
committersommerfeld <sommerfeld@sommerfeld.dev>2026-09-22 13:57:08 +0100
commit1e19a0c7cbb87302bbe7fa6a60ad53738719a095 (patch)
tree11b84a20c6fd4f53179bca59a92b808d855900d8 /tests/test_canonical.py
parenta297161fe83ec5e3e6fd3c0be26fadfad3ed788b (diff)
downloaddotfiles-1e19a0c7cbb87302bbe7fa6a60ad53738719a095.tar.gz
dotfiles-1e19a0c7cbb87302bbe7fa6a60ad53738719a095.tar.bz2
dotfiles-1e19a0c7cbb87302bbe7fa6a60ad53738719a095.zip
Default corporate SSH connections to the work identity
Diffstat (limited to 'tests/test_canonical.py')
-rw-r--r--tests/test_canonical.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/test_canonical.py b/tests/test_canonical.py
index 76c61d1..1a8c5dd 100644
--- a/tests/test_canonical.py
+++ b/tests/test_canonical.py
@@ -207,6 +207,32 @@ class RoleTests(unittest.TestCase):
subprocess.run(["sh", "-c", rendered], env=env, check=True)
self.assertEqual(target.read_text(), '{"local": true}\n')
+ def test_canonical_defaults_to_work_git_and_ssh_identity(self):
+ git = subprocess.check_output(
+ self.command(
+ "canonical",
+ "execute-template",
+ "--file",
+ str(ROOT / "dot_config/git/config.tmpl"),
+ ),
+ text=True,
+ )
+ self.assertIn('email = "work@canonical.com"', git)
+ self.assertIn('name = "Work User"', git)
+ self.assertIn('signingkey = "' + "A" * 40 + '"', git)
+ self.assertNotIn("includeIf", git)
+ ssh = subprocess.check_output(
+ self.command(
+ "canonical",
+ "execute-template",
+ "--file",
+ str(ROOT / "private_dot_ssh/config.tmpl"),
+ ),
+ text=True,
+ )
+ self.assertIn("IdentityFile ~/.ssh/work.pub", ssh)
+ self.assertIn("IdentitiesOnly yes", ssh)
+
def test_work_identity_is_rendered_without_personal_identity(self):
for source in [
"dot_config/git/config.tmpl",