Exchange etcd with grafana

This commit is contained in:
Jan Kurik 2021-09-23 14:52:25 +02:00
parent 69ba76f1b3
commit a61079afca
6 changed files with 41 additions and 34 deletions

View File

@ -1,3 +0,0 @@
PURPOSE of /tools/go-rpm-macros/Sanity/gobuild-etcd
Description: golang rpm macros usage building etcd
Author: Jan Kuřík <jkurik@redhat.com>

View File

@ -1,17 +0,0 @@
summary: golang rpm macros usage building etcd
description: ''
contact: Jan Kuřík <jkurik@redhat.com>
component:
- golang
test: ./runtest.sh
framework: beakerlib
recommend:
- golang
- go-rpm-macros
- go-srpm-macros
- /usr/bin/yumdownloader
- /usr/bin/yum-builddep
- /usr/bin/rpmbuild
duration: 2h
extra-summary: /tools/go-rpm-macros/Sanity/gobuild-etcd
extra-task: /tools/go-rpm-macros/Sanity/gobuild-etcd

View File

@ -1,7 +1,7 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /tools/go-rpm-macros/Sanity/gobuild-etcd
# Description: golang rpm macros usage building etcd
# Makefile of /tools/go-rpm-macros/Sanity/gobuild-grafana
# Description: golang rpm macros usage building grafana
# Author: Jan Kuřík <jkurik@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -23,7 +23,7 @@
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/tools/go-rpm-macros/Sanity/gobuild-etcd
export TEST=/tools/go-rpm-macros/Sanity/gobuild-grafana
export TESTVERSION=1.0
BUILT_FILES=
@ -49,7 +49,7 @@ $(METADATA): Makefile
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: golang rpm macros usage building etcd" >> $(METADATA)
@echo "Description: golang rpm macros usage building" >> $(METADATA)
@echo "Type: Sanity" >> $(METADATA)
@echo "TestTime: 2h" >> $(METADATA)
@echo "RunFor: golang" >> $(METADATA)

View File

@ -0,0 +1,3 @@
PURPOSE of /tools/go-rpm-macros/Sanity/gobuild-grafana
Description: golang rpm macros usage building grafana
Author: Jan Kuřík <jkurik@redhat.com>

View File

@ -0,0 +1,17 @@
summary: golang rpm macros usage building
description: ''
contact: Jan Kuřík <jkurik@redhat.com>
component:
- golang
test: ./runtest.sh
framework: beakerlib
recommend:
- golang
- go-rpm-macros
- go-srpm-macros
- /usr/bin/yumdownloader
- /usr/bin/yum-builddep
- /usr/bin/rpmbuild
duration: 2h
extra-summary: /tools/go-rpm-macros/Sanity/gobuild-grafana
extra-task: /tools/go-rpm-macros/Sanity/gobuild-grafana

View File

@ -2,8 +2,8 @@
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/go-rpm-macros/Sanity/gobuild-etcd
# Description: golang rpm macros usage building etcd
# runtest.sh of /tools/go-rpm-macros/Sanity/gobuild-grafana
# Description: golang rpm macros usage building grafana
# Author: Jan Kuřík <jkurik@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -37,7 +37,7 @@ set -o pipefail
rlJournalStart
rlPhaseStartSetup
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "TmpDir=\$(mktemp -d /var/tmp/XXXXXXX)" 0 "Creating tmp directory"
rlRun "pushd $TmpDir"
rlPhaseEnd
@ -48,16 +48,23 @@ rlJournalStart
rlAssertNotEquals "Checking if %gotest macro is defined" "$gotest_string" "%gotest"
rlPhaseEnd
rlPhaseStart FAIL "setup etcd sources"
rlRun "SRPM=\$(basename \$(yumdownloader --source --url etcd | tail -n 1))"
rlRun "yumdownloader --source etcd"
rlPhaseStart FAIL "setup grafana sources"
rlRun "SRPM=\$(basename \$(yumdownloader --source --url grafana | tail -n 1))"
rlRun "yumdownloader --source grafana"
rlRun "yum-builddep --enablerepo=\* -y --srpm ${SRPM}"
rlRun "rpm -i -D '_topdir $TmpDir' ${SRPM}"
rlRun "sed -i 's/^\s*%define\s*compile_frontend\s.*/%define compile_frontend 0/g' \
SPECS/grafana.spec" 0 "Make sure we build only the golang part, no JS stuff"
rlPhaseEnd
rlPhaseStartTest "rpmbuild etcd"
rlRun "rpmbuild --define='_topdir $TmpDir' --rebuild --nocheck ${SRPM} \
|& tee etcd.rpmbuild.log"
rlFileSubmit "etcd.rpmbuild.log"
rlPhaseStartTest "rpmbuild grafana"
rlRun "rpmbuild --showrc &> ${TmpDir}/rpm.rc"
rlFileSubmit "${TmpDir}/rpm.rc"
rlAssertGrep "%gobuild" SPECS/grafana.spec -w
rlAssertGrep "%gotest" SPECS/grafana.spec -w
rlRun "rpmbuild -bc --define='_topdir $TmpDir' SPECS/grafana.spec \
|& tee grafana.rpmbuild.log"
rlFileSubmit "grafana.rpmbuild.log"
rlPhaseEnd
rlPhaseStartCleanup