Calling "make nitsi" will run all nitsi tests
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- Makefile.am | 22 ++++++++++++++++++++++ configure.ac | 1 + 2 files changed, 23 insertions(+)
diff --git a/Makefile.am b/Makefile.am index 7a755cc264a1..c02376462cf4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -89,6 +89,10 @@ INSTALL_EXEC_HOOKS += \
# ------------------------------------------------------------------------------
+AM_V_NITSI = $(AM_V_NITSI_$(V)) +AM_V_NITSI_ = $(AM_V_NITSI_$(AM_DEFAULT_VERBOSITY)) +AM_V_NITSI_0 = @echo " NITSI " $@; + AM_V_XSLT = $(AM_V_XSLT_$(V)) AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY)) AM_V_XSLT_0 = @echo " XSLT " $@; @@ -543,3 +547,21 @@ TESTS = \ test/functions/ip/ip_prefix_is_valid \ test/functions/ip/ip_protocol_is_supported \ test/functions/ip/ip_split_prefix + +# - NITSI tests ---------------------------------------------------------------- + +NITSI_TESTS = \ + test/nitsi/test/hello-world + +EXTRA_DIST += \ + test/nitsi/test/hello-world/recipe \ + test/nitsi/test/hello-world/settings + +NITSI_ENVIRONMENT = + +.PHONY: $(NITSI_TESTS) +$(NITSI_TESTS): + $(AM_V_NITSI) $(NITSI_ENVIRONMENT) $(NITSI) --log-level error -d $@ + +.PHONY: nitsi +nitsi: $(NITSI_TESTS) diff --git a/configure.ac b/configure.ac index 7cb5ef1110fa..515941451aba 100644 --- a/configure.ac +++ b/configure.ac @@ -50,6 +50,7 @@ AC_PROG_LN_S AC_PROG_MKDIR_P AC_PROG_SED
+AC_PATH_PROG([NITSI], [nitsi]) AC_PATH_PROG([XSLTPROC], [xsltproc])
# pkg-config
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am index c02376462cf4..88c56bcf68eb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -560,7 +560,7 @@ EXTRA_DIST += \ NITSI_ENVIRONMENT =
.PHONY: $(NITSI_TESTS) -$(NITSI_TESTS): +$(NITSI_TESTS): dist $(AM_V_NITSI) $(NITSI_ENVIRONMENT) $(NITSI) --log-level error -d $@
.PHONY: nitsi
Reviewed-by: Jonatan Schlag jonatan.schlag@ipfire.org
Am Mo, 4. Jun, 2018 um 5:38 schrieb Michael Tremer michael.tremer@ipfire.org:
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- Makefile.am | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/Makefile.am b/Makefile.am index 88c56bcf68eb..73c79f501f99 100644 --- a/Makefile.am +++ b/Makefile.am @@ -502,16 +502,7 @@ SED_PROCESS = \ $(SED) $(subst '|,-e 's|@,$(subst =,@|,$(subst |',|g',$(substitutions)))) \ < $< > $@
-src/functions/functions: src/functions/functions.in Makefile - $(SED_PROCESS) - -src/ppp/ip-updown: src/ppp/ip-updown.in Makefile - $(SED_PROCESS) - -src/systemd/%: src/systemd/%.in Makefile - $(SED_PROCESS) - -src/%.pc: src/%.pc.in Makefile +%: %.in Makefile $(SED_PROCESS)
INSTALL_DIRS += \
Reviewed-by: Jonatan Schlag jonatan.schlag@ipfire.org
Am Mo, 4. Jun, 2018 um 5:38 schrieb Michael Tremer michael.tremer@ipfire.org:
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- Makefile.am | 16 ++++++++++++---- test/nitsi/test/make-check/.gitignore | 2 ++ test/nitsi/test/make-check/recipe.in | 3 +++ test/nitsi/test/make-check/settings.in | 12 ++++++++++++ 4 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 test/nitsi/test/make-check/.gitignore create mode 100644 test/nitsi/test/make-check/recipe.in create mode 100644 test/nitsi/test/make-check/settings.in
diff --git a/Makefile.am b/Makefile.am index 73c79f501f99..a0d57689d97e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -490,6 +490,7 @@ substitutions = \ '|PACKAGE_NAME=$(PACKAGE_NAME)|' \ '|PACKAGE_URL=$(PACKAGE_URL)|' \ '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \ + '|builddir=$(abs_builddir)|' \ '|prefix=$(prefix)|' \ '|exec_prefix=$(exec_prefix)|' \ '|sbindir=$(sbindir)|' \ @@ -542,17 +543,24 @@ TESTS = \ # - NITSI tests ----------------------------------------------------------------
NITSI_TESTS = \ - test/nitsi/test/hello-world + test/nitsi/test/hello-world \ + test/nitsi/test/make-check
EXTRA_DIST += \ test/nitsi/test/hello-world/recipe \ - test/nitsi/test/hello-world/settings + test/nitsi/test/hello-world/settings \ + test/nitsi/test/make-check/recipe.in \ + test/nitsi/test/make-check/settings.in + +CLEANFILES += \ + test/nitsi/test/make-check/recipe \ + test/nitsi/test/make-check/settings
NITSI_ENVIRONMENT =
.PHONY: $(NITSI_TESTS) -$(NITSI_TESTS): dist +$(NITSI_TESTS): % : %/recipe %/settings $(AM_V_NITSI) $(NITSI_ENVIRONMENT) $(NITSI) --log-level error -d $@
.PHONY: nitsi -nitsi: $(NITSI_TESTS) +nitsi: dist $(NITSI_TESTS) diff --git a/test/nitsi/test/make-check/.gitignore b/test/nitsi/test/make-check/.gitignore new file mode 100644 index 000000000000..5fd84c8fa188 --- /dev/null +++ b/test/nitsi/test/make-check/.gitignore @@ -0,0 +1,2 @@ +/recipe +/settings diff --git a/test/nitsi/test/make-check/recipe.in b/test/nitsi/test/make-check/recipe.in new file mode 100644 index 000000000000..13d664b8db9a --- /dev/null +++ b/test/nitsi/test/make-check/recipe.in @@ -0,0 +1,3 @@ +alice: tar xvfa @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz && cd @PACKAGE_NAME@-@PACKAGE_VERSION@ +alice: ./configure --prefix=/usr && make -j2 +alice: make check diff --git a/test/nitsi/test/make-check/settings.in b/test/nitsi/test/make-check/settings.in new file mode 100644 index 000000000000..cac865de8bad --- /dev/null +++ b/test/nitsi/test/make-check/settings.in @@ -0,0 +1,12 @@ +[DEFAULT] +Name = make check +Description = This test runs make install in the virtual environment + to determine if the source tarball is complete and module test + can be executed in the virtual environment + +Copy_from = ../../../../@PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz +Copy_to = /root/ + +[VIRTUAL_ENVIRONMENT] +Name = basic +path = ../../virtual-environment/basic
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- Makefile.am | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/Makefile.am b/Makefile.am index a0d57689d97e..06b6cddd2b74 100644 --- a/Makefile.am +++ b/Makefile.am @@ -542,6 +542,19 @@ TESTS = \
# - NITSI tests ----------------------------------------------------------------
+# Files for the virtual environment +EXTRA_DIST += \ + test/nitsi/virtual-environment/basic/machines/alice/machine.xml \ + test/nitsi/virtual-environment/basic/machines/alice/snapshot.xml \ + test/nitsi/virtual-environment/basic/machines/bob/machine.xml \ + test/nitsi/virtual-environment/basic/machines/bob/snapshot.xml \ + test/nitsi/virtual-environment/basic/network/network1/network.xml \ + test/nitsi/virtual-environment/basic/network/network2/network.xml \ + test/nitsi/virtual-environment/basic/network/network3/network.xml \ + test/nitsi/virtual-environment/basic/network/network4/network.xml \ + test/nitsi/virtual-environment/basic/README \ + test/nitsi/virtual-environment/basic/settings + NITSI_TESTS = \ test/nitsi/test/hello-world \ test/nitsi/test/make-check
This patch lets make automatically download all required images and extracts them.
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- Makefile.am | 40 +++++++++++++++++-- configure.ac | 1 + test/nitsi/virtual-environment/.gitignore | 1 + .../basic/machines/.gitignore | 1 + .../alice/{machine.xml => machine.xml.in} | 2 +- .../snapshot.xml => alice/snapshot.xml.in} | 2 +- .../bob/{machine.xml => machine.xml.in} | 2 +- .../snapshot.xml => bob/snapshot.xml.in} | 2 +- 8 files changed, 44 insertions(+), 7 deletions(-) create mode 100644 test/nitsi/virtual-environment/.gitignore create mode 100644 test/nitsi/virtual-environment/basic/machines/.gitignore rename test/nitsi/virtual-environment/basic/machines/alice/{machine.xml => machine.xml.in} (98%) rename test/nitsi/virtual-environment/basic/machines/{bob/snapshot.xml => alice/snapshot.xml.in} (69%) rename test/nitsi/virtual-environment/basic/machines/bob/{machine.xml => machine.xml.in} (98%) rename test/nitsi/virtual-environment/basic/machines/{alice/snapshot.xml => bob/snapshot.xml.in} (70%)
diff --git a/Makefile.am b/Makefile.am index 06b6cddd2b74..f4b8ba13dbea 100644 --- a/Makefile.am +++ b/Makefile.am @@ -89,6 +89,10 @@ INSTALL_EXEC_HOOKS += \
# ------------------------------------------------------------------------------
+AM_V_DOWNLOAD = $(AM_V_DOWNLOAD_$(V)) +AM_V_DOWNLOAD_ = $(AM_V_DOWNLOAD_$(AM_DEFAULT_VERBOSITY)) +AM_V_DOWNLOAD_0 = @echo " LOAD " $@; + AM_V_NITSI = $(AM_V_NITSI_$(V)) AM_V_NITSI_ = $(AM_V_NITSI_$(AM_DEFAULT_VERBOSITY)) AM_V_NITSI_0 = @echo " NITSI " $@; @@ -496,7 +500,8 @@ substitutions = \ '|sbindir=$(sbindir)|' \ '|networkdir=$(networkdir)|' \ '|helpersdir=$(helpersdir)|' \ - '|utildir=$(utildir)|' + '|utildir=$(utildir)|' \ + '|VIRTUAL_ENVIRONMENT_IMAGES_DIR=$(VIRTUAL_ENVIRONMENT_IMAGES_DIR)|'
SED_PROCESS = \ $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \ @@ -543,7 +548,7 @@ TESTS = \ # - NITSI tests ----------------------------------------------------------------
# Files for the virtual environment -EXTRA_DIST += \ +VIRTUAL_ENVIRONMENT_FILES = \ test/nitsi/virtual-environment/basic/machines/alice/machine.xml \ test/nitsi/virtual-environment/basic/machines/alice/snapshot.xml \ test/nitsi/virtual-environment/basic/machines/bob/machine.xml \ @@ -555,6 +560,30 @@ EXTRA_DIST += \ test/nitsi/virtual-environment/basic/README \ test/nitsi/virtual-environment/basic/settings
+EXTRA_DIST += \ + test/nitsi/virtual-environment/basic/machines/alice/machine.xml.in \ + test/nitsi/virtual-environment/basic/machines/alice/snapshot.xml.in \ + test/nitsi/virtual-environment/basic/machines/bob/machine.xml.in \ + test/nitsi/virtual-environment/basic/machines/bob/snapshot.xml.in + +CLEANFILES += \ + test/nitsi/virtual-environment/basic/machines/alice/machine.xml \ + test/nitsi/virtual-environment/basic/machines/alice/snapshot.xml \ + test/nitsi/virtual-environment/basic/machines/bob/machine.xml \ + test/nitsi/virtual-environment/basic/machines/bob/snapshot.xml + +# Virtual Machine Images +VIRTUAL_ENVIRONMENT_IMAGES = \ + $(VIRTUAL_ENVIRONMENT_IMAGES_DIR)/ipfire-alice-2.qcow2 \ + $(VIRTUAL_ENVIRONMENT_IMAGES_DIR)/ipfire-bob.qcow2 + +DISTCLEANFILES += \ + $(VIRTUAL_ENVIRONMENT_IMAGES) + +VIRTUAL_ENVIRONMENT_IMAGES_DIR = $(abs_builddir)/test/nitsi/virtual-environment/.images +VIRTUAL_ENVIRONMENT_IMAGES_DOWNLOAD_URL = \ + https://people.ipfire.org/~jschlag/nitsi-ipfire/virtual-environment/basic/ + NITSI_TESTS = \ test/nitsi/test/hello-world \ test/nitsi/test/make-check @@ -572,8 +601,13 @@ CLEANFILES += \ NITSI_ENVIRONMENT =
.PHONY: $(NITSI_TESTS) -$(NITSI_TESTS): % : %/recipe %/settings +$(NITSI_TESTS): % : %/recipe %/settings $(VIRTUAL_ENVIRONMENT_FILES) $(VIRTUAL_ENVIRONMENT_IMAGES) $(AM_V_NITSI) $(NITSI_ENVIRONMENT) $(NITSI) --log-level error -d $@
.PHONY: nitsi nitsi: dist $(NITSI_TESTS) + +# Downloads a virtual image file and extracts it +$(VIRTUAL_ENVIRONMENT_IMAGES): + $(AM_V_DOWNLOAD)$(MKDIR_P) $(dir $@) && \ + $(WGET) -qO - $(VIRTUAL_ENVIRONMENT_IMAGES_DOWNLOAD_URL)/$(notdir $@).xz | xz -qd > $@ diff --git a/configure.ac b/configure.ac index 515941451aba..e84bec7d284a 100644 --- a/configure.ac +++ b/configure.ac @@ -51,6 +51,7 @@ AC_PROG_MKDIR_P AC_PROG_SED
AC_PATH_PROG([NITSI], [nitsi]) +AC_PATH_PROG([WGET], [wget]) AC_PATH_PROG([XSLTPROC], [xsltproc])
# pkg-config diff --git a/test/nitsi/virtual-environment/.gitignore b/test/nitsi/virtual-environment/.gitignore new file mode 100644 index 000000000000..5a345eca37b4 --- /dev/null +++ b/test/nitsi/virtual-environment/.gitignore @@ -0,0 +1 @@ +/.images diff --git a/test/nitsi/virtual-environment/basic/machines/.gitignore b/test/nitsi/virtual-environment/basic/machines/.gitignore new file mode 100644 index 000000000000..89b260551efd --- /dev/null +++ b/test/nitsi/virtual-environment/basic/machines/.gitignore @@ -0,0 +1 @@ +*/*.xml diff --git a/test/nitsi/virtual-environment/basic/machines/alice/machine.xml b/test/nitsi/virtual-environment/basic/machines/alice/machine.xml.in similarity index 98% rename from test/nitsi/virtual-environment/basic/machines/alice/machine.xml rename to test/nitsi/virtual-environment/basic/machines/alice/machine.xml.in index 5f5b4aca5017..be8da3886021 100644 --- a/test/nitsi/virtual-environment/basic/machines/alice/machine.xml +++ b/test/nitsi/virtual-environment/basic/machines/alice/machine.xml.in @@ -28,7 +28,7 @@ <devices> <disk type='file' device='disk'> <driver name='qemu' type='qcow2'/> - <source file='/var/lib/libvirt/images/ipfire-alice.qcow2'/> + <source file='@VIRTUAL_ENVIRONMENT_IMAGES_DIR@/ipfire-alice-2.qcow2'/> <target dev='vda' bus='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/> </disk> diff --git a/test/nitsi/virtual-environment/basic/machines/bob/snapshot.xml b/test/nitsi/virtual-environment/basic/machines/alice/snapshot.xml.in similarity index 69% rename from test/nitsi/virtual-environment/basic/machines/bob/snapshot.xml rename to test/nitsi/virtual-environment/basic/machines/alice/snapshot.xml.in index a8311a261fea..8d2d1c05f5ad 100644 --- a/test/nitsi/virtual-environment/basic/machines/bob/snapshot.xml +++ b/test/nitsi/virtual-environment/basic/machines/alice/snapshot.xml.in @@ -2,7 +2,7 @@ <description>Snapshot to undo all changes from this test</description> <memory>no</memory> <disks> - <disk name='/var/lib/libvirt/images/ipfire-bob.qcow2'> + <disk name='@VIRTUAL_ENVIRONMENT_IMAGES_DIR@/ipfire-alice-2.qcow2'> </disk> </disks> </domainsnapshot> diff --git a/test/nitsi/virtual-environment/basic/machines/bob/machine.xml b/test/nitsi/virtual-environment/basic/machines/bob/machine.xml.in similarity index 98% rename from test/nitsi/virtual-environment/basic/machines/bob/machine.xml rename to test/nitsi/virtual-environment/basic/machines/bob/machine.xml.in index 60682112db17..f314e8edc5aa 100644 --- a/test/nitsi/virtual-environment/basic/machines/bob/machine.xml +++ b/test/nitsi/virtual-environment/basic/machines/bob/machine.xml.in @@ -28,7 +28,7 @@ <devices> <disk type='file' device='disk'> <driver name='qemu' type='qcow2'/> - <source file='/var/lib/libvirt/images/ipfire-bob.qcow2'/> + <source file='@VIRTUAL_ENVIRONMENT_IMAGES_DIR@/ipfire-bob.qcow2'/> <target dev='vda' bus='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/> </disk> diff --git a/test/nitsi/virtual-environment/basic/machines/alice/snapshot.xml b/test/nitsi/virtual-environment/basic/machines/bob/snapshot.xml.in similarity index 70% rename from test/nitsi/virtual-environment/basic/machines/alice/snapshot.xml rename to test/nitsi/virtual-environment/basic/machines/bob/snapshot.xml.in index fff9b97752e0..f15d19adc5d2 100644 --- a/test/nitsi/virtual-environment/basic/machines/alice/snapshot.xml +++ b/test/nitsi/virtual-environment/basic/machines/bob/snapshot.xml.in @@ -2,7 +2,7 @@ <description>Snapshot to undo all changes from this test</description> <memory>no</memory> <disks> - <disk name='/var/lib/libvirt/images/ipfire-alice.qcow2'> + <disk name='@VIRTUAL_ENVIRONMENT_IMAGES_DIR@/ipfire-bob.qcow2'> </disk> </disks> </domainsnapshot>
Hi,
Am Mo, 4. Jun, 2018 um 5:38 schrieb Michael Tremer michael.tremer@ipfire.org:
Here we need a "settings.in"
xz is not a variable here like $(WGET) but it should be
The path to the image needs to be changed also in the settings file otherwise the copy in feature will not work.
Those instructions are no longer valid
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- Makefile.am | 1 - test/nitsi/virtual-environment/basic/README | 7 ------- 2 files changed, 8 deletions(-) delete mode 100644 test/nitsi/virtual-environment/basic/README
diff --git a/Makefile.am b/Makefile.am index f4b8ba13dbea..81393999cbc6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -557,7 +557,6 @@ VIRTUAL_ENVIRONMENT_FILES = \ test/nitsi/virtual-environment/basic/network/network2/network.xml \ test/nitsi/virtual-environment/basic/network/network3/network.xml \ test/nitsi/virtual-environment/basic/network/network4/network.xml \ - test/nitsi/virtual-environment/basic/README \ test/nitsi/virtual-environment/basic/settings
EXTRA_DIST += \ diff --git a/test/nitsi/virtual-environment/basic/README b/test/nitsi/virtual-environment/basic/README deleted file mode 100644 index caa92da252b8..000000000000 --- a/test/nitsi/virtual-environment/basic/README +++ /dev/null @@ -1,7 +0,0 @@ -Images for these test can be downloaded from: -https://people.ipfire.org/~jschlag/nitsi-ipfire/virtual-environment/basic/ - -You must decompress these images with 'unxz' and place them in: -/var/lib/libvirt/images - -
Reviewed-by: Jonatan Schlag jonatan.schlag@ipfire.org
Am Mo, 4. Jun, 2018 um 5:38 schrieb Michael Tremer michael.tremer@ipfire.org:
Reviewed-by: Jonatan Schlag jonatan.schlag@ipfire.org
Am Mo, 4. Jun, 2018 um 5:38 schrieb Michael Tremer michael.tremer@ipfire.org: