summaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2020-07-02 21:49:26 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2020-07-02 21:49:26 -0700
commit55844741a1e74bd41b4cea57502c2efedc99bf47 (patch)
treea03e66e60b802944b10dee6f73d0ae9950c31715 /Documentation
parent083176c86ffae8c9b467358eca5ba05a54a27898 (diff)
parentc63d2dd7e134ebddce4745c51f9572b3f0d92b26 (diff)
Merge tag 'linux-kselftest-kunit-fixes-5.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
Pull kunit fixes from Shuah Khan "Fixes for build and run-times failures. Also includes troubleshooting tips updates to kunit user documentation" * tag 'linux-kselftest-kunit-fixes-5.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: Documentation: kunit: Add some troubleshooting tips to the FAQ kunit: kunit_tool: Fix invalid result when build fails kunit: show error if kunit results are not present kunit: kunit_config: Fix parsing of CONFIG options with space
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/dev-tools/kunit/faq.rst40
1 files changed, 40 insertions, 0 deletions
diff --git a/Documentation/dev-tools/kunit/faq.rst b/Documentation/dev-tools/kunit/faq.rst
index ea55b2467653..1628862e7024 100644
--- a/Documentation/dev-tools/kunit/faq.rst
+++ b/Documentation/dev-tools/kunit/faq.rst
@@ -61,3 +61,43 @@ test, or an end-to-end test.
kernel by installing a production configuration of the kernel on production
hardware with a production userspace and then trying to exercise some behavior
that depends on interactions between the hardware, the kernel, and userspace.
+
+KUnit isn't working, what should I do?
+======================================
+
+Unfortunately, there are a number of things which can break, but here are some
+things to try.
+
+1. Try running ``./tools/testing/kunit/kunit.py run`` with the ``--raw_output``
+ parameter. This might show details or error messages hidden by the kunit_tool
+ parser.
+2. Instead of running ``kunit.py run``, try running ``kunit.py config``,
+ ``kunit.py build``, and ``kunit.py exec`` independently. This can help track
+ down where an issue is occurring. (If you think the parser is at fault, you
+ can run it manually against stdin or a file with ``kunit.py parse``.)
+3. Running the UML kernel directly can often reveal issues or error messages
+ kunit_tool ignores. This should be as simple as running ``./vmlinux`` after
+ building the UML kernel (e.g., by using ``kunit.py build``). Note that UML
+ has some unusual requirements (such as the host having a tmpfs filesystem
+ mounted), and has had issues in the past when built statically and the host
+ has KASLR enabled. (On older host kernels, you may need to run ``setarch
+ `uname -m` -R ./vmlinux`` to disable KASLR.)
+4. Make sure the kernel .config has ``CONFIG_KUNIT=y`` and at least one test
+ (e.g. ``CONFIG_KUNIT_EXAMPLE_TEST=y``). kunit_tool will keep its .config
+ around, so you can see what config was used after running ``kunit.py run``.
+ It also preserves any config changes you might make, so you can
+ enable/disable things with ``make ARCH=um menuconfig`` or similar, and then
+ re-run kunit_tool.
+5. Try to run ``make ARCH=um defconfig`` before running ``kunit.py run``. This
+ may help clean up any residual config items which could be causing problems.
+6. Finally, try running KUnit outside UML. KUnit and KUnit tests can run be
+ built into any kernel, or can be built as a module and loaded at runtime.
+ Doing so should allow you to determine if UML is causing the issue you're
+ seeing. When tests are built-in, they will execute when the kernel boots, and
+ modules will automatically execute associated tests when loaded. Test results
+ can be collected from ``/sys/kernel/debug/kunit/<test suite>/results``, and
+ can be parsed with ``kunit.py parse``. For more details, see "KUnit on
+ non-UML architectures" in :doc:`usage`.
+
+If none of the above tricks help, you are always welcome to email any issues to
+kunit-dev@googlegroups.com.
.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
language: bash
services: docker

branches:
  only:
    - master

# preload images to avoid timeouts in tests
before_install:
  - docker pull mariadb:10
  - docker pull postgres:11-alpine

install:
  - git clone https://github.com/docker-library/official-images.git ~/official-images

