mirror of
https://github.com/JasonN3/build-container-installer.git
synced 2025-12-25 10:57:55 +01:00
check if empty list
This commit is contained in:
parent
9277acf58a
commit
5ff2a438ea
1 changed files with 14 additions and 28 deletions
40
Makefile
40
Makefile
|
|
@ -35,7 +35,15 @@ get_templates = $(shell ls lorax_templates/$(1)_*.tmpl) \
|
||||||
# Get a list of tests for the feature
|
# Get a list of tests for the feature
|
||||||
# $1 = test type
|
# $1 = test type
|
||||||
# $2 = feature
|
# $2 = feature
|
||||||
get_tests = $(shell ls tests/$(1)/$(2)_*)
|
run_tests = tests=$(shell ls tests/$(1)/$(2)_*); \
|
||||||
|
if [ -n "$$tests" ]; \
|
||||||
|
then \
|
||||||
|
chmod +x $$tests; \
|
||||||
|
for test in $$tests; \
|
||||||
|
do \
|
||||||
|
$(foreach var,$(_VARS),$(var)=$($(var))) ./$${test}; \
|
||||||
|
done; \
|
||||||
|
fi
|
||||||
|
|
||||||
# Converts a post script to a template
|
# Converts a post script to a template
|
||||||
# $1 = script to convert
|
# $1 = script to convert
|
||||||
|
|
@ -231,21 +239,10 @@ test-iso:
|
||||||
sudo mount -t squashfs -o loop /mnt/iso/images/install.img /mnt/install
|
sudo mount -t squashfs -o loop /mnt/iso/images/install.img /mnt/install
|
||||||
|
|
||||||
# install tests
|
# install tests
|
||||||
chmod +x $(call get_tests,iso,install)
|
$(call run_tests,iso,install)
|
||||||
for test in $(call get_tests,iso,install); \
|
|
||||||
do \
|
|
||||||
$(foreach var,$(_VARS),$(var)=$($(var))) ./$${test}; \
|
|
||||||
done
|
|
||||||
|
|
||||||
# flapak tests
|
# flapak tests
|
||||||
if [ -n "$(FLATPAK_REMOTE_REFS)" ]; \
|
[ -n "$(FLATPAK_REMOTE_REFS)" ] && ( $(call run_tests,iso,flatpak) )
|
||||||
then \
|
|
||||||
chmod +x $(call get_tests,iso,flatpak); \
|
|
||||||
for test in $(call get_tests,iso,flatpak); \
|
|
||||||
do \
|
|
||||||
$(foreach var,$(_VARS),$(var)=$($(var))) ./$${test}; \
|
|
||||||
done; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
sudo umount /mnt/install
|
sudo umount /mnt/install
|
||||||
|
|
@ -266,20 +263,9 @@ test-vm: ansible_inventory
|
||||||
ansible -i ansible_inventory -m ansible.builtin.wait_for_connection vm
|
ansible -i ansible_inventory -m ansible.builtin.wait_for_connection vm
|
||||||
|
|
||||||
# install tests
|
# install tests
|
||||||
chmod +x $(call get_tests,vm,install)
|
$(call run_tests,vm,install)
|
||||||
for test in $(call get_tests,vm,install); \
|
|
||||||
do \
|
|
||||||
./$${test}; \
|
|
||||||
done
|
|
||||||
|
|
||||||
# flapak tests
|
# flapak tests
|
||||||
if [ -n "$(FLATPAK_REMOTE_REFS)" ]; \
|
[ -n "$(FLATPAK_REMOTE_REFS)" ] && ( $(call run_tests,vm,flatpak) )
|
||||||
then \
|
|
||||||
chmod +x $(call get_tests,iso,flatpak); \
|
|
||||||
for test in $(call get_tests,iso,flatpak); \
|
|
||||||
do \
|
|
||||||
$(foreach var,$(_VARS),$(var)=$($(var))) ./$${test}; \
|
|
||||||
done; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
.PHONY: clean install-deps install-test-deps test test-iso test-vm
|
.PHONY: clean install-deps install-test-deps test test-iso test-vm
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue