ctdb-scripts: date "+%N" is non-portable
authorAmitay Isaacs <amitay@gmail.com>
Thu, 19 Jul 2018 04:43:09 +0000 (14:43 +1000)
committerMartin Schwenke <martins@samba.org>
Sat, 28 Jul 2018 01:50:11 +0000 (03:50 +0200)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13520

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb/config/events/legacy/00.ctdb.script
ctdb/tests/eventscripts/00.ctdb.init.009.sh
ctdb/tests/eventscripts/scripts/00.ctdb.sh

index 8db4a19d18444d1c4556863adc30e19e221329c5..05ce2bec14bff65ab334493eaa37fcb44ac4f00c 100755 (executable)
@@ -83,7 +83,7 @@ check_non_persistent_databases ()
     for _db in "${_dir}/"*.tdb.*[0-9] ; do
        [ -r "$_db" ] || continue
        check_tdb "$_db" || {
-           _backup="${_db}.$(date +'%Y%m%d.%H%M%S.%N').corrupt"
+           _backup="${_db}.$(date +'%Y%m%d.%H%M%S').corrupt"
            cat <<EOF
 WARNING: database ${_db} is corrupted.
  Moving to backup ${_backup} for later analysis.
index ca8107be8115edcf54da59ab5c40c292c482f491..92a0e254e600d5476b1398fddef15422a5961131 100755 (executable)
@@ -42,6 +42,7 @@ required_result_num_corrupt ()
 }
 
 for i in $(seq 1 15) ; do
+       FAKE_SLEEP_REALLY=yes sleep 1
        touch "$db"
        required_result_tdbcheck
        simple_test
index 7dd654e8cd0f97fb01d7aa80fad9d3b6de4e194e..5f169e6c6ea3fd2efa13466fde20dd42b5b056da 100644 (file)
@@ -25,7 +25,6 @@ result_filter ()
 {
        _date="[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]"
        _time="[0-9][0-9][0-9][0-9][0-9][0-9]"
-       _nanos="[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]"
-       _date_time="${_date}\.${_time}\.${_nanos}"
+       _date_time="${_date}\.${_time}"
        sed -e "s|\.${_date_time}\.|.DATE.TIME.|"
 }