From 9eb5256c3b34ca7c28c7565d5f55273997ec9846 Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Sat, 30 Mar 2024 11:02:26 -0400 Subject: [PATCH] fix paths --- Makefile | 8 ++++---- test/Makefile | 3 +++ test/iso/Makefile | 34 +++++++++++++------------------- test/iso/flatpak_repo_updated.sh | 4 ++-- test/iso/install_hash.sh | 4 ++-- test/iso/install_os-release.sh | 2 +- 6 files changed, 26 insertions(+), 29 deletions(-) diff --git a/Makefile b/Makefile index 0175c55..51153d9 100644 --- a/Makefile +++ b/Makefile @@ -109,7 +109,7 @@ _LORAX_TEMPLATES += $(call get_templates,secureboot) _TEMPLATE_VARS += ENROLLMENT_PASSWORD endif -_SUBDIRS = container external flatpak_refs lorax_templates repos xorriso +_SUBDIRS = container external flatpak_refs lorax_templates repos xorriso test # Step 7: Build end ISO ## Default action @@ -149,11 +149,11 @@ clean: .PHONY: install-deps install-deps: $(install_pkg) lorax xorriso coreutils gettext - $(foreach DIR,$(_SUBDIRS),$(MAKE) -w -C $(DIR) install-deps;) + $(foreach DIR,$(filter-out test,$(_SUBDIRS)),$(MAKE) -w -C $(DIR) install-deps;) -.PHONY: $(_SUBDIRS) test $(wildcard test/*) $(wildcard test/*/*) -test $(addsuffix /*,$(_SUBDIRS) test): +.PHONY: $(_SUBDIRS) $(wildcard test/*) $(wildcard test/*/*) +test $(addsuffix /*,$(_SUBDIRS)): $(eval DIR=$(firstword $(subst /, ,$@))) $(if $(filter-out $(DIR),$@), $(eval TARGET=$(subst $(DIR)/,,$@)),$(eval TARGET=)) $(MAKE) -w -C $(DIR) $(TARGET) diff --git a/test/Makefile b/test/Makefile index 7946d6b..c9785c7 100644 --- a/test/Makefile +++ b/test/Makefile @@ -17,4 +17,7 @@ $(filter-out README.md Makefile,$(wildcard */*)): install-deps: $(foreach DIR,$(filter-out README.md Makefile,$(wildcard *)),$(MAKE) -w -C $(DIR) install-deps;) +clean: + $(foreach DIR,$(filter-out README.md Makefile,$(wildcard *)),$(MAKE) -w -C $(DIR) clean;) + .PHONY: all $(filter-out README.md Makefile,$(wildcard *)) $(filter-out README.md Makefile,$(wildcard */*)) \ No newline at end of file diff --git a/test/iso/Makefile b/test/iso/Makefile index c82b415..745153e 100644 --- a/test/iso/Makefile +++ b/test/iso/Makefile @@ -1,31 +1,25 @@ ISO_NAME=deploy.iso -ISO_TESTS=$(filter-out README.md Makefile,$(wildcard *))) +ISO_TESTS=$(wildcard install_*) $(if $(FLATPAK_REMOTE_REFS) $(FLATPAK_DIR),$(wildcard flatpak_*)) -all: $(ISO_TESTS) +all: $(ISO_TESTS) clean -$(ISO_TESTS): +$(ISO_TESTS): /mnt/iso + $(eval _VARS = ISO_NAME VERSION FLATPAK_REMOTE_NAME _FLATPAK_REPO_URL) chmod +x $@ - ISO=../../$(ISO_NAME) ./$@ - -prep: - $(eval _VARS = VERSION FLATPAK_REMOTE_NAME _FLATPAK_REPO_URL) + $(foreach var,$(_VARS),$(var)=$($(var))) ./$@ +mnt/iso: sudo modprobe loop - sudo mkdir /mnt/iso /mnt/install - sudo mount -o loop deploy.iso /mnt/iso - sudo mount -t squashfs -o loop /mnt/iso/images/install.img /mnt/install + sudo mkdir mnt/iso mnt/install + sudo mount -o loop ../../$(ISO_NAME) mnt/iso + sudo mount -t squashfs -o loop mnt/iso/images/install.img mnt/install - # install tests - $(call run_tests,iso,install) - - # flapak tests - if [ -n "$(FLATPAK_REMOTE_REFS)" ]; then $(call run_tests,iso,flatpak); fi - - # Cleanup - sudo umount /mnt/install - sudo umount /mnt/iso +clean: + sudo umount /mnt/install || true + sudo umount /mnt/iso || true + sudo rmdir /mnt/install /mnt/iso install-deps: $(install_pkg) isomd5sum coreutils squashfs-tools -.PHONY: all $(ISO_TESTS) \ No newline at end of file +.PHONY: all $(ISO_TESTS) clean \ No newline at end of file diff --git a/test/iso/flatpak_repo_updated.sh b/test/iso/flatpak_repo_updated.sh index b5ee240..e6ed1c9 100644 --- a/test/iso/flatpak_repo_updated.sh +++ b/test/iso/flatpak_repo_updated.sh @@ -1,6 +1,6 @@ #!/bin/bash -add_line=$(grep flatpak_manager.add_remote /mnt/install/usr/lib64/python*/site-packages/pyanaconda/modules/payloads/payload/rpm_ostree/flatpak_installation.py) +add_line=$(grep flatpak_manager.add_remote mnt/install/usr/lib64/python*/site-packages/pyanaconda/modules/payloads/payload/rpm_ostree/flatpak_installation.py) add_line_repo=$(echo ${add_line} | grep ${FLATPAK_REMOTE_NAME}) add_line_url=$(echo ${add_line} | grep ${_FLATPAK_REPO_URL}) @@ -22,7 +22,7 @@ else echo "Repo url found on add_remote line" fi -replace_line=$(grep flatpak_manager.replace_installed_refs_remote /mnt/install/usr/lib64/python*/site-packages/pyanaconda/modules/payloads/payload/rpm_ostree/flatpak_installation.py) +replace_line=$(grep flatpak_manager.replace_installed_refs_remote mnt/install/usr/lib64/python*/site-packages/pyanaconda/modules/payloads/payload/rpm_ostree/flatpak_installation.py) replace_line_repo=$(echo ${replace_line} | grep ${FLATPAK_REMOTE_NAME}) diff --git a/test/iso/install_hash.sh b/test/iso/install_hash.sh index 4d62147..7cdd708 100644 --- a/test/iso/install_hash.sh +++ b/test/iso/install_hash.sh @@ -2,5 +2,5 @@ set -ex -checkisomd5 ${ISO} -cd $(dirname ${ISO}) && sha256sum -c $(basename ${ISO})-CHECKSUM \ No newline at end of file +checkisomd5 ../../${ISO_NAME} +cd $(dirname ../../${ISO_NAME}) && sha256sum -c $(basename ${ISO_NAME})-CHECKSUM \ No newline at end of file diff --git a/test/iso/install_os-release.sh b/test/iso/install_os-release.sh index ccef46c..02f7240 100644 --- a/test/iso/install_os-release.sh +++ b/test/iso/install_os-release.sh @@ -1,6 +1,6 @@ #!/bin/bash -FOUND_VERSION=$(cat /mnt/install/etc/os-release | grep VERSION_ID | cut -d= -f2) +FOUND_VERSION=$(cat mnt/install/etc/os-release | grep VERSION_ID | cut -d= -f2) if [[ ${FOUND_VERSION} != ${VERSION} ]] then