Skip to content
Snippets Groups Projects
  1. Mar 10, 2025
    • Peter Senna Tschudin's avatar
      runner/executor: Integrate igt_kmemleak scans · f42d48f1
      Peter Senna Tschudin authored and Kamil Konieczny's avatar Kamil Konieczny committed
      
      This patch modifies igt_runner to support runner_kmemleak() calls. By
      default, kmemleak scanning is disabled, so new command-line options are
      introduced to enable it:
       * -k, -k<option>, --kmemleak, --kmemleak=<option>
      
      The available options are:
       * once: Do single kmemleak scan after last test in the test list
       * each: Perform a kmemleak scan after each test completes
      
      By default, kmemleak scanning is disabled. If any kmemleaks are
      detected, they will be saved in the igt_runner results directory under
      kmemleak.txt.
      
      Additionally, this patch updates serialize_settings() and
      read_settings_from_file() to persist igt_runner settings across runs.
      This allows settings to be saved when running igt_runner --dry-run and
      later restored when executing igt_resume.
      
      The unit tests for igt_runner have been extended to verify:
       * Kmemleak scans are disabled by default
       * Kmemleak scans can be enabled via command-line arguments
       * The kmemleak setting is correctly saved to and restored from disk
      
      To test the new -k command-line option, this patch appends "--overwrite"
      to *argv[] in runner_test.c to expand the argument array. This approach
      avoids a major refactor of how *argv[] is defined across the file while
      keeping the changes isolated to unit testing. Since this only affects
      tests, there is no downstream impact.
      
      Cc: vitaly.prosyak@amd.com
      Cc: christian.koenig@amd.com
      Cc: alexander.deucher@amd.com
      Cc: jesse.zhang@amd.com
      Cc: harry.wentland@amd.com
      Cc: zbigniew.kempczynski@intel.com
      Cc: kamil.konieczny@linux.intel.com
      Cc: ryszard.knop@intel.com
      Cc: lucas.demarchi@intel.com
      Cc: katarzyna.piecielska@intel.com
      Reviewed-by: default avatarZbigniew Kempczyński <zbigniew.kempczynski@intel.com>
      Reviewed-by: default avatarJonathan Cavitt <jonathan.cavitt@intel.com>
      Reviewed-by: default avatarVitaly Prosyak <vitaly.prosyak@amd.com>
      Signed-off-by: default avatarPeter Senna Tschudin <peter.senna@linux.intel.com>
      f42d48f1
  2. Feb 10, 2025
  3. Dec 20, 2024
    • Peter Senna Tschudin's avatar
      runner/executor: Integrate igt_facts functionality · ecb43515
      Peter Senna Tschudin authored and Kamil Konieczny's avatar Kamil Konieczny committed
      
      Modifies igt_runner to include calls to igt_facts() before the
      execution of each test and after the final test concludes. Facts are
      disabled by default, so add command line options to igt_runner to
      enable facts:  -f, --facts
      
      Updates serialize_settings() and read_settings_from_file() to save
      and restore igt_runner settings to and from disk. This is used when
      calling igt_runner with '--dry-run' and then by calling igt_resume
      instead of igt_runner.
      
      Updates unit testing for igt_runner to test that:
       - Facts are disabled by default
       - Facts can be enabled by command line arguments
       - The choice about facts being enabled or not is saved to disk
         and restored from disk
      
      CC: Helen Koike <helen.koike@collabora.com>
      CC: Jani Nikula <jani.nikula@linux.intel.com>
      CC: Jani Saarinen <jani.saarinen@intel.com>
      CC: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
      CC: Juha-Pekka Heikkila <juha-pekka.heikkila@intel.com>
      CC: Kamil Konieczny <kamil.konieczny@linux.intel.com>
      CC: Lucas De Marchi <lucas.demarchi@intel.com>
      CC: Maíra Canal <mcanal@igalia.com>
      CC: Melissa Wen <mwen@igalia.com>
      CC: Petri Latvala <adrinael@adrinael.net>
      CC: Rob Clark <robdclark@chromium.org>
      CC: Ryszard Knop <ryszard.knop@intel.com>
      CC: Swati Sharma <swati2.sharma@intel.com>
      CC: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
      CC: dominik.karol.piatkowski@intel.com
      CC: himal.prasad.ghimiray@intel.com
      CC: katarzyna.piecielska@intel.com
      CC: luciano.coelho@intel.com
      CC: nirmoy.das@intel.com
      CC: stuart.summers@intel.com
      Reviewed-by: default avatarZbigniew Kempczyński <zbigniew.kempczynski@intel.com>
      Reviewed-by: default avatarRyszard Knop <ryszard.knop@intel.com>
      Reviewed-by: default avatarDominik Karol Piątkowski <dominik.karol.piatkowski@intel.com>
      Signed-off-by: default avatarPeter Senna Tschudin <peter.senna@linux.intel.com>
      ecb43515
  4. Sep 05, 2024
  5. Aug 21, 2024
  6. Oct 30, 2023
  7. Aug 31, 2022
    • Dragoon Aethis's avatar
      runner: Add tests for environment flags · ec22200d
      Dragoon Aethis authored
      Per Mauro's review, add some --environment tests:
      - Check if -e/--environment works,
      - Check both KEY=VALUE and KEY,
      - Check if resumes load the variables correctly.
      ec22200d
    • Dragoon Aethis's avatar
      b580bae7
    • Dragoon Aethis's avatar
      runner: Serialize the provided environment flags · f3d848a0
      Dragoon Aethis authored
      Settings serialization now creates a separate file, environment.txt,
      which contains KEY=VALUE pairs of environment variables to use for test
      process spawning. Only vars created with --environment are serialized.
      Also add misc warning fixes.
      
      v2:
      - Simplify env var reading from files (Mauro)
      - Don't align settings loading block (Mauro)
      - Make filenames static const (Mauro)
      f3d848a0
    • Dragoon Aethis's avatar
      runner: Add the --environment flag · 66ee80cc
      Dragoon Aethis authored
      Allows specifying additional environment variables to be set for the
      launched test processes. This commit introduces the argument parsing.
      
      v2:
      - Moved warning fixes from later commits here
      - igt_list_empty_or_null -> igt_list_empty (Mauro)
      - Optimized the parser, more error handling (Mauro)
      66ee80cc
    • Dragoon Aethis's avatar
      runner: make the usage function variadic · 01737c4a
      Dragoon Aethis authored
      For easier error logging, make the usage() function variadic and pass
      its arguments to vfprintf. Additionally, reorder its arguments so that
      it visually matches all the printf functions.
      
      v2:
      - usage(msg, ...) -> usage(stderr) (Maira)
      - __attribute__ ((format (...))) (Petri)
      01737c4a
    • Dragoon Aethis's avatar
      runner: rename free_settings to clear_settings · 1096ca21
      Dragoon Aethis authored
      That function does not actually free the settings pointer - rename it
      for clarity.
      1096ca21
  8. Apr 14, 2022
  9. Mar 31, 2022
    • Petri Latvala's avatar
      runner: Introduce --prune-mode to igt_runner · 4bbecaf8
      Petri Latvala authored
      
      Allow finer control of reporting dynamic subtests instead of
      unconditionally assuming that the main subtest result and logs are
      uninteresting if the subtest has dynamic subtests.
      
      The default is still to remove subtest results when the subtest has
      dynamic subtests. Other options are:
      
      keep-subtests: Remove the dynamic subtests instead, for cases when a
      stable test count is more important.
      
      keep-all: Remove nothing.
      
      keep-requested: Remove the results that were not directly requested to
      be executed. This option is useful in cases where the test selection
      is a hand-picked mix of subtests and particular dynamic subtests.
      
      Signed-off-by: default avatarPetri Latvala <petri.latvala@intel.com>
      Cc: Arkadiusz Hiler <arek@hiler.eu>
      Reviewed-by: default avatarSwati Sharma <swati2.sharma@intel.com>
      4bbecaf8
  10. Mar 21, 2022
    • Mauro Carvalho Chehab's avatar
      runner: Add support for code coverage · 7eb558a8
      Mauro Carvalho Chehab authored and Petri Latvala's avatar Petri Latvala committed
      The gcc compiler has a feature that enables checking the code coverage
      in runtime[1].
      
      [1] See https://www.kernel.org/doc/html/latest/dev-tools/gcov.html
      
      
      
      The Linux Kernel comes with an option to enable such feature:
      
      	./scripts/config -e DEBUG_FS -e GCOV_KERNEL
      
      The driver's Makefile also needs change to enable it. For instance, in
      order to enable GCOV for all DRM drivers, one would need to run:
      
      	for i in $(find drivers/gpu/drm/ -name Makefile); do
                      sed '1 a GCOV_PROFILE := y' -i $i
              done
      
      This patch adds support for it by:
      
      a) Implementing a logic to cleanup the code coverage counters via sysfs;
      b) Calling a script responsible for collecging code coverage data.
      
      The implementation works with two modes:
      
      1) It zeroes the counters, run all IGT tests and collects the code
         coverage results at the end.
      
         This implies that no tests would crash the driver, as otherwise the
         results won't be collected;
      
         This is faster, as collecting code coverage data can take several
         seconds.
      
      2) For each test, it will clean the code coverage counters, run the and
         collect the results.
      
         This is more reliable, as a Kernel crash/OOPS won't affect the
         results of the previously ran tests.
      
      Reviewed-by: default avatarPetri Latvala <petri.latvala@intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
      7eb558a8
    • Mauro Carvalho Chehab's avatar
      runner: check if it has root permissions · 4b88a925
      Mauro Carvalho Chehab authored and Petri Latvala's avatar Petri Latvala committed
      
      Without root permissions, most IGT tests won't actually run, but they
      would be displayed at the runner's output as if everything went fine.
      
      In order to avoid that, check if one attempts to run IGT without root
      permission. Such check can be disbled with a new command line option:
      
      	--allow-non-root
      
      As runner_tests runs as non-root, most unit tests need to pass
      --allow-non-root in order for them to not return an error.
      
      Reviewed-by: default avatarPetri Latvala <petri.latvala@intel.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
      4b88a925
  11. Jul 20, 2020
  12. Jun 11, 2020
    • Lyude Paul's avatar
      runner: Fix handling of metadata values containing spaces · a8c256b4
      Lyude Paul authored
      
      Noticed while running some tests that adding any kind of spaces into the
      name of a test run would stop igt_resume from working for said test run.
      Turns out that when we parse test metadata, we accidentally use the
      '%ms' specifier with fscanf() which finishes parsing strings when any
      kind of whitespace is encountered.
      
      So, fix this by using the proper %m[^\n] specifier, which dynamically
      allocates it's result and doesn't stop reading the string until a
      newline is encountered. Additionally, add a test for this.
      
      Signed-off-by: Lyude Paul's avatarLyude Paul <lyude@redhat.com>
      Reviewed-by: default avatarPetri Latvala <petri.latvala@intel.com>
      a8c256b4
  13. Apr 17, 2020
    • Petri Latvala's avatar
      runner: Add --version to igt_runner · 276b8a3f
      Petri Latvala authored
      
      To help verify correct deployment, add a --version flag to igt_runner
      that just prints the IGT-version text, the same tests would print.
      
      Note that only igt_runner gained the --version flag. igt_resume and
      igt_results don't do fancy flag handling, they only accept the
      directory to operate as their single arg.
      
      v2: Depend on version.h (CI)
      
      Signed-off-by: default avatarPetri Latvala <petri.latvala@intel.com>
      Cc: Tomi Sarvela <tomi.p.sarvela@intel.com>
      Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
      Reviewed-by: default avatarArkadiusz Hiler <arkadiusz.hiler@intel.com>
      276b8a3f
  14. Feb 19, 2020
  15. Sep 17, 2019
    • Petri Latvala's avatar
      runner: Add support for aborting on network failure · ddfde25f
      Petri Latvala authored
      
      If the network goes down while testing, CI tends to interpret that as
      the device being down, cutting its power after a while. This causes an
      incomplete to an innocent test, increasing noise in the results.
      
      A new flag to --abort-on-monitored-error, "ping", uses liboping to
      ping a host configured in .igtrc with one ping after each test
      execution and aborts the run if there is no reply in a hardcoded
      amount of time.
      
      v2:
       - Use a higher timeout
       - Allow hostname configuration from environment
      v3:
       - Use runner_c_args for holding c args for runner
       - Handle runner's meson options in runner/meson.build
       - Instead of one ping with 20 second timeout, ping with 1 second timeout
         for a duration of 20 seconds
      v4:
       - Rebase
       - Use now-exported igt_load_igtrc instead of copypaste code
       - Use define for timeout, clearer var name for single attempt timeout
      
      Signed-off-by: default avatarPetri Latvala <petri.latvala@intel.com>
      Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
      Cc: Martin Peres <martin.peres@linux.intel.com>
      Cc: Tomi Sarvela <tomi.p.sarvela@intel.com>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Reviewed-by: default avatarArkadiusz Hiler <arkadiusz.hiler@intel.com>
      ddfde25f
  16. Jun 24, 2019
  17. Jun 19, 2019
    • Oleg Vasilev's avatar
      runner: add --list-all and --blacklist · 29697c5d
      Oleg Vasilev authored and Petri Latvala's avatar Petri Latvala committed
      
      Currently, runner already collects all subtest names into job_list.
      --list-all allows to output it to stdout.
      
      --blacklist option takes a filename as an argument and adds all regexes
      from that file to the exclusion list.
      
      v2:
       - Update exclude/include regex matches for tests without
      	subtests to be matched with pigtit-like name (Petri)
       - Replace relative paths with those formatted with testdatadir (Petri)
       - Minor codestyle changes
      
      v3:
       - Print test names in lowercase (Petri)
      
      v4:
       - Replaced custom str_to_lower with generate_piglit_name (Petri)
       - Minor codestyle changes
      
      Cc: Petri Latvala <petri.latvala@intel.com>
      Signed-off-by: default avatarOleg Vasilev <oleg.vasilev@intel.com>
      Reviewed-by: default avatarPetri Latvala <petri.latvala@intel.com>
      29697c5d
  18. May 10, 2019
    • Lyude Paul's avatar
      runner: Use glib's regex utilities instead of POSIX ERE · 709bd686
      Lyude Paul authored
      
      POSIX ERE, while pretty standard is also very old and severely limited.
      In fact, it's so limited that Intel CI's own test blacklist,
      tests/intel-ci/blacklist.txt, doesn't even work with it due to the lack
      of support for backreferences.
      
      Since we're already using glib in other parts of igt, let's just start
      using glib's regular expression matching instead of the POSIX regex API.
      This gives us full perl compatible regular expressions and in turn, also
      gives us python compatible regular expressions to match piglit.
      
      Reviewed-by: default avatarPetri Latvala <petri.latvala@intel.com>
      Signed-off-by: Lyude Paul's avatarLyude Paul <lyude@redhat.com>
      709bd686
  19. Apr 01, 2019
  20. Nov 15, 2018
    • Petri Latvala's avatar
      runner: Implement --abort-on-monitored-error · 111593c4
      Petri Latvala authored
      
      Deviating a bit from the piglit command line flag, igt_runner takes an
      optional comma-separated list as an argument to
      --abort-on-monitored-error for the list of conditions to abort
      on. Without a list all possible conditions will be checked.
      
      Two conditions implemented:
       - "taint" checks the kernel taint level for TAINT_PAGE, TAINT_DIE and
       TAINT_OOPS
       - "lockdep" checks the kernel lockdep status
      
      Checking is done after every test binary execution, and if an abort
      condition is met, the reason is printed to stderr (unless log level is
      quiet) and the runner doesn't execute any further tests. Aborting
      between subtests (when running in --multiple-mode) is not done.
      
      v2:
       - Remember to fclose
       - Taints are unsigned long (Chris)
       - Use getline instead of fgets (Chris)
      v3:
       - Fix brainfart with lockdep
      v4:
       - Rebase
       - Refactor the abort condition checking to pass down strings
       - Present the abort result in results.json as a pseudo test result
       - Unit tests for the pseudo result
      v5:
       - Refactors (Chris)
       - Don't claim lockdep was triggered if debug_locks is not on
         anymore. Just say it's not active.
       - Dump lockdep_stats when aborting due to lockdep (Chris)
       - Use igt@runner@aborted instead for the pseudo result (Martin)
      v6:
       - If aborting after a test, generate results.json. Like was already
         done for aborting at startup.
       - Print the test that would be executed next as well when aborting,
         as requested by Tomi.
      v7:
       - Remove the resolved TODO item from commit message
      
      Signed-off-by: default avatarPetri Latvala <petri.latvala@intel.com>
      Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
      Cc: Tomi Sarvela <tomi.p.sarvela@intel.com>
      Cc: Martin Peres <martin.peres@linux.intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: default avatarArkadiusz Hiler <arkadiusz.hiler@intel.com>
      111593c4
  21. Oct 19, 2018
  22. Aug 31, 2018
  23. Aug 13, 2018
Loading