diff --git a/.version b/.version index 5e9287b..81c871d 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -1.9.11 +1.10.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index 76487f9..cce3409 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.10.0] - 2021-10-27 + +### Added + +- CASMHMS-5055 - Added BSS CT test RPM. + ## [1.9.11] - 2021-09-21 ### Changed diff --git a/Jenkinsfile.github b/Jenkinsfile.github index 2b104e3..2286802 100644 --- a/Jenkinsfile.github +++ b/Jenkinsfile.github @@ -19,6 +19,9 @@ pipeline { NO_CACHE = "--no-cache" CHART_NAME = "cray-hms-bss" CHART_VERSION = getChartVersion(version: env.VERSION) + TEST_NAME = "hms-bss-ct-test" + TEST_SPEC_FILE = "hms-bss-ct-test.spec" + BUILD_METADATA = getRpmRevision(isStable: env.IS_STABLE) } stages { @@ -41,11 +44,21 @@ pipeline { } } + stage("Test Rpm") { + steps { + echo "RPM build metadata is: ${env.BUILD_METADATA}" + runLibraryScript("addRpmMetaData.sh", env.TEST_SPEC_FILE) + sh "make test_rpm" + } + } + stage("Publish") { steps { script { publishCsmDockerImage(image: env.NAME, tag: env.VERSION, isStable: env.IS_STABLE) publishCsmHelmCharts(component: env.CHART_NAME, chartsPath: "${WORKSPACE}/kubernetes/.packaged", isStable: env.IS_STABLE) + publishCsmRpms(component: env.TEST_NAME, pattern: "dist/bss-ct-test-rpmbuild/RPMS/x86_64/*.rpm", arch: "x86_64", isStable: env.IS_STABLE) + publishCsmRpms(component: env.TEST_NAME, pattern: "dist/bss-ct-test-rpmbuild/SRPMS/*.rpm", arch: "src", isStable: env.IS_STABLE) } } } diff --git a/Makefile b/Makefile index 62aa37e..bef1b56 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +# MIT License +# # (C) Copyright 2021 Hewlett Packard Enterprise Development LP # # Permission is hereby granted, free of charge, to any person obtaining a @@ -18,6 +20,7 @@ # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. +# Service NAME ?= cray-bss VERSION ?= $(shell cat .version) @@ -26,7 +29,18 @@ CHART_PATH ?= kubernetes CHART_NAME ?= cray-hms-bss CHART_VERSION ?= $(shell cat .version) -all : image unittest chart +# Common RPM variable +BUILD_METADATA ?= "1~development~$(shell git rev-parse --short HEAD)" + +# CT Test RPM +TEST_SPEC_NAME ?= hms-bss-ct-test +TEST_RPM_VERSION ?= $(shell cat .version) +TEST_SPEC_FILE ?= ${TEST_SPEC_NAME}.spec +TEST_SOURCE_NAME ?= ${TEST_SPEC_NAME}-${TEST_RPM_VERSION} +TEST_BUILD_DIR ?= $(PWD)/dist/bss-ct-test-rpmbuild +TEST_SOURCE_PATH := ${TEST_BUILD_DIR}/SOURCES/${TEST_SOURCE_NAME}.tar.bz2 + +all : image unittest chart test_rpm image: docker build ${NO_CACHE} --pull ${DOCKER_ARGS} --tag '${NAME}:${VERSION}' . @@ -39,3 +53,18 @@ chart: helm dep up ${CHART_PATH}/${CHART_NAME} helm package ${CHART_PATH}/${CHART_NAME} -d ${CHART_PATH}/.packaged --version ${CHART_VERSION} +test_rpm: test_rpm_prepare test_rpm_package_source test_rpm_build_source test_rpm_build + +test_rpm_prepare: + rm -rf $(TEST_BUILD_DIR) + mkdir -p $(TEST_BUILD_DIR)/SPECS $(TEST_BUILD_DIR)/SOURCES + cp $(TEST_SPEC_FILE) $(TEST_BUILD_DIR)/SPECS/ + +test_rpm_package_source: + tar --transform 'flags=r;s,^,/$(TEST_SOURCE_NAME)/,' --exclude .git --exclude dist -cvjf $(TEST_SOURCE_PATH) ./${TEST_SPEC_FILE} ./tests/ct ./LICENSE + +test_rpm_build_source: + BUILD_METADATA=$(BUILD_METADATA) rpmbuild -ts $(TEST_SOURCE_PATH) --define "_topdir $(TEST_BUILD_DIR)" + +test_rpm_build: + BUILD_METADATA=$(BUILD_METADATA) rpmbuild -ba $(TEST_SPEC_FILE) --define "_topdir $(TEST_BUILD_DIR)" --nodeps diff --git a/README.md b/README.md index 442e8ca..f26c600 100644 --- a/README.md +++ b/README.md @@ -9,3 +9,8 @@ images. This code will be refactored from the old hms-netboot code for bootargsd and associated components created for the Q4 Redfish and Q1 systems management deep dive demos. +### BSS CT Testing + +This repository builds and publishes hms-bss-ct-test RPMs along with the service itself containing tests that verify BSS on the +NCNs of live Shasta systems. The tests require the hms-ct-test-base RPM to also be installed on the NCNs in order to execute. +The version of the test RPM installed on the NCNs should always match the version of BSS deployed on the system. diff --git a/hms-bss-ct-test.spec b/hms-bss-ct-test.spec new file mode 100644 index 0000000..e973697 --- /dev/null +++ b/hms-bss-ct-test.spec @@ -0,0 +1,76 @@ +# MIT License +# +# (C) Copyright [2021] Hewlett Packard Enterprise Development LP +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR +# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. + +Name: hms-bss-ct-test +License: MIT +Summary: HMS CT tests for the Boot Script Service (BSS) +Group: System/Management +Version: %(cat .version) +Release: %(echo ${BUILD_METADATA}) +Source: %{name}-%{version}.tar.bz2 +Vendor: Hewlett Packard Enterprise +Requires: hms-ct-test-base >= 1.9.0 + +# name of this repository +%define REPO hms-bss + +# test installation location +%define TEST_DIR /opt/cray/tests + +%description +This is a collection of post-install CT tests for BSS. + +%prep +%setup -q + +%build +# Categories of CT tests to install +TEST_BUCKETS=( + ncn-smoke + ncn-functional + ncn-long + ncn-destructive + ncn-resources + remote-smoke + remote-functional + remote-long + remote-destructive + remote-resources +) + +echo "Current directory is: ${PWD}..." + +echo "Searching for CT tests..." +for BUCKET in ${TEST_BUCKETS[@]} ; do + find . -name "*${BUCKET}*" -exec mkdir -p %{buildroot}%{TEST_DIR}/${BUCKET}/hms/%{REPO}/ \; \ + -exec cp -v {} %{buildroot}%{TEST_DIR}/${BUCKET}/hms/%{REPO}/ \; +done + +%files + +# CT tests +%dir %{TEST_DIR} +%{TEST_DIR}/* + +%changelog +* Wed Oct 27 2021 Mitch Schooler +- Moved CT test packaging from hms-test to individual service repos for their own RPM builds. diff --git a/kubernetes/cray-hms-bss/Chart.yaml b/kubernetes/cray-hms-bss/Chart.yaml index 8facbf9..02d703c 100644 --- a/kubernetes/cray-hms-bss/Chart.yaml +++ b/kubernetes/cray-hms-bss/Chart.yaml @@ -2,4 +2,4 @@ apiVersion: v1 description: "Kubernetes resources for cray-hms-bss" name: "cray-hms-bss" home: "HMS/hms-bss" -version: 1.9.11 +version: 1.10.0