-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support of slow drive #8
base: develop
Are you sure you want to change the base?
Add support of slow drive #8
Conversation
atf_parallels/loop.sh
Outdated
function docker_run { | ||
create_loop_device |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how slow drive is used? is it used for all ATF test scripts? or is it only used by a small set of test scripts related to "Configurable time before shutdown". Will adding a slow drive slow down running the atf test suites?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yang1070 Please notice this specific ATF branch mostly required for scripts related to SDL-0117 feature.
It is not recommended to use it for other scripts. Even though other scripts wouldn't be slow down however there could be an issues with loop
devices which would be created and deleted for each script run.
This and some other issues are the reasons why this ATF branch is not part of delivery and should only be used for testing the feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dboltovskyi are you saying that this change will not be merged into the release branch even if after the review and the SDL-0117 feature is completed ? otherwise it will impact the performance or stability of existing ATF tests?
is it possible to add some parameters to control the docker run so that for some test cases a slow disk is set up and for most test cases no slow disk created?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@dboltovskyi my concern is this change will cause the all other atf test cases takes a longer time to run
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yang1070 Please find the following updates:
- ATF: 765a952
- Scripts: LuxoftSDL/sdl_atf_test_scripts@33ac041
These changes allow ATF to create loop device only if it's required by script.
I did test them within new and existing scripts and they work fine.
Even though these changes work pretty stable I would think that loop device possibility requires a separate proposal.
Current solution has a few drawbacks:
- Pure flexibility. Now it's supported only write rate for a loop device. In case if we need to use other restrictions ATF would require an update. (e.g. drive size, read speed etc.) Though we can quite simply add a few more prospective options in a current implementation.
- ATF runner (before executing the script) fetches script's content to obtain loop device options ( e.g.
config.isLoopDeviceRequired
andconfig.loopDeviceWriteRate
parameters). I guess this is not the best approach and there may be better one. - There is a limit on number of available loop devices. It should correlate with the number of parallel workers. Issue would occur when total number of scripts currently assigned to the workers which require loop device exceeds number of available loop devices (in the system). This number is variable and depends on environment.
- Fault tolerance and error handling needs to be improved for the cases when loop device can't be created.
From other hand current solution is workable and we spent some amount of time to implement it. It might be not a good option to leave it in a specific branch.
We can fix some of the issues and try to push this PR into Open as part of feature implementation. Then to see what Project Maintainers think about it.
I would appreciate your feedback what do you think would be the best option here.
This PR adds support of the drive with slow writing speed.
It's required for the ATF scripts for SDL-0117 Configurable time before shutdown feature published in LuxoftSDL/sdl_atf_test_scripts#129
Notes:
losetup
which is used to create loop device requires root permissions. In order to get rid of a corresponding message the command may be run on a host machine:sudo chmod u+s /sbin/losetup
sudo chmod u+s /usr/sbin/losetup
This one time action needs to be done before running the tests for the first time.