Re: [PATCH v3] ci: run SELinux kernel test suite

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

 



On Thu, Jun 11, 2020 at 7:15 AM William Roberts
<bill.c.roberts@xxxxxxxxx> wrote:
>
> On Thu, Jun 11, 2020 at 7:14 AM Stephen Smalley
> <stephen.smalley.work@xxxxxxxxx> wrote:
> >
> > On Thu, Jun 11, 2020 at 8:03 AM Petr Lautrbach <plautrba@xxxxxxxxxx> wrote:
> > >
> > > On Tue, Jun 02, 2020 at 02:18:56PM -0500, bill.c.roberts@xxxxxxxxx wrote:
> > > > From: William Roberts <william.c.roberts@xxxxxxxxx>
> > > >
> > > > The current Travis CI runs the userspace tooling and libraries against
> > > > policy files, but cannot test against an SELinux enabled kernel. Thus,
> > > > some tests are not being done in the CI. Travis, unfortunately only
> > > > provides Ubuntu images, so in order to run against a modern distro with
> > > > SELinux in enforcing mode, we need to launch a KVM with something like
> > > > Fedora.
> > > >
> > > > This patch enables this support by launching a Fedora32 Cloud Image with
> > > > the SELinux userspace library passed on from the Travis clone, it then
> > > > builds and replaces the current SELinux bits on the Fedora32 image and
> > > > runs the SELinux testsuite.
> > > >
> > > > The cloud image run can be controlled with the TRAVIS env variable:
> > > > TRAVIS_CLOUD_IMAGE_VERSION. That variable takes the major and minor
> > > > version numbers in a colon delimited string, eg: "32:1.6".
> > > >
> > > > Signed-off-by: William Roberts <william.c.roberts@xxxxxxxxx>
> > >
> > > I pushed all Acked bugs to my fork's branch 3.1-rc2 and the travis jobs failed:
> > >
> > > https://travis-ci.org/github/bachradsusi/SELinuxProject-selinux/jobs/697177370
> > >
> > > ~~~
> > > #
> > > # Great we have a host running, ssh into it. We specify -o so
> > > # we don't get blocked on asking to add the servers key to
> > > # our known_hosts.
> > > #
> > > ssh -tt -o StrictHostKeyChecking=no -o LogLevel=QUIET "root@$ipaddy" "/root/selinux/$TEST_RUNNER"
> > > bash: /root/selinux/scripts/ci/fedora-test-runner.sh: No such file or directory
> > > The command "scripts/ci/travis-kvm-setup.sh" exited with 127.
> > >
> > > Done. Your build exited with 1.
> >
> > Hmm..worked for me.  I looked at your travis log file and it showed
> > the culprit: your repository is named SELinuxProject-selinux rather
> > than selinux and the script assumes it is named selinux.  So the
> > script just needs to be a little more general I guess.
>
> You guys are way faster than me, i'm still on my first cup of coffee.
> Let me send something that makes that a tad more general. Ill look
> into the travis variables.

I didn't see anything that just provides the name of the project, but basename
of $TRAVIS_BUILD_DIR i think will give us what we want, so I did:

diff --git a/scripts/ci/travis-kvm-setup.sh b/scripts/ci/travis-kvm-setup.sh
index 864dbac96a46..ceedaa6f4e27 100755
--- a/scripts/ci/travis-kvm-setup.sh
+++ b/scripts/ci/travis-kvm-setup.sh
@@ -120,6 +120,7 @@ fi
 # we don't get blocked on asking to add the servers key to
 # our known_hosts.
 #
-ssh -tt -o StrictHostKeyChecking=no -o LogLevel=QUIET "root@$ipaddy"
"/root/selinux/$TEST_RUNNER"
+project_dir="$(basename "$TRAVIS_BUILD_DIR")"
+ssh -tt -o StrictHostKeyChecking=no -o LogLevel=QUIET "root@$ipaddy"
"/root/$project_dir/$TEST_RUNNER"

 exit 0

----

Im testing now.



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

  Powered by Linux