Skip to content

Commit

Permalink
serge-testuite: sync with downstream
Browse files Browse the repository at this point in the history
This patch forward-ports the following commits:

commit 668b5c3f246912cf8f822deb71b6dc6174cea504
Author: Ondrej Mosnacek <[email protected]>
Date:   Wed Jun 19 10:16:01 2019 +0200

    Sanity/serge-testsuite: detect xperms support on RHEL-7

    Extended ioctl permission rules are only supported staring with
    3.10.0-875 RHEL-7 kernel. This makes the TC pass on RHEL-7.5.

    Signed-off-by: Ondrej Mosnacek <[email protected]>

commit 15c6489d277f0377e8279a58b0f80c5cad8afd2a
Author: Ondrej Mosnacek <[email protected]>
Date:   Wed Jun 19 10:15:15 2019 +0200

    Sanity/serge-testsuite: fix version check

    Signed-off-by: Ondrej Mosnacek <[email protected]>

commit 6973613422c0b0e3bb521b94e74d0ad1974397e4
Author: Ondrej Mosnacek <[email protected]>
Date:   Tue May 21 14:39:22 2019 +0200

    Sanity/serge-testsuite: Use fixed git commit by default

    This will avoid breakage of testing caused by upstream commits. Old
    functionality can be achieved by running the TC with GIT_BRANCH=master
    param.

    Acked-by: Milos Malik <[email protected]>
    Signed-off-by: Ondrej Mosnacek <[email protected]>

Signed-off-by: Ondrej Mosnacek <[email protected]>
  • Loading branch information
WOnder93 authored and spbnick committed Jun 19, 2019
1 parent 2bbd004 commit 2a4c697
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions packages/selinux-policy/serge-testsuite/runtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,17 @@ typeset -l debug=${_DEBUG}

PACKAGE="selinux-policy"

# Default commit to checkout from the repo.
# This should be updated as needed after verifying that the new version
# doesn't break testing and after applying all necessary tweaks in the TC.
# Run with GIT_BRANCH=master to run the latest upstream version.
DEFAULT_COMMIT="f33778210539adc66cf6d29bc28cc409860fb29c"

# Optional test parametr - location of testuite git.
GIT_URL=${GIT_URL:-"git://github.com/SELinuxProject/selinux-testsuite"}

# Optional test paramenter - branch containing tests.
GIT_BRANCH=${GIT_BRANCH:-"master"}
GIT_BRANCH=${GIT_BRANCH:-"$DEFAULT_COMMIT"}

# Check if pipefail is enabled to restore original setting.
# See: https://unix.stackexchange.com/a/73180
Expand Down Expand Up @@ -123,10 +129,15 @@ rlJournalStart
"Fix up Python shebang in overlay test"
fi

if kver_lt "3.10.0-875"; then
rlLog "No xperms support => disable xperms testing"
rlRun "sed -i '/TARGETS += test_ioctl_xperms\.te/d' policy/Makefile"
rlRun "sed -i 's/\$kernver >= 30/\$kernver >= 999999/' tests/ioctl/test"
fi
# workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1613056
# (if running kernel version sorts inside the known-bug window, then
# we need to apply the workaround)
if kver_ge "3.10.0-874" && kver_lt "3.10.0-972"; then
if kver_ge "3.10.0-875" && kver_lt "3.10.0-972"; then
rlLog "Applying workaround for BZ 1613056..."
rlRun "cat >>policy/test_ipc.te <<<'allow_map(ipcdomain, tmpfs_t, file)'"
rlRun "cat >>policy/test_mmap.te <<<'allow_map(test_execmem_t, tmpfs_t, file)'"
Expand Down

0 comments on commit 2a4c697

Please sign in to comment.