Compare commits
17 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3764359b21 | ||
|
|
4db2c31c2c | ||
|
|
93b2318897 | ||
|
|
e32b491807 | ||
|
|
2a393ab63a | ||
|
|
12d48af54a | ||
|
|
51c0c798f1 | ||
|
|
80bf058d7c | ||
|
|
dcd6b95df8 | ||
|
|
ae66570d85 | ||
|
|
815dc75a45 | ||
|
|
da05dd9608 | ||
|
|
e2d918aee9 | ||
|
|
d6dd6f9fca | ||
|
|
ed70b0e090 | ||
|
|
9ee2552213 | ||
|
|
bdf8114d46 |
22 changed files with 1122 additions and 1273 deletions
13
annobin-golang-spaces-in-symbols.patch
Normal file
13
annobin-golang-spaces-in-symbols.patch
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
--- annobin.orig/annocheck/hardened.c 2021-12-02 15:27:27.325863983 +0000
|
||||
+++ annobin-9.87/annocheck/hardened.c 2021-12-02 15:28:03.915609648 +0000
|
||||
@@ -3108,6 +3108,10 @@ contains_suspicious_characters (const un
|
||||
if (isgraph (c))
|
||||
continue;
|
||||
|
||||
+ /* Golang allows spaces in some symbols. */
|
||||
+ if (c == ' ' && (per_file.lang == LANG_GO || (per_file.seen_tools & TOOL_GO)))
|
||||
+ continue;
|
||||
+
|
||||
/* Control characters are always suspect. So are spaces and DEL */
|
||||
if (iscntrl (c) || c == ' ' || c == 0x7f)
|
||||
return true;
|
||||
1391
annobin.spec
1391
annobin.spec
File diff suppressed because it is too large
Load diff
404
annobin.unicode.patch
Normal file
404
annobin.unicode.patch
Normal file
|
|
@ -0,0 +1,404 @@
|
|||
diff -rupN annobin.orig/Makefile.in annobin-9.87/Makefile.in
|
||||
--- annobin.orig/Makefile.in 2021-11-10 14:34:16.366259510 +0000
|
||||
+++ annobin-9.87/Makefile.in 2021-11-10 14:35:15.947890504 +0000
|
||||
@@ -323,6 +323,7 @@ plugindir = @plugindir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
+runstatedir = @runstatedir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
diff -rupN annobin.orig/annocheck/Makefile.in annobin-9.87/annocheck/Makefile.in
|
||||
--- annobin.orig/annocheck/Makefile.in 2021-11-10 14:34:16.368259498 +0000
|
||||
+++ annobin-9.87/annocheck/Makefile.in 2021-11-10 14:35:15.948890497 +0000
|
||||
@@ -314,6 +314,7 @@ plugindir = @plugindir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
+runstatedir = @runstatedir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
diff -rupN annobin.orig/annocheck/hardened.c annobin-9.87/annocheck/hardened.c
|
||||
--- annobin.orig/annocheck/hardened.c 2021-11-10 14:34:16.368259498 +0000
|
||||
+++ annobin-9.87/annocheck/hardened.c 2021-11-10 14:35:53.677656812 +0000
|
||||
@@ -40,6 +40,7 @@
|
||||
#define SOURCE_STRING_SECTION "string section"
|
||||
#define SOURCE_COMMENT_SECTION "comment section"
|
||||
#define SOURCE_RODATA_SECTION ".rodata section"
|
||||
+#define SOURCE_SYMBOL_SECTION "symbol section"
|
||||
|
||||
#define GOLD_COLOUR "\e[33;40m"
|
||||
#define RED_COLOUR "\x1B[31;47m"
|
||||
@@ -208,6 +209,7 @@ enum test_index
|
||||
TEST_STACK_REALIGN,
|
||||
TEST_TEXTREL,
|
||||
TEST_THREADS,
|
||||
+ TEST_UNICODE,
|
||||
TEST_WARNINGS,
|
||||
TEST_WRITEABLE_GOT,
|
||||
|
||||
@@ -252,6 +254,7 @@ static test tests [TEST_MAX] =
|
||||
TEST (stack-realign, STACK_REALIGN, "Compiled with -mstackrealign (i686 only)"),
|
||||
TEST (textrel, TEXTREL, "There are no text relocations in the binary"),
|
||||
TEST (threads, THREADS, "Compiled with -fexceptions"),
|
||||
+ TEST (unicode, UNICODE, "No unicode symbol names"),
|
||||
TEST (warnings, WARNINGS, "Compiled with -Wall"),
|
||||
TEST (writeable-got, WRITEABLE_GOT, "The .got section is not writeable"),
|
||||
};
|
||||
@@ -1067,6 +1070,11 @@ interesting_sec (annocheck_data * da
|
||||
if (streq (sec->secname, ".gdb_index"))
|
||||
per_file.debuginfo_file = true;
|
||||
|
||||
+ if (tests[TEST_UNICODE].enabled
|
||||
+ && (sec->shdr.sh_type == SHT_SYMTAB
|
||||
+ || sec->shdr.sh_type == SHT_DYNSYM))
|
||||
+ return true;
|
||||
+
|
||||
if (streq (sec->secname, ".text"))
|
||||
{
|
||||
/* Separate debuginfo files have a .text section with a non-zero
|
||||
@@ -3086,6 +3094,64 @@ check_code_section (annocheck_data *
|
||||
}
|
||||
|
||||
static bool
|
||||
+contains_suspicious_characters (const unsigned char * name)
|
||||
+{
|
||||
+ uint i;
|
||||
+ uint len = strlen ((const char *) name);
|
||||
+
|
||||
+ /* FIXME: Test that locale is UTF-8. */
|
||||
+
|
||||
+ for (i = 0; i < len; i++)
|
||||
+ {
|
||||
+ unsigned char c = name[i];
|
||||
+
|
||||
+ if (isgraph (c))
|
||||
+ continue;
|
||||
+
|
||||
+ /* Control characters are always suspect. So are spaces and DEL */
|
||||
+ if (iscntrl (c) || c == ' ' || c == 0x7f)
|
||||
+ return true;
|
||||
+
|
||||
+ if (c < 0x7f) /* This test is probably redundant. */
|
||||
+ continue;
|
||||
+
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
+static bool
|
||||
+check_symbol_section (annocheck_data * data, annocheck_section * sec)
|
||||
+{
|
||||
+ if (! tests[TEST_UNICODE].enabled)
|
||||
+ return true;
|
||||
+
|
||||
+ /* Scan the symbols looking for non-ASCII characters in their names
|
||||
+ that might cause problems. Note - we do not examine the string
|
||||
+ tables directly as there are perfectly legitimate reasons why these
|
||||
+ characters might appear in strings. But when they are used for
|
||||
+ identifier names, their use is ... problematic. */
|
||||
+ GElf_Sym sym;
|
||||
+ uint symndx;
|
||||
+
|
||||
+ for (symndx = 1; gelf_getsym (sec->data, symndx, & sym) != NULL; symndx++)
|
||||
+ {
|
||||
+ const char * symname = elf_strptr (data->elf, sec->shdr.sh_link, sym.st_name);
|
||||
+
|
||||
+ if (contains_suspicious_characters ((const unsigned char *) symname))
|
||||
+ {
|
||||
+ fail (data, TEST_UNICODE, SOURCE_SYMBOL_SECTION, "suspicious characters were found in a symbol name");
|
||||
+ einfo (VERBOSE, "%s: info: symname: '%s', (%lu bytes long) in section: %s",
|
||||
+ get_filename (data), symname, (unsigned long) strlen (symname), sec->secname);
|
||||
+ if (!BE_VERBOSE)
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
+static bool
|
||||
check_sec (annocheck_data * data,
|
||||
annocheck_section * sec)
|
||||
{
|
||||
@@ -3096,6 +3162,8 @@ check_sec (annocheck_data * data,
|
||||
selected in interesting_sec(). */
|
||||
switch (sec->shdr.sh_type)
|
||||
{
|
||||
+ case SHT_SYMTAB:
|
||||
+ case SHT_DYNSYM: return check_symbol_section (data, sec);
|
||||
case SHT_NOTE: return check_note_section (data, sec);
|
||||
case SHT_STRTAB: return check_string_section (data, sec);
|
||||
case SHT_DYNAMIC: return check_dynamic_section (data, sec);
|
||||
@@ -3823,6 +3891,7 @@ finish (annocheck_data * data)
|
||||
case TEST_RWX_SEG:
|
||||
case TEST_TEXTREL:
|
||||
case TEST_THREADS:
|
||||
+ case TEST_UNICODE:
|
||||
case TEST_WRITEABLE_GOT:
|
||||
/* The absence of a result for these tests actually means that they have passed. */
|
||||
pass (data, i, SOURCE_FINAL_SCAN, NULL);
|
||||
diff -rupN annobin.orig/configure annobin-9.87/configure
|
||||
--- annobin.orig/configure 2021-11-10 14:34:16.366259510 +0000
|
||||
+++ annobin-9.87/configure 2021-11-10 14:35:15.950890485 +0000
|
||||
@@ -765,6 +765,7 @@ infodir
|
||||
docdir
|
||||
oldincludedir
|
||||
includedir
|
||||
+runstatedir
|
||||
localstatedir
|
||||
sharedstatedir
|
||||
sysconfdir
|
||||
@@ -863,6 +864,7 @@ datadir='${datarootdir}'
|
||||
sysconfdir='${prefix}/etc'
|
||||
sharedstatedir='${prefix}/com'
|
||||
localstatedir='${prefix}/var'
|
||||
+runstatedir='${localstatedir}/run'
|
||||
includedir='${prefix}/include'
|
||||
oldincludedir='/usr/include'
|
||||
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
|
||||
@@ -1115,6 +1117,15 @@ do
|
||||
| -silent | --silent | --silen | --sile | --sil)
|
||||
silent=yes ;;
|
||||
|
||||
+ -runstatedir | --runstatedir | --runstatedi | --runstated \
|
||||
+ | --runstate | --runstat | --runsta | --runst | --runs \
|
||||
+ | --run | --ru | --r)
|
||||
+ ac_prev=runstatedir ;;
|
||||
+ -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
|
||||
+ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
|
||||
+ | --run=* | --ru=* | --r=*)
|
||||
+ runstatedir=$ac_optarg ;;
|
||||
+
|
||||
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
|
||||
ac_prev=sbindir ;;
|
||||
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
|
||||
@@ -1252,7 +1263,7 @@ fi
|
||||
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
|
||||
datadir sysconfdir sharedstatedir localstatedir includedir \
|
||||
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
|
||||
- libdir localedir mandir
|
||||
+ libdir localedir mandir runstatedir
|
||||
do
|
||||
eval ac_val=\$$ac_var
|
||||
# Remove trailing slashes.
|
||||
@@ -1405,6 +1416,7 @@ Fine tuning of the installation director
|
||||
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
|
||||
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
|
||||
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
|
||||
+ --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
|
||||
--libdir=DIR object code libraries [EPREFIX/lib]
|
||||
--includedir=DIR C header files [PREFIX/include]
|
||||
--oldincludedir=DIR C header files for non-gcc [/usr/include]
|
||||
diff -rupN annobin.orig/doc/Makefile.in annobin-9.87/doc/Makefile.in
|
||||
--- annobin.orig/doc/Makefile.in 2021-11-10 14:34:16.366259510 +0000
|
||||
+++ annobin-9.87/doc/Makefile.in 2021-11-10 14:35:15.951890479 +0000
|
||||
@@ -329,6 +329,7 @@ plugindir = @plugindir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
+runstatedir = @runstatedir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
diff -rupN annobin.orig/doc/annobin.info annobin-9.87/doc/annobin.info
|
||||
--- annobin.orig/doc/annobin.info 2021-11-10 14:34:16.366259510 +0000
|
||||
+++ annobin-9.87/doc/annobin.info 2021-11-10 14:35:15.951890479 +0000
|
||||
@@ -751,6 +751,7 @@ File: annobin.info, Node: Hardened, Ne
|
||||
[-skip-stack-realign]
|
||||
[-skip-textrel]
|
||||
[-skip-threads]
|
||||
+ [-skip-unicode]
|
||||
[-skip-warnings]
|
||||
[-skip-writeable-got]
|
||||
[-test-NAME]
|
||||
@@ -877,6 +878,10 @@ code to support the test.
|
||||
Check that the program was built by a production-ready compiler.
|
||||
Disabled by '--skip-production'.
|
||||
|
||||
+'Unicode'
|
||||
+ This test checks for the presence of multibyte characters in symbol
|
||||
+ names, which are unusual and potentially dangerous.
|
||||
+
|
||||
The tool does support a couple of other command line options as well:
|
||||
|
||||
'--skip-future'
|
||||
diff -rupN annobin.orig/doc/annobin.texi annobin-9.87/doc/annobin.texi
|
||||
--- annobin.orig/doc/annobin.texi 2021-11-10 14:34:16.366259510 +0000
|
||||
+++ annobin-9.87/doc/annobin.texi 2021-11-10 14:35:15.951890479 +0000
|
||||
@@ -855,6 +855,7 @@ annocheck
|
||||
[@b{--skip-stack-realign}]
|
||||
[@b{--skip-textrel}]
|
||||
[@b{--skip-threads}]
|
||||
+ [@b{--skip-unicode}]
|
||||
[@b{--skip-warnings}]
|
||||
[@b{--skip-writeable-got}]
|
||||
[@b{--test-@var{name}}]
|
||||
@@ -996,6 +997,11 @@ Check that the program makes consistent
|
||||
@item Production Ready Compiler
|
||||
Check that the program was built by a production-ready compiler.
|
||||
Disabled by @option{--skip-production}.
|
||||
+
|
||||
+@item Unicode
|
||||
+This test checks for the presence of multibyte characters in symbol
|
||||
+names, which are unusual and potentially dangerous.
|
||||
+
|
||||
@end table
|
||||
|
||||
The tool does support a couple of other command line options as well:
|
||||
diff -rupN annobin.orig/gcc-plugin/Makefile.in annobin-9.87/gcc-plugin/Makefile.in
|
||||
--- annobin.orig/gcc-plugin/Makefile.in 2021-11-10 14:34:16.368259498 +0000
|
||||
+++ annobin-9.87/gcc-plugin/Makefile.in 2021-11-10 14:35:15.951890479 +0000
|
||||
@@ -333,6 +333,7 @@ plugindir = @plugindir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
+runstatedir = @runstatedir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
diff -rupN annobin.orig/scripts/Makefile.in annobin-9.87/scripts/Makefile.in
|
||||
--- annobin.orig/scripts/Makefile.in 2021-11-10 14:34:16.366259510 +0000
|
||||
+++ annobin-9.87/scripts/Makefile.in 2021-11-10 14:35:15.951890479 +0000
|
||||
@@ -284,6 +284,7 @@ plugindir = @plugindir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
+runstatedir = @runstatedir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
diff -rupN annobin.orig/tests/Makefile.am annobin-9.87/tests/Makefile.am
|
||||
--- annobin.orig/tests/Makefile.am 2021-11-10 14:34:16.369259492 +0000
|
||||
+++ annobin-9.87/tests/Makefile.am 2021-11-10 14:35:15.951890479 +0000
|
||||
@@ -22,6 +22,7 @@ TESTS=compile-test \
|
||||
missing-notes-test \
|
||||
active-checks-test \
|
||||
property-note-test \
|
||||
+ unicode-test \
|
||||
hardening-fail-test
|
||||
|
||||
if HAVE_DEBUGINFOD
|
||||
diff -rupN annobin.orig/tests/Makefile.in annobin-9.87/tests/Makefile.in
|
||||
--- annobin.orig/tests/Makefile.in 2021-11-10 14:34:16.369259492 +0000
|
||||
+++ annobin-9.87/tests/Makefile.in 2021-11-10 14:35:15.952890473 +0000
|
||||
@@ -459,6 +459,7 @@ plugindir = @plugindir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
+runstatedir = @runstatedir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
@@ -479,7 +480,7 @@ TESTS = compile-test abi-test active-che
|
||||
hardening-test instrumentation-test lto-test \
|
||||
missing-notes-test objcopy-test section-size-test \
|
||||
missing-notes-test active-checks-test property-note-test \
|
||||
- hardening-fail-test $(am__append_1)
|
||||
+ unicode-test hardening-fail-test $(am__append_1)
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
@@ -764,6 +765,13 @@ property-note-test.log: property-note-te
|
||||
$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
|
||||
--log-file $$b.log --trs-file $$b.trs \
|
||||
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
|
||||
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
|
||||
+unicode-test.log: unicode-test
|
||||
+ @p='unicode-test'; \
|
||||
+ b='unicode-test'; \
|
||||
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
|
||||
+ --log-file $$b.log --trs-file $$b.trs \
|
||||
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
|
||||
"$$tst" $(AM_TESTS_FD_REDIRECT)
|
||||
debuginfod-test.log: debuginfod-test
|
||||
@p='debuginfod-test'; \
|
||||
diff -rupN annobin.orig/tests/trick-hello.s annobin-9.87/tests/trick-hello.s
|
||||
--- annobin.orig/tests/trick-hello.s 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ annobin-9.87/tests/trick-hello.s 2021-11-10 14:35:15.947890504 +0000
|
||||
@@ -0,0 +1,33 @@
|
||||
+ .file "trick-hello.c"
|
||||
+ .text
|
||||
+ .section .rodata
|
||||
+.LC0:
|
||||
+ .string "hah, gotcha!"
|
||||
+ .text
|
||||
+ .globl heoll
|
||||
+ .type heoll, %function
|
||||
+heoll:
|
||||
+.LFB0:
|
||||
+ nop
|
||||
+.LFE0:
|
||||
+ .size heoll, .-heoll
|
||||
+ .section .rodata
|
||||
+.LC1:
|
||||
+ .string "Hello world"
|
||||
+ .text
|
||||
+ .globl hello
|
||||
+ .type hello, %function
|
||||
+hello:
|
||||
+.LFB1:
|
||||
+ nop
|
||||
+.LFE1:
|
||||
+ .size hello, .-hello
|
||||
+ .globl main
|
||||
+ .type main, %function
|
||||
+main:
|
||||
+.LFB2:
|
||||
+ nop
|
||||
+.LFE2:
|
||||
+ .size main, .-main
|
||||
+ .ident "GCC: (GNU) 11.2.1 20210728 (Red Hat 11.2.1-1)"
|
||||
+ .section .note.GNU-stack,"",%progbits
|
||||
diff -rupN annobin.orig/tests/unicode-test annobin-9.87/tests/unicode-test
|
||||
--- annobin.orig/tests/unicode-test 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ annobin-9.87/tests/unicode-test 2021-11-10 14:35:15.947890504 +0000
|
||||
@@ -0,0 +1,45 @@
|
||||
+#!/bin/bash
|
||||
+
|
||||
+# Copyright (c) 2021 Red Hat.
|
||||
+#
|
||||
+# This 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 3, or (at your
|
||||
+# option) any later version.
|
||||
+#
|
||||
+# It 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.
|
||||
+
|
||||
+TEST_NAME=unicode
|
||||
+. $srcdir/common.sh
|
||||
+
|
||||
+OPTS="-O2 -g -Wl,-z,now -pie -fpie"
|
||||
+
|
||||
+start_test
|
||||
+
|
||||
+$GCC $OPTS $srcdir/trick-hello.s -o trick-hello.exe
|
||||
+if [ $? != 0 ];
|
||||
+then
|
||||
+ echo "unicode-test: FAIL: Could not compile test source file"
|
||||
+ end_test
|
||||
+ exit 1
|
||||
+fi
|
||||
+
|
||||
+# Run annocheck
|
||||
+
|
||||
+OPTS="--ignore-gaps --skip-all --test-unicode"
|
||||
+
|
||||
+$ANNOCHECK trick-hello.exe $OPTS > unicode.out
|
||||
+grep -e "FAIL: unicode" unicode.out
|
||||
+if [ $? != 0 ];
|
||||
+then
|
||||
+ echo "unicode-test: FAIL: annocheck did not detect suspicious symbol names"
|
||||
+ $ANNOCHECK trick-hello.exe $OPTS --verbose
|
||||
+ end_test
|
||||
+ exit 1
|
||||
+fi
|
||||
+
|
||||
+end_test
|
||||
+
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
summary: CI Gating Plan
|
||||
discover:
|
||||
how: fmf
|
||||
url: https://src.fedoraproject.org/tests/annobin.git
|
||||
directory: tests
|
||||
execute:
|
||||
how: tmt
|
||||
how: beakerlib
|
||||
|
|
|
|||
2
sources
2
sources
|
|
@ -1 +1 @@
|
|||
SHA512 (annobin-13.05.tar.xz) = 07bc023018e3f456fae470b271915bde2e1ff367ee8bb58adb74255023ae59e8c45ced8e4bd2130bf8a496966d986bca9866e054019f6ca4660d78c129b6532f
|
||||
SHA512 (annobin-9.79.tar.xz) = cbb8406ad804c2fa3f49ca963c4fd85672a00d864f4ebd645019255b05ff3bc8f4fb07db1f28b8cd1667f09cf4eb23822b8b05f143c39c389433cacc09652d9f
|
||||
|
|
|
|||
2
tests/README
Normal file
2
tests/README
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
The test's Makefiles are not used in Fedora CI infrastructure. But are kept here
|
||||
for backward compatibility with traditional beakerlib test harness in RHEL.
|
||||
71
tests/Regression/identify/Makefile
Normal file
71
tests/Regression/identify/Makefile
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# 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)
|
||||
3
tests/Regression/identify/PURPOSE
Normal file
3
tests/Regression/identify/PURPOSE
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
PURPOSE of /tools/annobin/Regression/identify
|
||||
Description: identify
|
||||
Author: Martin Cermak <mcermak@redhat.com>
|
||||
21
tests/Regression/identify/main.fmf
Normal file
21
tests/Regression/identify/main.fmf
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
summary: identify
|
||||
description: ''
|
||||
contact:
|
||||
- Martin Cermak <mcermak@redhat.com>
|
||||
component:
|
||||
- annobin
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- annobin
|
||||
- devtoolset-10
|
||||
- devtoolset-10-annocheck
|
||||
- devtoolset-11
|
||||
- devtoolset-11-annocheck
|
||||
- gcc-toolset-10
|
||||
- gcc-toolset-10-annocheck
|
||||
- gcc-toolset-11
|
||||
- gcc-toolset-11-annocheck
|
||||
duration: 48h
|
||||
extra-summary: /tools/annobin/Regression/identify
|
||||
extra-task: /tools/annobin/Regression/identify
|
||||
43
tests/Regression/identify/runtest.sh
Executable file
43
tests/Regression/identify/runtest.sh
Executable file
|
|
@ -0,0 +1,43 @@
|
|||
#!/bin/bash
|
||||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh 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/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Include Beaker environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PACKAGE="annobin"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartTest
|
||||
rlRun "rpm -qa | fgrep -e redhat-rpm-config -e gcc -e annobin -e binutils | sort"
|
||||
rlRun "tool_v=$(annocheck --version | awk '/^annocheck: Version/ {print $3}')"
|
||||
rlRun "__RPM=$(rpm --queryformat='%{name}\n' -qf $(man -w annobin))"
|
||||
rlRun "rpm_v=$(rpm -q --queryformat='%{version}\n' $__RPM)"
|
||||
# Following fails for annobin-8.89-2.el8
|
||||
rlRun "[[ "x${tool_v}" == "x${rpm_v}." ]]"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
64
tests/Regression/lto-preprocessor-options/Makefile
Normal file
64
tests/Regression/lto-preprocessor-options/Makefile
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# 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)
|
||||
3
tests/Regression/lto-preprocessor-options/PURPOSE
Normal file
3
tests/Regression/lto-preprocessor-options/PURPOSE
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
PURPOSE of /tools/annobin/Regression/lto-preprocessor-options
|
||||
Description: lto-preprocessor-options
|
||||
Author: Martin Cermak <mcermak@redhat.com>
|
||||
15
tests/Regression/lto-preprocessor-options/main.fmf
Normal file
15
tests/Regression/lto-preprocessor-options/main.fmf
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
summary: lto-preprocessor-options
|
||||
description: ''
|
||||
contact:
|
||||
- Martin Cermak <mcermak@redhat.com>
|
||||
component:
|
||||
- annobin
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- annobin
|
||||
- annobin-annocheck
|
||||
- redhat-rpm-config
|
||||
duration: 48h
|
||||
extra-summary: /tools/annobin/Regression/lto-preprocessor-options
|
||||
extra-task: /tools/annobin/Regression/lto-preprocessor-options
|
||||
44
tests/Regression/lto-preprocessor-options/runtest.sh
Executable file
44
tests/Regression/lto-preprocessor-options/runtest.sh
Executable file
|
|
@ -0,0 +1,44 @@
|
|||
#!/bin/bash
|
||||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh 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/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Include Beaker environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PACKAGE="annobin"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartTest
|
||||
b=`mktemp`
|
||||
rlRun "rpm -qa | fgrep -e redhat-rpm-config -e gcc -e annobin -e binutils | sort"
|
||||
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
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
78
tests/Regression/testsuite/Makefile
Normal file
78
tests/Regression/testsuite/Makefile
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# 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)
|
||||
3
tests/Regression/testsuite/PURPOSE
Normal file
3
tests/Regression/testsuite/PURPOSE
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
PURPOSE of /tools/annobin/Regression/testsuite
|
||||
Description: testsuite
|
||||
Author: Martin Cermak <mcermak@redhat.com>
|
||||
27
tests/Regression/testsuite/main.fmf
Normal file
27
tests/Regression/testsuite/main.fmf
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
summary: testsuite
|
||||
description: ''
|
||||
contact:
|
||||
- Martin Cermak <mcermak@redhat.com>
|
||||
component:
|
||||
- annobin
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- annobin
|
||||
- annobin-annocheck
|
||||
- binutils-devel
|
||||
- gcc
|
||||
- gcc-c++
|
||||
- elfutils
|
||||
- elfutils-devel
|
||||
- make
|
||||
- rpm-build
|
||||
- rpm-devel
|
||||
- gcc-plugin-devel
|
||||
- yum
|
||||
- dnf
|
||||
- yum-utils
|
||||
- bzip2-devel
|
||||
duration: 48h
|
||||
extra-summary: /tools/annobin/Regression/testsuite
|
||||
extra-task: /tools/annobin/Regression/testsuite
|
||||
85
tests/Regression/testsuite/runtest.sh
Executable file
85
tests/Regression/testsuite/runtest.sh
Executable file
|
|
@ -0,0 +1,85 @@
|
|||
#!/bin/bash
|
||||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh 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/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Include Beaker environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PACKAGE="${PACKAGE:-$(rpm -qf --queryformat=%{name} $(man -w annobin))}"
|
||||
export PACKAGE
|
||||
|
||||
GCC="${GCC:-$(which gcc)}"
|
||||
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlLogInfo "PACKAGES=$PACKAGES"
|
||||
rlLogInfo "REQUIRES=$REQUIRES"
|
||||
rlLogInfo "COLLECTIONS=$COLLECTIONS"
|
||||
rlLogInfo "X_SCLS=$X_SCLS"
|
||||
rlLogInfo "GCC=$GCC"
|
||||
|
||||
rlRun "rpm -qa | fgrep -e redhat-rpm-config -e gcc -e annobin -e binutils | sort"
|
||||
|
||||
# In case more than one devtoolset- or gcc-toolset -build package is
|
||||
# installed (they can co-exist from the packaging persp, but their
|
||||
# coexistence causes unexpected results with rpm macros), then we have
|
||||
# a mess of defined rpm macros coming e.g. from
|
||||
# /etc/rpm/macros.gcc-toolset-10-config
|
||||
# /etc/rpm/macros.gcc-toolset-9-config etc. To have just the needed
|
||||
# macros (respective to given SCL under test) defined without
|
||||
# uninstalling unneeded RPMs, we'll need an override mechanism. The
|
||||
# following assumes just one SCL *enabled* (more than one installed),
|
||||
# and doesn't care of a (useless) revert:
|
||||
echo ${X_SCLS} | fgrep toolset && \
|
||||
rlRun "cat /etc/rpm/*${X_SCLS%\ }* > ~/.rpmmacros"
|
||||
|
||||
rlAssertRpm $PACKAGE
|
||||
rlRun "TMP=\$(mktemp -d)"
|
||||
rlRun "pushd $TMP"
|
||||
|
||||
rlFetchSrcForInstalled $PACKAGE
|
||||
rlRun "yum-builddep -y *src.rpm"
|
||||
rlRun "rpm --define='_topdir $TMP' -Uvh *src.rpm"
|
||||
rlRun "rpmbuild --define='_topdir $TMP' -bc SPECS/annobin.spec"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
rlRun "pushd BUILD/annobin-*"
|
||||
set -o pipefail
|
||||
rlRun "make check |& tee $TMP/check.log"
|
||||
rlRun -l "grep '^PASS:' $TMP/check.log" 0
|
||||
rlRun -l "grep '^FAIL:' $TMP/check.log" 1
|
||||
PASSCOUNT=$(grep '^PASS:' $TMP/check.log | wc -l)
|
||||
rlRun "[[ $PASSCOUNT -ge 7 ]]"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $TMP"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
59
tests/Sanity/smoke/Makefile
Normal file
59
tests/Sanity/smoke/Makefile
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# 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)
|
||||
3
tests/Sanity/smoke/PURPOSE
Normal file
3
tests/Sanity/smoke/PURPOSE
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
PURPOSE of /tools/annobin/Sanity/smoke
|
||||
Description: smoke test for annobin plugin
|
||||
Author: Martin Cermak <mcermak@redhat.com>
|
||||
15
tests/Sanity/smoke/main.fmf
Normal file
15
tests/Sanity/smoke/main.fmf
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
summary: smoke test for annobin plugin
|
||||
description: ''
|
||||
contact:
|
||||
- Martin Cermak <mcermak@redhat.com>
|
||||
component:
|
||||
- annobin
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- man-db
|
||||
- annobin
|
||||
- annobin-annocheck
|
||||
duration: 48h
|
||||
extra-summary: /tools/annobin/Sanity/smoke
|
||||
extra-task: /tools/annobin/Sanity/smoke
|
||||
45
tests/Sanity/smoke/runtest.sh
Executable file
45
tests/Sanity/smoke/runtest.sh
Executable file
|
|
@ -0,0 +1,45 @@
|
|||
#!/bin/bash
|
||||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh 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/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Include Beaker environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PACKAGE="annobin"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlRun "which gcc"
|
||||
rlRun "man -w annobin"
|
||||
rlRun "echo $X_SCLS"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
rlRun "rpm -qa | fgrep -e redhat-rpm-config -e gcc -e annobin -e binutils | sort"
|
||||
rlRun "echo 'int main() {return 0;}' | gcc -xc -fplugin=annobin -o /dev/null -"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
Loading…
Add table
Add a link
Reference in a new issue