Clone this repo:
  1. 8f82d0c Change API to allow running a test by name, rather than returning the list. by Robert Sesek · 5 weeks ago master oreo-mr1-iot-release android-o-mr1-iot-release-1.0.10
  2. ac56b76 DO NOT MERGE by Xin Li · 3 months ago android-o-mr1-iot-release-1.0.7 android-o-mr1-iot-release-1.0.8
  3. 6b6e0ba Convert seccomp-tests to Android.bp by Dan Willemsen · 4 months ago
  4. 8d4aeae Snap for 4455093 from 910e9a11450f6b50463fc7a5fa4a77823d40a326 to pi-release by android-build-team Robot · 1 year, 4 months ago p-preview-1 pie-arc pie-cts-release pie-cuttlefish-testing pie-gsi pie-platform-release pie-r2-release pie-r2-s1-release pie-r2-s2-release pie-release pie-release-2 pie-s2-release pie-vts-release android-9.0.0_r1 android-9.0.0_r10 android-9.0.0_r17 android-9.0.0_r18 android-9.0.0_r2 android-9.0.0_r3 android-9.0.0_r5 android-9.0.0_r6 android-9.0.0_r7 android-9.0.0_r8 android-9.0.0_r9 android-cts-9.0_r1 android-cts-9.0_r2 android-cts-9.0_r3 android-cts-9.0_r4 android-cts-9.0_r5 android-cts-9.0_r6 android-cts-9.0_r7 android-p-preview-1 android-p-preview-4 android-p-preview-5 android-vts-9.0_r4 android-vts-9.0_r5 android-vts-9.0_r6 android-vts-9.0_r7
  5. 910e9a1 Add metadata am: 9de8234400 am: 7634acc306 am: 527780b07c by Bill Yi · 1 year, 4 months ago master-cuttlefish-testing-release oreo-mr1-1.2-iot-release pie-dev pie-dr1-dev pie-dr1-release pie-qpr1-release pie-qpr1-s1-release pie-qpr1-s2-release pie-qpr1-s3-release pie-qpr2-release android-9.0.0_r11 android-9.0.0_r12 android-9.0.0_r16 android-9.0.0_r19 android-9.0.0_r20 android-9.0.0_r21 android-9.0.0_r22 android-9.0.0_r30 android-9.0.0_r31 android-9.0.0_r32 android-9.0.0_r33 android-9.0.0_r34 android-o-mr1-iot-release-1.0.3 android-o-mr1-iot-release-1.0.4 android-o-mr1-iot-release-1.0.5 android-o-mr1-iot-release-smart-display-r3 android-o-mr1-iot-release-smart-display-r4 android-o-mr1-iot-release-smart-display-r5 android-p-preview-2 android-p-preview-3 android-wear-9.0.0_r1 android-wear-9.0.0_r2 android-wear-9.0.0_r3

Seccomp-BPF Kernel Self-Test Suite

This repository contains a mirror of the upstream Linux kernel test suite for the Seccomp-BPF system call filter. The test suite runs as part of CTS, but it is maintained in a separate repository because the code is GPL.

Syncing to Upstream

Rather than hold the entire Linux history in this repository, only the subdirectory for the Seccomp selftests are preserved here. In order to sync this repository to the upstream Linux, follow these instructions.

The pristine copy of the upstream source is kept on a branch called upstream-master. This branch is then merged into an Android development branch.

First-Time Setup

These instructions only need to be followed for the first time you are updating the repository from a checkout.

  1. Configure a remote to use as the source repository (limited to only syncing the master branch):
    git remote add upstream-linux git:// -t master --no-tags

Updating the Source

Perform these steps every time you need to update the test suite from upstream.

  1. Update the remote to fetch the latest sources:

    git remote update upstream-linux
  2. Create a new local branch from the updated source, replacing YYYYMMDD with today's date:

    git checkout -b update-YYYYMMDD upstream-linux/master
  3. Filter the branch to just the subtree containing the Seccomp test suite:

    git filter-branch --subdirectory-filter tools/testing/selftests/seccomp
  4. Check out the upstream-master branch, which contains the pristine, filter-branch'd copy of the source code. Pushing non-merge commits with a “forged” author/committer can only be done against the upstream-master branch.

    git checkout -b upstream-master aosp/upstream-master
  5. Update this upstream-master branch to the newly filtered branch of upstream-linux.

    git merge --ff-only update-YYYYMMDD
  6. Upload the changes on upstream-master for review and submit them.

  7. Merge the changes from upstream-master into the Android development branch (typically master). Resolve any conflicts with the local modifications present in the repository.

    repo start sync-upstream .
    git subtree merge -P linux/ upstream-master

Now build and test the changes by running CTS:

$ mmma cts/tests/tests/os
$ cts-tradefed run singleCommand cts -m CtsOsTestCases -t android.os.cts.SeccompTest

The tests are expected to pass on arm, arm64, x86, and x86_64. If they pass, then repo upload/submit the CL branch. Afterwards, you can remove the update-YYYYMMDD branch.

Linux Space-Saving

If you already have a Linux kernel checkout, you can skip adding Linux as a remote and instead perform steps 1-3 of “Updating the Source” in the kernel checkout. Then simply fetch the filtered branch into the seccomp-tests repository and subtree merge it (as FETCH_HEAD). This will avoid copying the entire kernel history into your local checkout.