From 102949ba3551acff1d9c7342526653f1087fe43f Mon Sep 17 00:00:00 2001 From: Timothy Day Date: Mon, 30 Dec 2024 16:44:39 -0500 Subject: [PATCH] LU-17000 contrib: update coverity-run script Update coverity-run script to allow for builds on any arbitrary RHEL8 host with ssh access. This removes the strict dependency on Vagrant/libvirt. Also, update the branch to master-next for Coverity builds rather than master. Test-Parameters: trivial Signed-off-by: Timothy Day Change-Id: Ic0a36ed2b090b5a839d3725fb7299c2ff93da525 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/57607 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Arshad Hussain Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- Vagrantfile | 18 ------- contrib/coverity/coverity-run | 110 ++++++++++++++++++++++++++++++------------ 2 files changed, 78 insertions(+), 50 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 588fecf..989722a 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -42,23 +42,5 @@ Vagrant.configure("2") do |config| sed -i "s/$(hostname) //g" /etc/hosts echo "$GIVEN_IP $(hostname)" >> /etc/hosts grep $(hostname) /etc/hosts - - # Add repos - dnf config-manager --set-enabled powertools - dnf config-manager --add-repo=https://downloads.whamcloud.com/public/e2fsprogs/latest/el8 - - # General kernel tools - dnf groupinstall -y 'Development Tools' - - # Debug info (needed for ldiskfs) - sudo dnf install -y --enablerepo=*debug* kernel-debuginfo - - # Install Lustre/ZFS dependencies and tools - dnf install -y --nogpgcheck git libyaml-devel libnl3-devel libmount-devel \ - wget ncurses-devel bc dwarves kernel kernel-devel openssl-devel \ - binutils-devel lsof crash kexec-tools perf psmisc e2fsprogs-devel \ - elfutils-libelf-devel libudev-devel libattr-devel libaio-devel libuuid-devel \ - libblkid-devel libtirpc-devel libffi-devel ncompress python3-cffi python3-devel \ - python3-packaging SHELL end diff --git a/contrib/coverity/coverity-run b/contrib/coverity/coverity-run index 6e0db09..79d781c 100755 --- a/contrib/coverity/coverity-run +++ b/contrib/coverity/coverity-run @@ -6,7 +6,7 @@ # # contrib/coverity/coverity-run # -# Setup a simple VM for running Coverity builds +# Script for running Coverity builds (and setup VMs) # to upload to https://scan.coverity.com/projects/lustre # # Author: Timothy Day @@ -19,24 +19,25 @@ function cr_list() { less -F < build -> run -> clean + setup -> install -> build -> run -> clean -The tool currently has a dependency on Vagrant and the 'libvirt' -provider. After the scan is run, there will be a tar file in the -'contrib/coverity' directory. This should be uploaded to Coverity +To run this locally, both Vagrant and the 'libvirt' provider must be +used. Otherwise, any remote host can be used. After the scan is run, +there will be a tar file generated. This should be uploaded to Coverity via the web portal using the Lustre version output during the 'run' step as the software version. EOF @@ -47,14 +48,47 @@ EOF # Create VM using Vagrant. # function cr_setup() { - vagrant up + if [[ "$COV_SSH" =~ "vagrant" ]]; then + vagrant up + vagrant reload + vagrant ssh-config > vagrant-ssh.config + fi - # Save/test ssh config - vagrant ssh-config > vagrant-ssh.config - ssh -F vagrant-ssh.config default "uname -r" + ssh "$COV_SSH" "$COV_HOST" "uname -r" +} - # Restart VM - vagrant reload +# +# Setup node to build Lustre and run Coverity +# +function cr_install() { + # Setup host + ssh "$COV_SSH" "$COV_HOST" <&1 >/dev/null; then + echo "Vagrant could not be found." + exit 1 + fi +fi + # Process options for arg in "$@"; do shift case "$arg" in setup) cr_setup;; + install) cr_install;; build) cr_build;; run) cr_run;; clean) cr_clean;; -- 1.8.3.1