From b22f2bc8e98c084f859ad94023706619f828bb14 Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Fri, 15 Nov 2024 16:15:11 +0100 Subject: [PATCH] libstore: use http for exceptionAbortsDownload tests file:// urls are no longer handled by curl itself, and this is supposed to test the curl wrapper. use http to force the wrapper to be involved. Change-Id: Ib13087db07b3b2f1ae44ce8e3ec7a96d935b1bab --- tests/unit/libstore/filetransfer.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/unit/libstore/filetransfer.cc b/tests/unit/libstore/filetransfer.cc index 4a7f53e43..78299a2d5 100644 --- a/tests/unit/libstore/filetransfer.cc +++ b/tests/unit/libstore/filetransfer.cc @@ -204,7 +204,8 @@ TEST(FileTransfer, exceptionAbortsDownload) LambdaSink broken([](auto block) { throw Done(); }); - ASSERT_THROW(ft->download("file:///dev/zero").second->drainInto(broken), Done); + auto [port, srv] = serveHTTP({{"200 ok", "", [](int) { return "foo"; }}}); + ASSERT_THROW(ft->download(fmt("http://[::1]:%d/index", port)).second->drainInto(broken), Done); // makeFileTransfer returns a ref<>, which cannot be cleared. since we also // can't default-construct it we'll have to overwrite it instead, but we'll