From 86c239d44cb031f87679fa95a1bdcaafb36c6e24 Mon Sep 17 00:00:00 2001 From: b12f Date: Tue, 3 Sep 2024 10:18:11 +0200 Subject: [PATCH] tests/keycloak: local imap syncing for client --- tests/keycloak.nix | 2 ++ tests/support/client.nix | 20 ++++++++++++++++++++ tests/support/mail-server.nix | 4 ++++ 3 files changed, 26 insertions(+) diff --git a/tests/keycloak.nix b/tests/keycloak.nix index b189391..10df7c1 100644 --- a/tests/keycloak.nix +++ b/tests/keycloak.nix @@ -88,5 +88,7 @@ in puppeteer_run('page.locator("button::-p-text(Register)").click()') puppeteer_run('page.waitForNetworkIdle()') client.screenshot("after-register") + + client.succeed("offlineimap") ''; } diff --git a/tests/support/client.nix b/tests/support/client.nix index ddc8457..335dadb 100644 --- a/tests/support/client.nix +++ b/tests/support/client.nix @@ -45,5 +45,25 @@ in ]; }; }; + + accounts.email.accounts."test-user@${config.pub-solar-os.networking.domain}" = { + primary = true; + address = "test-user@${config.pub-solar-os.networking.domain}"; + userName = "test-user@${config.pub-solar-os.networking.domain}"; + passwordCommand = "echo password"; + realName = "Test User"; + imap = { + host = "mail.${config.pub-solar-os.networking.domain}"; + port = 993; + }; + smtp = { + host = "mail.${config.pub-solar-os.networking.domain}"; + port = 587; + tls.useStartTls = true; + }; + getmail.enable = true; + getmail.mailboxes = [ "ALL" ]; + msmtp.enable = true; + }; }; } diff --git a/tests/support/mail-server.nix b/tests/support/mail-server.nix index b0a1ada..27e6d7b 100644 --- a/tests/support/mail-server.nix +++ b/tests/support/mail-server.nix @@ -22,6 +22,10 @@ "hakkonaut@${config.pub-solar-os.networking.domain}" = { hashedPasswordFile = "/tmp/emailpw"; }; + "test-user@${config.pub-solar-os.networking.domain}" = { + quota = "1G"; + hashedPasswordFile = "/tmp/emailpw"; + }; }; }; }