diff options
| author | mattpetersepic <[email protected]> | 2022-02-18 13:59:27 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-02-18 13:59:27 -0700 |
| commit | b0310f0da356fb9a5e9202f1352cad82e3811b10 (patch) | |
| tree | a406be9d25ee35f8d1920e8fbc4f6d632ea4de96 /zenserver-test/zenserver-test.cpp | |
| parent | remote_build: allow path .zips are copied to to be overriden (diff) | |
| download | zen-b0310f0da356fb9a5e9202f1352cad82e3811b10.tar.xz zen-b0310f0da356fb9a5e9202f1352cad82e3811b10.zip | |
Value propagation fix - Read/Write ValueAPI as CompressedBinary type when writing to zen and horde upstreams. Return failure from HandleGetCacheRecord if the requested type does not match the cachetype. (#55)
* Fix bug with getting values PUT to Jupiter as CompressedBinary. When getting CompressedBinary records from Jupiter, they are expected to now be a record with a reference to the compact binary. This has to be accounted for when performing upstream GETs.
* HandleGetCacheRecord: avoid crashing on invalid type, and avoid sending back data that doesn't match the AcceptType.
Diffstat (limited to 'zenserver-test/zenserver-test.cpp')
| -rw-r--r-- | zenserver-test/zenserver-test.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/zenserver-test/zenserver-test.cpp b/zenserver-test/zenserver-test.cpp index 8ca16e560..293af7816 100644 --- a/zenserver-test/zenserver-test.cpp +++ b/zenserver-test/zenserver-test.cpp @@ -324,7 +324,7 @@ main(int argc, char** argv) zen::logging::InitializeLogging(); spdlog::set_level(spdlog::level::debug); - spdlog::set_formatter(std::make_unique<::logging::full_test_formatter>("test", std::chrono::system_clock::now())); + spdlog::set_formatter(std::make_unique< ::logging::full_test_formatter>("test", std::chrono::system_clock::now())); std::filesystem::path ProgramBaseDir = std::filesystem::path(argv[0]).parent_path(); std::filesystem::path TestBaseDir = ProgramBaseDir.parent_path().parent_path() / ".test"; @@ -797,7 +797,8 @@ TEST_CASE("zcache.basic") { zen::IoHash Key = zen::IoHash::HashBuffer(&i, sizeof i); - cpr::Response Result = cpr::Get(cpr::Url{fmt::format("{}/{}/{}", BaseUri, "test", Key)}); + cpr::Response Result = + cpr::Get(cpr::Url{fmt::format("{}/{}/{}", BaseUri, "test", Key)}, cpr::Header{{"Accept", "application/x-ue-cbpkg"}}); CHECK(Result.status_code == 200); } @@ -835,7 +836,8 @@ TEST_CASE("zcache.basic") { zen::IoHash Key = HashKey(i); - cpr::Response Result = cpr::Get(cpr::Url{fmt::format("{}/{}/{}", BaseUri, "test", Key)}); + cpr::Response Result = + cpr::Get(cpr::Url{fmt::format("{}/{}/{}", BaseUri, "test", Key)}, cpr::Header{{"Accept", "application/x-ue-cbpkg"}}); CHECK(Result.status_code == 200); } @@ -1348,7 +1350,7 @@ TEST_CASE("zcache.policy") // Get record { cpr::Response Result = cpr::Get(cpr::Url{fmt::format("{}/{}/{}?Policy=Default,SkipData", Cfg.BaseUri, Bucket, Key)}, - cpr::Header{{"Accept", "application/x-ue-cbobject"}}); + cpr::Header{{"Accept", "application/x-ue-cb"}}); CHECK(IsHttpSuccessCode(Result.status_code)); IoBuffer Buffer(IoBuffer::Wrap, Result.text.c_str(), Result.text.size()); CbObject ResponseObject = zen::LoadCompactBinaryObject(Buffer); @@ -2581,9 +2583,9 @@ public: ZenServerInstance& GetInstance(int Index) { return *m_Instances[Index]; } private: - std::string m_HelperId; - int m_ServerCount = 0; - std::vector<std::unique_ptr<ZenServerInstance>> m_Instances; + std::string m_HelperId; + int m_ServerCount = 0; + std::vector<std::unique_ptr<ZenServerInstance> > m_Instances; }; TEST_CASE("http.basics") |