1
0
Fork 0
Commit graph

79 commits

Author SHA1 Message Date
Pavol Žáčik
609f2a47b0
tests: Restore TuneD service after the error messages test 2024-06-25 09:10:30 +02:00
Pavol Žáčik
b00c5984b5
tests: Do not run tunedDisableSystemdRateLimitingStart via rlRun 2024-06-25 08:32:42 +02:00
Jaroslav Škarvada
40f1507138
Merge pull request #615 from zacikpa/default-profile-locations
Migrate profiles to /etc/tuned/profiles/ and /usr/lib/tuned/profiles/
2024-05-23 13:24:08 +02:00
Pavol Žáčik
6d3aa949b3
Migrate profiles to /etc/tuned/profiles/ and /usr/lib/tuned/profiles/ 2024-04-03 11:01:10 +02:00
Adriaan Schmidt
b10bafce48 instance: add priority as a property
Currently instance priorities are only used at startup to sort the
instance classes. To enable dynamic creation of instances, we need
to store the priorities, so new instances can be sorted accordingly.

Signed-off-by: Adriaan Schmidt <adriaan.schmidt@siemens.com>
2024-03-15 12:13:43 +01:00
Jaroslav Škarvada
2f911b7e02
hotplug: do not report ENOENT errors on device remove
It requires slight internal plugin API change, thus 3rd party plugins
needs updating.

Namely the 'command_set' methods for devices were extended by the
'remove' boolean parameter which is set to 'True' on the hotplug remove
event. Then the method should silent the ENOENT errors where
appropriate, because the device interface may be removed (by
kernel/udev) before the method finishes.

Resolves: RHEL-11342

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2023-12-07 13:00:34 +01:00
Jaroslav Škarvada
f4c976f2f5
Merge pull request #421 from RHEmployee/ratelimit
Update tests: disable systemd rate limiting.
2023-08-03 18:48:17 +02:00
Robin Hack
178bc00dc8 Update tests: disable systemd rate limiting. 2023-07-27 08:03:42 -04:00
Robin Hack
fb8b707aae tests/beakerlib: Add new test which covers socket API.
And fix licences.
2023-04-17 03:04:39 -04:00
Robin Hack
432253afc1 tests: add new tests. 2023-03-28 07:39:21 -04:00
Jaroslav Škarvada
8d55d8d256
Merge pull request #417 from CZerta/rhbz1891036_striping_quotes_when_unpacking_cpu_list
Striping quotes when unpacking cpu list
2022-08-09 16:11:40 +02:00
Jaroslav Škarvada
e1045f2d1d
Merge pull request #380 from CZerta/configparser_default_delimiter
Default delimiters errors, inline comments
2022-03-16 23:34:15 +01:00
Jan Zerdik
910ff510e9
Default delimiters causing errors in some specific situations, inline comments
Resolves: rhbz#2060138
Resolves: rhbz#2038886

Signed-off-by: Jan Zerdik <jzerdik@redhat.com>
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2022-03-16 12:49:03 +01:00
Jaroslav Škarvada
e0deb1bdaf
beakerlib: fix systemd rate limiting for variables-support-in-profiles
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2022-03-15 00:31:00 +01:00
Jan Zerdik
2ec3546cd1 Striping quotes when unpacking cpu list
Resolves: rhbz#1891036

Signed-off-by: Jan Zerdik <jzerdik@redhat.com>
2022-03-08 14:12:43 +01:00
Jaroslav Škarvada
f9ae0ccfc5
Merge pull request #385 from RHEmployee/add-tests
beakerlibtests: add new test
2022-01-17 13:20:08 +01:00
Robin Hack
9bf602afba beakerlibtests: add new test
Add slowdown for centos stream -
systemd failure:
Active: failed (Result: start-limit-hit)
2022-01-17 06:27:57 -05:00
Robin Hack
00a9d5cde4 Tests: Be in sync with upstreaming guide. 2021-10-13 05:21:08 -04:00
Jan Zerdik
063277a05b Removing dependency on python-configobj.
Resolves: rhbz#1936386

Signed-off-by: Jan Zerdik <jzerdik@redhat.com>
2021-08-18 10:28:27 +02:00
Jaroslav Škarvada
bd6697f8f4
profiles: fix loading multiple profiles if there are repeating profiles
The original idea behind this patch is credited to
Jiří Mencák <jmencak@redhat.com>.

