Avoid mixing STI and FMF tests

Related: https://pagure.io/fedora-ci/general/issue/206

Also, drop unneeded legacy Makefile's and PURPOSE files,
and explicitly require gcc.rpm, which is not installed
on the CI workers by default any more it seems.
This commit is contained in:
Martin Cermak 2021-04-16 19:13:27 +02:00
parent 7d1af348fb
commit 604b1841b5
19 changed files with 84 additions and 302 deletions

View File

@ -1,71 +0,0 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /tools/annobin/Regression/identify
# Description: identify
# Author: Martin Cermak <mcermak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2019 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/tools/annobin/Regression/identify
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE
.PHONY: all install download clean
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
test -x runtest.sh || chmod a+x runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
requires = annobin
# https://mojo.redhat.com/docs/DOC-1072127
dtsver = $(shell seq -s, 10 11)
dtsreq = $(shell echo {dev,gcc-}toolset-{$(dtsver)}{,-annocheck})
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Martin Cermak <mcermak@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: identify" >> $(METADATA)
@echo "Type: Regression" >> $(METADATA)
@echo "TestTime: 48h" >> $(METADATA)
@echo "RunFor: annobin" >> $(METADATA)
$(foreach package, $(requires) $(dtsreq), \
echo "Requires: $(package)" >> $(METADATA); \
)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2+" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Releases: -RHEL4 -RHELClient5 -RHELServer5 -RHEL6" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -1,3 +0,0 @@
PURPOSE of /tools/annobin/Regression/identify
Description: identify
Author: Martin Cermak <mcermak@redhat.com>

View File

@ -1,64 +0,0 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /tools/annobin/Regression/lto-preprocessor-options
# Description: lto-preprocessor-options
# Author: Martin Cermak <mcermak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2020 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/tools/annobin/Regression/lto-preprocessor-options
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE
.PHONY: all install download clean
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
test -x runtest.sh || chmod a+x runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Martin Cermak <mcermak@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: lto-preprocessor-options" >> $(METADATA)
@echo "Type: Regression" >> $(METADATA)
@echo "TestTime: 48h" >> $(METADATA)
@echo "RunFor: annobin" >> $(METADATA)
@echo "Requires: annobin annobin-annocheck redhat-rpm-config" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2+" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Bug: 1743635" >> $(METADATA)
@echo "Releases: -RHEL4 -RHEL6 -RHEL7 -RHELClient5 -RHELServer5" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -1,3 +0,0 @@
PURPOSE of /tools/annobin/Regression/lto-preprocessor-options
Description: lto-preprocessor-options
Author: Martin Cermak <mcermak@redhat.com>

View File

@ -7,6 +7,7 @@ component:
test: ./runtest.sh
framework: beakerlib
recommend:
- gcc
- annobin
- annobin-annocheck
- redhat-rpm-config

View File

@ -33,7 +33,10 @@ PACKAGE="annobin"
rlJournalStart
rlPhaseStartTest
b=`mktemp`
rlRun "echo 'int main (void) { return 0; }' | gcc -xc -o $b `rpm --eval "%build_cflags %build_ldflags"` -flto - "
rlRun "rpm -q redhat-rpm-config"
rlRun "cflags=\"$(rpm --eval '%build_cflags')\""
rlRun "ldflags=\"$(rpm --eval '%build_ldflags')\""
rlRun "echo 'int main (void) { return 0; }' | gcc -xc -o $b $cflags $ldflags -flto - "
rlRun "annocheck -v $b"
rm $b
rlPhaseEnd

View File

@ -1,78 +0,0 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /tools/annobin/Regression/testsuite
# Description: testsuite
# Author: Martin Cermak <mcermak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2018 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/tools/annobin/Regression/testsuite
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE
.PHONY: all install download clean
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
test -x runtest.sh || chmod a+x runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
requires = annobin binutils-devel gcc-c++ elfutils elfutils-devel make rpm-build \
rpm-devel gcc-plugin-devel yum yum-utils bzip2-devel
# https://mojo.redhat.com/docs/DOC-1072127
dtsver = $(shell seq -s, 9 11)
dtsreq = $(shell echo {dev,gcc-}toolset-{$(dtsver)}-{build,elfutils{,-devel},gcc{,-c++,-plugin-devel},binutils{,-devel},annobin{,-annocheck}})
installdeps:
yum -y install $(requires)
showdeps:
echo $(requires)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Martin Cermak <mcermak@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: testsuite" >> $(METADATA)
@echo "Type: Regression" >> $(METADATA)
@echo "TestTime: 48h" >> $(METADATA)
@echo "RunFor: annobin" >> $(METADATA)
$(foreach package, $(requires) $(dtsreq), \
echo "Requires: $(package)" >> $(METADATA); \
)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2+" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -1,3 +0,0 @@
PURPOSE of /tools/annobin/Regression/testsuite
Description: testsuite
Author: Martin Cermak <mcermak@redhat.com>

