Kernel Patch Evaluated Testing

Framework which will execute targeted testing based on changes introduced in the patch

KPET is a framework which will execute targeted testing based on changes introduced in the patch, e.g. a network driver or similar would trigger network related testing

KPET CLI Quick Start Guide

  1. Install KPET CLI

    kpet is written in Python that means you will need python3 installed on your system. You can execute it directly from the repository ./bin/kpet or you can install it via pip and use it directly from your PATH.

    pip install --user git+https://gitlab.com/cki-project/kpet.git
    
  2. Run KPET (you can point to a patch url or file)

    1. Install KPET Database

      In order to use kpet you will need to download the kpet database which includes the templates and pattern files needed to analyze the patch and generate the corresponding beaker xml.

      git clone https://gitlab.com/cki-project/kpet-db.git
      
    2. Change directory to newly cloned kpet-db. The database is assumed to reside in the current working directory, otherwise add --db DB to specify the location of the kpet database.

      cd kpet-db
      
    3. To preview patch generated test cases:

      kpet run test list 001.patch
      

      or

      kpet run test list https://patchwork.kernel.org/patch/10533445/mbox
      
    4. To generate complete beaker xml:

      kpet run generate \
          --description 'kpet onboarding'
          --arch x86_64 \
          --kernel '##KPG_URL##' \
          --tree rhel8 \
          --output job.xml \
          001.patch
      

      or

      kpet run generate \
          --description 'kpet onboarding' \
          --arch x86_64 \
          --kernel '##KPG_URL##' \
          --tree rhel8 \
          --output job.xml \
          https://patchwork.kernel.org/patch/10533445/mbox
      

      where ##KPG_URL## is a URL pointing to a gzipped kernel tarball with /boot and /lib/modules/ directories or a yum repo to install the a prebuilt RPM and dependencies.

    5. To generate xml specific to a kernel subsystem, include --sets and the correct subsystem keyword:

      kpet run generate \
          --description 'kpet onboarding' \
          --arch x86_64 \
          --kernel '##KPG_URL##' \
          --tree rhel8 \
          --sets kt1 \
          --output kt1.xml
      
    6. Submit the job to beaker

      bkr job-submit job.xml
      
    7. Reserve the system

      Beaker CLI will display your submitted beaker job id, you can then login to beaker webui to extend the reservation as needed.

Complete example:

pip install --user git+https://gitlab.com/cki-project/kpet
git clone https://gitlab.com/cki-project/kpet-db.git
cd kpet-db
kpet run generate \
    --db . \
    --description 'new_feature.patch' \
    --kernel 'http://your.url.here/c1b7ab.tar.gz' \
    --tree rhel8 \
    --arch x86_64 \
    --output job.xml \
    https://patchwork.kernel.org/patch/10533445/mbox
bkr job-submit job.xml

For complete details on how to use kpet and kpet-db, please see the Readme

Last modified August 4, 2021: Move some links to end of file (e692647)