From 9c17c0cc6cb2d69fbb069ebceb249ebeb51f11a4 Mon Sep 17 00:00:00 2001 From: Alexander Todorov Date: Thu, 22 Nov 2018 15:40:27 +0200 Subject: [PATCH] Copy blueprints used for testing to temporary directory If trying to execute test_cli.sh inside a git checkout we are going to get the following exception: Traceback (most recent call last): File "./src/sbin/lorax-composer", line 251, in repo = open_or_create_repo(server.config["REPO_DIR"]) File "/home/jenkins/lorax/src/pylorax/api/recipes.py", line 306, in open_or_create_repo gi.repository.GLib.Error: ggit-error: failed to stat '/home/jenkins/lorax/tests/pylorax/blueprints': Permission denied (-1) Error in atexit._run_exitfuncs: Traceback (most recent call last): File "/usr/lib64/python3.7/multiprocessing/popen_fork.py", line 54, in _send_signal os.kill(self.pid, sig) From what I can tell open_or_create_repo() is trying to initialize a git repository inside the blueprints directory which fails when we have an active git checkout. This doesn't happen when we run the tests in Travis CI because rsync excludes .git/ inside the Docker container. (cherry picked from commit c9d706a382275fa58d13b3e447219fcfe1061d62) --- tests/test_cli.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_cli.sh b/tests/test_cli.sh index c7876886..03a57dda 100755 --- a/tests/test_cli.sh +++ b/tests/test_cli.sh @@ -6,8 +6,11 @@ rm -rf /var/tmp/beakerlib-*/ export top_srcdir=`pwd` . ./tests/testenv.sh +BLUEPRINTS_DIR=`mktemp -d '/tmp/blueprints.XXXXX'` +cp ./tests/pylorax/blueprints/*.toml $BLUEPRINTS_DIR + # start the lorax-composer daemon -./src/sbin/lorax-composer --sharedir ./share/ ./tests/pylorax/blueprints/ & +./src/sbin/lorax-composer --sharedir ./share/ $BLUEPRINTS_DIR & # wait for the backend to become ready tries=0