Resolves: rhbz#1825882

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2021-06-09 11:00:18 +02:00
Jaroslav Škarvada
78df85affe
Merge branch 'master' into project-rename 2021-06-03 17:20:55 +02:00
Jaroslav Škarvada
871e68bea1
tests: added rlRun python detect description to beaker test
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2021-06-03 16:08:55 +02:00
Jaroslav Škarvada
4f1901991e
ci: fixed RHEL-8
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2021-06-03 01:22:41 +02:00
Jaroslav Škarvada
49b74a8b56
ci: beakerlib tests fixes
Switch from the deprecated execution method.
Fix for the bz1798183-RFE-support-post-loaded-profile beakerlib test.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2021-05-20 14:54:45 +02:00
Jaroslav Škarvada
16d4acbaca
Project renamed to TuneD
The 'D' is now capital to clarify pronunciation.

DBus service name is kept as '/Tuned' not to break
backward compatibility.

This will also need update of downstream tests
which rely on the specific output strings containing
the name.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2021-05-17 22:09:02 +02:00
Jaroslav Škarvada
89e670c80a
Fixed building on RHEL-7/CentOS 7
Also fixed building with python-2.7.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2020-06-19 11:15:12 +02:00
Ondřej Lysoněk
4f5f35830a Add support for a post-loaded profile
This is a minimal viable implementation of a post-loaded profile
feature. It was implemented to satisfy the needs of the
kernel_settings Ansible role.
https://github.com/linux-system-roles/kernel_settings

This feature allows us to apply a profile in a way that is
somewhat separate from the way profiles from the active_profile file
are applied. Namely, the post-loaded profile is always applied after
all the profiles from the active_profile (or more precisely, the
post-loaded profile is always put to the tail of the profile chain
when merging). Also, the post-loaded profile setting is not affected
by running 'tuned-adm profile <some profile>' - the post-loaded
profile remains applied.

The name of the post-loaded profile is stored in
/etc/tuned/post_loaded_profile.

The lack of support for multiple post-loaded profiles was more or less
an arbitrary decision. There are no problems with it, as far as I can
see. However, there is currently no use case for multiple post-loaded
profiles, so I decided to make things easier for our future selves -
it's one less thing to worry about if we need to make changes to the
profile loading logic. We can add support for multiple post-loaded
profiles anytime.

A number of other design decisions went into the
implementation. They are listed here:
https://github.com/redhat-performance/tuned/pull/272

Resolves: rhbz#1798183

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2020-06-01 19:11:29 +02:00
Miro Hrončok
2399aa3b2d Remove usage of unittest2, use unittest from the standard library
Fixes https://github.com/redhat-performance/tuned/issues/241

Fedora is removing the unittest2 package: https://bugzilla.redhat.com/show_bug.cgi?id=1794222

tuned is not targeting Python 2.6: https://github.com/redhat-performance/tuned/issues/241#issuecomment-588320175

One thing not present in Python 2.7 is assertItemsEqual() -- renamed to assertCountEqual().

Related, mock was also listed as a requirement in the spec file,
but all the imports are from unittest.mock, hence removed.
2020-02-25 20:04:51 +01:00
Tomas Korbar
925e7d1764 Stop using Travis
We replaced travis with packit.
Also remove Dockerfile because we do not need it anymore.

Signed-off-by: Tomas Korbar <tkorbar@redhat.com>
2019-12-02 12:20:33 +01:00
Tomas Korbar
140d982354 Replace python flexmock module with builtin mock
Also replace dependency in specfile and alter dockerfile

Signed-off-by: Tomas Korbar <tkorbar@redhat.com>
2019-11-28 07:54:15 +01:00
Petr Šplíchal
e82271a6bb Remove obsolete rhts imports from beakerlib tests 2019-11-20 13:15:58 +01:00
Jaroslav Škarvada
2bafe790be
beakerlib: fixed beakerlib path used in beakerlib test
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2019-11-20 11:56:25 +01:00
Petr Šplíchal
2ca4f84792 Remove extra fmf root, move test under beakerlib 2019-11-20 10:50:16 +01:00
Jaroslav Škarvada
cc974087a0
Merge pull request #212 from pvalena/fix-tmt
Fix packit / TMT tests.
2019-11-19 22:34:18 +01:00
Pavel Valena
2100a53b44 Fix packit / TMT tests. 2019-11-19 18:32:09 -02:00
Jaroslav Škarvada
7623044b58
packit: minor updates
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2019-11-19 19:58:43 +01:00
Jaroslav Škarvada
9841c1250f
beakerlib: added Robin's name and fixed description
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2019-11-18 16:38:01 +01:00
Jaroslav Škarvada
cff78c537c tests: moved tests under directory 'tests'
Also renamed directories to be more consistent.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2019-11-18 16:34:11 +01:00
Ondřej Lysoněk
a9f2b27d30 Rework device handling to avoid races caused by hotplug
This patch fixes (at least) the following race conditions:
1. If a device is attached while iterating assigned devices, the
   MonitorObserver thread can attempt to insert the newly attached
   device to the assigned_devices set while the set is being iterated,
   which results in the following exception:
   RuntimeError: Set changed size during iteration
