From d253d6926e41365c54b04e53288ecc0c729057cd Mon Sep 17 00:00:00 2001 From: Barthelemy Date: Wed, 28 Oct 2020 10:54:19 +0100 Subject: [PATCH 1/2] fix TestFetchingHeaders --- CCDB/test/testCcdbApi.cxx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/CCDB/test/testCcdbApi.cxx b/CCDB/test/testCcdbApi.cxx index f5a619eb09de3..e089e359f6783 100644 --- a/CCDB/test/testCcdbApi.cxx +++ b/CCDB/test/testCcdbApi.cxx @@ -421,16 +421,24 @@ BOOST_AUTO_TEST_CASE(TestHeaderParsing) BOOST_AUTO_TEST_CASE(TestFetchingHeaders, *utf::precondition(if_reachable())) { + // first store the object + string objectPath = basePath + "objectETag"; + test_fixture f; + TH1F h1("objectETag", "objectETag", 100, 0, 99); + f.api.storeAsTFile(&h1, objectPath, f.metadata); + + // then get the headers std::string etag; std::vector headers; std::vector pfns; - auto updated = CcdbApi::getCCDBEntryHeaders("http://ccdb-test.cern.ch:8080/TOF/LHCphase/1567080816927", etag, headers); + string path = objectPath + "/" +std::to_string(getCurrentTimestamp()); + auto updated = CcdbApi::getCCDBEntryHeaders("http://ccdb-test.cern.ch:8080/"+path, etag, headers); BOOST_CHECK_EQUAL(updated, true); BOOST_REQUIRE(headers.size() != 0); CcdbApi::parseCCDBHeaders(headers, pfns, etag); BOOST_REQUIRE(etag != ""); BOOST_REQUIRE(pfns.size()); - updated = CcdbApi::getCCDBEntryHeaders("http://ccdb-test.cern.ch:8080/TOF/LHCphase/1567080816927", etag, headers); + updated = CcdbApi::getCCDBEntryHeaders("http://ccdb-test.cern.ch:8080/"+path, etag, headers); BOOST_CHECK_EQUAL(updated, false); } From d5ed4b32a3e2ef540e925daae5b044050d841446 Mon Sep 17 00:00:00 2001 From: Barthelemy Date: Wed, 28 Oct 2020 10:54:47 +0100 Subject: [PATCH 2/2] format --- CCDB/test/testCcdbApi.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CCDB/test/testCcdbApi.cxx b/CCDB/test/testCcdbApi.cxx index e089e359f6783..40b51774c9f49 100644 --- a/CCDB/test/testCcdbApi.cxx +++ b/CCDB/test/testCcdbApi.cxx @@ -431,14 +431,14 @@ BOOST_AUTO_TEST_CASE(TestFetchingHeaders, *utf::precondition(if_reachable())) std::string etag; std::vector headers; std::vector pfns; - string path = objectPath + "/" +std::to_string(getCurrentTimestamp()); - auto updated = CcdbApi::getCCDBEntryHeaders("http://ccdb-test.cern.ch:8080/"+path, etag, headers); + string path = objectPath + "/" + std::to_string(getCurrentTimestamp()); + auto updated = CcdbApi::getCCDBEntryHeaders("http://ccdb-test.cern.ch:8080/" + path, etag, headers); BOOST_CHECK_EQUAL(updated, true); BOOST_REQUIRE(headers.size() != 0); CcdbApi::parseCCDBHeaders(headers, pfns, etag); BOOST_REQUIRE(etag != ""); BOOST_REQUIRE(pfns.size()); - updated = CcdbApi::getCCDBEntryHeaders("http://ccdb-test.cern.ch:8080/"+path, etag, headers); + updated = CcdbApi::getCCDBEntryHeaders("http://ccdb-test.cern.ch:8080/" + path, etag, headers); BOOST_CHECK_EQUAL(updated, false); }