Skip to content

Commit bac14b0

Browse files
committed
Add local postfix dovecot e2e recipe
1 parent a21c132 commit bac14b0

2 files changed

Lines changed: 67 additions & 0 deletions

File tree

meson.build

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,12 @@ test(
672672
)
673673

674674
if fs.is_file('/usr/lib/dovecot/libdovecot-storage.so')
675+
test(
676+
'docs issue 0289 postfix dovecot e2e recipe',
677+
python,
678+
args: files('tests/docs/test_issue_0289_postfix_dovecot_e2e_recipe.py'),
679+
)
680+
675681
test(
676682
'docs issue 0293 dovecot imap fetch recipe',
677683
python,
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#!/usr/bin/env python3
2+
3+
import subprocess
4+
import tempfile
5+
from pathlib import Path
6+
7+
8+
REPO_ROOT = Path(__file__).resolve().parents[2]
9+
DEFAULT_DOVECOT_SOURCE_DIR = REPO_ROOT / "tests" / "dovecot" / "fixtures" / (
10+
"valid-2.3.21.1"
11+
)
12+
DEFAULT_DOVECOT_BUILD_DIR = (
13+
DEFAULT_DOVECOT_SOURCE_DIR / "build-config-valid"
14+
)
15+
16+
17+
def run(command: list[str], cwd: Path) -> None:
18+
subprocess.run(command, cwd=cwd, check=True, text=True)
19+
20+
21+
def main() -> None:
22+
with tempfile.TemporaryDirectory(prefix="wyrebox-postfix-dovecot-e2e-recipe-") as tmp:
23+
tempdir = Path(tmp)
24+
builddir = tempdir / "build"
25+
26+
run(
27+
[
28+
"meson",
29+
"setup",
30+
"-Ddovecot_backend=enabled",
31+
f"-Ddovecot_source_dir={DEFAULT_DOVECOT_SOURCE_DIR}",
32+
f"-Ddovecot_build_dir={DEFAULT_DOVECOT_BUILD_DIR}",
33+
str(builddir),
34+
str(REPO_ROOT),
35+
],
36+
cwd=tempdir,
37+
)
38+
run(
39+
[
40+
"meson",
41+
"test",
42+
"-C",
43+
str(builddir),
44+
"postfix pipe real daemon delivery",
45+
],
46+
cwd=tempdir,
47+
)
48+
run(
49+
[
50+
"meson",
51+
"test",
52+
"-C",
53+
str(builddir),
54+
"dovecot plugin mailbox smoke",
55+
],
56+
cwd=tempdir,
57+
)
58+
59+
60+
if __name__ == "__main__":
61+
main()

0 commit comments

Comments
 (0)