3 # Regression test for http://tracker.ceph.com/issues/14984
5 # When the bug is present, starting the rbdmap service causes
6 # a bogus log message to be emitted to the log because the RBDMAPFILE
7 # environment variable is not set.
9 # When the bug is not present, starting the rbdmap service will emit
10 # no log messages, because /etc/ceph/rbdmap does not contain any lines
11 # that require processing.
15 which ceph-detect-init
>/dev
/null ||
exit 1
16 [ "$(ceph-detect-init)" = "systemd" ] ||
exit 0
18 echo "TEST: save timestamp for use later with journalctl --since"
19 TIMESTAMP
=$
(date +%Y-
%m-
%d\
%H
:%M
:%S
)
21 echo "TEST: assert that rbdmap has not logged anything since boot"
22 journalctl
-b 0 -t rbdmap |
grep 'rbdmap\[[[:digit:]]' && exit 1
23 journalctl
-b 0 -t init-rbdmap |
grep 'rbdmap\[[[:digit:]]' && exit 1
25 echo "TEST: restart the rbdmap.service"
26 sudo systemctl restart rbdmap.service
28 echo "TEST: ensure that /usr/bin/rbdmap runs to completion"
29 until sudo systemctl status rbdmap.service |
grep 'active (exited)' ; do
33 echo "TEST: assert that rbdmap has not logged anything since TIMESTAMP"
34 journalctl
--since "$TIMESTAMP" -t rbdmap |
grep 'rbdmap\[[[:digit:]]' && exit 1
35 journalctl
--since "$TIMESTAMP" -t init-rbdmap |
grep 'rbdmap\[[[:digit:]]' && exit 1