2. Some devices can be missed when applying a tuning - devices are enumerated
   (i.e., Plugin._init_devices() gets called) before udev device monitoring is
   started (hotplug.Plugin._hardware_events_init() gets called), so devices
   that appear between these two actions are not tuned.
3. Device monitoring is stopped too late, which can result in some tunings
   not being unapplied after stopping a profile. This can happen for devices
   that get added during profile rollback after unit_manager.stop_tuning()
   gets called, but before unit_manager.destroy_all() gets called.
4. It can happen that tuning is applied twice for a device if it is added
   during profile activation, e.g. after unit_manager.create() is called in
   Daemon._thread_code(), but before unit_manager.start_tuning() is called.
   Apart from unnecessarily applying the tuning twice, it can result in
   overwriting saved original settings for the device and hence our inability
   to properly roll back our changes to the settings.
5. The observer thread can attempt to use load_monitor before it's created
   in Plugin._instance_init(), which can result in AttributeError.

Hopefully it doesn't introduce new race conditions :).

The fix is to:
1. rearrange the sequence of certain actions,
2. separate Instance.devices to two separate sets: processed_devices
   and assigned_devices.

   processed_devices are never iterated when the MonitorObserver thread
   is running (*), so the first problem described above cannot happen.
   The set is used to store devices, which have already been tuned.

   The assigned_devices set is now the set of devices that are going
   to be tuned. The set can only be accessed by the main thread.

   (*) Except when verifying tuning - this is fixed in a follow-up patch

I tried to separate the changes into more digestable patches, but I
couldn't figure out how.

Resolves: rhbz#1592743

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2019-03-06 19:52:07 +01:00
Ondřej Lysoněk
32666498ba tests: Fix import of Mapping
Since python3.3, Mapping has been moved to collections.abc and starting
with python3.8, it will no longer be available as collections.Mapping.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2019-02-19 16:26:27 +01:00
Tomas Korbar
3722b15192 Add range feature for cpu exclusion
- It is now possible to exclude cpu range by !1-3
- Also edited test for cpulist_unpack method to test this new
feature
- Resolves rhbz#1533908
2018-11-21 15:23:11 +01:00
Tomas Korbar
38ebdbeda2 Fix deprecation warnings when python 3 is used
- we should use pyudev.Device class property 'properties'
for accesing device properties
- but we still need to keep try catch workaround
because of old pyudev package which is present in centos
2018-10-15 13:20:14 +02:00
Tomas Korbar
2fad9568f6 Fix test_pickle_provider
- change of default storage file in CommandsTestCase affects this test
- file has been changed also in this test to ensure stable behaviour
2018-10-15 13:20:14 +02:00
Tomas Korbar
d8e319caef Edit InventoryTestCase 2018-10-15 13:20:14 +02:00
Tomas Korbar
db3647ef65 Edit tests for DeviceMatcherUdev class 2018-10-15 13:20:14 +02:00
Tomas Korbar
2b990ac8ac Add Travis and Docker file
- Dockerfile supports builds for both fedora and centos
- This commit will allow us to run tests after each new commit
2018-10-15 13:20:14 +02:00
Tomas Korbar
3319d53a87 Add tests for GlobalConfig class 2018-10-15 13:20:14 +02:00
Tomas Korbar
b4f4e41adc Fix unit tests for Merger class 2018-10-15 13:20:14 +02:00
Tomas Korbar
ca040870b3 Use unittest2 module for unittesting 2018-10-15 13:20:14 +02:00
Tomas Korbar
a2ed07c1af Fix profiles.Loader class tests 2018-10-15 13:20:14 +02:00