]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/TestOSDScrub: fix mktime() error 40621/head
authorluo rixin <luorixin@huawei.com>
Thu, 20 Feb 2020 12:07:39 +0000 (20:07 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 6 Apr 2021 13:48:10 +0000 (21:48 +0800)
The var tm tm isn't initialized, when the tm.tm_isdst is a
positive value, mktime(&tm) return -1 result in test failed
in ubuntu 19.10 for aarch64 GLIBC2.30.

Signed-off-by: luo rixin <luorixin@huawei.com>
(cherry picked from commit 4806fce7f46899499549d9235ca87625d806f2da)

src/test/osd/TestOSDScrub.cc

index 34a3b8d81afae65437a4d2048f644b393fcc53a1..55175726af9479ce8180eb0a34c855587e34b20c 100644 (file)
@@ -71,6 +71,7 @@ TEST(TestOSDScrub, scrub_time_permit) {
   g_ceph_context->_conf.set_val("osd_scrub_end_hour", "24");
   g_ceph_context->_conf.apply_changes(nullptr);
   tm tm;
+  tm.tm_isdst = -1;
   strptime("2015-01-16 12:05:13", "%Y-%m-%d %H:%M:%S", &tm);
   utime_t now = utime_t(mktime(&tm), 0);
   bool ret = osd->scrub_time_permit(now);