#!/bin/bash
# Copyright 2024 Ian Jackson and contributors to dkim-rotate
# SPDX-License-Identifier: GPL-3.0-or-later
# There is NO WARRANTY.

set -ex

. tests/lib

cat >> $tmp/etc/test.zone <<END
! mta_reload x-dkim-rotate-crash-mta
! dns_reload x-dkim-rotate-crash-dns
END

expect-fail "x-dkim-rotate-crash" \
day 0 --new

cat $tmp/var/zone

cat >> $tmp/etc/test.zone <<END
! mta_reload touch $tmp/reloaded-mta
! dns_reload touch $tmp/reloaded-dns
END

day 0

test -f $tmp/reloaded-mta
test -f $tmp/reloaded-dns

echo ok.
