diff --git a/.gitignore b/.gitignore index e69de29..4b692e6 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,3 @@ +/v4.0.17.tar.gz +/genwqe-user-4.0.18.tar.gz +/genwqe-user-4.0.20.tar.gz diff --git a/genwqe-tools.spec b/genwqe-tools.spec new file mode 100644 index 0000000..134e2df --- /dev/null +++ b/genwqe-tools.spec @@ -0,0 +1,232 @@ +# Copyright 2015, International Business Machines +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# zlib-devel 1.2.8 is better, but 1.2.7 should work too +# +# The following switch tries to take care that the distros libz.so is been taken: +# CONFIG_ZLIB_PATH=%%{_libdir}/libz.so +# No special libz build should be needed anymore, since we added the right +# dependency to the spec file. We want to have a zlib-devel installed. +# + +Summary: GenWQE userspace tools +Name: genwqe-tools +Version: 4.0.20 +Release: 12%{?dist} +License: ASL 2.0 +URL: https://github.com/ibm-genwqe/genwqe-user/ +BuildRequires: gcc +BuildRequires: zlib-devel >= 1.2.7 +BuildRequires: help2man +%ifarch %{power64} +BuildRequires: libcxl-devel +%endif +Source0: https://github.com/ibm-genwqe/genwqe-user/archive/v%{version}.tar.gz#/genwqe-user-%{version}.tar.gz +Patch0: genwqe-user-4.0.18-install-gzFile_test.patch +Patch1: genwqe-user-4.0.20-glibc-2.30-gettid-naming-conflict.patch +Requires: genwqe-zlib = %{version}-%{release} + +%description +Provide a suite of utilities to manage and configure the IBM GenWQE card. + +%package -n genwqe-zlib +Summary: GenWQE hardware accelerated libz +%description -n genwqe-zlib +GenWQE hardware accelerated libz and test-utilities. + +%package -n genwqe-vpd +Summary: GenWQE adapter VPD tools +%description -n genwqe-vpd +The genwqe-vpd package contains GenWQE adapter VPD tools. + +%package -n genwqe-zlib-devel +Summary: Development files for %{name} +Requires: genwqe-zlib%{?_isa} = %{version}-%{release} + +%description -n genwqe-zlib-devel +The genwqe-zlib-devel package contains libraries and header files for +developing applications that use %{name}. + +%package -n genwqe-zlib-static +Summary: Static library files for %{name} +Requires: genwqe-zlib-devel%{?_isa} = %{version}-%{release} + +%description -n genwqe-zlib-static +The genwqe-zlib-static package contains static libraries for +developing applications that use %{name}. + +%prep +%autosetup -p1 -n genwqe-user-%{version} + +%build +LDFLAGS="%{__global_ldflags}" CFLAGS="%{optflags}" make %{?_smp_mflags} tools lib \ + VERSION=%{version} CONFIG_ZLIB_PATH=%{_libdir}/libz.so V=2 + +%install +make %{?_smp_mflags} install DESTDIR=%{buildroot}/%{_prefix} \ + SYSTEMD_UNIT_DIR=%{buildroot}/%{_unitdir} \ + LIB_INSTALL_PATH=%{buildroot}/%{_libdir}/genwqe \ + INCLUDE_INSTALL_PATH=%{buildroot}/%{_includedir}/genwqe + +# move genwqe_vpd.csv to expected location. +mkdir -p %{buildroot}/%{_sysconfdir}/ +install -m 0644 tools/genwqe_vpd.csv %{buildroot}/etc/ + +# remove libz stuff +rm %{buildroot}%{_libdir}/genwqe/libz.* +mv %{buildroot}%{_libdir}/genwqe/* %{buildroot}%{_libdir}/ +rmdir %{buildroot}%{_libdir}/genwqe/ + +%ldconfig_scriptlets -n genwqe-zlib + +%files -n genwqe-tools +%license LICENSE +%{_bindir}/genwqe_echo +%{_bindir}/genwqe_ffdc +%{_bindir}/genwqe_cksum +%{_bindir}/genwqe_memcopy +%{_bindir}/genwqe_peek +%{_bindir}/genwqe_poke +%{_bindir}/genwqe_update + +%{_bindir}/genwqe_gunzip +%{_bindir}/genwqe_gzip +%{_bindir}/genwqe_test_gz +%{_bindir}/genwqe_mt_perf +%{_bindir}/zlib_mt_perf +%{_bindir}/gzFile_test + +%{_mandir}/man1/genwqe_echo.1* +%{_mandir}/man1/genwqe_ffdc.1* +%{_mandir}/man1/genwqe_gunzip.1* +%{_mandir}/man1/genwqe_gzip.1* +%{_mandir}/man1/genwqe_cksum.1* +%{_mandir}/man1/genwqe_memcopy.1* +%{_mandir}/man1/genwqe_peek.1* +%{_mandir}/man1/genwqe_poke.1* +%{_mandir}/man1/genwqe_update.1* +%{_mandir}/man1/zlib_mt_perf.1* +%{_mandir}/man1/genwqe_test_gz.1* +%{_mandir}/man1/genwqe_mt_perf.1* +%{_mandir}/man1/gzFile_test.1* + +%ifarch %{power64} +%{_bindir}/genwqe_maint +%{_bindir}/genwqe_loadtree +/%{_unitdir}/genwqe_maint.service +%{_mandir}/man1/genwqe_maint.1* +%{_mandir}/man1/genwqe_loadtree.1* +%endif + +%files -n genwqe-zlib +%license LICENSE +%{_libdir}/*.so.* + +%files -n genwqe-vpd +%license LICENSE +%config(noreplace) %{_sysconfdir}/genwqe_vpd.csv +%{_bindir}/genwqe_csv2vpd +%{_bindir}/genwqe_vpdconv +%{_bindir}/genwqe_vpdupdate +%{_mandir}/man1/genwqe_csv2vpd.1* +%{_mandir}/man1/genwqe_vpdconv.1* +%{_mandir}/man1/genwqe_vpdupdate.1* + +%files -n genwqe-zlib-devel +%dir %{_includedir}/genwqe +%{_includedir}/genwqe/* +%{_libdir}/*.so + +%files -n genwqe-zlib-static +%{_libdir}/*.a + +%changelog +* Mon Jul 27 2020 Fedora Release Engineering - 4.0.20-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Tue Jan 28 2020 Fedora Release Engineering - 4.0.20-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Thu Jan 23 2020 Than Ngo - 4.0.20-10 +- renames gettid() to sys_gettid() +- adds gating tests + +* Wed Oct 23 2019 Than Ngo - 4.0.20-9 +- FTBFS, do not define gettid if glibc >= 2.30 + +* Thu Jul 25 2019 Fedora Release Engineering - 4.0.20-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Thu Jan 31 2019 Fedora Release Engineering - 4.0.20-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Fri Jul 13 2018 Fedora Release Engineering - 4.0.20-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Wed May 23 2018 Than Ngo - 4.0.20-5 +- add explicit package version requirement +- fix multilib regression in man pages + +* Wed Feb 07 2018 Fedora Release Engineering - 4.0.20-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Mon Feb 05 2018 Than Ngo - - 4.0.20-3 +- use the Fedora linker flags + +* Thu Feb 1 2018 Florian Weimer - 4.0.20-2 +- Build with linker flags from redhat-rpm-config + +* Mon Jan 15 2018 Dan HorĂ¡k - 4.0.20-1 +- update to 4.0.20 (#1533296) + +* Wed Aug 02 2017 Fedora Release Engineering - 4.0.18-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 4.0.18-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Mon Mar 13 2017 Than Ngo - 4.0.18-2 +- backport upstream to fix compilation on 32-bits arch + +* Mon Feb 13 2017 Than Ngo - 4.0.18-1 +- update to 4.0.18 prerelease + +* Tue Feb 07 2017 Than Ngo - 4.0.17-2 +- fix build with RPM_OPT_FLAGS + +* Mon Feb 06 2017 Than Ngo - 4.0.17-1 +- fixed to build system libcxl on power64 +- clean up spec files + +* Wed Apr 06 2016 Gabriel Krisman Bertazi - 4.0.16 +- dlopen uses SONAME when opening libz. +- Support CAPI version. +- Bulid fixes. +- Include genwqe_maint daemon (CAPI version). + +* Mon Apr 04 2016 Frank Haverkamp +- Renamed some scripts again + +* Thu Feb 04 2016 Frank Haverkamp +- Fix s390 and Intel build. Remove debug stuff from zlib rpm. + +* Fri Dec 11 2015 Frank Haverkamp +- Changing some install directories again. + +* Tue Dec 08 2015 Gabriel Krisman Bertazi - 4.0.7-1 +- Create Fedora package. +- Make genwqe-vpd and genwqe-libz subpackages of genwqe-tools. + +* Wed Apr 22 2015 Frank Haverkamp +- Initial release. diff --git a/genwqe-user-4.0.18-install-gzFile_test.patch b/genwqe-user-4.0.18-install-gzFile_test.patch new file mode 100644 index 0000000..3047b5c --- /dev/null +++ b/genwqe-user-4.0.18-install-gzFile_test.patch @@ -0,0 +1,11 @@ +diff -up genwqe-user-4.0.18/tools/Makefile.than genwqe-user-4.0.18/tools/Makefile +--- genwqe-user-4.0.18/tools/Makefile.than 2017-02-13 15:26:30.887046956 +0100 ++++ genwqe-user-4.0.18/tools/Makefile 2017-02-13 15:27:01.084890726 +0100 +@@ -110,6 +110,7 @@ install_gzip_tools: all + install -D -m 755 zlib_mt_perf -T $(DESTDIR)/bin/zlib_mt_perf + install -D -m 755 genwqe_mt_perf -T $(DESTDIR)/bin/genwqe_mt_perf + install -D -m 755 genwqe_test_gz -T $(DESTDIR)/bin/genwqe_test_gz ++ install -D -m 755 gzFile_test -T $(DESTDIR)/bin/gzFile_test + + uninstall_gzip_tools: + $(RM) $(DESTDIR)/bin/genwqe_gzip \ diff --git a/genwqe-user-4.0.20-glibc-2.30-gettid-naming-conflict.patch b/genwqe-user-4.0.20-glibc-2.30-gettid-naming-conflict.patch new file mode 100644 index 0000000..fd31947 --- /dev/null +++ b/genwqe-user-4.0.20-glibc-2.30-gettid-naming-conflict.patch @@ -0,0 +1,293 @@ +diff -up genwqe-user-4.0.20/lib/card_defs.h.me genwqe-user-4.0.20/lib/card_defs.h +--- genwqe-user-4.0.20/lib/card_defs.h.me 2020-01-22 16:19:20.402193318 +0100 ++++ genwqe-user-4.0.20/lib/card_defs.h 2020-01-22 16:24:19.363948393 +0100 +@@ -32,19 +32,19 @@ + #include + #include /* For SYS_xxx definitions */ + +-static inline pid_t gettid(void) ++static inline pid_t sys_gettid(void) + { + return (pid_t)syscall(SYS_gettid); + } + + #define pr_err(fmt, ...) \ + fprintf(stderr, "%08x.%08x %s:%u: Error: " fmt, \ +- getpid(), gettid(), __FILE__, __LINE__, ## __VA_ARGS__) ++ getpid(), sys_gettid(), __FILE__, __LINE__, ## __VA_ARGS__) + + #define pr_warn(fmt, ...) do { \ + if (_dbg_flag) \ + fprintf(stderr, "%08x.%08x %s:%u: Warn: " fmt, \ +- getpid(), gettid(), __FILE__, __LINE__, \ ++ getpid(), sys_gettid(), __FILE__, __LINE__, \ + ## __VA_ARGS__); \ + } while (0) + +@@ -56,7 +56,7 @@ static inline pid_t gettid(void) + #define pr_info(fmt, ...) do { \ + if (_dbg_flag) \ + fprintf(stderr, "%08x.%08x %s:%u: Info: " fmt, \ +- getpid(), gettid(), __FILE__, __LINE__, \ ++ getpid(), sys_gettid(), __FILE__, __LINE__, \ + ## __VA_ARGS__); \ + } while (0) + +diff -up genwqe-user-4.0.20/lib/ddcb_capi.c.me genwqe-user-4.0.20/lib/ddcb_capi.c +--- genwqe-user-4.0.20/lib/ddcb_capi.c.me 2020-01-22 16:18:44.625864311 +0100 ++++ genwqe-user-4.0.20/lib/ddcb_capi.c 2020-01-22 16:24:09.547857765 +0100 +@@ -61,7 +61,7 @@ extern FILE *libddcb_fd_out; + + #include /* For SYS_xxx definitions */ + +-static inline pid_t gettid(void) ++static inline pid_t sys_gettid(void) + { + return (pid_t)syscall(SYS_gettid); + } +@@ -69,25 +69,25 @@ static inline pid_t gettid(void) + #define VERBOSE0(fmt, ...) do { \ + if (libddcb_fd_out) \ + fprintf(libddcb_fd_out, "%08x.%08x: " fmt, \ +- getpid(), gettid(), ## __VA_ARGS__); \ ++ getpid(), sys_gettid(), ## __VA_ARGS__); \ + } while (0) + + #define VERBOSE1(fmt, ...) do { \ + if (libddcb_fd_out && (libddcb_verbose > 0)) \ + fprintf(libddcb_fd_out, "%08x.%08x: " fmt, \ +- getpid(), gettid(), ## __VA_ARGS__); \ ++ getpid(), sys_gettid(), ## __VA_ARGS__); \ + } while (0) + + #define VERBOSE2(fmt, ...) do { \ + if (libddcb_fd_out && (libddcb_verbose > 1)) \ + fprintf(libddcb_fd_out, "%08x.%08x: " fmt, \ +- getpid(), gettid(), ## __VA_ARGS__); \ ++ getpid(), sys_gettid(), ## __VA_ARGS__); \ + } while (0) + + #define VERBOSE3(fmt, ...) do { \ + if (libddcb_fd_out && (libddcb_verbose > 3)) \ + fprintf(libddcb_fd_out, "%08x.%08x: " fmt, \ +- getpid(), gettid(), ## __VA_ARGS__); \ ++ getpid(), sys_gettid(), ## __VA_ARGS__); \ + } while (0) + + #define __free(ptr) free((ptr)) +diff -up genwqe-user-4.0.20/lib/hw_defs.h.me genwqe-user-4.0.20/lib/hw_defs.h +--- genwqe-user-4.0.20/lib/hw_defs.h.me 2020-01-22 16:23:17.373376030 +0100 ++++ genwqe-user-4.0.20/lib/hw_defs.h 2020-01-22 16:24:02.595793576 +0100 +@@ -33,7 +33,7 @@ + # define ABS(a) (((a) < 0) ? -(a) : (a)) + #endif + +-static inline pid_t gettid(void) ++static inline pid_t sys_gettid(void) + { + return (pid_t)syscall(SYS_gettid); + } +@@ -44,14 +44,14 @@ extern FILE *zedc_log; + #define pr_err(fmt, ...) do { \ + if (zedc_log) \ + fprintf(zedc_log, "%08x.%08x %s:%u: Error: " fmt, \ +- getpid(), gettid(), __FILE__, __LINE__, \ ++ getpid(), sys_gettid(), __FILE__, __LINE__, \ + ## __VA_ARGS__); \ + } while (0) + + #define pr_warn(fmt, ...) do { \ + if (zedc_log) \ + fprintf(zedc_log, "%08x.%08x %s:%u: Warn: " fmt, \ +- getpid(), gettid(), __FILE__, __LINE__, \ ++ getpid(), sys_gettid(), __FILE__, __LINE__, \ + ## __VA_ARGS__); \ + } while (0) + +@@ -63,14 +63,14 @@ extern FILE *zedc_log; + #define pr_info(fmt, ...) do { \ + if (zedc_log && zedc_dbg) \ + fprintf(zedc_log, "%08x.%08x %s:%u: Info: " fmt, \ +- getpid(), gettid(), __FILE__, __LINE__, \ ++ getpid(), sys_gettid(), __FILE__, __LINE__, \ + ## __VA_ARGS__); \ + } while (0) + + #define pr_log(dbg, fmt, ...) do { \ + if (zedc_log && (dbg)) \ + fprintf(zedc_log, "%08x.%08x %s:%u: Info: " fmt, \ +- getpid(), gettid(), __FILE__, __LINE__, \ ++ getpid(), sys_gettid(), __FILE__, __LINE__, \ + ## __VA_ARGS__); \ + } while (0) + +diff -up genwqe-user-4.0.20/misc/zpipe_append.c.me genwqe-user-4.0.20/misc/zpipe_append.c +--- genwqe-user-4.0.20/misc/zpipe_append.c.me 2020-01-22 16:24:32.062065638 +0100 ++++ genwqe-user-4.0.20/misc/zpipe_append.c 2020-01-22 16:25:35.884654925 +0100 +@@ -61,7 +61,7 @@ static unsigned int CHUNK_i = 16 * 1024; + static unsigned int CHUNK_o = 16 * 1024; /* 16384; */ + static int _pattern = 0; + +-static inline pid_t gettid(void) ++static inline pid_t sys_gettid(void) + { + return (pid_t)syscall(SYS_gettid); + } +diff -up genwqe-user-4.0.20/misc/zpipe_mt.c.me genwqe-user-4.0.20/misc/zpipe_mt.c +--- genwqe-user-4.0.20/misc/zpipe_mt.c.me 2020-01-22 16:25:05.510374476 +0100 ++++ genwqe-user-4.0.20/misc/zpipe_mt.c 2020-01-22 16:27:10.566529136 +0100 +@@ -126,7 +126,7 @@ static int pin_to_cpu(int run_cpu) + return run_cpu; + } + +-static pid_t gettid(void) ++static pid_t sys_gettid(void) + { + return (pid_t)syscall(SYS_gettid); + } +@@ -178,7 +178,7 @@ static int check_for_pattern(const unsig + "it=%d: %d or more times \"%02x\" " + "at %016lx!\n", + (unsigned long)getpid(), +- (unsigned long)gettid(), ++ (unsigned long)sys_gettid(), + (unsigned long)in, + (unsigned long)out, + it, zeros, pattern, +@@ -253,11 +253,11 @@ static int def(struct thread_data *d, FI + strm.next_out = out; + memset(strm.next_out, 0xF0, chunk_o); + if (chunk_o >= 8) +- *((uint32_t *)&out[4]) = gettid(); ++ *((uint32_t *)&out[4]) = sys_gettid(); + + pr_dbg(3, "%08lx.%08lx 1) %02x%02x%02x%02x%02x ...\n", + (unsigned long)getpid(), +- (unsigned long)gettid(), ++ (unsigned long)sys_gettid(), + out[0], out[1], out[2], out[3], out[4]); + + ret = deflate(&strm, flush); /* no bad ret value */ +@@ -267,7 +267,7 @@ static int def(struct thread_data *d, FI + + pr_dbg(3, "%08lx.%08lx 2) %02x%02x%02x%02x%02x ...\n", + (unsigned long)getpid(), +- (unsigned long)gettid(), ++ (unsigned long)sys_gettid(), + out[0], out[1], out[2], out[3], out[4]); + + if (check_for_pattern(out, have, nr, in, out, 0x00) || +@@ -488,16 +488,16 @@ static void *libz_thread(void *data) + char i_fname[64], o_fname[64], n_fname[64]; + char diff_cmd[128]; + +- d->tid = gettid(); ++ d->tid = sys_gettid(); + d->cpu = sched_getcpu(); + + for (i = 0; (i < (unsigned int)count) && (exit_on_err == 0); i++) { + unsigned int j; + int new_cpu; + +- sprintf(i_fname, "i_%08x_%08x_%d.bin", getpid(), gettid(), i); +- sprintf(o_fname, "o_%08x_%08x_%d.bin", getpid(), gettid(), i); +- sprintf(n_fname, "n_%08x_%08x_%d.bin", getpid(), gettid(), i); ++ sprintf(i_fname, "i_%08x_%08x_%d.bin", getpid(), sys_gettid(), i); ++ sprintf(o_fname, "o_%08x_%08x_%d.bin", getpid(), sys_gettid(), i); ++ sprintf(n_fname, "n_%08x_%08x_%d.bin", getpid(), sys_gettid(), i); + + i_fp = fopen(i_fname, "w+"); + for (j = 0, len = 0; len < data_size; j++) { +@@ -534,7 +534,7 @@ static void *libz_thread(void *data) + exit(EXIT_FAILURE); + + pr_dbg(3, "%08x.%08x %d. compressing ...\n", +- getpid(), gettid(), i); ++ getpid(), sys_gettid(), i); + + rc = def(d, i_fp, o_fp, Z_DEFAULT_COMPRESSION, i); + if (rc != Z_OK) { +@@ -549,7 +549,7 @@ static void *libz_thread(void *data) + new_cpu = sched_getcpu(); + if (d->cpu != new_cpu) { + pr_dbg(1, "%08x.%08x CPU moved from %d to %d\n", +- getpid(), gettid(), d->cpu, new_cpu); ++ getpid(), sys_gettid(), d->cpu, new_cpu); + d->cpu = new_cpu; + } + +@@ -558,7 +558,7 @@ static void *libz_thread(void *data) + d->compressions++; + + pr_dbg(3, "%08x.%08x %d. decompressing ...\n", +- getpid(), gettid(), i); ++ getpid(), sys_gettid(), i); + + o_fp = fopen(o_fname, "r"); /* original data */ + if (o_fp == NULL) +@@ -573,7 +573,7 @@ static void *libz_thread(void *data) + error_trigger(); + + fprintf(stderr, "%08x.%08x err/inf: rc=%d %s %s %s\n", +- getpid(), gettid(), rc, ++ getpid(), sys_gettid(), rc, + i_fname, o_fname, n_fname); + zerr(rc); + +@@ -582,7 +582,7 @@ static void *libz_thread(void *data) + rc = system(diff_cmd); + if (rc != 0) + fprintf(stderr, "%08x.%08x %s: %d\n", +- getpid(), gettid(), ++ getpid(), sys_gettid(), + strerror(errno), errno); + + goto exit_failure; +@@ -605,7 +605,7 @@ static void *libz_thread(void *data) + error_trigger(); + + fprintf(stderr, "%08x.%08x In %s and Out %s differ!\n", +- getpid(), gettid(), i_fname, n_fname); ++ getpid(), sys_gettid(), i_fname, n_fname); + goto exit_failure; + } + +diff -up genwqe-user-4.0.20/tools/zlib_mt_perf.c.me genwqe-user-4.0.20/tools/zlib_mt_perf.c +--- genwqe-user-4.0.20/tools/zlib_mt_perf.c.me 2020-01-22 16:27:23.608649564 +0100 ++++ genwqe-user-4.0.20/tools/zlib_mt_perf.c 2020-01-22 16:28:09.166070205 +0100 +@@ -162,7 +162,7 @@ static int pin_to_cpu(int run_cpu) + return run_cpu; + } + +-static pid_t gettid(void) ++static pid_t sys_gettid(void) + { + return (pid_t)syscall(SYS_gettid); + } +@@ -492,7 +492,7 @@ static void *libz_thread_defl(void *data + d->defl_total=0; + d->defl_time=0; + d->comp_calls=0; +- d->tid = gettid(); ++ d->tid = sys_gettid(); + d->cpu = sched_getcpu(); + d->first_run = true; + d->checksum = 0; +@@ -533,7 +533,7 @@ static void *libz_thread_infl(void *data + d->infl_total = 0; + d->infl_time = 0; + d->decomp_calls = 0; +- d->tid = gettid(); ++ d->tid = sys_gettid(); + d->cpu = sched_getcpu(); + d->first_run = true; + d->checksum = 0; +@@ -550,7 +550,7 @@ static void *libz_thread_infl(void *data + rc = infl(d, c_fp); + if (rc != Z_OK) { + fprintf(stderr, "%08x.%08x err/inf: rc=%d %s\n", +- getpid(), gettid(), rc, c_fname); ++ getpid(), sys_gettid(), rc, c_fname); + zerr(rc); + goto exit_failure; + } diff --git a/sources b/sources new file mode 100644 index 0000000..0d5926b --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (genwqe-user-4.0.20.tar.gz) = 43ba0c03fba2d1705147d907101a10dbcfe39c78e92ec68e57a5175112c517082c0763f50ff37beb76e8db41634b73f30be7469013985006d88289ca9cf1ad74 diff --git a/tests/Sanity-test-for-genwqe-tools/Makefile b/tests/Sanity-test-for-genwqe-tools/Makefile new file mode 100644 index 0000000..0e4a527 --- /dev/null +++ b/tests/Sanity-test-for-genwqe-tools/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/genwqe-tools/Sanity-test-for-genwqe-tools +# Description: Sanity test +# Author: Brock Organ +# Than Ngo +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# 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, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/CoreOS/genwqe-tools/Sanity-test-for-genwqe-tools +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) + chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Than Ngo " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Sanity test" >> $(METADATA) + @echo "Type: Sanity" >> $(METADATA) + @echo "TestTime: 30m" >> $(METADATA) + @echo "RunFor: genwqe-tools" >> $(METADATA) + @echo "Requires: coreutils man-db" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: ASL 2.0" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Sanity-test-for-genwqe-tools/PURPOSE b/tests/Sanity-test-for-genwqe-tools/PURPOSE new file mode 100644 index 0000000..b132a44 --- /dev/null +++ b/tests/Sanity-test-for-genwqe-tools/PURPOSE @@ -0,0 +1,7 @@ +PURPOSE of /CoreOS/genwqe-tools/Sanity-test-for-genwqe-tools +Description: smoke test, funktion test for CI gating +Author: Than Ngo + +tests following scenarios: + * smoke test + * funktion test diff --git a/tests/Sanity-test-for-genwqe-tools/runtest.sh b/tests/Sanity-test-for-genwqe-tools/runtest.sh new file mode 100755 index 0000000..f6a0efd --- /dev/null +++ b/tests/Sanity-test-for-genwqe-tools/runtest.sh @@ -0,0 +1,44 @@ +#! /bin/sh +# genwqe-tools basics + +PACKAGES="genwqe-tools" +# SERVICES="" + +# source the test script helpers +# requires beakerlib package +. /usr/bin/rhts-environment.sh || exit 1 +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +rlJournalStart + rlPhaseStartSetup + for p in $PACKAGES ; do + rlAssertRpm $p + done + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + rlPhaseEnd + rlPhaseStartTest "Smoke, sanity and function tests" + rlRun "genwqe_cksum --version" 0 "version check" + rlRun "genwqe_echo --version" 0 "version check" + rlRun "genwqe_ffdc --version" 0 "version check" + rlRun "genwqe_gunzip --version" 0 "version check" + rlRun "genwqe_memcopy --version" 0 "version check" + rlRun "genwqe_peek --version" 0 "version check" + rlRun "genwqe_poke --version" 0 "version check" + rlRun "genwqe_update --version" 0 "version check" + rlRun "zlib_mt_perf --version" 0 "version check" + + # check man page + for m in genwqe_cksum genwqe_echo genwqe_ffdc genwqe_gunzip genwqe_gzip genwqe_memcopy genwqe_mt_perf genwqe_peek genwqe_poke genwqe_test_gz genwqe_update gzFile_test zlib_mt_perf ; do + rlRun "man -P head $m" 0 "Show the $m man page" + done + + # check for sane license and readme file + rlRun "head /usr/share/licenses/genwqe-tools/LICENSE" 0 "Check for license file" + rlPhaseEnd + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -fr $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..af9add2 --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,12 @@ +--- +# Run tests in all contexts +- hosts: localhost + tags: + - classic + roles: + - role: standard-test-beakerlib + tests: + - Sanity-test-for-genwqe-tools + required_packages: + - genwqe-tools + - man-db