1
0
Fork 0
Commit graph

48 commits

Author SHA1 Message Date
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
Tomas Korbar
2a22bf03e1 Add Plugin class tests 2018-10-15 13:20:14 +02:00
Tomas Korbar
3049600c35 Add Commands class tests 2018-10-15 13:20:14 +02:00
Tomas Korbar
213eca72d8 Add exports Controller class tests 2018-10-15 13:20:14 +02:00
Tomas Korbar
d1051a7e3e Add device matcher udev tests 2018-10-15 13:20:14 +02:00
Tomas Korbar
0245c53ee1 Add Inventory class tests 2018-10-15 13:20:14 +02:00
Tomas Korbar
b09c8d0d37 Start using unittest2 in test_device_matcher 2018-10-15 13:20:14 +02:00
Jaroslav Škarvada
f563c7d756
An attempt to port Tuned to python3 and keeping it python2 compatible
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-12-21 10:20:13 +01:00
Evgeni Golov
7f087627ef move DeviceMatcher to hardware 2017-04-18 12:17:42 +02:00
Evgeni Golov
7aafbccb32 profile units are OrderedDicts, not lists
refs #35
2017-04-18 11:53:53 +02:00
Jaroslav Škarvada
c909f7f15a tests: added basic functionality test
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2014-10-17 00:46:53 +02:00
Jan Vcelak
a614c1b54b implement profiles locator class, used by profiles loader 2012-11-07 11:24:49 +01:00
Jan Vcelak
6d48f2099d move DeviceMatcher from profiles to units submodule 2012-10-26 17:59:30 +02:00
Jan Vcelak
ec9c3a53dd profiles: Factory and Merger depend on Loader 2012-10-26 17:59:30 +02:00
Jan Vcelak
69679eaccd profiles.unit: separate properties for type, enabled and replace 2012-10-26 17:59:30 +02:00
Jan Vcelak
fc87b96744 profiles: use Merger object in Loader 2012-10-26 17:59:30 +02:00
Jan Vcelak
123215eaa5 profiles: add Merger class 2012-10-26 17:59:30 +02:00
Jan Vcelak
fd132cf8d0 profiles tests: add device matcher class 2012-10-26 17:59:30 +02:00
Jan Vcelak
89dcad5a19 profiles.loader tests: multiple profiles loading 2012-10-26 17:59:30 +02:00
Jan Vcelak
04d460349b storage tests: check provider property 2012-10-26 17:59:30 +02:00
Jan Vcelak
f72f034c84 monitors tests: exception if update method not implemented 2012-10-26 17:59:30 +02:00
Jan Vcelak
a14d16cb33 monitors tests: instance deregistration 2012-10-26 17:59:30 +02:00
Jan Vcelak
4417a01e27 plugins tests: initial tests for base class 2012-10-26 17:59:29 +02:00
Jan Vcelak
6693b7f359 monitors tests: initial tests for base class 2012-10-26 17:59:29 +02:00
Jan Vcelak
eb4b1d9455 tests: mock TunedLogger with NullHandler 2012-10-26 17:59:29 +02:00
Jan Vcelak
d388dec6ab remove circular dependencies between library and tests 2012-10-26 17:59:29 +02:00
Jan Vcelak
ce5a07d9de profile.loader tests: script name expansion 2012-10-26 17:59:29 +02:00
Jan Vcelak
44e56043c1 Profile: add name property 2012-10-26 17:59:29 +02:00
Jan Vcelak
00d02f4ffb storage: relocate unit tests to correct location 2012-10-26 17:59:29 +02:00
Jan Vcelak
94f24ae120 profiles.loader: new code, unit tests 2012-10-26 17:59:28 +02:00