* [PATCH 1/2] rteval: Move unittest.py to tests/unittest-legacy.py @ 2025-11-25 11:02 Tomas Glozar 2025-11-25 11:02 ` [PATCH 2/2] rteval: Add README-tests Tomas Glozar 2025-11-25 19:04 ` [PATCH 1/2] rteval: Move unittest.py to tests/unittest-legacy.py John Kacur 0 siblings, 2 replies; 4+ messages in thread From: Tomas Glozar @ 2025-11-25 11:02 UTC (permalink / raw) To: John Kacur, Clark Williams; +Cc: Linux RT Users, Tomas Glozar We now have a tests/ folder. Move unittest.py there, rename it to unittest-legacy.py to prevent conflict with Python's unittest module, and remove the now empty directory unit-tests/. Signed-off-by: Tomas Glozar <tglozar@redhat.com> --- This is a follow-up to [1], in place of patch 2 and 3. Patch 1 got applied, patches 2 and 3 required changes following the merging of [2]. [1] https://lore.kernel.org/linux-rt-users/20251107134749.257350-1-tglozar@redhat.com/T/ [2] https://lore.kernel.org/linux-rt-users/20251107182645.19545-1-jkacur@redhat.com/T/ unit-tests/unittest.py => tests/unittest-legacy.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename unit-tests/unittest.py => tests/unittest-legacy.py (100%) diff --git a/unit-tests/unittest.py b/tests/unittest-legacy.py similarity index 100% rename from unit-tests/unittest.py rename to tests/unittest-legacy.py -- 2.51.1 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 2/2] rteval: Add README-tests 2025-11-25 11:02 [PATCH 1/2] rteval: Move unittest.py to tests/unittest-legacy.py Tomas Glozar @ 2025-11-25 11:02 ` Tomas Glozar 2025-11-25 19:05 ` John Kacur 2025-11-25 19:04 ` [PATCH 1/2] rteval: Move unittest.py to tests/unittest-legacy.py John Kacur 1 sibling, 1 reply; 4+ messages in thread From: Tomas Glozar @ 2025-11-25 11:02 UTC (permalink / raw) To: John Kacur, Clark Williams; +Cc: Linux RT Users, Tomas Glozar Add a README-tests file describing what tests are implemented for rteval and how to run them. Signed-off-by: Tomas Glozar <tglozar@redhat.com> --- README-tests | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 README-tests diff --git a/README-tests b/README-tests new file mode 100644 index 0000000..802d4eb --- /dev/null +++ b/README-tests @@ -0,0 +1,102 @@ +There currently exist four kinds of tests for rteval: + +- Unit tests + +Unit tests reside in the tests/ directory. They are Python modules which import +the Python unittest library. + +The Makefile target "unittest" (or, alternatively, just "test") invokes unit +tests: + +$ make test +Running unit tests... +./run_tests.sh +========================================= +Running rteval Unit Tests +========================================= + +Running: test_measurement_module_selection +--- +test_argparse_rejects_invalid_module (__main__.TestMeasurementModuleSelection) +Test that argparse rejects invalid module names ... usage: test_measurement_module_selection.py [--measurement-module {cyclictest,timerlat}] +test_measurement_module_selection.py: error: argument --measurement-module: invalid choice: 'invalid' (choose from 'cyclictest', 'timerlat') +ok +... + +---------------------------------------------------------------------- +Ran 6 tests in 0.003s + +OK +✓ PASSED: test_measurement_module_selection + +========================================= +Test Summary +========================================= +Total tests run: 1 +Passed: 1 +Failed: 0 + +✓ All tests passed! + +- End-to-end tests + +End-to-end tests reside in the tests/e2e subdirectory, in files with +the .t extension. They are written in bash and produce output compatible with +the TEP standard. + +To run end-to-end tests, the rteval kcompile source tarball has to be present; +see LOADS variable in Makefile for the tarballs used by the current version of +rteval. + +The Makefile target "check" invokes the end-to-end tests under Test::Harness +via the "prove" command: + +$ sudo make e2e-tests +PYTHON="python3" RTEVAL="/usr/src/rteval/rteval-cmd" RTEVAL_PKG="/usr/src/rteval" prove -o -f -v tests/e2e/ +... +All tests successful. +Files=3, Tests=33, 288 wallclock secs ( 0.02 usr 0.00 sys + 127.59 cusr 155.27 csys = 282.88 CPU) +Result: PASS + +Test::Harness here serves the purpose of measuring time, counting the total +number of tests, and verifying if each test suite reported the correct number +of test results. + +Note: rteval requires root privileges to run. All tests, with the exception of +a part of the unit tests, thus require root. + +- Pre-defined rteval commands for manual testing + +These are accessible under the Makefile targets: "runit", "load", and +"sysreport". + +"runit" tests both measurements and loads, "load" tests only loads, and +"sysreport" runs both measurements and loads while also generating a SOS report +at the end of the rteval run. + +- Legacy unit tests + +Legacy unit tests are embedded directly in rteval source code. The test engine +to run them is located in tests/unittest-legacy.py, and may be run with +the following sequence of commands (starting in the root directory): + +$ cd rteval/ +$ sudo python3 ../tests/unittest-legacy.py +... + -------------------- + ** TEST SUMMARY ** + -------------------- + + - Modules: + Declared for test: 4 + Successfully imported: 4 + Failed import: 0 + + - Tests: + Tests scheduled: 4 + Sucessfully tests: 4 + Failed tests: 0 + Missing unit_test() 0 + +Note that some of the tests require root and will fail if run under normal +user. -- 2.51.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] rteval: Add README-tests 2025-11-25 11:02 ` [PATCH 2/2] rteval: Add README-tests Tomas Glozar @ 2025-11-25 19:05 ` John Kacur 0 siblings, 0 replies; 4+ messages in thread From: John Kacur @ 2025-11-25 19:05 UTC (permalink / raw) To: Tomas Glozar; +Cc: Clark Williams, Linux RT Users [-- Attachment #1: Type: text/plain, Size: 4053 bytes --] On Tue, 25 Nov 2025, Tomas Glozar wrote: > Add a README-tests file describing what tests are implemented for > rteval and how to run them. > > Signed-off-by: Tomas Glozar <tglozar@redhat.com> > --- > README-tests | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 102 insertions(+) > create mode 100644 README-tests > > diff --git a/README-tests b/README-tests > new file mode 100644 > index 0000000..802d4eb > --- /dev/null > +++ b/README-tests > @@ -0,0 +1,102 @@ > +There currently exist four kinds of tests for rteval: > + > +- Unit tests > + > +Unit tests reside in the tests/ directory. They are Python modules which import > +the Python unittest library. > + > +The Makefile target "unittest" (or, alternatively, just "test") invokes unit > +tests: > + > +$ make test > +Running unit tests... > +./run_tests.sh > +========================================= > +Running rteval Unit Tests > +========================================= > + > +Running: test_measurement_module_selection > +--- > +test_argparse_rejects_invalid_module (__main__.TestMeasurementModuleSelection) > +Test that argparse rejects invalid module names ... usage: test_measurement_module_selection.py [--measurement-module {cyclictest,timerlat}] > +test_measurement_module_selection.py: error: argument --measurement-module: invalid choice: 'invalid' (choose from 'cyclictest', 'timerlat') > +ok > +... > + > +---------------------------------------------------------------------- > +Ran 6 tests in 0.003s > + > +OK > +✓ PASSED: test_measurement_module_selection > + > +========================================= > +Test Summary > +========================================= > +Total tests run: 1 > +Passed: 1 > +Failed: 0 > + > +✓ All tests passed! > + > +- End-to-end tests > + > +End-to-end tests reside in the tests/e2e subdirectory, in files with > +the .t extension. They are written in bash and produce output compatible with > +the TEP standard. > + > +To run end-to-end tests, the rteval kcompile source tarball has to be present; > +see LOADS variable in Makefile for the tarballs used by the current version of > +rteval. > + > +The Makefile target "check" invokes the end-to-end tests under Test::Harness > +via the "prove" command: > + > +$ sudo make e2e-tests > +PYTHON="python3" RTEVAL="/usr/src/rteval/rteval-cmd" RTEVAL_PKG="/usr/src/rteval" prove -o -f -v tests/e2e/ > +... > +All tests successful. > +Files=3, Tests=33, 288 wallclock secs ( 0.02 usr 0.00 sys + 127.59 cusr 155.27 csys = 282.88 CPU) > +Result: PASS > + > +Test::Harness here serves the purpose of measuring time, counting the total > +number of tests, and verifying if each test suite reported the correct number > +of test results. > + > +Note: rteval requires root privileges to run. All tests, with the exception of > +a part of the unit tests, thus require root. > + > +- Pre-defined rteval commands for manual testing > + > +These are accessible under the Makefile targets: "runit", "load", and > +"sysreport". > + > +"runit" tests both measurements and loads, "load" tests only loads, and > +"sysreport" runs both measurements and loads while also generating a SOS report > +at the end of the rteval run. > + > +- Legacy unit tests > + > +Legacy unit tests are embedded directly in rteval source code. The test engine > +to run them is located in tests/unittest-legacy.py, and may be run with > +the following sequence of commands (starting in the root directory): > + > +$ cd rteval/ > +$ sudo python3 ../tests/unittest-legacy.py > +... > + -------------------- > + ** TEST SUMMARY ** > + -------------------- > + > + - Modules: > + Declared for test: 4 > + Successfully imported: 4 > + Failed import: 0 > + > + - Tests: > + Tests scheduled: 4 > + Sucessfully tests: 4 > + Failed tests: 0 > + Missing unit_test() 0 > + > +Note that some of the tests require root and will fail if run under normal > +user. > -- > 2.51.1 > > Signed-off-by: John Kacur <jkacur@redhat.com> ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] rteval: Move unittest.py to tests/unittest-legacy.py 2025-11-25 11:02 [PATCH 1/2] rteval: Move unittest.py to tests/unittest-legacy.py Tomas Glozar 2025-11-25 11:02 ` [PATCH 2/2] rteval: Add README-tests Tomas Glozar @ 2025-11-25 19:04 ` John Kacur 1 sibling, 0 replies; 4+ messages in thread From: John Kacur @ 2025-11-25 19:04 UTC (permalink / raw) To: Tomas Glozar; +Cc: Clark Williams, Linux RT Users On Tue, 25 Nov 2025, Tomas Glozar wrote: > We now have a tests/ folder. Move unittest.py there, rename it to > unittest-legacy.py to prevent conflict with Python's unittest > module, and remove the now empty directory unit-tests/. > > Signed-off-by: Tomas Glozar <tglozar@redhat.com> > --- > This is a follow-up to [1], in place of patch 2 and 3. Patch 1 got applied, > patches 2 and 3 required changes following the merging of [2]. > > [1] https://lore.kernel.org/linux-rt-users/20251107134749.257350-1-tglozar@redhat.com/T/ > [2] https://lore.kernel.org/linux-rt-users/20251107182645.19545-1-jkacur@redhat.com/T/ > > unit-tests/unittest.py => tests/unittest-legacy.py | 0 > 1 file changed, 0 insertions(+), 0 deletions(-) > rename unit-tests/unittest.py => tests/unittest-legacy.py (100%) > > diff --git a/unit-tests/unittest.py b/tests/unittest-legacy.py > similarity index 100% > rename from unit-tests/unittest.py > rename to tests/unittest-legacy.py > -- > 2.51.1 > > Signed-off-by: John Kacur <jkacur@redghat.com> ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-11-25 19:05 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-11-25 11:02 [PATCH 1/2] rteval: Move unittest.py to tests/unittest-legacy.py Tomas Glozar 2025-11-25 11:02 ` [PATCH 2/2] rteval: Add README-tests Tomas Glozar 2025-11-25 19:05 ` John Kacur 2025-11-25 19:04 ` [PATCH 1/2] rteval: Move unittest.py to tests/unittest-legacy.py John Kacur
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox