Files
chasquid/cmd/chasquid-util/test_alias_resolve.cmy
Alberto Bertogli e6c6df457d chasquid-util: Use server for aliases-resolve and domaininfo-remove
This patch makes chasquid-util's aliases-resolve and domaininfo-remove
commands talk to the chasquid server (via the new localrpc server).

For aliases-resolve, currently has fairly hacky logic which reimplements
a bunch of the servers', and is also incomplete because it does not
support hooks.

In this patch we fix that by having it talk to the server, where we get
authoritative responses and have no issues with aliases hooks. This
resolves https://github.com/albertito/chasquid/issues/18.

For domaininfo-remove, currently its implementation is also very hacky
since it manipulates files behind the servers' back and without even
using the internal library.

In this patch we fix that by doing the operation through the server,
avoiding the need for those hacks, and also remove the need to manually
reload the server afterwards.
2023-07-30 13:21:07 +01:00

22 lines
528 B
Plaintext

# Test success.
server unix_listen .data/localrpc-v1
c = ./chasquid-util -C=.config aliases-resolve test@test.com
server <- AliasResolve Address=test%40test.com
server -> 200 %28email%29=r1%40r1.com&%28pipe%29=cmd%20args
c <- (email) r1@r1.com
c <- (pipe) cmd args
c wait 0
# Test error.
server unix_listen .data/localrpc-v1
c = ./chasquid-util -C=.config aliases-resolve test@test.com
server <- AliasResolve Address=test%40test.com
server -> 500 This is a test error
c <- Error resolving: This is a test error
c wait 1