From 1c81b7f56e408c85ae4e72c3ab390f858fe4ac8b Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Tue, 23 Feb 2016 17:50:07 -0500 Subject: [PATCH] test-ucontainer.sh: use test-repo in srcdir Running `make check` would fail because test-ucontainer.sh uses test-repo, which points directly to the installed_testdir, where it is not installed yet. We make another processed version of test-repo.repo.in which instead points to the repo in the srcdir and make use of that in test-ucontainer.sh. There are probably other ways of solving this, but this is the one that jumped out at me. --- Makefile-tests.am | 6 ++++++ tests/test-ucontainer.sh | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Makefile-tests.am b/Makefile-tests.am index 6fffdfa4..5dd40abf 100644 --- a/Makefile-tests.am +++ b/Makefile-tests.am @@ -23,12 +23,18 @@ tests/compose/yum/repodata/repomd.xml: tests/compose/yum/empty tests/compose/yum tests/compose/test-repo.repo: tests/compose/test-repo.repo.in tests/compose/yum/repodata/repomd.xml cat $< | sed -e "s|%WHERE%|$(installed_testdir)|" > $@ +# A version of the repo that points directly to the srcdir (for uninstalled tests) +tests/compose/test-repo-local.repo: tests/compose/test-repo.repo.in tests/compose/yum/repodata/repomd.xml + cat $< | sed -e "s|%WHERE%|$(shell pwd)|" > $@ + tests_jsonutil_CPPFLAGS = -I $(srcdir)/src/libpriv tests_jsonutil_CFLAGS = $(PKGDEP_RPMOSTREE_CFLAGS) tests_jsonutil_LDADD = $(PKGDEP_RPMOSTREE_LIBS) librpmostreepriv.la tests/test-compose.sh: tests/compose/test-repo.repo +tests/test-ucontainer.sh: tests/compose/test-repo-local.repo + installed_test_data = tests/libtest.sh \ tests/compose/test-repo.repo \ tests/compose/test-repo.json \ diff --git a/tests/test-ucontainer.sh b/tests/test-ucontainer.sh index b8ce7abb..6156c8fd 100755 --- a/tests/test-ucontainer.sh +++ b/tests/test-ucontainer.sh @@ -29,7 +29,13 @@ if test -d ${SRCDIR}/compose; then else composedatadir=${SRCDIR} fi -cp ${composedatadir}/test-repo.repo rpmmd.repos.d + +REPO=test-repo +if test -n "${UNINSTALLEDTESTS:-}"; then + REPO=test-repo-local +fi + +cp ${composedatadir}/$REPO.repo rpmmd.repos.d cat >empty.conf <