Re: [PATCH testsuite] travis: update the kernel and reboot before running the suite

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 21, 2020 at 8:33 PM Ondrej Mosnacek <omosnace@xxxxxxxxxx> wrote:
> While the stable release cloud image always ships with a kernel which
> has the matching -modules and -devel packages available in the "fedora"
> repo, on development releases the nightly images may be behind the
> latest repo content and thus may fail to install kernel-modules and
> kernel-devel.
>
> Fix it by installing the latest available the kernel and booting it
> before running the testsuite. This unfortunately adds around 3-4 minutes
> to the Travis build time, but there seems to be no better way to make
> the Rawhide test work.
>
> Signed-off-by: Ondrej Mosnacek <omosnace@xxxxxxxxxx>
> ---
>  .travis.yml               |  1 +
>  travis-ci/run-kvm-test.sh | 12 ++++++++++++
>  2 files changed, 13 insertions(+)
>
> diff --git a/.travis.yml b/.travis.yml
> index 9488807..dcac54d 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -17,6 +17,7 @@ addons:
>        - bridge-utils
>        - libguestfs-tools
>        - cpu-checker
> +      - netcat
>
>  before_install:
>    # FYI: known good with HEAD at 8551fc60fc515cd290ba38ee8c758c1f4df52b56
> diff --git a/travis-ci/run-kvm-test.sh b/travis-ci/run-kvm-test.sh
> index 70fcf08..d22c92b 100755
> --- a/travis-ci/run-kvm-test.sh
> +++ b/travis-ci/run-kvm-test.sh
> @@ -120,5 +120,17 @@ fi
>  # our known_hosts. Also, we need to forward the project directory
>  # so forks know where to go.
>  #
> +
> +# First update to the latest kernel.
> +ssh -tt -o StrictHostKeyChecking=no -o LogLevel=QUIET "root@$ipaddy" \
> +    dnf install -y kernel
> +
> +# Then reboot.
> +sudo virsh reboot fedoravm
> +sleep 5
> +
> +while ! nc -w 10 -z "$ipaddy" 22; do sleep 0.5s; done
> +
> +# And run the testsuite.
>  project_dir="$(basename "$TRAVIS_BUILD_DIR")"
>  ssh -tt -o StrictHostKeyChecking=no -o LogLevel=QUIET "root@$ipaddy" "SELINUX_DIR=/root/$project_dir /root/$project_dir/$TEST_RUNNER"
> --
> 2.26.2

I went ahead and applied this one as well so that we have a fully
working CI again:
https://github.com/SELinuxProject/selinux-testsuite/commit/596f1f174be32236f80d26c686244f78791b565a

-- 
Ondrej Mosnacek
Software Engineer, Platform Security - SELinux kernel
Red Hat, Inc.




[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux