selinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: bill.c.roberts@gmail.com
To: bill.c.roberts@gmail.com
Cc: paul@paul-moore.com, plautrba@redhat.com,
	selinux@vger.kernel.org, stephen.smalley.work@gmail.com,
	william.c.roberts@intel.com
Subject: [PATCH v2] ci: dont use hardcoded project name
Date: Thu, 11 Jun 2020 12:30:39 -0500	[thread overview]
Message-ID: <20200611173039.21742-1-william.c.roberts@intel.com> (raw)
In-Reply-To: <CAFftDdrszrtxO64GtiGKyszae-rNv9Kohzs-jwmxgtW3rfTnJw@mail.gmail.com>

From: William Roberts <william.c.roberts@intel.com>

Not everyone's github project is "selinux" so use the projects
name, as derived from TRAVIS_BUILD_DIR. TRAVIS_BUILD_DIR is
the absolute path to the project checkout on disk, so the
basename should be sufficient. The script that runs in the KVM
environment also needs to be updated where it can find the
selinux project code, so we pass it in through an env variable
in the ssh command.

Tested on Travis CI here:
  - https://travis-ci.org/github/williamcroberts/selinux/jobs/697307824

Signed-off-by: William Roberts <william.c.roberts@intel.com>
---
v2:
 - Fix the KVM script project location when it's not /root/selinux.

 scripts/ci/fedora-test-runner.sh | 10 ++++++++--
 scripts/ci/travis-kvm-setup.sh   |  6 ++++--
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/scripts/ci/fedora-test-runner.sh b/scripts/ci/fedora-test-runner.sh
index 0927ed5dad8f..569723387f6b 100755
--- a/scripts/ci/fedora-test-runner.sh
+++ b/scripts/ci/fedora-test-runner.sh
@@ -2,6 +2,12 @@
 
 set -ev
 
+#
+# We expect this to be set in the environment, but if it's not, most selinux projects
+# just have the same name as upstream, so choose that.
+#
+export SELINUX_DIR="${SELINUX_DIR:-/root/selinux}"
+
 # CI Debug output if things go squirrely.
 getenforce
 id -Z
@@ -58,7 +64,7 @@ dnf install -y \
 #
 # Move to selinux code and build
 #
-cd "$HOME/selinux"
+cd "$SELINUX_DIR"
 
 # Show HEAD commit for sanity checking
 git log -1
@@ -71,7 +77,7 @@ make -j"$(nproc)" LIBDIR=/usr/lib64 SHLIBDIR=/lib64 install-pywrap
 make -j"$(nproc)" LIBDIR=/usr/lib64 SHLIBDIR=/lib64 relabel
 
 #
-# Get the selinux testsuite, but don't clone it in $HOME/selinux, move to $HOME
+# Get the selinux testsuite, but don't clone it in selinux git directory, move to $HOME
 # first.
 #
 cd "$HOME"
diff --git a/scripts/ci/travis-kvm-setup.sh b/scripts/ci/travis-kvm-setup.sh
index 864dbac96a46..8d4cfb79f7d7 100755
--- a/scripts/ci/travis-kvm-setup.sh
+++ b/scripts/ci/travis-kvm-setup.sh
@@ -118,8 +118,10 @@ fi
 #
 # 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.
+# our known_hosts. Also, we need to forward the project directory
+# so forks know where to go.
 #
-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" "SELINUX_DIR=/root/$project_dir /root/$project_dir/$TEST_RUNNER"
 
 exit 0
-- 
2.17.1


  reply	other threads:[~2020-06-11 17:30 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-19 15:14 Travis CI: Run selinux-testsuite bill.c.roberts
2020-05-19 15:14 ` [PATCH] ci: run SE Linux kernel test suite bill.c.roberts
2020-05-19 22:00   ` Paul Moore
2020-05-19 22:16     ` William Roberts
2020-05-19 22:23       ` Paul Moore
2020-05-20 15:13         ` William Roberts
2020-05-20 15:20           ` William Roberts
2020-05-19 21:41 ` Travis CI: Run selinux-testsuite Paul Moore
2020-05-20 16:34   ` [v2] " bill.c.roberts
2020-05-20 16:34     ` [PATCH v2] ci: run SELinux kernel test suite bill.c.roberts
2020-05-21  8:50       ` Ondrej Mosnacek
2020-05-21 12:52         ` Stephen Smalley
2020-05-21 12:58           ` Ondrej Mosnacek
2020-05-21 14:11             ` William Roberts
2020-05-22  7:40               ` Ondrej Mosnacek
2020-05-24 16:18                 ` William Roberts
2020-05-29 13:24                   ` Stephen Smalley
2020-05-29 15:33                     ` William Roberts
2020-05-21 19:54       ` Nicolas Iooss
2020-05-21 20:52         ` William Roberts
2020-05-21 22:39         ` William Roberts
2020-05-22 19:07           ` Nicolas Iooss
2020-05-23  0:21             ` William Roberts
2020-05-29 18:42       ` Ondrej Mosnacek
2020-05-29 19:17         ` William Roberts
2020-05-20 16:56     ` [v2] Travis CI: Run selinux-testsuite Paul Moore
2020-06-02 19:18     ` [v3] " bill.c.roberts
2020-06-02 19:18       ` [PATCH v3] ci: run SELinux kernel test suite bill.c.roberts
2020-06-09 14:01         ` Stephen Smalley
2020-06-11 12:01         ` Petr Lautrbach
2020-06-11 12:12           ` William Roberts
2020-06-11 12:13           ` Ondrej Mosnacek
2020-06-11 12:14           ` Stephen Smalley
2020-06-11 12:15             ` William Roberts
2020-06-11 12:23               ` William Roberts
2020-06-11 14:05                 ` [PATCH] ci: dont use hardcoded project name bill.c.roberts
2020-06-11 15:34                   ` Petr Lautrbach
2020-06-11 15:55                     ` Petr Lautrbach
2020-06-11 16:19                       ` William Roberts
2020-06-11 16:44                         ` William Roberts
2020-06-11 17:30                           ` bill.c.roberts [this message]
2020-06-12  5:39                             ` [PATCH v2] " Petr Lautrbach
2020-06-17 17:07                               ` Stephen Smalley
2020-06-18 15:52                                 ` Petr Lautrbach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200611173039.21742-1-william.c.roberts@intel.com \
    --to=bill.c.roberts@gmail.com \
    --cc=paul@paul-moore.com \
    --cc=plautrba@redhat.com \
    --cc=selinux@vger.kernel.org \
    --cc=stephen.smalley.work@gmail.com \
    --cc=william.c.roberts@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).