validate raw.xz-ended img for disposable minion
AbandonedPublic

Authored by jskladan on Jun 22 2016, 10:13 AM.

Details

Summary

Modify the code to validate raw.xz-ended img for disposable minion

Test Plan

Just do the common runtask using a disposable VM

Diff Detail

Repository
rLTRN libtaskotron
Branch
angel
Lint
Lint WarningsExcuse: raw.xz is "long" compare to img
SeverityLocationCodeMessage
Warninglibtaskotron/ext/disposable/vm.py:277E501flake8 100
Unit
Unit Tests OK
Build Status
Buildable 672
Build 672: arc lint + arc unit
lnie retitled this revision from to validate raw.xz-ended img for disposable minion.Jun 22 2016, 10:13 AM
lnie updated this object.
lnie edited the test plan for this revision. (Show Details)
lnie added reviewers: adamwill, kparal, mkrizek, pschindl.
jskladan requested changes to this revision.Jun 22 2016, 11:42 AM
jskladan added a reviewer: jskladan.
jskladan added a subscriber: jskladan.
jskladan added inline comments.
libtaskotron/ext/disposable/vm.py
277

This does not really do what you probably think it does, as it will match e.g. 160301_1030-fedora-23-taskotron_cloud-x86_64.rawaxz, what you really want (and I'm not sure that testcloud can use xzipped raw images, but that's another can of worms) is:

re.compile(r'^([0-9]{6}_[0-9]{4})-(.*?)-(.*?)-(.*?)-(.*?)\.(qcow2|raw(\.xz)?|img)$')
This revision now requires changes to proceed.Jun 22 2016, 11:42 AM

Also, what is the use case for gzipped raw image? Would it not be usefull also for other formats than raw?
It might also make sense to get rid of the extension checking completely - it was initially created with one specific use-case in mind, and if we have more general usecases, it does not really make sense to make our life complicated with the ever-expanding regexp.

lnie added a comment.Jun 23 2016, 9:23 AM

Also, what is the use case for gzipped raw image? Would it not be usefull also for other formats than raw?

It will be useful for all kinds of compressed raw image if we check the suffix of the image name and uncompressed them in proper method.

It might also make sense to get rid of the extension checking completely - it was initially created with one specific use-case in mind, and if we have more general usecases, it does not really make sense to make our life complicated with the ever-expanding regexp.

yeah,+1 for that point,as testcloud grab img from the specific URL or dir ,like /var/lib/taskotron/images ,which is unlikely to be stained.

This comment was removed by jskladan.
lnie added a comment.Jun 28 2016, 7:39 AM
In D899#16867, @lnie wrote:

Also, what is the use case for gzipped raw image? Would it not be usefull also for other formats than raw?

It will be useful for all kinds of compressed raw image if we check the suffix of the image name and uncompressed them in proper method.

It might also make sense to get rid of the extension checking completely - it was initially created with one specific use-case in mind, and if we have more general usecases, it does not really make sense to make our life complicated with the ever-expanding regexp.

yeah,+1 for that point,as testcloud grab img from the specific URL or dir ,like /var/lib/taskotron/images ,which is unlikely to be stained.

So ,should we pre-open our arm to all kinds of potential img from the future by changing the regexp to "re.compile(r'^([0-9]{6}_[0-9]{4})-(.*?)-(.*?)-(.*?)-(.*?)\..*')" ?

kparal edited reviewers, added: lbrabec; removed: pschindl, adamwill.Jul 11 2016, 11:22 AM
In D899#17000, @lnie wrote:

So ,should we pre-open our arm to all kinds of potential img from the future

That is a good question. Hardcoding which images is testcloud able to handle is suboptimal. I don't see a really good solution here, especially since people might want to add e.g. _disabled suffix to an image and expect it to be invisible to us. So for the moment I'd keep the hardcoded lists. If testcloud is able to handle that (after D898), the expression ending could perhaps be something like \.(qcow2|raw|img)(\.xz)?$.

jskladan commandeered this revision.Jan 13 2017, 2:03 PM
jskladan abandoned this revision.
jskladan edited reviewers, added: lnie; removed: jskladan.

Abandoning, as there was no change on this for half a year