From 8d1b9f8cbe54f3937443dc2a89bd5b2705b419ff Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Wed, 27 Nov 2024 15:25:22 +0100 Subject: [PATCH] Convert tests to TMT Apart from the expected Makefile -> main.fmf conversion, this also does a couple more tweaks to make the tests pass in CI, namely: - adds a missing bzip2 dependency - the msi/msp/mst tests from file-tests are timezone-dependent, so the reference timestamps were adjusted for the UTC timezone (used in CIs); not sure if there's any nicer way to tell file to always assume UTC when generating the timestamps without touching timezone data on the test machine itself --- .../main.fmf | 17 +++++++++++++++++ .../runtest.sh | 1 - tests/command-line-options/Makefile | 2 +- tests/command-line-options/main.fmf | 15 +++++++++++++++ tests/command-line-options/runtest.sh | 1 - tests/file-tests/main.fmf | 11 +++++++++++ .../reference/msi/SampleFirst_full.msi.ref | 2 +- .../file-tests/reference/msp/Patch_full.msp.ref | 2 +- .../reference/mst/wix_transform_full.mst.ref | 2 +- tests/file-tests/runtest.sh | 3 +-- tests/tests.yml | 16 ---------------- 11 files changed, 48 insertions(+), 24 deletions(-) create mode 100644 tests/Support-local-additions-to-magic-files/main.fmf create mode 100644 tests/command-line-options/main.fmf create mode 100644 tests/file-tests/main.fmf delete mode 100644 tests/tests.yml diff --git a/tests/Support-local-additions-to-magic-files/main.fmf b/tests/Support-local-additions-to-magic-files/main.fmf new file mode 100644 index 0000000..0cd12fd --- /dev/null +++ b/tests/Support-local-additions-to-magic-files/main.fmf @@ -0,0 +1,17 @@ +summary: Support local additions to magic files +description: |+ + Testing custom additions in + /etc/magic + $HOME/.magic + $HOME/.magic.mgc + +contact: Karel Srot +component: + - file +test: ./runtest.sh +framework: beakerlib +recommend: + - file +duration: 5m +extra-summary: Support-local-additions-to-magic-files +extra-task: Support-local-additions-to-magic-files diff --git a/tests/Support-local-additions-to-magic-files/runtest.sh b/tests/Support-local-additions-to-magic-files/runtest.sh index 2adcb02..b164fce 100755 --- a/tests/Support-local-additions-to-magic-files/runtest.sh +++ b/tests/Support-local-additions-to-magic-files/runtest.sh @@ -27,7 +27,6 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Include Beaker environment -. /usr/bin/rhts-environment.sh . /usr/share/beakerlib/beakerlib.sh PACKAGE="file" diff --git a/tests/command-line-options/Makefile b/tests/command-line-options/Makefile index 240aeb3..beddecc 100644 --- a/tests/command-line-options/Makefile +++ b/tests/command-line-options/Makefile @@ -54,7 +54,7 @@ $(METADATA): Makefile @echo "Type: Sanity" >> $(METADATA) @echo "TestTime: 10m" >> $(METADATA) @echo "RunFor: file zlib" >> $(METADATA) - @echo "Requires: file" >> $(METADATA) + @echo "Requires: file bzip2" >> $(METADATA) @echo "Priority: Normal" >> $(METADATA) @echo "License: GPLv2" >> $(METADATA) @echo "Confidential: no" >> $(METADATA) diff --git a/tests/command-line-options/main.fmf b/tests/command-line-options/main.fmf new file mode 100644 index 0000000..2aed0ee --- /dev/null +++ b/tests/command-line-options/main.fmf @@ -0,0 +1,15 @@ +summary: Tests (most of) command line options available for the file command. +description: | + test multiple cmd line options +contact: Karel Srot +component: + - file + - zlib +test: ./runtest.sh +framework: beakerlib +recommend: + - bzip2 + - file +duration: 10m +extra-summary: /CoreOS/file/Sanity/command-line-options +extra-task: /CoreOS/file/Sanity/command-line-options diff --git a/tests/command-line-options/runtest.sh b/tests/command-line-options/runtest.sh index 174ab21..b19ceaa 100755 --- a/tests/command-line-options/runtest.sh +++ b/tests/command-line-options/runtest.sh @@ -27,7 +27,6 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Include rhts environment -. /usr/bin/rhts-environment.sh . /usr/share/beakerlib/beakerlib.sh PACKAGE="file" diff --git a/tests/file-tests/main.fmf b/tests/file-tests/main.fmf new file mode 100644 index 0000000..81d6b2b --- /dev/null +++ b/tests/file-tests/main.fmf @@ -0,0 +1,11 @@ +summary: File regressions detection tests from github.com:file/file-tests.git +contact: Jan Kaluza +component: + - file +test: ./runtest.sh +framework: beakerlib +recommend: + - file +duration: 20m +extra-summary: file-tests +extra-task: file-tests diff --git a/tests/file-tests/reference/msi/SampleFirst_full.msi.ref b/tests/file-tests/reference/msi/SampleFirst_full.msi.ref index 86088a6..dcabd1a 100644 --- a/tests/file-tests/reference/msi/SampleFirst_full.msi.ref +++ b/tests/file-tests/reference/msi/SampleFirst_full.msi.ref @@ -1 +1 @@ -Composite Document File V2 Document Little Endian Os: Windows Version 5.1 MSI Installer Code page: 1252 Title: Installation Database Subject: Acme's Foobar 1.0 Installer Author: file-test creator Keywords: Installer Comments: created following http://wix.tramontana.co.hu/tutorial Template: Intel;1033 Revision Number: {F6B1C691-4136-4489-AD6A-DFE142735E4B} Create Time/Date: Mon Mar 24 12:00:28 2014 Last Saved Time/Date: Mon Mar 24 12:00:28 2014 Number of Pages: 100 Number of Words: 2 Name of Creating Application: Windows Installer XML Toolset (3.8.1128.0) Security: 2 +Composite Document File V2 Document Little Endian Os: Windows Version 5.1 MSI Installer Code page: 1252 Title: Installation Database Subject: Acme's Foobar 1.0 Installer Author: file-test creator Keywords: Installer Comments: created following http://wix.tramontana.co.hu/tutorial Template: Intel;1033 Revision Number: {F6B1C691-4136-4489-AD6A-DFE142735E4B} Create Time/Date: Mon Mar 24 11:00:28 2014 Last Saved Time/Date: Mon Mar 24 11:00:28 2014 Number of Pages: 100 Number of Words: 2 Name of Creating Application: Windows Installer XML Toolset (3.8.1128.0) Security: 2 diff --git a/tests/file-tests/reference/msp/Patch_full.msp.ref b/tests/file-tests/reference/msp/Patch_full.msp.ref index 923b63e..f904013 100644 --- a/tests/file-tests/reference/msp/Patch_full.msp.ref +++ b/tests/file-tests/reference/msp/Patch_full.msp.ref @@ -1 +1 @@ -Composite Document File V2 Document Little Endian Os: Windows Version 5.1 Code page: 1252 Title: Installation Database Subject: Acme's Foobar 1.0 Installer Author: Acme Ltd. Keywords: Installer Comments: Foobar is a registered trademark of Acme Ltd. Create Time/Date: Mon Mar 24 12:33:32 2014 Name of Creating Application: Windows Installer XML Toolset (3.8.1128.0) Security: 4 Template: Intel;1033 Last Saved By: Intel;1033 Revision Number: {3D9F6ADC-CBB9-4EE4-949F-CA8BCFDB8255}1.0.0;{3D9F6ADC-CBB9-4EE4-949F-CA8BCFDB8255}1.0.0;{11799D66-3206-495E-AA87-901734ECDAEA} Number of Pages: 100 Number of Characters: 153223199 +Composite Document File V2 Document Little Endian Os: Windows Version 5.1 Code page: 1252 Title: Installation Database Subject: Acme's Foobar 1.0 Installer Author: Acme Ltd. Keywords: Installer Comments: Foobar is a registered trademark of Acme Ltd. Create Time/Date: Mon Mar 24 11:33:32 2014 Name of Creating Application: Windows Installer XML Toolset (3.8.1128.0) Security: 4 Template: Intel;1033 Last Saved By: Intel;1033 Revision Number: {3D9F6ADC-CBB9-4EE4-949F-CA8BCFDB8255}1.0.0;{3D9F6ADC-CBB9-4EE4-949F-CA8BCFDB8255}1.0.0;{11799D66-3206-495E-AA87-901734ECDAEA} Number of Pages: 100 Number of Characters: 153223199 diff --git a/tests/file-tests/reference/mst/wix_transform_full.mst.ref b/tests/file-tests/reference/mst/wix_transform_full.mst.ref index 306e5bd..e26b5b5 100644 --- a/tests/file-tests/reference/mst/wix_transform_full.mst.ref +++ b/tests/file-tests/reference/mst/wix_transform_full.mst.ref @@ -1 +1 @@ -Composite Document File V2 Document Little Endian Os: Windows Version 5.1 Code page: 1250 Title: Installation Database Subject: Acme's Foobar 1.0 Installer Author: Acme Ltd. Keywords: Installer Comments: Foobar is a registered trademark of Acme Ltd. Create Time/Date: Mon Mar 24 13:02:34 2014 Name of Creating Application: Windows Installer XML Toolset (3.8.1128.0) Security: 4 Template: Intel;1033 Last Saved By: Intel;1033 Revision Number: {26FB1AB6-7195-4B92-9751-F1B6226CBA34}1.0.0;{26FB1AB6-7195-4B92-9751-F1B6226CBA34}1.0.0;{3F2782EF-47A2-4602-B6B4-4ECD17E98294} Number of Pages: 100 Number of Characters: 131135 +Composite Document File V2 Document Little Endian Os: Windows Version 5.1 Code page: 1250 Title: Installation Database Subject: Acme's Foobar 1.0 Installer Author: Acme Ltd. Keywords: Installer Comments: Foobar is a registered trademark of Acme Ltd. Create Time/Date: Mon Mar 24 12:02:34 2014 Name of Creating Application: Windows Installer XML Toolset (3.8.1128.0) Security: 4 Template: Intel;1033 Last Saved By: Intel;1033 Revision Number: {26FB1AB6-7195-4B92-9751-F1B6226CBA34}1.0.0;{26FB1AB6-7195-4B92-9751-F1B6226CBA34}1.0.0;{3F2782EF-47A2-4602-B6B4-4ECD17E98294} Number of Pages: 100 Number of Characters: 131135 diff --git a/tests/file-tests/runtest.sh b/tests/file-tests/runtest.sh index 5f2f00c..e1fcc55 100755 --- a/tests/file-tests/runtest.sh +++ b/tests/file-tests/runtest.sh @@ -13,7 +13,6 @@ done cd .. -. /usr/bin/rhts-environment.sh . /usr/share/beakerlib/beakerlib.sh PACKAGE="file" @@ -762,4 +761,4 @@ rlJournalStart rlJournalPrintText rlJournalEnd -rm -rf tmp \ No newline at end of file +rm -rf tmp diff --git a/tests/tests.yml b/tests/tests.yml deleted file mode 100644 index ce0a286..0000000 --- a/tests/tests.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- -# This first play always runs on the local staging system -- hosts: localhost - roles: - - role: standard-test-beakerlib - tags: - - classic - - container - - atomic - tests: - - Support-local-additions-to-magic-files - - command-line-options - - file-tests - required_packages: - - file # file package required for both tests - - bzip2 # bunzip2 command required for cmd-line-options test