Verified Commit 839b7f78 authored by Karel Koci's avatar Karel Koci 🤘
Browse files

tests/lua/postprocess: remove usage of

Web now responds with valid HTML site on any URL thus we
have to use different web to get 404 response. We use our own server
that is used in other tests already.

It also turns out that curl changed error messages so instead of
matching exact error message this just tries to match the known minimum.
parent 57bbfb6b
Pipeline #76787 passed with stages
in 4 minutes and 59 seconds
......@@ -104,26 +104,28 @@ end
local multierror = utils.exception("multiple", "Multiple exceptions (1)")
local sub_err = utils.exception("unreachable", "Fake network is down")
sub_err.why = "missing"
sub_err.repo = "test1/"
sub_err.repo = "test1/"
multierror.errors = {sub_err}
function test_get_repos_broken_fatal()
-- When we can't download the thing, it throws
requests.repository({}, "test1", "")
requests.repository({}, "test1", "")
local ok, err = pcall(postprocess.get_repos)
assert_table_equal(utils.exception('repo missing', "Download failed for repository index test1 ( The requested URL returned error: 404 Not Found"), err)
assert_match("Download failed for repository index test1 %( The requested URL returned error: 404.*", err.msg)
err.msg = ""
assert_table_equal(utils.exception('repo missing', ""), err)
function test_get_repos_broken_nonfatal()
requests.repository({}, "test1", "", {optional = true})
requests.repository({}, "test1", "", {optional = true})
requests.known_repositories["test1"].index_uri = nil
["test1"] = {
optional = true,
name = "test1",
repo_uri = "",
repo_uri = "",
pkg_hash_required = true,
priority = 50,
serial = 1,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment