From 66c0191743106e5335811d2f057a9517de6d3225 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= Date: Fri, 4 Jul 2025 13:39:06 +0200 Subject: [PATCH] tests: migrate from STI to TMT Related: https://fedoraproject.org/wiki/Changes/DisableSTI --- .fmf/version | 1 + plans/ci.fmf | 5 +++++ .../main.fmf | 17 ++++++++++++++++ .../runtest.sh | 3 +-- tests/diff-Z-hangs/main.fmf | 13 ++++++++++++ tests/diff-Z-hangs/runtest.sh | 1 - tests/diff-hang-long-files/main.fmf | 20 +++++++++++++++++++ tests/diff-hang-long-files/runtest.sh | 2 +- .../main.fmf | 17 ++++++++++++++++ .../runtest.sh | 1 - .../main.fmf | 14 +++++++++++++ .../runtest.sh | 3 +-- tests/tests.yml | 18 ----------------- tests/whitespace/main.fmf | 15 ++++++++++++++ tests/whitespace/runtest.sh | 3 +-- 15 files changed, 106 insertions(+), 27 deletions(-) create mode 100644 .fmf/version create mode 100644 plans/ci.fmf create mode 100644 tests/cmp-s-returns-1-even-if-files-are-identical/main.fmf mode change 100644 => 100755 tests/cmp-s-returns-1-even-if-files-are-identical/runtest.sh create mode 100644 tests/diff-Z-hangs/main.fmf mode change 100644 => 100755 tests/diff-Z-hangs/runtest.sh create mode 100644 tests/diff-hang-long-files/main.fmf mode change 100644 => 100755 tests/diff-hang-long-files/runtest.sh create mode 100644 tests/diff-w-b-doesn-t-treat-U3000-IDEOGRAPHIC-SPACE-as-space/main.fmf mode change 100644 => 100755 tests/diff-w-b-doesn-t-treat-U3000-IDEOGRAPHIC-SPACE-as-space/runtest.sh create mode 100644 tests/sdiff-does-not-recognize-E-option/main.fmf mode change 100644 => 100755 tests/sdiff-does-not-recognize-E-option/runtest.sh delete mode 100644 tests/tests.yml create mode 100644 tests/whitespace/main.fmf mode change 100644 => 100755 tests/whitespace/runtest.sh diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/plans/ci.fmf b/plans/ci.fmf new file mode 100644 index 0000000..c1627f9 --- /dev/null +++ b/plans/ci.fmf @@ -0,0 +1,5 @@ +summary: Basic smoke test +discover: + how: fmf +execute: + how: tmt diff --git a/tests/cmp-s-returns-1-even-if-files-are-identical/main.fmf b/tests/cmp-s-returns-1-even-if-files-are-identical/main.fmf new file mode 100644 index 0000000..d7910cc --- /dev/null +++ b/tests/cmp-s-returns-1-even-if-files-are-identical/main.fmf @@ -0,0 +1,17 @@ +summary: Test for cmp -s returns 1 even if files are identical +description: "Bug summary: cmp -s returns 1 even if files are identical\n\nDescription:\n\ + 'cmp -s' can return 1 even if files are identical, for example, if comparing\n\ + a file from /proc with a copy of that file in /tmp, since all files in\n/proc + have a size of 0 bytes.\n" +contact: Jeffrey Bastian +component: + - diffutils +test: ./runtest.sh +framework: beakerlib +recommend: + - diffutils +duration: 5m +extra-summary: + /CoreOS/diffutils/Regression/cmp-s-returns-1-even-if-files-are-identical +extra-task: + /CoreOS/diffutils/Regression/cmp-s-returns-1-even-if-files-are-identical diff --git a/tests/cmp-s-returns-1-even-if-files-are-identical/runtest.sh b/tests/cmp-s-returns-1-even-if-files-are-identical/runtest.sh old mode 100644 new mode 100755 index 4e16f2b..72ded09 --- a/tests/cmp-s-returns-1-even-if-files-are-identical/runtest.sh +++ b/tests/cmp-s-returns-1-even-if-files-are-identical/runtest.sh @@ -26,8 +26,7 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Include rhts environment -. /usr/bin/rhts-environment.sh -. /usr/share/rhts-library/rhtslib.sh +. /usr/share/beakerlib/beakerlib.sh || exit 1 PACKAGE="diffutils" #set -x diff --git a/tests/diff-Z-hangs/main.fmf b/tests/diff-Z-hangs/main.fmf new file mode 100644 index 0000000..b978f00 --- /dev/null +++ b/tests/diff-Z-hangs/main.fmf @@ -0,0 +1,13 @@ +summary: Test for diffutils to check if comparing two files using diff -Z with + mixed line endings doesn't hang +description: "Bug summary: diff -Z hangs\n" +contact: Filip Holec +component: + - diffutils +test: ./runtest.sh +framework: beakerlib +recommend: + - diffutils +duration: 5m +extra-summary: /CoreOS/diffutils/Regression/diff-Z-hangs +extra-task: /CoreOS/diffutils/Regression/diff-Z-hangs diff --git a/tests/diff-Z-hangs/runtest.sh b/tests/diff-Z-hangs/runtest.sh old mode 100644 new mode 100755 index ef14e65..79b396a --- a/tests/diff-Z-hangs/runtest.sh +++ b/tests/diff-Z-hangs/runtest.sh @@ -27,7 +27,6 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Include Beaker environment -. /usr/bin/rhts-environment.sh . /usr/share/beakerlib/beakerlib.sh PACKAGE="diffutils" diff --git a/tests/diff-hang-long-files/main.fmf b/tests/diff-hang-long-files/main.fmf new file mode 100644 index 0000000..e41e226 --- /dev/null +++ b/tests/diff-hang-long-files/main.fmf @@ -0,0 +1,20 @@ +summary: Diff appears to hang in long file +description: "Test Name: diff-hang-long-files\nAuthor: Michal Fabry \n\ + Location: /CoreOS/diffutils/Regression/diff-hang-long-files\n\nShort Description: + Diff appears to hang in long file\n\n\nLong Description:\n\nRunning the \"diff + -bBw\" command on a very large input file (eg 250 MB), in a multi-byte locale + (ie UTF-8), took a very long time to complete, if at all. In a reported case, + a diff ran for multiple days and did not complete. In certain situations, this + could cause 100% CPU usage.\n" +contact: Michal Fabry +component: + - diffutils +test: ./runtest.sh +framework: beakerlib +recommend: + - diffutils + - words + - time +duration: 5m +extra-summary: /CoreOS/diffutils/Regression/diff-hang-long-files +extra-task: /CoreOS/diffutils/Regression/diff-hang-long-files diff --git a/tests/diff-hang-long-files/runtest.sh b/tests/diff-hang-long-files/runtest.sh old mode 100644 new mode 100755 index 18d3606..1457dfe --- a/tests/diff-hang-long-files/runtest.sh +++ b/tests/diff-hang-long-files/runtest.sh @@ -15,7 +15,6 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Include Beaker environment -. /usr/bin/rhts-environment.sh || exit 1 . /usr/share/beakerlib/beakerlib.sh || exit 1 @@ -76,3 +75,4 @@ rlPhaseEnd #rlCreateLogFromJournal | tee $OUTPUTFILE rlJournalPrintText +rlJournalEnd diff --git a/tests/diff-w-b-doesn-t-treat-U3000-IDEOGRAPHIC-SPACE-as-space/main.fmf b/tests/diff-w-b-doesn-t-treat-U3000-IDEOGRAPHIC-SPACE-as-space/main.fmf new file mode 100644 index 0000000..06210fd --- /dev/null +++ b/tests/diff-w-b-doesn-t-treat-U3000-IDEOGRAPHIC-SPACE-as-space/main.fmf @@ -0,0 +1,17 @@ +summary: Test for diffutils to ensure U3000 ideographic space is treated as + space when used -b or -w options +description: "Bug summary: diff -w/-b doesn't treat U3000 (IDEOGRAPHIC SPACE) as space\n\ + \nTest for diffutils to ensure U3000 ideographic space is treated as space when + used -b or -w options\n" +contact: Filip Holec +component: + - diffutils +test: ./runtest.sh +framework: beakerlib +recommend: + - diffutils +duration: 5m +extra-summary: + /CoreOS/diffutils/Regression/diff-w-b-doesn-t-treat-U3000-IDEOGRAPHIC-SPACE-as-space +extra-task: + /CoreOS/diffutils/Regression/diff-w-b-doesn-t-treat-U3000-IDEOGRAPHIC-SPACE-as-space diff --git a/tests/diff-w-b-doesn-t-treat-U3000-IDEOGRAPHIC-SPACE-as-space/runtest.sh b/tests/diff-w-b-doesn-t-treat-U3000-IDEOGRAPHIC-SPACE-as-space/runtest.sh old mode 100644 new mode 100755 index 46a760d..d84af01 --- a/tests/diff-w-b-doesn-t-treat-U3000-IDEOGRAPHIC-SPACE-as-space/runtest.sh +++ b/tests/diff-w-b-doesn-t-treat-U3000-IDEOGRAPHIC-SPACE-as-space/runtest.sh @@ -27,7 +27,6 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Include Beaker environment -. /usr/bin/rhts-environment.sh . /usr/share/beakerlib/beakerlib.sh PACKAGE="diffutils" diff --git a/tests/sdiff-does-not-recognize-E-option/main.fmf b/tests/sdiff-does-not-recognize-E-option/main.fmf new file mode 100644 index 0000000..6fe5268 --- /dev/null +++ b/tests/sdiff-does-not-recognize-E-option/main.fmf @@ -0,0 +1,14 @@ +summary: Test for sdiff does not recognize -E option +description: "Bug summary: sdiff does not recognize -E option\n\nThe test runs sdiff + -E on two files differing just in use of tab/8 spaces. sdiff shall not fail and + shall return that the files are identical.\n" +contact: Martin Kyral +component: + - diffutils +test: ./runtest.sh +framework: beakerlib +recommend: + - diffutils +duration: 10m +extra-summary: /CoreOS/diffutils/Regression/sdiff-does-not-recognize-E-option +extra-task: /CoreOS/diffutils/Regression/sdiff-does-not-recognize-E-option diff --git a/tests/sdiff-does-not-recognize-E-option/runtest.sh b/tests/sdiff-does-not-recognize-E-option/runtest.sh old mode 100644 new mode 100755 index d60f29b..be034f2 --- a/tests/sdiff-does-not-recognize-E-option/runtest.sh +++ b/tests/sdiff-does-not-recognize-E-option/runtest.sh @@ -27,8 +27,7 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Include Beaker environment -. /usr/bin/rhts-environment.sh -. /usr/lib/beakerlib/beakerlib.sh +. /usr/share/beakerlib/beakerlib.sh || exit 1 PACKAGE="diffutils" diff --git a/tests/tests.yml b/tests/tests.yml deleted file mode 100644 index 7f41590..0000000 --- a/tests/tests.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -# Tests that run in classic context -- hosts: localhost - roles: - - role: standard-test-beakerlib - tags: - - classic - - container - - atomic - tests: - - cmp-s-returns-1-even-if-files-are-identical - - diff-hang-long-files - - diff-w-b-doesn-t-treat-U3000-IDEOGRAPHIC-SPACE-as-space - - diff-Z-hangs - - sdiff-does-not-recognize-E-option - - whitespace - required_packages: - - findutils # beakerlib needs find command diff --git a/tests/whitespace/main.fmf b/tests/whitespace/main.fmf new file mode 100644 index 0000000..955e588 --- /dev/null +++ b/tests/whitespace/main.fmf @@ -0,0 +1,15 @@ +summary: diff -b should ignore whitespace +description: "Create 2 files, f1, f2 with contents \"abc\" and \"abc \" (without quotes),\n\ + i.e. the same line with a space on the end.\n\nDiff ignoring whitespace:\n\ndiff + -b f1 f2\n\nshould produce no diff output, but does on F8. Works fine on FC6.\n\ + \nversion: diffutils-2.8.1-17.fc8\n" +contact: Bill Peck +component: + - diffutils +test: ./runtest.sh +framework: beakerlib +recommend: + - diffutils +duration: 5m +extra-summary: /CoreOS/diffutils/whitespace +extra-task: /CoreOS/diffutils/whitespace diff --git a/tests/whitespace/runtest.sh b/tests/whitespace/runtest.sh old mode 100644 new mode 100755 index 50348e9..9f28bf1 --- a/tests/whitespace/runtest.sh +++ b/tests/whitespace/runtest.sh @@ -15,8 +15,7 @@ # # Author: Bill Peck -. /usr/bin/rhts-environment.sh -. /usr/share/rhts-library/rhtslib.sh +. /usr/share/beakerlib/beakerlib.sh || exit 1 PACKAGE="diffutils"