Compare commits
10 Commits
b6a4fa9e4c
...
bd40d05c6b
Author | SHA1 | Date | |
---|---|---|---|
|
bd40d05c6b | ||
|
11912bf0ac | ||
|
d3d606787f | ||
|
a30e0dc915 | ||
|
25218a7570 | ||
|
162ec5a4af | ||
|
ac2923b81c | ||
|
579396834f | ||
|
08ebb0b6d7 | ||
|
ba9d7c1b4b |
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
|
*.swp
|
||||||
/stress-ng-*.tar.xz
|
/stress-ng-*.tar.xz
|
||||||
|
@ -0,0 +1,55 @@
|
|||||||
|
From 6a22f648bd3452c83c5f88ec530d496fefe5e9a0 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Colin Ian King <colin.i.king@gmail.com>
|
||||||
|
Date: Mon, 21 Nov 2022 12:16:47 +0000
|
||||||
|
Subject: [PATCH 1/3] stress-sysfs: check for zero sysfs entries after pruning
|
||||||
|
the directory
|
||||||
|
|
||||||
|
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
|
||||||
|
---
|
||||||
|
stress-sysfs.c | 18 +++++++++++-------
|
||||||
|
1 file changed, 11 insertions(+), 7 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/stress-sysfs.c b/stress-sysfs.c
|
||||||
|
index 00fe9ba08100..24267d00ee5a 100644
|
||||||
|
--- a/stress-sysfs.c
|
||||||
|
+++ b/stress-sysfs.c
|
||||||
|
@@ -634,14 +634,11 @@ static int stress_sysfs(const stress_args_t *args)
|
||||||
|
}
|
||||||
|
|
||||||
|
n = scandir("/sys", &dlist, NULL, alphasort);
|
||||||
|
- if (n <= 0) {
|
||||||
|
- if (args->instance == 0)
|
||||||
|
- pr_inf_skip("%s: no /sys entries found, skipping stressor\n", args->name);
|
||||||
|
- stress_dirent_list_free(dlist, n);
|
||||||
|
- (void)munmap((void *)ctxt, sizeof(*ctxt));
|
||||||
|
- return EXIT_NO_RESOURCE;
|
||||||
|
- }
|
||||||
|
+ if (n <= 0)
|
||||||
|
+ goto exit_no_sysfs_entries;
|
||||||
|
n = stress_dirent_list_prune(dlist, n);
|
||||||
|
+ if (n <= 0)
|
||||||
|
+ goto exit_no_sysfs_entries;
|
||||||
|
|
||||||
|
os_release = 0;
|
||||||
|
#if defined(HAVE_UNAME) && \
|
||||||
|
@@ -806,10 +803,17 @@ finish:
|
||||||
|
(void)close(ctxt->kmsgfd);
|
||||||
|
(void)shim_pthread_spin_destroy(&lock);
|
||||||
|
|
||||||
|
+exit_free:
|
||||||
|
stress_dirent_list_free(dlist, n);
|
||||||
|
(void)munmap((void *)ctxt, sizeof(*ctxt));
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
+
|
||||||
|
+exit_no_sysfs_entries:
|
||||||
|
+ if (args->instance == 0)
|
||||||
|
+ pr_inf_skip("%s: no /sys entries found, skipping stressor\n", args->name);
|
||||||
|
+ rc = EXIT_NO_RESOURCE;
|
||||||
|
+ goto exit_free;
|
||||||
|
}
|
||||||
|
|
||||||
|
stressor_info_t stress_sysfs_info = {
|
||||||
|
--
|
||||||
|
2.38.1
|
||||||
|
|
@ -0,0 +1,37 @@
|
|||||||
|
From f424f5b774b7cb0fd7939d28e68db6fa977baea1 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Colin Ian King <colin.i.king@gmail.com>
|
||||||
|
Date: Mon, 21 Nov 2022 12:45:11 +0000
|
||||||
|
Subject: [PATCH 2/3] stress-shm: skip stressor if /dev/shm is not mounted with
|
||||||
|
tmpfs on linux
|
||||||
|
|
||||||
|
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
|
||||||
|
---
|
||||||
|
stress-shm.c | 12 ++++++++++++
|
||||||
|
1 file changed, 12 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/stress-shm.c b/stress-shm.c
|
||||||
|
index 91bcd961aeb1..4e6327ac97d4 100644
|
||||||
|
--- a/stress-shm.c
|
||||||
|
+++ b/stress-shm.c
|
||||||
|
@@ -122,6 +122,18 @@ static int stress_shm_posix_child(
|
||||||
|
const size_t page_size = args->page_size;
|
||||||
|
struct sigaction sa;
|
||||||
|
|
||||||
|
+#if defined(__linux__)
|
||||||
|
+ /*
|
||||||
|
+ * /dev/shm should be mounted with tmpfs and
|
||||||
|
+ * be writeable, if not shm_open will fail
|
||||||
|
+ */
|
||||||
|
+ if (access("/dev/shm", W_OK) < 0) {
|
||||||
|
+ pr_inf("%s: cannot access /dev/shm for writes, errno=%d (%s) skipping stressor\n",
|
||||||
|
+ args->name, errno, strerror(errno));
|
||||||
|
+ return EXIT_NO_RESOURCE;
|
||||||
|
+ }
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
addrs = calloc(shm_posix_objects, sizeof(*addrs));
|
||||||
|
if (!addrs) {
|
||||||
|
pr_fail("%s: calloc on addrs failed, out of memory\n", args->name);
|
||||||
|
--
|
||||||
|
2.38.1
|
||||||
|
|
@ -0,0 +1,55 @@
|
|||||||
|
From 7681f2d05470b8c8850346bcf12e525f628941b3 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Colin Ian King <colin.i.king@gmail.com>
|
||||||
|
Date: Mon, 21 Nov 2022 12:46:54 +0000
|
||||||
|
Subject: [PATCH 3/3] stress-shm: move /dev/shm check to earlier in the setup
|
||||||
|
phase
|
||||||
|
|
||||||
|
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
|
||||||
|
---
|
||||||
|
stress-shm.c | 23 +++++++++++------------
|
||||||
|
1 file changed, 11 insertions(+), 12 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/stress-shm.c b/stress-shm.c
|
||||||
|
index 4e6327ac97d4..a9c26498024e 100644
|
||||||
|
--- a/stress-shm.c
|
||||||
|
+++ b/stress-shm.c
|
||||||
|
@@ -122,18 +122,6 @@ static int stress_shm_posix_child(
|
||||||
|
const size_t page_size = args->page_size;
|
||||||
|
struct sigaction sa;
|
||||||
|
|
||||||
|
-#if defined(__linux__)
|
||||||
|
- /*
|
||||||
|
- * /dev/shm should be mounted with tmpfs and
|
||||||
|
- * be writeable, if not shm_open will fail
|
||||||
|
- */
|
||||||
|
- if (access("/dev/shm", W_OK) < 0) {
|
||||||
|
- pr_inf("%s: cannot access /dev/shm for writes, errno=%d (%s) skipping stressor\n",
|
||||||
|
- args->name, errno, strerror(errno));
|
||||||
|
- return EXIT_NO_RESOURCE;
|
||||||
|
- }
|
||||||
|
-#endif
|
||||||
|
-
|
||||||
|
addrs = calloc(shm_posix_objects, sizeof(*addrs));
|
||||||
|
if (!addrs) {
|
||||||
|
pr_fail("%s: calloc on addrs failed, out of memory\n", args->name);
|
||||||
|
@@ -384,6 +372,17 @@ static int stress_shm(const stress_args_t *args)
|
||||||
|
}
|
||||||
|
orig_sz = sz = shm_posix_bytes & ~(page_size - 1);
|
||||||
|
|
||||||
|
+#if defined(__linux__)
|
||||||
|
+ /*
|
||||||
|
+ * /dev/shm should be mounted with tmpfs and
|
||||||
|
+ * be writeable, if not shm_open will fail
|
||||||
|
+ */
|
||||||
|
+ if (access("/dev/shm", W_OK) < 0) {
|
||||||
|
+ pr_inf("%s: cannot access /dev/shm for writes, errno=%d (%s) skipping stressor\n",
|
||||||
|
+ args->name, errno, strerror(errno));
|
||||||
|
+ return EXIT_NO_RESOURCE;
|
||||||
|
+ }
|
||||||
|
+#endif
|
||||||
|
stress_set_proc_state(args->name, STRESS_STATE_RUN);
|
||||||
|
|
||||||
|
while (keep_stressing_flag() && retry) {
|
||||||
|
--
|
||||||
|
2.38.1
|
||||||
|
|
6
gating.yaml
Normal file
6
gating.yaml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
--- !Policy
|
||||||
|
product_versions:
|
||||||
|
- rhel-9
|
||||||
|
decision_context: osci_compose_gate
|
||||||
|
rules:
|
||||||
|
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}
|
3
rpminspect.yaml
Normal file
3
rpminspect.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
inspections:
|
||||||
|
badfuncs: off
|
2
sources
2
sources
@ -1 +1 @@
|
|||||||
SHA512 (stress-ng-0.12.09.tar.xz) = 510b210a920b540c25e9f4cc0597924f72a80a85e6cd647346f7e91335e127e776bfa1bdcf0e67f557b7c154d2e6f2b2ed5abe9612b2552f53a8d21c920dc6c1
|
SHA512 (stress-ng-0.15.00.tar.xz) = ca7f3e89285d1a4651d90e73132eefa51eb3449c1018871c9adce155288e42de2a67aaa3d53053daacb65cbd6acece471334423ec208075ef46db53a51a12971
|
||||||
|
@ -1,11 +1,14 @@
|
|||||||
Name: stress-ng
|
Name: stress-ng
|
||||||
Version: 0.12.09
|
Version: 0.15.00
|
||||||
Release: 1%{?dist}
|
Release: 1%{?dist}
|
||||||
Summary: Stress test a computer system in various ways
|
Summary: Stress test a computer system in various ways
|
||||||
|
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
URL: https://kernel.ubuntu.com/~cking/%{name}
|
URL: https://github.com/ColinIanKing/%{name}/tarball
|
||||||
Source0: https://kernel.ubuntu.com/~cking/tarballs/%{name}/%{name}-%{version}.tar.xz
|
Source0: https://github.com/ColinIanKing/%{name}/tarball/%{name}-%{version}.tar.xz
|
||||||
|
|
||||||
|
# Work around for ld.gold error
|
||||||
|
%undefine _package_note_flags
|
||||||
|
|
||||||
BuildRequires: make
|
BuildRequires: make
|
||||||
BuildRequires: gcc
|
BuildRequires: gcc
|
||||||
@ -21,6 +24,11 @@ BuildRequires: libatomic
|
|||||||
BuildRequires: zlib-devel
|
BuildRequires: zlib-devel
|
||||||
BuildRequires: Judy-devel
|
BuildRequires: Judy-devel
|
||||||
|
|
||||||
|
# Patches
|
||||||
|
Patch1: 0001-stress-sysfs-check-for-zero-sysfs-entries-after-prun.patch
|
||||||
|
Patch2: 0002-stress-shm-skip-stressor-if-dev-shm-is-not-mounted-w.patch
|
||||||
|
Patch3: 0003-stress-shm-move-dev-shm-check-to-earlier-in-the-setu.patch
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Stress test a computer system in various ways. It was designed to exercise
|
Stress test a computer system in various ways. It was designed to exercise
|
||||||
various physical subsystems of a computer as well as the various operating
|
various physical subsystems of a computer as well as the various operating
|
||||||
@ -28,11 +36,14 @@ system kernel interfaces.
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q
|
%setup -q
|
||||||
|
%patch1 -p1
|
||||||
|
%patch2 -p1
|
||||||
|
%patch3 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
export CFLAGS="%{optflags}"
|
export CFLAGS="%{optflags}"
|
||||||
export LDFLAGS="%{__global_ldflags}"
|
export LDFLAGS="%{__global_ldflags}"
|
||||||
%make_build
|
%make_build V=
|
||||||
|
|
||||||
%install
|
%install
|
||||||
install -p -m 755 -D %{name} %{buildroot}%{_bindir}/%{name}
|
install -p -m 755 -D %{name} %{buildroot}%{_bindir}/%{name}
|
||||||
@ -43,7 +54,7 @@ install -pm 644 bash-completion/%{name} \
|
|||||||
|
|
||||||
%files
|
%files
|
||||||
%license COPYING
|
%license COPYING
|
||||||
%doc README
|
%doc README.md
|
||||||
%{_bindir}/%{name}
|
%{_bindir}/%{name}
|
||||||
%{_mandir}/man1/%{name}.1.*
|
%{_mandir}/man1/%{name}.1.*
|
||||||
%dir %{_datadir}/bash-completion
|
%dir %{_datadir}/bash-completion
|
||||||
@ -51,6 +62,47 @@ install -pm 644 bash-completion/%{name} \
|
|||||||
%{_datadir}/bash-completion/completions/%{name}
|
%{_datadir}/bash-completion/completions/%{name}
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Nov 21 2022 John Kacur <jkacur@redhat.com> - 0.15.00-1
|
||||||
|
- Rebase to upstream V0.15.00
|
||||||
|
- Add the following upstream patches
|
||||||
|
- stress-shm: move /dev/shm check to earlier in the setup phase
|
||||||
|
- stress-shm: skip stressor if /dev/shm is not mounted with tmpfs on linux
|
||||||
|
- stress-sysfs: check for zero sysfs entries after pruning the directory
|
||||||
|
Resolves: rhbz#2144070
|
||||||
|
|
||||||
|
* Tue Oct 18 2022 John Kacur <jkacur@redhat.com> - 0.14.06-1
|
||||||
|
- Rebase to upstream V0.14.06
|
||||||
|
Resolves: rhbz#2119871
|
||||||
|
|
||||||
|
* Fri Apr 22 2022 John Kacur <jkacur@redhat.com> - 0.14.00-2
|
||||||
|
- Add a local rpminspect.yaml file and disable badfuncs test
|
||||||
|
Resolves: rhbz#2077925
|
||||||
|
|
||||||
|
* Wed Apr 20 2022 John Kacur <jkacur@redhat.com> - 0.14.00-1
|
||||||
|
- Rebase to upstream V0.14.00
|
||||||
|
- Update Source URLs
|
||||||
|
Resolves: rhbz#2067588
|
||||||
|
|
||||||
|
* Fri Jan 14 2022 John Kacur <jkacur@redhat.com> - 0.13.10-1
|
||||||
|
- Rebase to upstres V0.13.10
|
||||||
|
Resolves; rhbz#2018597
|
||||||
|
|
||||||
|
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 0.13.00-2
|
||||||
|
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
|
||||||
|
Related: rhbz#1991688
|
||||||
|
|
||||||
|
* Tue Aug 03 2021 John Kacur <jkacur@redhat.com> - 0.13.00-1
|
||||||
|
- Rebase to stress-ng-0.13.00 to get fix for build break with glibc-2.34
|
||||||
|
Resolves: rhbz#1984800
|
||||||
|
|
||||||
|
* Tue Jun 15 2021 John Kacur <jkacur@redhat.com> - 0.12.04-3
|
||||||
|
- Bump release number
|
||||||
|
Resolves: rhbz#1846033
|
||||||
|
|
||||||
|
* Tue Jun 15 2021 John Kacur <jkacur@redhat.com> - 0.12.04-2
|
||||||
|
- Revert to 0.12.04 and just build without libbsd
|
||||||
|
Resolves: rhbz#1846033
|
||||||
|
|
||||||
* Wed May 26 2021 John Kacur <jkacur@redhat.com> - 0.12.09-1
|
* Wed May 26 2021 John Kacur <jkacur@redhat.com> - 0.12.09-1
|
||||||
- Rebase to 0.12.09 upstream, and build without libbsd
|
- Rebase to 0.12.09 upstream, and build without libbsd
|
||||||
Resolves: rhbz#1846033
|
Resolves: rhbz#1846033
|
||||||
|
17
tests/scripts/run_tests.sh
Normal file
17
tests/scripts/run_tests.sh
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
#!/usr/bin/bash
|
||||||
|
# make sure we have stress-ng installed
|
||||||
|
if rpm -q --quiet stress-ng; then
|
||||||
|
:
|
||||||
|
else
|
||||||
|
sudo dnf install -y stress-ng
|
||||||
|
if [[ $? != 0 ]]; then
|
||||||
|
echo "install of stress-ng failed!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# See if stress-ng is installed and executable
|
||||||
|
stress-ng --help 2>> /dev/null
|
||||||
|
if [[ $? != 0 ]]; then
|
||||||
|
exit 2
|
||||||
|
fi
|
12
tests/tests.yml
Normal file
12
tests/tests.yml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
- hosts: localhost
|
||||||
|
roles:
|
||||||
|
- role: standard-test-basic
|
||||||
|
tags:
|
||||||
|
- classic
|
||||||
|
tests:
|
||||||
|
- simple:
|
||||||
|
dir: scripts
|
||||||
|
run: ./run_tests.sh
|
||||||
|
required_packages:
|
||||||
|
- make
|
||||||
|
- stress-ng
|
Loading…
Reference in New Issue
Block a user