before_script:
  - env | sort
  - wget -qO- 'https://github.com/tianon/pgp-happy-eyeballs/raw/master/hack-my-builds.sh' | bash
  - image="nextcloud:${VERSION}${VARIANT:+-$VARIANT}"
  - if [[ "$ARCH" == 'i386' ]]; then sed -i -e 's/FROM php/FROM i386\/php/g' "${VERSION}/${VARIANT}/Dockerfile"; fi

script:
  - |
    (
      set -Eeuo pipefail
      set -x
      travis_retry docker build -t "$image" "${VERSION}/${VARIANT}"
      travis_retry ~/official-images/test/run.sh "$image"
      .travis/test-example-dockerfiles.sh "$image"
    )

after_script:
  - docker images

jobs:
  # https://github.com/docker-library/php/issues/822
  allow_failures:
    - env: VERSION=16.0 VARIANT=apache ARCH=i386
    - env: VERSION=17.0 VARIANT=apache ARCH=i386
    - env: VERSION=18.0 VARIANT=apache ARCH=i386
    - env: VERSION=19.0 VARIANT=apache ARCH=i386
    - env: VERSION=16.0-rc VARIANT=apache ARCH=i386
    - env: VERSION=17.0-rc VARIANT=apache ARCH=i386
    - env: VERSION=18.0-rc VARIANT=apache ARCH=i386
    - env: VERSION=19.0-rc VARIANT=apache ARCH=i386
    - env: VERSION=17.0-beta VARIANT=apache ARCH=i386
    - env: VERSION=18.0-beta VARIANT=apache ARCH=i386
    - env: VERSION=19.0-beta VARIANT=apache ARCH=i386
  include:
    - &test-scripts
      stage: test scripts
      env: SCRIPT=update.sh
      services: []
      install: skip
      before_script: skip
      script:
        - hash_before=$(git write-tree)
        - travis_retry ./update.sh
        - bash -c "[[ $hash_before = $(git add -A && git write-tree) ]]"
      after_script: skip

    - <<: *test-scripts
      env: SCRIPT=generate-stackbrew-library.sh
      install:
        - wget -O "$HOME/bin/bashbrew" https://doi-janky.infosiftr.net/job/bashbrew/lastSuccessfulBuild/artifact/bin/bashbrew-amd64
        - chmod +x "$HOME/bin/bashbrew"
      script:
        - travis_retry ./generate-stackbrew-library.sh

    - stage: test images
      env: VERSION=19.0-beta VARIANT=fpm-alpine ARCH=amd64
    - env: VERSION=19.0-beta VARIANT=fpm-alpine ARCH=i386
    - env: VERSION=19.0-beta VARIANT=fpm ARCH=amd64
    - env: VERSION=19.0-beta VARIANT=fpm ARCH=i386
    - env: VERSION=19.0-beta VARIANT=apache ARCH=amd64
    - env: VERSION=19.0-beta VARIANT=apache ARCH=i386
    - env: VERSION=16.0 VARIANT=fpm-alpine ARCH=amd64
    - env: VERSION=16.0 VARIANT=fpm-alpine ARCH=i386
    - env: VERSION=16.0 VARIANT=fpm ARCH=amd64
    - env: VERSION=16.0 VARIANT=fpm ARCH=i386
    - env: VERSION=16.0 VARIANT=apache ARCH=amd64
    - env: VERSION=16.0 VARIANT=apache ARCH=i386
    - env: VERSION=17.0 VARIANT=fpm-alpine ARCH=amd64
    - env: VERSION=17.0 VARIANT=fpm-alpine ARCH=i386
    - env: VERSION=17.0 VARIANT=fpm ARCH=amd64
    - env: VERSION=17.0 VARIANT=fpm ARCH=i386
    - env: VERSION=17.0 VARIANT=apache ARCH=amd64
    - env: VERSION=17.0 VARIANT=apache ARCH=i386
    - env: VERSION=18.0 VARIANT=fpm-alpine ARCH=amd64
    - env: VERSION=18.0 VARIANT=fpm-alpine ARCH=i386
    - env: VERSION=18.0 VARIANT=fpm ARCH=amd64
    - env: VERSION=18.0 VARIANT=fpm ARCH=i386
    - env: VERSION=18.0 VARIANT=apache ARCH=amd64
    - env: VERSION=18.0 VARIANT=apache ARCH=i386