diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2023-11-08 17:20:56 +0100 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2023-11-14 13:35:01 +0100 |
commit | 71ac573d9efa4bc9b46214187c06a8e462242072 (patch) | |
tree | 58fda99e30dca44a71a69588fc3edbd0b9635a75 /test | |
parent | 2a17d5bbfb1cde47af676f49f7409c7a0014758b (diff) | |
download | justbuild-71ac573d9efa4bc9b46214187c06a8e462242072.tar.gz |
test: Fetch from mirrors given in just's specification file
Diffstat (limited to 'test')
-rw-r--r-- | test/end-to-end/just-mr/just-mr-mirrors.test.sh | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/test/end-to-end/just-mr/just-mr-mirrors.test.sh b/test/end-to-end/just-mr/just-mr-mirrors.test.sh index c9015373..74a64579 100644 --- a/test/end-to-end/just-mr/just-mr-mirrors.test.sh +++ b/test/end-to-end/just-mr/just-mr-mirrors.test.sh @@ -103,6 +103,8 @@ readonly DISTFILES=${WRKDIR}/.distfiles mkdir -p ${DISTFILES} readonly DISTDIR_ARGS="--distdir ${DISTFILES}" +### Using "mirrors" config field + echo "Create repos.json" mkdir -p "${TEST_ROOT}" cd "${TEST_ROOT}" @@ -168,4 +170,77 @@ if [ ! -s "${CONFIG_CPP}" ]; then exit 1 fi +### Using .just-local specifications + +rm -rf ${BUILDROOT} + +cat > test-repos.json <<EOF +{ "repositories": + { "git_repo_1": + { "repository": + { "type": "git" + , "repository": "http://non-existent.example.org/dummy.git" + , "branch": "test" + , "commit": "${GIT_REPO_COMMIT}" + , "subdir": "foo" + } + } + , "git_repo_2": + { "repository": + { "type": "git" + , "repository": "http://non-existent.example.org/dummy.git" + , "branch": "test" + , "commit": "${GIT_REPO_COMMIT}" + , "subdir": "." + } + } + , "zip_repo": + { "repository": + { "type": "zip" + , "content": "${ZIP_REPO_CONTENT}" + , "distfile": "zip_repo.zip" + , "fetch": "http://non-existent.example.org/zip_repo.zip" + , "sha256": "${ZIP_REPO_SHA256}" + , "sha512": "${ZIP_REPO_SHA512}" + , "subdir": "root" + , "pragma": {"special": "resolve-partially"} + } + } + , "tgz_repo": + { "repository": + { "type": "archive" + , "content": "${TGZ_REPO_CONTENT}" + , "distfile": "tgz_repo.tar.gz" + , "fetch": "http://non-existent.example.org:${port_num}/tgz_repo.tar.gz" + , "sha256": "${TGZ_REPO_SHA256}" + , "sha512": "${TGZ_REPO_SHA512}" + , "subdir": "root/baz" + , "pragma": {"special": "ignore"} + } + } + } +} +EOF + +cat > just-local.json <<EOF +{ "local mirrors": + { "http://non-existent.example.org/dummy.git": + [ "http://non-existent.example.org/dummy.git" + , "${GIT_ROOT}" + ] + , "http://non-existent.example.org/zip_repo.zip": + [ "http://non-existent.example.org/zip_repo.zip" + , "http://127.0.0.1:${port_num}/zip_repo.zip" + ] + } +, "preferred hostnames": + ["non-existent.example.org", "127.0.0.1"] +} +EOF + +CONFIG_CPP=$(${JUST_MR_CPP} -C test-repos.json --norc --local-build-root ${BUILDROOT} --checkout-locations just-local.json -j 32 setup --all) +if [ ! -s "${CONFIG_CPP}" ]; then + exit 1 +fi + echo OK |