]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | #!/bin/sh |
2 | # | |
3 | # Regression test for http://tracker.ceph.com/issues/14984 | |
4 | # | |
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. | |
8 | # | |
11fdf7f2 TL |
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 | |
7c673cae FG |
11 | # that require processing. |
12 | # | |
13 | set -ex | |
14 | ||
7c673cae FG |
15 | echo "TEST: save timestamp for use later with journalctl --since" |
16 | TIMESTAMP=$(date +%Y-%m-%d\ %H:%M:%S) | |
17 | ||
18 | echo "TEST: assert that rbdmap has not logged anything since boot" | |
19 | journalctl -b 0 -t rbdmap | grep 'rbdmap\[[[:digit:]]' && exit 1 | |
20 | journalctl -b 0 -t init-rbdmap | grep 'rbdmap\[[[:digit:]]' && exit 1 | |
21 | ||
22 | echo "TEST: restart the rbdmap.service" | |
23 | sudo systemctl restart rbdmap.service | |
24 | ||
25 | echo "TEST: ensure that /usr/bin/rbdmap runs to completion" | |
11fdf7f2 | 26 | until sudo systemctl status rbdmap.service | grep 'active (exited)' ; do |
7c673cae FG |
27 | sleep 0.5 |
28 | done | |
29 | ||
30 | echo "TEST: assert that rbdmap has not logged anything since TIMESTAMP" | |
31 | journalctl --since "$TIMESTAMP" -t rbdmap | grep 'rbdmap\[[[:digit:]]' && exit 1 | |
32 | journalctl --since "$TIMESTAMP" -t init-rbdmap | grep 'rbdmap\[[[:digit:]]' && exit 1 | |
33 | ||
34 | exit 0 |