dnsmasq/Regression/cannot-open-log/test.sh
2023-08-02 16:11:59 +02:00

38 lines
1 KiB
Bash
Executable file

#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
. /usr/share/beakerlib/beakerlib.sh || exit 1
: ${DELAY:=1}
rlJournalStart
rlPhaseStartSetup
rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory"
rlRun "pushd $tmp"
rlRun "set -o pipefail"
rlFileBackup --missing-ok /etc/dnsmasq.d/log.conf
rlFileBackup --missing-ok /var/log/dnsmasq.log
echo "log-facility=/var/log/dnsmasq.log" > /etc/dnsmasq.d/log.conf
rlPhaseEnd
rlPhaseStartTest
rlRun "systemctl enable dnsmasq"
rlRun "systemctl start dnsmasq"
sleep $DELAY
rlRun "systemctl status dnsmasq"
rlRun "systemctl restart dnsmasq"
sleep $DELAY
rlRun "ls -l /var/log/dnsmasq.log"
rlRun "systemctl disable dnsmasq"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -f /var/log/dnsmasq.log"
rlRun "rm -f /etc/dnsmasq.d/log.conf"
rlRun "rm -r $tmp" 0 "Remove tmp directory"
rlFileRestore
rlPhaseEnd
echo "debug:::::::::"
cat /var/log/audit/audit.log |grep den
echo "end of debug"
rlJournalEnd