From a0be831a2f3408014cbdc57d97baaf43d6bed47f Mon Sep 17 00:00:00 2001 From: Eugene Smirnov Date: Fri, 15 Mar 2019 17:07:17 +0100 Subject: [PATCH] tests/ostree_http_repo: drop connection not depending on the object Signed-off-by: Eugene Smirnov --- src/sota_tools/ostree_http_repo_test.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/sota_tools/ostree_http_repo_test.cc b/src/sota_tools/ostree_http_repo_test.cc index 1cabbf1900..55116dc677 100644 --- a/src/sota_tools/ostree_http_repo_test.cc +++ b/src/sota_tools/ostree_http_repo_test.cc @@ -94,8 +94,14 @@ TEST(http_repo, bad_connection) { auto hash = OSTreeHash::Parse("52a0e22cc8fe97daf1b028049ad93f36f33b04b150229924259456c4d50dc280"); UploadToTreehub(src_repo, ServerCredentials(filepath), hash, cert_path.string(), RunMode::kDefault, 1); - int result = system( - (std::string("diff -r ") + (src_repo->root() / "objects/").string() + " tests/sota_tools/repo/objects/").c_str()); + std::string diff("diff -r "); + std::string src_path((src_dir.Path() / "objects").string() + " "); + std::string repo_path((src_repo->root() / "objects").string() + " "); + std::string dst_path((dst_dir.Path() / "objects").string() + " "); + + int result = system((diff + src_path + repo_path).c_str()); + result |= system((diff + repo_path + dst_path).c_str()); + EXPECT_EQ(result, 0) << "Diff between source and destination repos is nonzero."; }