View File

@ -22,6 +22,7 @@ recommend:
- dnf
- yum-utils
- bzip2-devel
- rpm-build
duration: 48h
extra-summary: /tools/annobin/Regression/testsuite
extra-task: /tools/annobin/Regression/testsuite

View File

@ -0,0 +1,5 @@
#include <stdio.h>
void hello() {
printf("Hello World\n");
}

View File

@ -0,0 +1,5 @@
#include <iostream>
void hello() {
std::cout << "Hello World\n";
}

View File

@ -0,0 +1,6 @@
void hello();
int main(int argc, char **argv) {
hello();
return 0;
}

View File

@ -0,0 +1,6 @@
void hello();
int main(int argc, char **argv) {
hello();
return 0;
}

View File

@ -0,0 +1,17 @@
summary: gcc-fedora-flags
description: ''
contact:
- Tom Stellard <tstellar@redhat.com>
component:
- annobin
test: ./runtest.sh
framework: beakerlib
recommend:
- gcc
- gcc-c++
- annobin
- annobin-annocheck
- redhat-rpm-config
duration: 1h
extra-summary: /tools/annobin/Sanity/gcc-fedora-flags
extra-task: /tools/annobin/Sanity/gcc-fedora-flags

View File

@ -0,0 +1,38 @@
#!/bin/bash
. /usr/share/beakerlib/beakerlib.sh || exit 1
set -x
default_cflags=`rpm -E %{build_cflags}`
default_cxxflags=`rpm -E %{build_cxxflags}`
default_ldflags=`rpm -E %{build_ldflags}`
cflags=`rpm -D '%toolchain gcc' -E %{build_cflags}`
cxxflags=`rpm -D '%toolchain gcc' -E %{build_cxxflags}`
ldflags=`rpm -D '%toolchain gcc' -E %{build_ldflags}`
set +x
rlJournalStart
rlPhaseStartTest
rlRun "test \"$default_cflags\" = \"$cflags\""
rlRun "test \"$default_cxxflags\" = \"$cxxflags\""
rlRun "test \"$default_ldflags\" = \"$ldflags\""
rlRun "gcc $cflags -o hello.o -c hello.c"
rlRun "annocheck hello.o"
rlRun "gcc $cflags -o main.o -c main.c"
rlRun "gcc $ldflags -o hello main.o hello.o"
rlRun "annocheck hello"
rlRun "./hello | grep \"Hello World\""
rlRun "g++ $cxxflags -o hello-cpp.o -c hello.cpp"
rlRun "annocheck hello-cpp.o"
rlRun "g++ $cxxflags -o main-cpp.o -c main.cpp"
rlRun "g++ $ldflags -o hello-cpp main-cpp.o hello-cpp.o"
rlRun "annocheck hello-cpp"
rlRun "./hello-cpp | grep \"Hello World\""
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View File

@ -1,59 +0,0 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /tools/annobin/Sanity/smoke
# Description: smoke test for annobin plugin
# Author: Martin Cermak <mcermak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2019 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/tools/annobin/Sanity/smoke
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE
.PHONY: all install download clean
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
test -x runtest.sh || chmod a+x runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Martin Cermak <mcermak@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: smoke test for annobin plugin" >> $(METADATA)
@echo "Type: Sanity" >> $(METADATA)
@echo "TestTime: 48h" >> $(METADATA)
@echo "License: GPL" >> $(METADATA)
@echo "RunFor: annobin" >> $(METADATA)
@echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -1,3 +0,0 @@
PURPOSE of /tools/annobin/Sanity/smoke
Description: smoke test for annobin plugin
Author: Martin Cermak <mcermak@redhat.com>

View File

@ -8,6 +8,7 @@ test: ./runtest.sh
framework: beakerlib
recommend:
- man-db
- gcc
- annobin
- annobin-annocheck
duration: 48h

View File

@ -1,17 +0,0 @@
- hosts: localhost
roles:
- role: standard-test-basic
tags:
- classic
required_packages:
# gcc-fedora-flags
- rpm
- redhat-rpm-config
- gcc
- gcc-c++
- annobin-annocheck
repositories:
- repo: https://src.fedoraproject.org/rpms/redhat-rpm-config.git
dest: redhat-rpm-config
tests:
- redhat-rpm-config/tests/gcc-fedora-flags