From 28ba79385cd1b80a99629d35bd535adc5f817497 Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Wed, 23 Nov 2022 16:37:52 +0100 Subject: do little refactoring to the way host system testing directories are prepared and passed to `guix-container.sh` --- Makefile | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index d40610d..7de829e 100644 --- a/Makefile +++ b/Makefile @@ -28,10 +28,6 @@ HYDRILLA_WEBSITE_INFO = \ subrepos/hydrilla-website/src/hydrilla_website.egg-info/PKG-INFO TEST_ROOT_DIR = "/tmp/$$(pwd | sed 's|/|!|g')!!test-root" -TEST_WWW_DIR=$(TEST_ROOT_DIR)/var/www -TEST_ALL_LOGS_DIR = $(TEST_ROOT_DIR)/var/log -TEST_LOG_DIR = $(TEST_ALL_LOGS_DIR)/guix-container -TEST_ETC_DIR = $(TEST_ROOT_DIR)/etc/guix-container all: | container-runner.touchfile log @@ -56,26 +52,24 @@ hosts: hosts-extra /etc/hosts cat $^ > $@ log: - ln -sf $(TEST_LOG_DIR) $@ + ln -sf $(TEST_ROOT_DIR)/var/log/guix-container $@ + +HYDRILLA_WEBSITE_ETC_DIR = $(TEST_ROOT_DIR)/etc/guix-container/hydrilla-website prepare-test-root: rm -rf $(TEST_ROOT_DIR) @# Prepare replacement `/var/www` - mkdir -p $(TEST_WWW_DIR)/koszko.org/html - printf ':D\n' > $(TEST_WWW_DIR)/koszko.org/html/index.html + mkdir -p $(TEST_ROOT_DIR)/var/www/koszko.org/html + printf ':D\n' > $(TEST_ROOT_DIR)/var/www/koszko.org/html/index.html @# Prepare replacement `/var/log` - mkdir -p $(TEST_ALL_LOGS_DIR) + mkdir -p $(TEST_ROOT_DIR)/var/log @# Prepare replacement `/etc` - mkdir --mode=750 -p $(TEST_ETC_DIR)/hydrilla-website - printf 'test non-secret\n' > $(TEST_ETC_DIR)/hydrilla-website/secret.txt - chgrp -R 133 $(TEST_ETC_DIR)/hydrilla-website - chmod 640 $(TEST_ETC_DIR)/hydrilla-website/secret.txt - -GUIX_CONTAINER_FLAGS = \ - -e ./container-runner -p ./pidfile \ - -l $(TEST_LOG_DIR) \ - -w $(TEST_WWW_DIR) \ - -t $(TEST_ETC_DIR) + mkdir --mode=750 -p $(HYDRILLA_WEBSITE_ETC_DIR) + printf 'test non-secret\n' > $(HYDRILLA_WEBSITE_ETC_DIR)/secret.txt + chgrp -R 133 $(HYDRILLA_WEBSITE_ETC_DIR) + chmod 640 $(HYDRILLA_WEBSITE_ETC_DIR)/secret.txt + +GUIX_CONTAINER_FLAGS = -e ./container-runner -p ./pidfile -r $(TEST_ROOT_DIR) start-container: guix-container.sh container-runner.touchfile \ prepare-test-root | log -- cgit v1.2.3