From a61079afcace3d1b73f3c72fe91eee25df0eca50 Mon Sep 17 00:00:00 2001 From: Jan Kurik Date: Thu, 23 Sep 2021 14:52:25 +0200 Subject: [PATCH] Exchange etcd with grafana --- tests/Sanity/gobuild-etcd/PURPOSE | 3 --- tests/Sanity/gobuild-etcd/main.fmf | 17 ------------ .../Makefile | 8 +++--- tests/Sanity/gobuild-grafana/PURPOSE | 3 +++ tests/Sanity/gobuild-grafana/main.fmf | 17 ++++++++++++ .../runtest.sh | 27 ++++++++++++------- 6 files changed, 41 insertions(+), 34 deletions(-) delete mode 100644 tests/Sanity/gobuild-etcd/PURPOSE delete mode 100644 tests/Sanity/gobuild-etcd/main.fmf rename tests/Sanity/{gobuild-etcd => gobuild-grafana}/Makefile (89%) create mode 100644 tests/Sanity/gobuild-grafana/PURPOSE create mode 100644 tests/Sanity/gobuild-grafana/main.fmf rename tests/Sanity/{gobuild-etcd => gobuild-grafana}/runtest.sh (67%) diff --git a/tests/Sanity/gobuild-etcd/PURPOSE b/tests/Sanity/gobuild-etcd/PURPOSE deleted file mode 100644 index 99007a5..0000000 --- a/tests/Sanity/gobuild-etcd/PURPOSE +++ /dev/null @@ -1,3 +0,0 @@ -PURPOSE of /tools/go-rpm-macros/Sanity/gobuild-etcd -Description: golang rpm macros usage building etcd -Author: Jan Kuřík diff --git a/tests/Sanity/gobuild-etcd/main.fmf b/tests/Sanity/gobuild-etcd/main.fmf deleted file mode 100644 index 1e0b030..0000000 --- a/tests/Sanity/gobuild-etcd/main.fmf +++ /dev/null @@ -1,17 +0,0 @@ -summary: golang rpm macros usage building etcd -description: '' -contact: Jan Kuřík -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 diff --git a/tests/Sanity/gobuild-etcd/Makefile b/tests/Sanity/gobuild-grafana/Makefile similarity index 89% rename from tests/Sanity/gobuild-etcd/Makefile rename to tests/Sanity/gobuild-grafana/Makefile index 5051038..de0caba 100644 --- a/tests/Sanity/gobuild-etcd/Makefile +++ b/tests/Sanity/gobuild-grafana/Makefile @@ -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 # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -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) diff --git a/tests/Sanity/gobuild-grafana/PURPOSE b/tests/Sanity/gobuild-grafana/PURPOSE new file mode 100644 index 0000000..8b029f5 --- /dev/null +++ b/tests/Sanity/gobuild-grafana/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /tools/go-rpm-macros/Sanity/gobuild-grafana +Description: golang rpm macros usage building grafana +Author: Jan Kuřík diff --git a/tests/Sanity/gobuild-grafana/main.fmf b/tests/Sanity/gobuild-grafana/main.fmf new file mode 100644 index 0000000..d041977 --- /dev/null +++ b/tests/Sanity/gobuild-grafana/main.fmf @@ -0,0 +1,17 @@ +summary: golang rpm macros usage building +description: '' +contact: Jan Kuřík +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 diff --git a/tests/Sanity/gobuild-etcd/runtest.sh b/tests/Sanity/gobuild-grafana/runtest.sh similarity index 67% rename from tests/Sanity/gobuild-etcd/runtest.sh rename to tests/Sanity/gobuild-grafana/runtest.sh index 79688c3..03537fb 100755 --- a/tests/Sanity/gobuild-etcd/runtest.sh +++ b/tests/Sanity/gobuild-grafana/runtest.sh @@ -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 # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -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