From 00e06c3d1ffb7044be502a417f07dc0c558192e6 Mon Sep 17 00:00:00 2001 From: Kamil Páral Date: Jul 31 2017 12:22:16 +0000 Subject: rename dirs --- diff --git a/artifacts/LICENSE b/artifacts/LICENSE new file mode 100644 index 0000000..d159169 --- /dev/null +++ b/artifacts/LICENSE @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/artifacts/README.rst b/artifacts/README.rst new file mode 100644 index 0000000..2105766 --- /dev/null +++ b/artifacts/README.rst @@ -0,0 +1,17 @@ +exampleartifacts +================ + +This is an example task for `Taskotron `_ +that functions but doesn't actually do any useful work. + +The task takes in a bodhi update id, does nothing with it and creates an empty file +in the artifacts directory as a made-up task result. + +Standalone you can run it like this (replace NVR with something currently +in Bodhi):: + + $ ./run_exampleartifacts.py tigervnc-1.3.0-14.fc20 x86_64 + +Through taskotron runner you can run it like this:: + + $ runtask -i tigervnc-1.3.0-14.fc20 -t bodhi_id -a x86_64 runtask.yml diff --git a/artifacts/run_exampleartifacts.py b/artifacts/run_exampleartifacts.py new file mode 100755 index 0000000..7c2bb8b --- /dev/null +++ b/artifacts/run_exampleartifacts.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python + +import sys +import tempfile + +from libtaskotron import check + +def run(updateid='', arch='noarch', artifactsdir=u'.'): + """Runs an example task on a given bodhi update. Creates a file in the artifacts + directory. + + :param updateid: the bodhi update id to use + :type updateid: str + :param arch: the arch of packages to inspect + :type arch: str + :returns: TAP output representing the update and its contained builds + """ + + try: + tempfile.mkstemp(prefix="task-", dir=artifactsdir) + detail = check.CheckDetail(item=updateid, + report_type=check.ReportType.BODHI_UPDATE, + outcome='PASSED', + note='A file was created') + except Exception: + # if for any reason tempfile.mkstemp fails, just report the task as FAILED + detail = check.CheckDetail(item=updateid, + report_type=check.ReportType.BODHI_UPDATE, + outcome='FAILED', + note='A file failed to be created') + + return check.export_YAML(detail) + + +if __name__ == '__main__': + if len(sys.argv) != 3: + print 'USAGE: %s BODHI_UPDATEID ARCH' % sys.argv[0] + sys.exit(1) + + updateid = sys.argv[1] + arch = sys.argv[2] + + print "running exampleartifacts for update %s, arch %s" % (updateid, arch) + output = run(updateid, arch) + + print output diff --git a/artifacts/runtask.yml b/artifacts/runtask.yml new file mode 100644 index 0000000..162af30 --- /dev/null +++ b/artifacts/runtask.yml @@ -0,0 +1,24 @@ +--- +name: exampleartifacts +desc: "Creates a file in the artifacts directory." +maintainer: mkrizek + +input: + args: + - bodhi_id + - arch + +actions: + - name: run exampleartifacts + python: + file: run_exampleartifacts.py + callable: run + updateid: ${bodhi_id} + arch: ${arch} + artifactsdir: ${artifactsdir} + export: exampleartifacts_output + + - name: report results to resultsdb + resultsdb: + results: ${exampleartifacts_output} + diff --git a/bodhi/LICENSE b/bodhi/LICENSE new file mode 100644 index 0000000..d159169 --- /dev/null +++ b/bodhi/LICENSE @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/bodhi/README.rst b/bodhi/README.rst new file mode 100644 index 0000000..3c2cf2b --- /dev/null +++ b/bodhi/README.rst @@ -0,0 +1,17 @@ +examplebodhi +============ + +This is an example task for `Taskotron `_ +that functions but doesn't actually do any useful work. + +The task takes in a bodhi update id and assigns a PASS/FAIL value on a +pseudo-random basis. + +Standalone you can run it like this (replace NVR with something currently +in Bodhi):: + + $ ./run_examplebodhi.py testcloud-0.1.9-1.fc24 x86_64 + +Through taskotron runner you can run it like this:: + + $ runtask -i testcloud-0.1.9-1.fc24 -t bodhi_id -a x86_64 runtask.yml diff --git a/bodhi/run_examplebodhi.py b/bodhi/run_examplebodhi.py new file mode 100755 index 0000000..1e20aa7 --- /dev/null +++ b/bodhi/run_examplebodhi.py @@ -0,0 +1,71 @@ +#!/usr/bin/env python + +import sys +import random +from fedora.client import bodhi +import koji + +from libtaskotron import check + +def run(updateid='', arch='noarch'): + """Runs a trivial task on a given bodhi update. Will assign PASS/FAIL on a + pseudo-random basis + + :param updateid: the bodhi update id to use + :type updateid: str + :param arch: the arch of packages to inspect + :type arch: str + :returns: TAP output representing the update and its contained builds + """ + + bodhi_client = bodhi.BodhiClient() + koji_client = koji.ClientSession('http://koji.fedoraproject.org/kojihub') + + update = bodhi_client.query(package=updateid, limit=1) + builds = [build['nvr'] for build in update['updates'][0]['builds']] + + buildid = koji_client.getBuild(builds[0])['id'] + + # add noarch if it isn't already specified + arches = [arch] + if arch != 'noarch': + arches.append('noarch') + + nvrs = ['%s.%s' % (rpm['nvr'], rpm['arch']) + for rpm in koji_client.listRPMs(buildid)] + + # decide whether or not to pass or fail with ~25% fail + if random.randint(1,4) != 1: + detail = check.CheckDetail(item=updateid, + report_type=check.ReportType.BODHI_UPDATE, + outcome='PASSED', + note='PASSED by random chance') + for nvr in nvrs: + detail.store('PASS: %s' % nvr, printout=False) + return check.export_YAML(detail) + else: + detail = check.CheckDetail(item=updateid, + report_type=check.ReportType.BODHI_UPDATE, + outcome='FAILED', + note='FAILED by random chance') + for nvr in nvrs: + # make it seem a bit more organic by failing ~ 1 of 4 builds + if random.randint(1,4) != 1: + detail.store('PASS: %s' % nvr, printout=False) + else: + detail.store('FAIL: %s' % nvr, printout=False) + return check.export_YAML(detail) + + +if __name__ == '__main__': + if len(sys.argv) != 3: + print 'USAGE: %s BODHI_UPDATEID ARCH' % sys.argv[0] + sys.exit(1) + + updateid = sys.argv[1] + arch = sys.argv[2] + + print "running examplebodhi for update %s, arch %s" % (updateid, arch) + output = run(updateid, arch) + + print output diff --git a/bodhi/runtask.yml b/bodhi/runtask.yml new file mode 100644 index 0000000..40bdabe --- /dev/null +++ b/bodhi/runtask.yml @@ -0,0 +1,23 @@ +--- +name: examplebodhi +desc: "examine bodhi update and randomly generate output based on the update's contents" +maintainer: tflink + +input: + args: + - bodhi_id + - arch + +actions: + - name: run examplebodhi + python: + file: run_examplebodhi.py + callable: run + updateid: ${bodhi_id} + arch: ${arch} + export: examplebodhi_output + + - name: report results to resultsdb + resultsdb: + results: ${examplebodhi_output} + diff --git a/gzip/README.rst b/gzip/README.rst new file mode 100644 index 0000000..15debdf --- /dev/null +++ b/gzip/README.rst @@ -0,0 +1,6 @@ +Taskotron Task: example-gzip +============================ + +This is an example task for `Taskotron `_. This to showcase +a "dist-git style task", in which a specific package is tested after it is built. In this case, +some smoke checks are run for gzip. diff --git a/gzip/all_checks.sh b/gzip/all_checks.sh new file mode 100755 index 0000000..8e6423d --- /dev/null +++ b/gzip/all_checks.sh @@ -0,0 +1,56 @@ +#!/bin/bash +# A basic gzip check suite. Optionally integrated with Taskotron. +set -e + +# dir with all checks +CHECKDIR=$(dirname "$(readlink -f $0)") + +CHECKS=( +'check_gzip_gunzip.sh' +'check_keep.sh' +'check_piped.sh' +) + +# overall pass or fail mark +FAILED= + +# run all checks +for CHECK in "${CHECKS[@]}"; do + echo "===== $CHECK =====" + + if bash "$CHECKDIR/$CHECK"; then + echo "PASSED" + else + echo "FAILED" + FAILED=1 + fi +done + +# determine overall outcome +if test -n "$FAILED"; then + echo "Some checks failed ✘" + OUTCOME='FAILED' + #exit 1 +else + echo "All checks passed ✔" + OUTCOME='PASSED' + #exit 0 +fi + + +# === Taskotron integration === +# (this section can be easily disabled via env var if you need to be able +# to run the test suite standalone as well) + +# test item is passed from task formula, e.g. gzip-1.6-10.fc24 +ITEM=$1 +# where to save results, again passed from task formula +OUTFILE=$2 +# currently tested architecture. It would be better to pass it from task +# formula, but that's currently broken. +ARCH=$(uname -m) + +# save ResultsYAML file +taskotron_result --file $OUTFILE --item $ITEM --report_type koji_build \ + --outcome $OUTCOME --keyval arch=$ARCH +echo "ResultsYAML output saved to $OUTFILE" diff --git a/gzip/check_gzip_gunzip.sh b/gzip/check_gzip_gunzip.sh new file mode 100755 index 0000000..0f2d89d --- /dev/null +++ b/gzip/check_gzip_gunzip.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# smoke test for gzip compresion and decompression basic functionality + +# exit on any error +set -eo pipefail + +# work in temp dir +DIR=$(mktemp -d --tmpdir check_gz.XXXXXXXX) +cd "$DIR" + +# create files to work with +dd if=/dev/urandom of=file bs=1M count=1 +cp file file.orig + +# check compression +gzip file +test -f file.gz +! test -e file +! cmp file.gz file.orig + +# check integrity +gzip -t file.gz + +# check decompression +gunzip file.gz +test -f file +! test -e file.gz +cmp file file.orig + +# clean up +rm -rf "$DIR" diff --git a/gzip/check_keep.sh b/gzip/check_keep.sh new file mode 100755 index 0000000..b6465de --- /dev/null +++ b/gzip/check_keep.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# check gzip --keep + +# exit on any error +set -eo pipefail + +# work in temp dir +DIR=$(mktemp -d --tmpdir check_gz.XXXXXXXX) +cd "$DIR" + +# create files to work with +echo -e "Lorem ipsum dolor sit amet,\nconsectetur adipiscing elit." > file +cp file file.orig + +# check gzip --keep +gzip --keep file +test -f file +cmp file file.orig +gzip -t file.gz + +# check gunzip --keep +rm file +cp file.gz file.gz.orig +gunzip --keep file.gz +test -f file.gz +cmp file.gz file.gz.orig +cmp file file.orig + +# clean up +rm -rf "$DIR" diff --git a/gzip/check_piped.sh b/gzip/check_piped.sh new file mode 100755 index 0000000..86fdee1 --- /dev/null +++ b/gzip/check_piped.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# check gzip functionality when using piped input/output + +# exit on any error +set -eo pipefail + +# work in temp dir +DIR=$(mktemp -d --tmpdir check_gz.XXXXXXXX) +cd "$DIR" + +# create files to work with +echo -e "Lorem ipsum dolor sit amet,\nconsectetur adipiscing elit." > file + +# check piped input +cat file | gzip > file.gz +gzip -t file.gz + +# check piped output +cat file.gz | gunzip > file.new +cmp file file.new + +# clean up +rm -rf "$DIR" diff --git a/gzip/runtask.yml b/gzip/runtask.yml new file mode 100644 index 0000000..fa2bd94 --- /dev/null +++ b/gzip/runtask.yml @@ -0,0 +1,45 @@ +name: gzip +namespace: scratch +desc: run basic smoke checks of gzip +maintainer: kparal + +input: + args: + - koji_build + - arch + +environment: + rpm: + - coreutils + - diffutils + - bash + - dnf + +actions: + - name: download rpms from koji + koji: + action: download + koji_build: ${koji_build} + arch: ${arch} + target_dir: ${workdir}/rpms + + # This will require root (local execution) or a disposable minion (remote + # execution). If you want to run this locally without root, simply comment + # out this action (the checks will run against your current gzip version). + - name: install downloaded packages + shell: + - sudo dnf install -y ${workdir}/rpms/*.rpm + + - name: run gzip checks + shell: + # The first arg is what gets tested, the second arg is where to save + # results. + - [bash, all_checks.sh, '${koji_build}', '${workdir}/results.yaml'] + + - name: create a pretty html report (and save it as an artifact) + create_report: + file: ${workdir}/results.yaml + + - name: report results to resultsdb + resultsdb: + file: ${workdir}/results.yaml diff --git a/httpd-check/httpd-test.yaml b/httpd-check/httpd-test.yaml new file mode 100644 index 0000000..60148df --- /dev/null +++ b/httpd-check/httpd-test.yaml @@ -0,0 +1,50 @@ +--- +name: httpd-test +desc: "run httpd specific tasks" +maintainer: tflink + +# Don't need an environment here because we install +# everything we need as part of the task + +input: + args: + - koji_build + +actions: + - name: download rpms from koji + koji: + action: download + koji_build: ${koji_build} + arch: ['x86_64', 'noarch'] + target_dir: "${workdir}/downloaded_packages/" + + - name: mash downloaded rpms + mash: + rpmdir: "${workdir}/downloaded_packages/" + dodelta: "false" + arch: ['x86_64'] + + - name: prepare for httpd tests + python: + file: httpdtest.py + callable: prepare + envr: "${koji_build}" + workdir: "${workdir}" + export: prepare_output + + - name: report prep results to resultsdb + resultsdb: + results: ${prepare_output} + + - name: run httpd tests + python: + file: httpdtest.py + callable: run + envr: "${koji_build}" + workdir: "${workdir}" + export: task_output + + - name: report exec results to resultsdb + resultsdb: + results: ${task_output} + diff --git a/httpd-check/httpdtest.py b/httpd-check/httpdtest.py new file mode 100644 index 0000000..d6dd98c --- /dev/null +++ b/httpd-check/httpdtest.py @@ -0,0 +1,78 @@ +import logging +import subprocess +import shutil +import os + +#import pytest + +from libtaskotron import check + +log = logging.getLogger('httpdtest') +log.setLevel(logging.DEBUG) +log.addHandler(logging.NullHandler()) + +def run_shell(command, cwd=None): + p = subprocess.Popen(command, cwd=cwd) + output = p.communicate() + + if p.returncode !=0: + raise Exception("Non-Zero Return Code Detected! {}, {}".format(output[0], output[1])) + + return output + + +def prepare(envr, workdir='.'): + + detail = check.CheckDetail(envr, report_type='koji_build', outcome="PASSED") + here = os.path.dirname(os.path.abspath(__file__)) + output = [] + try: + escaped_workdir = workdir.replace('/', '\\/') + output.append(run_shell(['sed', '-i', 's/%%%basedir%%%/{}\\//'.format(escaped_workdir), '{}/localhttpd.repo'.format(here)])) + output.append(run_shell(['cp', '{}/localhttpd.repo'.format(here), '/etc/yum.repos.d/localhttpd.repo'])) + + # we need newesthttpd, mod_php, mod_ssl before running the php test + installcmd = ['dnf', '--enablerepo=local-httpd-repo', '-y', 'install', 'httpd', 'mod_php', 'mod_ssl'] + output.append(run_shell(installcmd)) + shutil.copytree('{}/testcases-scripts'.format(here), '{}/testcases-scripts'.format(workdir)) + + output.append(run_shell(['systemctl', 'enable', 'httpd'])) + output.append(run_shell(['systemctl', 'start', 'httpd'])) + output.append(run_shell(['systemctl', 'restart', 'httpd'])) + except Exception, e: + log.error(e) + detail.outcome = "CRASHED" + finally: + detail.output = output + + return check.export_YAML(detail) + +FAILFAST = True +QUIET = False + +''' +-rwxr-xr-x. 1 root root 713 Feb 5 17:34 httpd_basic_auth.sh +-rwxr-xr-x. 1 root root 274 Feb 5 17:34 httpd_php.sh +-rwxr-xr-x. 1 root root 212 Feb 5 17:34 httpd_servehtml.sh +-rwxr-xr-x. 1 root root 223 Feb 5 17:34 httpd_servehtml_ssl.sh +-rwxr-xr-x. 1 root root 560 Feb 5 17:34 httpd_vhost.sh +''' + +def run(envr, workdir='.'): + details = [] + + test_list = ['httpd_basic_auth.sh', 'httpd_php.sh', 'httpd_servehtml.sh', 'httpd_servehtml_ssl.sh', 'httpd_vhost.sh'] + + for testname in test_list: + detail = check.CheckDetail(envr, report_type='koji_build', outcome="PASSED", note="{} - {}".format(envr, testname)) + output = ("ERROR","ERROR") + try: + output = run_shell(['sh','{}/testcases-scripts/httpd/{}'.format(workdir, testname)]) + except Exception: + detail.outcome = 'FAILED' + detail.note = 'FAILED: {} - {}'.format(envr, testname) + detail.output = "out: {0}\nerr: {1}".format(output[0], output[1]) + + details.append(detail) + + return check.export_YAML(details) diff --git a/httpd-check/localhttpd.repo b/httpd-check/localhttpd.repo new file mode 100644 index 0000000..6012094 --- /dev/null +++ b/httpd-check/localhttpd.repo @@ -0,0 +1,4 @@ +[local-httpd-repo] +baseurl=file://%%%basedir%%%/downloaded_packages/ +gpgcheck=false +enabled=false diff --git a/httpd-check/readme.rst b/httpd-check/readme.rst new file mode 100644 index 0000000..82a000e --- /dev/null +++ b/httpd-check/readme.rst @@ -0,0 +1,19 @@ +=============== +task-httpd-test +=============== + +This is a relatively simple task designed to be run against new builds of +apache httpd. + +To run this task, install `libtaskotron `_ +and `testcloud `_ before running the +following:: + + runtask -t koji_build -i --libvirt httpd-test.yaml + + +Credit +====== + +This task is based heavily on the `httpd test scripts written by Athmane +Madjoudj `_. diff --git a/import-to-beaker/import-to-beaker.yml b/import-to-beaker/import-to-beaker.yml new file mode 100644 index 0000000..0796a41 --- /dev/null +++ b/import-to-beaker/import-to-beaker.yml @@ -0,0 +1,25 @@ +name: import-to-beaker +desc: Import Fedora daily snapshot to Beaker +maintainer: atodorov + +input: + args: + - koji_build # make this `compose' when updates are available and update everywhere + +environment: + rpm: + - libtaskbot + - kobo + +actions: + - name: import distro in Beaker + python: + file: import.py + callable: run + koji_build: ${koji_build} + export: import_output + + - name: report results to resultsdb + resultsdb: + results: ${import_output} + diff --git a/import-to-beaker/import.py b/import-to-beaker/import.py new file mode 100644 index 0000000..dfa6e80 --- /dev/null +++ b/import-to-beaker/import.py @@ -0,0 +1,43 @@ +import os +import subprocess +from libtaskotron import check + +def run(koji_build): + """ + For the moment fedmsg messages don't contain any useful information + indicating which is the compose which was completed so we just + query the entire mash/ directory in Koji. + + (17,12,30) tflink: there's not a lot of data in the fedmsg + (17,12,46) tflink: almost none + (17,13,21) tflink: it just gives : {"arch": "arm", "branch": "rawhide", "log": "done"} + """ + try: + import kobo.xmlrpc + except ImportError: + if 0 != subprocess.call('yum -y install kobo'.split(' ')): + result = 'FAILED' + summary = '%s - yum install kobo' % result + detail = check.CheckDetail('yum install', check.ReportType.KOJI_BUILD, result, summary) + tapdetail = check.export_TAP(detail) + return tapdetail + + compose=koji_build + retcode = subprocess.call(['./sync-fedora-snapshots-from-koji-to-beaker']) + + if retcode == 0: + result = 'PASSED' + else: + result = 'FAILED' + + summary = '%s - import distro for %s' % (result, compose) + detail = check.CheckDetail(compose, check.ReportType.KOJI_BUILD, result, summary) +# todo: ReportType needs to change but there's no other suitable value in libtaskotron yet + tapdetail = check.export_TAP(detail) + return tapdetail + +if __name__ == '__main__': + tapout = run() + + for result in tapout: + print result diff --git a/import-to-beaker/readme.rst b/import-to-beaker/readme.rst new file mode 100644 index 0000000..de82863 --- /dev/null +++ b/import-to-beaker/readme.rst @@ -0,0 +1,5 @@ +Taskotron Task: import-to-beaker +============================== + +This is an example task for taskotron. It will import a Fedora snapshot distro +to Beaker. diff --git a/import-to-beaker/sync-fedora-snapshots-from-koji-to-beaker b/import-to-beaker/sync-fedora-snapshots-from-koji-to-beaker new file mode 100755 index 0000000..e9724d7 --- /dev/null +++ b/import-to-beaker/sync-fedora-snapshots-from-koji-to-beaker @@ -0,0 +1,194 @@ +#!/usr/bin/env python + +################################################################################ +# +# Copyright (c) 2014, Alexander Todorov +# +################################################################################ + +import io +import os +import sys +import time +import urllib2 +import xmlrpclib +import kobo.xmlrpc +try: + import ConfigParser as configparser +except ImportError: + import configparser + +from optparse import OptionParser + +def _get_dirname_from_link(link): + if link.find('href=') > -1: + dirname = link.split('')[0].strip('"').strip('/') + if not dirname.startswith("?") and dirname!="mash": + return dirname + + return "" + +def get_snapshot_dirs(url): + result = [] + data = urllib2.urlopen(url).read() + for line in data.split('\n'): + dir = _get_dirname_from_link(line) + if dir and ((dir.find('rawhide-') > -1) or (dir.find('branched-') > -1)): + result.append(dir) + + return result + + +def get_versions(url): + result = [] + data = urllib2.urlopen(url).read() + for line in data.split('\n'): + version = _get_dirname_from_link(line) + if version and (version != "logs"): + result.append(version) + + return result + +def get_arches(url): + result = [] + data = urllib2.urlopen(url).read() + for line in data.split('\n'): + arch = _get_dirname_from_link(line) + if arch and (arch != "source"): + result.append(arch) + + return result + +def get_treeinfo(url): + try: + data = urllib2.urlopen("%s/os/.treeinfo" % url).read() + except urllib2.HTTPError: # network error or 404 + return None + + treeinfo = configparser.RawConfigParser() + treeinfo.readfp(io.BytesIO(data)) + return treeinfo + +def make_timestamp(s_timestamp): + ts = time.gmtime(float(s_timestamp)) + return "%d%d%02d" % (ts.tm_year, ts.tm_mon, ts.tm_mday) + +def make_variant(variant): + if variant: + return variant + + return "Fedora" + +if __name__ == "__main__": + config={} + + parser = OptionParser(description="Sync Fedora snapshots between Koji and Beaker") + parser.add_option("-b", "--beaker", dest="beaker", action="store", default="http://beaker01.qa.fedoraproject.org:8000/", + help="URL of Beaker proxy, default http://beaker01.qa.fedoraproject.org:8000/") + parser.add_option("-m", "--mash", dest="mash", action="store", default="http://koji.fedoraproject.org/mash/", + help="URL of Mash, default http://koji.fedoraproject.org/mash/") + (opt, args) = parser.parse_args() + + if not opt.beaker: + print "ERROR: Beaker URL is not specified." + sys.exit(1) + opt.beaker = opt.beaker.strip('/') + + if not opt.mash: + print "ERROR: Mash URL is not specified." + sys.exit(1) + # replace koji FQDN with internal IP address b/c (maybe) it doesn't resolve properly + # inside Beaker's environment + opt.mash = opt.mash.strip('/').replace('koji.fedoraproject.org', '10.5.125.63') + + # build a transport which supports cookies. + # cookies are used for authentication + if opt.beaker.startswith("https://"): + TransportClass = kobo.xmlrpc.retry_request_decorator(kobo.xmlrpc.SafeCookieTransport) + else: + TransportClass = kobo.xmlrpc.retry_request_decorator(kobo.xmlrpc.CookieTransport) + + # Build XML-RPC object (this is Beaker Proxy, not Beaker HTTP server) + bkr = xmlrpclib.ServerProxy(opt.beaker, transport=TransportClass()) + + # get a list of all Beaker distros + bkr_distros = bkr.get_distro_trees() + distros = {} + for d in bkr_distros: + name = d['distro_name'] + arch = d['arch'] + if distros.has_key(name): + distros[name].append(arch) + else: + distros[name] = [arch] + bkr_distros = distros + + # get a list of all Fedora snapshots in mash + mash_distros = [] + for dir in get_snapshot_dirs(opt.mash): + for version in get_versions("%s/%s" % (opt.mash, dir)): + for arch in get_arches("%s/%s/%s" % (opt.mash, dir, version)): + distro = {} + treeinfo = get_treeinfo("%s/%s/%s/%s" % (opt.mash, dir, version, arch)) + + if not treeinfo: + print "WARN: No .treeinfo found under %s/%s/%s ..." % (dir, version, arch) + continue + + timestamp = make_timestamp(treeinfo.get('general', 'timestamp')) + distro['tree_build_time'] = treeinfo.get('general', 'timestamp') + + family = treeinfo.get('general', 'family').replace(' ', '') + version = treeinfo.get('general', 'version') + + distro['osmajor'] = "%s%s" % (family, version) + distro['osminor'] = 0 + + distro['name'] = "%s-%s-%s" % (family, version, timestamp) + distro['arch'] = treeinfo.get('general', 'arch') + distro['variant'] = make_variant(treeinfo.get('general', 'variant')) + + # NB: trailing / after os/ is important. + # without it Beaker dies when trying to fetch install images + repo = "%s/%s/%s/%s/os/" % (opt.mash, dir, version, arch) + distro['urls'] = [repo] + distro['repos'] = [ + { + 'repoid' : 'Fedora', + 'type' : 'variant', + 'path' : '.', + }, + { + 'repoid' : 'Fedora-debuginfo', + 'type' : 'debuginfo', + 'path' : repo.replace('/os', '/debug'), + }, + ] + + distro['images'] = [] + for (img_type, img_path) in treeinfo.items('images-%s' % distro['arch']): + if img_type in ['kernel', 'initrd', 'uimage', 'uinitrd']: + distro['images'].append({ + 'type' : img_type, + 'path' : img_path, + }) + + mash_distros.append(distro) + print "INFO: Found %s-%s" % (distro['name'], distro['arch']) + + + if not mash_distros: + print "ERROR: No distros found on mash!" + sys.exit(2) + + # loop over all distros to search for new ones + # if distro is not known to Beaker => add it + for distro in mash_distros: + name = distro['name'] + arch = distro['arch'] + if bkr_distros.has_key(name) and (arch in bkr_distros[name]): + print "INFO: %s-%s is already in Beaker!" % (name, arch) + continue + + distro_tree_id = bkr.add_distro_tree(distro) + print "INFO: Added %s-%s as %d!" % (name, arch, distro_tree_id) diff --git a/long/LICENSE b/long/LICENSE new file mode 100644 index 0000000..d159169 --- /dev/null +++ b/long/LICENSE @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/long/README b/long/README new file mode 100644 index 0000000..d77b432 --- /dev/null +++ b/long/README @@ -0,0 +1,8 @@ +examplelong +============ + +This is an example task for `Taskotron `_ +that functions but doesn't actually do any useful work. + +The task runs for a specified length of time (in seconds) and emits log messages +at specified intervals (also in seconds) diff --git a/long/run_examplelong.py b/long/run_examplelong.py new file mode 100644 index 0000000..9e8c7e0 --- /dev/null +++ b/long/run_examplelong.py @@ -0,0 +1,79 @@ +# +# run_examplelong.py +# +# Copyright 2014, Red Hat, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Authors: +# Tim Flink + +import sys +import random +import time + +from libtaskotron import check + + +def getpassfail(ratio): + if random.random() > ratio: + return False + return True + + +def run(runtime='300', loginterval='15', passratio='1.0'): + """Trivial task that outputs log messages at specified intervals and + returns a pass/fail result with the specified ratio. + + :param runtime: the time, in seconds, to run + :type time: str + :param loginterval: the interval on which to emit log messages + :type arch: str + :param passratio: the ratio to use when determining pass/fail status. Will be parsed to a float + :type passratio: str + :returns: TAP output representing the pass/fail status of the task + """ + + # jinja2 seems to not like ints in yaml, so we do strings + real_runtime = int(runtime) + real_loginterval = int(loginterval) + real_passratio = float(passratio) + + current_time = 0 + while current_time < real_runtime: + print "Emitting log message at %d of %d seconds" % (current_time, real_runtime) + current_time += real_loginterval + time.sleep(1) + + # create TAP output and decide pass/fail + detail = check.CheckDetail('examplelong task', 'bodhi_update') + if getpassfail(real_passratio): + detail.update_outcome('PASSED') + detail.note = 'examplelong PASSED by pseudo-random chance!' + else: + detail.update_outcome('FAILED') + detail.note = 'examplelong FAILED by pseudo-random chance!' + + return check.export_YAML(detail) + +if __name__ == '__main__': + runtime = sys.argv[1] + loginterval = sys.argv[2] + + print "running examplelong for %s and log interval of %s" % (runtime, loginterval) + output = run(runtime, loginterval) + + import pprint + pprint.pprint(output) diff --git a/long/runtask.yml b/long/runtask.yml new file mode 100644 index 0000000..12381d5 --- /dev/null +++ b/long/runtask.yml @@ -0,0 +1,22 @@ +--- +name: examplelong +desc: "run for a long period of time and output log messages" +maintainer: tflink + +input: + args: + - koji_build + - arch + +actions: + - name: run examplelong + python: + file: run_examplelong.py + callable: run + runtime: '300' + loginterval: '15' + export: examplelong_output + + - name: report results to resultsdb + resultsdb: + results: ${examplelong_output} diff --git a/reporting/LICENSE b/reporting/LICENSE new file mode 100644 index 0000000..d159169 --- /dev/null +++ b/reporting/LICENSE @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/reporting/README.rst b/reporting/README.rst new file mode 100644 index 0000000..860222d --- /dev/null +++ b/reporting/README.rst @@ -0,0 +1,17 @@ +example_reporting +================= + +This is an example task for `Taskotron `_ +that functions but doesn't actually do any useful work. + +The task takes in a bodhi update id and assigns a PASS/FAIL value on a +pseudo-random basis. + +Standalone you can run it like this (replace NVR with something currently +in Bodhi):: + + $ ./run_example_reporting.py -b testcloud-0.1.9-1.fc24 -a x86_64 + +Through taskotron runner you can run it like this:: + + $ runtask -i testcloud-0.1.9-1.fc24 -t bodhi_id -a x86_64 runtask.yml diff --git a/reporting/run_example_reporting.py b/reporting/run_example_reporting.py new file mode 100755 index 0000000..d27192b --- /dev/null +++ b/reporting/run_example_reporting.py @@ -0,0 +1,60 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright 2010-2014, Red Hat, Inc. +# License: GNU General Public License version 2 or later + +import random +import argparse + +from libtaskotron import check + +def run(updateid='', arch='noarch'): + """Will assign PASS/FAIL on a pseudo-random basis. + + :param updateid: the bodhi update id to use + :type updateid: str + :param arch: the arch of packages to inspect + :type arch: str + :returns: TAP output representing a result + """ + + detail = check.CheckDetail(item=updateid, + report_type=check.ReportType.BODHI_UPDATE) + + # decide whether or not to pass or fail with ~25% fail + if random.randint(1, 4) != 1: + outcome = 'PASSED' + note = 'PASSED on %s by random chance' % arch + else: + outcome = 'FAILED' + note = 'FAILED on %s by random chance' % arch + + detail.outcome = outcome + detail.note = note + + return check.export_YAML(detail) + + +def main(): + args = parse_args() + + print "running example_reporting for update %s, arch %s" % (args.bodhi_id, args.arch) + output = run(args.bodhi_id, args.arch) + + print output + + +def parse_args(): + parser = argparse.ArgumentParser( + description='Example task that reports result into ResultsDB') + parser.add_argument('-b', '--bodhi_id', required=True, + help='Bodhi update ID') + parser.add_argument('-a', '--arch', required=True, help='Arch') + + args = parser.parse_args() + + return args + + +if __name__ == '__main__': + main() diff --git a/reporting/runtask.yml b/reporting/runtask.yml new file mode 100644 index 0000000..0747735 --- /dev/null +++ b/reporting/runtask.yml @@ -0,0 +1,22 @@ +--- +name: example_reporting +desc: "randomly generate output based on the update's contents and report the result into ResultsDB" +maintainer: mkrizek + +input: + args: + - bodhi_id + - arch + +actions: + - name: run example_reporting + python: + file: run_example_reporting.py + callable: run + updateid: ${bodhi_id} + arch: ${arch} + export: example_reporting_output + + - name: report results to resultsdb + resultsdb: + results: ${example_reporting_output} diff --git a/rpmbuild/readme.rst b/rpmbuild/readme.rst new file mode 100644 index 0000000..5cbc8a6 --- /dev/null +++ b/rpmbuild/readme.rst @@ -0,0 +1,10 @@ +Taskotron Task: rpmbuild +======================= + +This is an example task for taskotron. It builds RPMs from given SRPM using +`mock http://fedoraproject.org/wiki/Projects/Mock`_ and formats the results +in TAP messages. + +While it can be run standalone, it is designed to be executed by the +`libtaskotron `_. +Please see the libtaskotron docs for details on execution. diff --git a/rpmbuild/run_rpmbuild.py b/rpmbuild/run_rpmbuild.py new file mode 100644 index 0000000..6aaadc3 --- /dev/null +++ b/rpmbuild/run_rpmbuild.py @@ -0,0 +1,75 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright 2010-2016, Red Hat, Inc. +# License: GNU General Public License version 2 or later + + +import subprocess as sub +import platform +import argparse +import logging + +from libtaskotron import check + +logger = logging.getLogger('rpmbuild') +logger.setLevel(logging.INFO) +logger.addHandler(logging.NullHandler()) + +def taskotron_get_srpm_filename(koji_directive_output): + return koji_directive_output['downloaded_rpms'][0] + + +def get_mock_root(release, arch): + buildarch = arch + if buildarch == 'noarch': + buildarch = platform.uname()[-1] + name = None + if release.startswith('fc'): + name = 'fedora' + elif release.startswith('el'): + name = 'epel' + return '%s-%s-%s' % (name, release[2:], buildarch) + + +def run(srpm_filename, arches, releases): + + details = [] + koji_build = srpm_filename.split('/')[-1][0:-8] + + for release in releases: + for arch in arches: + cmd = ['/usr/bin/mock', '-r', '%s' % get_mock_root(release, arch), '--rebuild', '%s' % srpm_filename] + + p = sub.Popen(cmd, stdout=sub.PIPE, stderr=sub.PIPE) + output, errors = p.communicate() + logger.debug(output) + logger.info(errors) + retcode = p.returncode + + result = 'FAILED' if retcode else 'PASSED' + note = 'RPMBUILD %s for SRPM %s on %s on %s' % (result, koji_build, release, arch) + details.append(check.CheckDetail(koji_build, check.ReportType.KOJI_BUILD, + result, note, output.split('\n'))) + + return check.export_YAML(details) + + +def parse_args(): + parser = argparse.ArgumentParser( + description='Task that builds rpm from srpm for taskotron testing purposes') + parser.add_argument('-s', '--srpm', required=True, + help='Source RPM to build') + parser.add_argument('-r', '--release', action='append', + required=True, help='Release to build for') + parser.add_argument('-a', '--arch', action='append', + required=True, help='Arch to build for') + + args = parser.parse_args() + + return args + + +if __name__ == '__main__': + logging.basicConfig() + args = parse_args() + print run(args.srpm, args.arch, args.release) diff --git a/rpmbuild/runtask.yml b/rpmbuild/runtask.yml new file mode 100644 index 0000000..8096f25 --- /dev/null +++ b/rpmbuild/runtask.yml @@ -0,0 +1,35 @@ +--- +name: rpmbuild +desc: download specified srpm and builds its rpms in mock +maintainer: mkrizek + +input: + args: + - koji_build + - arch + +actions: + - name: download srpm from koji + koji: + action: download + koji_build: ${koji_build} + arch: [] + src: True + export: koji_directive_output + + - name: get srpm filename + python: + file: run_rpmbuild.py + callable: taskotron_get_srpm_filename + koji_directive_output: ${koji_directive_output} + export: srpm_filename + + - name: run rpmbuild on downloaded srpm + python: + file: run_rpmbuild.py + callable: run + srpm_filename: ${srpm_filename} + arches: ${arch} + releases: + - fc24 + export: rpmbuild_output diff --git a/simple-docker/runtask.yml b/simple-docker/runtask.yml new file mode 100644 index 0000000..53473c0 --- /dev/null +++ b/simple-docker/runtask.yml @@ -0,0 +1,26 @@ +name: test httpd docker image + +environment: + rpm: + - docker + +actions: + - shell: + - systemctl start docker + + - shell: + - docker pull ${item} + + - shell: + - docker run -d -p 80:80 --name docker_test httpd + + - shell: + - sh test.sh + export: test_output + + - shell: + - docker rm -f docker_test_httpd + + - name: report + resultsdb: + results: ${test_output} diff --git a/simple-docker/test.sh b/simple-docker/test.sh new file mode 100644 index 0000000..f759194 --- /dev/null +++ b/simple-docker/test.sh @@ -0,0 +1,17 @@ +#!/bin/bash +{ + #wait for container to start + sleep 1s + #test it + curl localhost + outcome=$? + +} &> /dev/null + + +cat << EOF +results: + - item: httpd + type: docker_image + outcome: $([ "$outcome" == 0 ] && echo "PASSED" || echo "FAILED") +EOF diff --git a/task-example-gzip/README.rst b/task-example-gzip/README.rst deleted file mode 100644 index 15debdf..0000000 --- a/task-example-gzip/README.rst +++ /dev/null @@ -1,6 +0,0 @@ -Taskotron Task: example-gzip -============================ - -This is an example task for `Taskotron `_. This to showcase -a "dist-git style task", in which a specific package is tested after it is built. In this case, -some smoke checks are run for gzip. diff --git a/task-example-gzip/all_checks.sh b/task-example-gzip/all_checks.sh deleted file mode 100755 index 8e6423d..0000000 --- a/task-example-gzip/all_checks.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash -# A basic gzip check suite. Optionally integrated with Taskotron. -set -e - -# dir with all checks -CHECKDIR=$(dirname "$(readlink -f $0)") - -CHECKS=( -'check_gzip_gunzip.sh' -'check_keep.sh' -'check_piped.sh' -) - -# overall pass or fail mark -FAILED= - -# run all checks -for CHECK in "${CHECKS[@]}"; do - echo "===== $CHECK =====" - - if bash "$CHECKDIR/$CHECK"; then - echo "PASSED" - else - echo "FAILED" - FAILED=1 - fi -done - -# determine overall outcome -if test -n "$FAILED"; then - echo "Some checks failed ✘" - OUTCOME='FAILED' - #exit 1 -else - echo "All checks passed ✔" - OUTCOME='PASSED' - #exit 0 -fi - - -# === Taskotron integration === -# (this section can be easily disabled via env var if you need to be able -# to run the test suite standalone as well) - -# test item is passed from task formula, e.g. gzip-1.6-10.fc24 -ITEM=$1 -# where to save results, again passed from task formula -OUTFILE=$2 -# currently tested architecture. It would be better to pass it from task -# formula, but that's currently broken. -ARCH=$(uname -m) - -# save ResultsYAML file -taskotron_result --file $OUTFILE --item $ITEM --report_type koji_build \ - --outcome $OUTCOME --keyval arch=$ARCH -echo "ResultsYAML output saved to $OUTFILE" diff --git a/task-example-gzip/check_gzip_gunzip.sh b/task-example-gzip/check_gzip_gunzip.sh deleted file mode 100755 index 0f2d89d..0000000 --- a/task-example-gzip/check_gzip_gunzip.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -# smoke test for gzip compresion and decompression basic functionality - -# exit on any error -set -eo pipefail - -# work in temp dir -DIR=$(mktemp -d --tmpdir check_gz.XXXXXXXX) -cd "$DIR" - -# create files to work with -dd if=/dev/urandom of=file bs=1M count=1 -cp file file.orig - -# check compression -gzip file -test -f file.gz -! test -e file -! cmp file.gz file.orig - -# check integrity -gzip -t file.gz - -# check decompression -gunzip file.gz -test -f file -! test -e file.gz -cmp file file.orig - -# clean up -rm -rf "$DIR" diff --git a/task-example-gzip/check_keep.sh b/task-example-gzip/check_keep.sh deleted file mode 100755 index b6465de..0000000 --- a/task-example-gzip/check_keep.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -# check gzip --keep - -# exit on any error -set -eo pipefail - -# work in temp dir -DIR=$(mktemp -d --tmpdir check_gz.XXXXXXXX) -cd "$DIR" - -# create files to work with -echo -e "Lorem ipsum dolor sit amet,\nconsectetur adipiscing elit." > file -cp file file.orig - -# check gzip --keep -gzip --keep file -test -f file -cmp file file.orig -gzip -t file.gz - -# check gunzip --keep -rm file -cp file.gz file.gz.orig -gunzip --keep file.gz -test -f file.gz -cmp file.gz file.gz.orig -cmp file file.orig - -# clean up -rm -rf "$DIR" diff --git a/task-example-gzip/check_piped.sh b/task-example-gzip/check_piped.sh deleted file mode 100755 index 86fdee1..0000000 --- a/task-example-gzip/check_piped.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# check gzip functionality when using piped input/output - -# exit on any error -set -eo pipefail - -# work in temp dir -DIR=$(mktemp -d --tmpdir check_gz.XXXXXXXX) -cd "$DIR" - -# create files to work with -echo -e "Lorem ipsum dolor sit amet,\nconsectetur adipiscing elit." > file - -# check piped input -cat file | gzip > file.gz -gzip -t file.gz - -# check piped output -cat file.gz | gunzip > file.new -cmp file file.new - -# clean up -rm -rf "$DIR" diff --git a/task-example-gzip/runtask.yml b/task-example-gzip/runtask.yml deleted file mode 100644 index fa2bd94..0000000 --- a/task-example-gzip/runtask.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: gzip -namespace: scratch -desc: run basic smoke checks of gzip -maintainer: kparal - -input: - args: - - koji_build - - arch - -environment: - rpm: - - coreutils - - diffutils - - bash - - dnf - -actions: - - name: download rpms from koji - koji: - action: download - koji_build: ${koji_build} - arch: ${arch} - target_dir: ${workdir}/rpms - - # This will require root (local execution) or a disposable minion (remote - # execution). If you want to run this locally without root, simply comment - # out this action (the checks will run against your current gzip version). - - name: install downloaded packages - shell: - - sudo dnf install -y ${workdir}/rpms/*.rpm - - - name: run gzip checks - shell: - # The first arg is what gets tested, the second arg is where to save - # results. - - [bash, all_checks.sh, '${koji_build}', '${workdir}/results.yaml'] - - - name: create a pretty html report (and save it as an artifact) - create_report: - file: ${workdir}/results.yaml - - - name: report results to resultsdb - resultsdb: - file: ${workdir}/results.yaml diff --git a/task-example_reporting/LICENSE b/task-example_reporting/LICENSE deleted file mode 100644 index d159169..0000000 --- a/task-example_reporting/LICENSE +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/task-example_reporting/README.rst b/task-example_reporting/README.rst deleted file mode 100644 index 860222d..0000000 --- a/task-example_reporting/README.rst +++ /dev/null @@ -1,17 +0,0 @@ -example_reporting -================= - -This is an example task for `Taskotron `_ -that functions but doesn't actually do any useful work. - -The task takes in a bodhi update id and assigns a PASS/FAIL value on a -pseudo-random basis. - -Standalone you can run it like this (replace NVR with something currently -in Bodhi):: - - $ ./run_example_reporting.py -b testcloud-0.1.9-1.fc24 -a x86_64 - -Through taskotron runner you can run it like this:: - - $ runtask -i testcloud-0.1.9-1.fc24 -t bodhi_id -a x86_64 runtask.yml diff --git a/task-example_reporting/run_example_reporting.py b/task-example_reporting/run_example_reporting.py deleted file mode 100755 index d27192b..0000000 --- a/task-example_reporting/run_example_reporting.py +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright 2010-2014, Red Hat, Inc. -# License: GNU General Public License version 2 or later - -import random -import argparse - -from libtaskotron import check - -def run(updateid='', arch='noarch'): - """Will assign PASS/FAIL on a pseudo-random basis. - - :param updateid: the bodhi update id to use - :type updateid: str - :param arch: the arch of packages to inspect - :type arch: str - :returns: TAP output representing a result - """ - - detail = check.CheckDetail(item=updateid, - report_type=check.ReportType.BODHI_UPDATE) - - # decide whether or not to pass or fail with ~25% fail - if random.randint(1, 4) != 1: - outcome = 'PASSED' - note = 'PASSED on %s by random chance' % arch - else: - outcome = 'FAILED' - note = 'FAILED on %s by random chance' % arch - - detail.outcome = outcome - detail.note = note - - return check.export_YAML(detail) - - -def main(): - args = parse_args() - - print "running example_reporting for update %s, arch %s" % (args.bodhi_id, args.arch) - output = run(args.bodhi_id, args.arch) - - print output - - -def parse_args(): - parser = argparse.ArgumentParser( - description='Example task that reports result into ResultsDB') - parser.add_argument('-b', '--bodhi_id', required=True, - help='Bodhi update ID') - parser.add_argument('-a', '--arch', required=True, help='Arch') - - args = parser.parse_args() - - return args - - -if __name__ == '__main__': - main() diff --git a/task-example_reporting/runtask.yml b/task-example_reporting/runtask.yml deleted file mode 100644 index 0747735..0000000 --- a/task-example_reporting/runtask.yml +++ /dev/null @@ -1,22 +0,0 @@ ---- -name: example_reporting -desc: "randomly generate output based on the update's contents and report the result into ResultsDB" -maintainer: mkrizek - -input: - args: - - bodhi_id - - arch - -actions: - - name: run example_reporting - python: - file: run_example_reporting.py - callable: run - updateid: ${bodhi_id} - arch: ${arch} - export: example_reporting_output - - - name: report results to resultsdb - resultsdb: - results: ${example_reporting_output} diff --git a/task-exampleartifacts/LICENSE b/task-exampleartifacts/LICENSE deleted file mode 100644 index d159169..0000000 --- a/task-exampleartifacts/LICENSE +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/task-exampleartifacts/README.rst b/task-exampleartifacts/README.rst deleted file mode 100644 index 2105766..0000000 --- a/task-exampleartifacts/README.rst +++ /dev/null @@ -1,17 +0,0 @@ -exampleartifacts -================ - -This is an example task for `Taskotron `_ -that functions but doesn't actually do any useful work. - -The task takes in a bodhi update id, does nothing with it and creates an empty file -in the artifacts directory as a made-up task result. - -Standalone you can run it like this (replace NVR with something currently -in Bodhi):: - - $ ./run_exampleartifacts.py tigervnc-1.3.0-14.fc20 x86_64 - -Through taskotron runner you can run it like this:: - - $ runtask -i tigervnc-1.3.0-14.fc20 -t bodhi_id -a x86_64 runtask.yml diff --git a/task-exampleartifacts/run_exampleartifacts.py b/task-exampleartifacts/run_exampleartifacts.py deleted file mode 100755 index 7c2bb8b..0000000 --- a/task-exampleartifacts/run_exampleartifacts.py +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env python - -import sys -import tempfile - -from libtaskotron import check - -def run(updateid='', arch='noarch', artifactsdir=u'.'): - """Runs an example task on a given bodhi update. Creates a file in the artifacts - directory. - - :param updateid: the bodhi update id to use - :type updateid: str - :param arch: the arch of packages to inspect - :type arch: str - :returns: TAP output representing the update and its contained builds - """ - - try: - tempfile.mkstemp(prefix="task-", dir=artifactsdir) - detail = check.CheckDetail(item=updateid, - report_type=check.ReportType.BODHI_UPDATE, - outcome='PASSED', - note='A file was created') - except Exception: - # if for any reason tempfile.mkstemp fails, just report the task as FAILED - detail = check.CheckDetail(item=updateid, - report_type=check.ReportType.BODHI_UPDATE, - outcome='FAILED', - note='A file failed to be created') - - return check.export_YAML(detail) - - -if __name__ == '__main__': - if len(sys.argv) != 3: - print 'USAGE: %s BODHI_UPDATEID ARCH' % sys.argv[0] - sys.exit(1) - - updateid = sys.argv[1] - arch = sys.argv[2] - - print "running exampleartifacts for update %s, arch %s" % (updateid, arch) - output = run(updateid, arch) - - print output diff --git a/task-exampleartifacts/runtask.yml b/task-exampleartifacts/runtask.yml deleted file mode 100644 index 162af30..0000000 --- a/task-exampleartifacts/runtask.yml +++ /dev/null @@ -1,24 +0,0 @@ ---- -name: exampleartifacts -desc: "Creates a file in the artifacts directory." -maintainer: mkrizek - -input: - args: - - bodhi_id - - arch - -actions: - - name: run exampleartifacts - python: - file: run_exampleartifacts.py - callable: run - updateid: ${bodhi_id} - arch: ${arch} - artifactsdir: ${artifactsdir} - export: exampleartifacts_output - - - name: report results to resultsdb - resultsdb: - results: ${exampleartifacts_output} - diff --git a/task-examplebodhi/LICENSE b/task-examplebodhi/LICENSE deleted file mode 100644 index d159169..0000000 --- a/task-examplebodhi/LICENSE +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/task-examplebodhi/README.rst b/task-examplebodhi/README.rst deleted file mode 100644 index 3c2cf2b..0000000 --- a/task-examplebodhi/README.rst +++ /dev/null @@ -1,17 +0,0 @@ -examplebodhi -============ - -This is an example task for `Taskotron `_ -that functions but doesn't actually do any useful work. - -The task takes in a bodhi update id and assigns a PASS/FAIL value on a -pseudo-random basis. - -Standalone you can run it like this (replace NVR with something currently -in Bodhi):: - - $ ./run_examplebodhi.py testcloud-0.1.9-1.fc24 x86_64 - -Through taskotron runner you can run it like this:: - - $ runtask -i testcloud-0.1.9-1.fc24 -t bodhi_id -a x86_64 runtask.yml diff --git a/task-examplebodhi/run_examplebodhi.py b/task-examplebodhi/run_examplebodhi.py deleted file mode 100755 index 1e20aa7..0000000 --- a/task-examplebodhi/run_examplebodhi.py +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env python - -import sys -import random -from fedora.client import bodhi -import koji - -from libtaskotron import check - -def run(updateid='', arch='noarch'): - """Runs a trivial task on a given bodhi update. Will assign PASS/FAIL on a - pseudo-random basis - - :param updateid: the bodhi update id to use - :type updateid: str - :param arch: the arch of packages to inspect - :type arch: str - :returns: TAP output representing the update and its contained builds - """ - - bodhi_client = bodhi.BodhiClient() - koji_client = koji.ClientSession('http://koji.fedoraproject.org/kojihub') - - update = bodhi_client.query(package=updateid, limit=1) - builds = [build['nvr'] for build in update['updates'][0]['builds']] - - buildid = koji_client.getBuild(builds[0])['id'] - - # add noarch if it isn't already specified - arches = [arch] - if arch != 'noarch': - arches.append('noarch') - - nvrs = ['%s.%s' % (rpm['nvr'], rpm['arch']) - for rpm in koji_client.listRPMs(buildid)] - - # decide whether or not to pass or fail with ~25% fail - if random.randint(1,4) != 1: - detail = check.CheckDetail(item=updateid, - report_type=check.ReportType.BODHI_UPDATE, - outcome='PASSED', - note='PASSED by random chance') - for nvr in nvrs: - detail.store('PASS: %s' % nvr, printout=False) - return check.export_YAML(detail) - else: - detail = check.CheckDetail(item=updateid, - report_type=check.ReportType.BODHI_UPDATE, - outcome='FAILED', - note='FAILED by random chance') - for nvr in nvrs: - # make it seem a bit more organic by failing ~ 1 of 4 builds - if random.randint(1,4) != 1: - detail.store('PASS: %s' % nvr, printout=False) - else: - detail.store('FAIL: %s' % nvr, printout=False) - return check.export_YAML(detail) - - -if __name__ == '__main__': - if len(sys.argv) != 3: - print 'USAGE: %s BODHI_UPDATEID ARCH' % sys.argv[0] - sys.exit(1) - - updateid = sys.argv[1] - arch = sys.argv[2] - - print "running examplebodhi for update %s, arch %s" % (updateid, arch) - output = run(updateid, arch) - - print output diff --git a/task-examplebodhi/runtask.yml b/task-examplebodhi/runtask.yml deleted file mode 100644 index 40bdabe..0000000 --- a/task-examplebodhi/runtask.yml +++ /dev/null @@ -1,23 +0,0 @@ ---- -name: examplebodhi -desc: "examine bodhi update and randomly generate output based on the update's contents" -maintainer: tflink - -input: - args: - - bodhi_id - - arch - -actions: - - name: run examplebodhi - python: - file: run_examplebodhi.py - callable: run - updateid: ${bodhi_id} - arch: ${arch} - export: examplebodhi_output - - - name: report results to resultsdb - resultsdb: - results: ${examplebodhi_output} - diff --git a/task-examplelong/LICENSE b/task-examplelong/LICENSE deleted file mode 100644 index d159169..0000000 --- a/task-examplelong/LICENSE +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/task-examplelong/README b/task-examplelong/README deleted file mode 100644 index d77b432..0000000 --- a/task-examplelong/README +++ /dev/null @@ -1,8 +0,0 @@ -examplelong -============ - -This is an example task for `Taskotron `_ -that functions but doesn't actually do any useful work. - -The task runs for a specified length of time (in seconds) and emits log messages -at specified intervals (also in seconds) diff --git a/task-examplelong/run_examplelong.py b/task-examplelong/run_examplelong.py deleted file mode 100644 index 9e8c7e0..0000000 --- a/task-examplelong/run_examplelong.py +++ /dev/null @@ -1,79 +0,0 @@ -# -# run_examplelong.py -# -# Copyright 2014, Red Hat, Inc -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Authors: -# Tim Flink - -import sys -import random -import time - -from libtaskotron import check - - -def getpassfail(ratio): - if random.random() > ratio: - return False - return True - - -def run(runtime='300', loginterval='15', passratio='1.0'): - """Trivial task that outputs log messages at specified intervals and - returns a pass/fail result with the specified ratio. - - :param runtime: the time, in seconds, to run - :type time: str - :param loginterval: the interval on which to emit log messages - :type arch: str - :param passratio: the ratio to use when determining pass/fail status. Will be parsed to a float - :type passratio: str - :returns: TAP output representing the pass/fail status of the task - """ - - # jinja2 seems to not like ints in yaml, so we do strings - real_runtime = int(runtime) - real_loginterval = int(loginterval) - real_passratio = float(passratio) - - current_time = 0 - while current_time < real_runtime: - print "Emitting log message at %d of %d seconds" % (current_time, real_runtime) - current_time += real_loginterval - time.sleep(1) - - # create TAP output and decide pass/fail - detail = check.CheckDetail('examplelong task', 'bodhi_update') - if getpassfail(real_passratio): - detail.update_outcome('PASSED') - detail.note = 'examplelong PASSED by pseudo-random chance!' - else: - detail.update_outcome('FAILED') - detail.note = 'examplelong FAILED by pseudo-random chance!' - - return check.export_YAML(detail) - -if __name__ == '__main__': - runtime = sys.argv[1] - loginterval = sys.argv[2] - - print "running examplelong for %s and log interval of %s" % (runtime, loginterval) - output = run(runtime, loginterval) - - import pprint - pprint.pprint(output) diff --git a/task-examplelong/runtask.yml b/task-examplelong/runtask.yml deleted file mode 100644 index 12381d5..0000000 --- a/task-examplelong/runtask.yml +++ /dev/null @@ -1,22 +0,0 @@ ---- -name: examplelong -desc: "run for a long period of time and output log messages" -maintainer: tflink - -input: - args: - - koji_build - - arch - -actions: - - name: run examplelong - python: - file: run_examplelong.py - callable: run - runtime: '300' - loginterval: '15' - export: examplelong_output - - - name: report results to resultsdb - resultsdb: - results: ${examplelong_output} diff --git a/task-httpd-check/httpd-test.yaml b/task-httpd-check/httpd-test.yaml deleted file mode 100644 index 60148df..0000000 --- a/task-httpd-check/httpd-test.yaml +++ /dev/null @@ -1,50 +0,0 @@ ---- -name: httpd-test -desc: "run httpd specific tasks" -maintainer: tflink - -# Don't need an environment here because we install -# everything we need as part of the task - -input: - args: - - koji_build - -actions: - - name: download rpms from koji - koji: - action: download - koji_build: ${koji_build} - arch: ['x86_64', 'noarch'] - target_dir: "${workdir}/downloaded_packages/" - - - name: mash downloaded rpms - mash: - rpmdir: "${workdir}/downloaded_packages/" - dodelta: "false" - arch: ['x86_64'] - - - name: prepare for httpd tests - python: - file: httpdtest.py - callable: prepare - envr: "${koji_build}" - workdir: "${workdir}" - export: prepare_output - - - name: report prep results to resultsdb - resultsdb: - results: ${prepare_output} - - - name: run httpd tests - python: - file: httpdtest.py - callable: run - envr: "${koji_build}" - workdir: "${workdir}" - export: task_output - - - name: report exec results to resultsdb - resultsdb: - results: ${task_output} - diff --git a/task-httpd-check/httpdtest.py b/task-httpd-check/httpdtest.py deleted file mode 100644 index d6dd98c..0000000 --- a/task-httpd-check/httpdtest.py +++ /dev/null @@ -1,78 +0,0 @@ -import logging -import subprocess -import shutil -import os - -#import pytest - -from libtaskotron import check - -log = logging.getLogger('httpdtest') -log.setLevel(logging.DEBUG) -log.addHandler(logging.NullHandler()) - -def run_shell(command, cwd=None): - p = subprocess.Popen(command, cwd=cwd) - output = p.communicate() - - if p.returncode !=0: - raise Exception("Non-Zero Return Code Detected! {}, {}".format(output[0], output[1])) - - return output - - -def prepare(envr, workdir='.'): - - detail = check.CheckDetail(envr, report_type='koji_build', outcome="PASSED") - here = os.path.dirname(os.path.abspath(__file__)) - output = [] - try: - escaped_workdir = workdir.replace('/', '\\/') - output.append(run_shell(['sed', '-i', 's/%%%basedir%%%/{}\\//'.format(escaped_workdir), '{}/localhttpd.repo'.format(here)])) - output.append(run_shell(['cp', '{}/localhttpd.repo'.format(here), '/etc/yum.repos.d/localhttpd.repo'])) - - # we need newesthttpd, mod_php, mod_ssl before running the php test - installcmd = ['dnf', '--enablerepo=local-httpd-repo', '-y', 'install', 'httpd', 'mod_php', 'mod_ssl'] - output.append(run_shell(installcmd)) - shutil.copytree('{}/testcases-scripts'.format(here), '{}/testcases-scripts'.format(workdir)) - - output.append(run_shell(['systemctl', 'enable', 'httpd'])) - output.append(run_shell(['systemctl', 'start', 'httpd'])) - output.append(run_shell(['systemctl', 'restart', 'httpd'])) - except Exception, e: - log.error(e) - detail.outcome = "CRASHED" - finally: - detail.output = output - - return check.export_YAML(detail) - -FAILFAST = True -QUIET = False - -''' --rwxr-xr-x. 1 root root 713 Feb 5 17:34 httpd_basic_auth.sh --rwxr-xr-x. 1 root root 274 Feb 5 17:34 httpd_php.sh --rwxr-xr-x. 1 root root 212 Feb 5 17:34 httpd_servehtml.sh --rwxr-xr-x. 1 root root 223 Feb 5 17:34 httpd_servehtml_ssl.sh --rwxr-xr-x. 1 root root 560 Feb 5 17:34 httpd_vhost.sh -''' - -def run(envr, workdir='.'): - details = [] - - test_list = ['httpd_basic_auth.sh', 'httpd_php.sh', 'httpd_servehtml.sh', 'httpd_servehtml_ssl.sh', 'httpd_vhost.sh'] - - for testname in test_list: - detail = check.CheckDetail(envr, report_type='koji_build', outcome="PASSED", note="{} - {}".format(envr, testname)) - output = ("ERROR","ERROR") - try: - output = run_shell(['sh','{}/testcases-scripts/httpd/{}'.format(workdir, testname)]) - except Exception: - detail.outcome = 'FAILED' - detail.note = 'FAILED: {} - {}'.format(envr, testname) - detail.output = "out: {0}\nerr: {1}".format(output[0], output[1]) - - details.append(detail) - - return check.export_YAML(details) diff --git a/task-httpd-check/localhttpd.repo b/task-httpd-check/localhttpd.repo deleted file mode 100644 index 6012094..0000000 --- a/task-httpd-check/localhttpd.repo +++ /dev/null @@ -1,4 +0,0 @@ -[local-httpd-repo] -baseurl=file://%%%basedir%%%/downloaded_packages/ -gpgcheck=false -enabled=false diff --git a/task-httpd-check/readme.rst b/task-httpd-check/readme.rst deleted file mode 100644 index 82a000e..0000000 --- a/task-httpd-check/readme.rst +++ /dev/null @@ -1,19 +0,0 @@ -=============== -task-httpd-test -=============== - -This is a relatively simple task designed to be run against new builds of -apache httpd. - -To run this task, install `libtaskotron `_ -and `testcloud `_ before running the -following:: - - runtask -t koji_build -i --libvirt httpd-test.yaml - - -Credit -====== - -This task is based heavily on the `httpd test scripts written by Athmane -Madjoudj `_. diff --git a/task-import-to-beaker/import-to-beaker.yml b/task-import-to-beaker/import-to-beaker.yml deleted file mode 100644 index 0796a41..0000000 --- a/task-import-to-beaker/import-to-beaker.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: import-to-beaker -desc: Import Fedora daily snapshot to Beaker -maintainer: atodorov - -input: - args: - - koji_build # make this `compose' when updates are available and update everywhere - -environment: - rpm: - - libtaskbot - - kobo - -actions: - - name: import distro in Beaker - python: - file: import.py - callable: run - koji_build: ${koji_build} - export: import_output - - - name: report results to resultsdb - resultsdb: - results: ${import_output} - diff --git a/task-import-to-beaker/import.py b/task-import-to-beaker/import.py deleted file mode 100644 index dfa6e80..0000000 --- a/task-import-to-beaker/import.py +++ /dev/null @@ -1,43 +0,0 @@ -import os -import subprocess -from libtaskotron import check - -def run(koji_build): - """ - For the moment fedmsg messages don't contain any useful information - indicating which is the compose which was completed so we just - query the entire mash/ directory in Koji. - - (17,12,30) tflink: there's not a lot of data in the fedmsg - (17,12,46) tflink: almost none - (17,13,21) tflink: it just gives : {"arch": "arm", "branch": "rawhide", "log": "done"} - """ - try: - import kobo.xmlrpc - except ImportError: - if 0 != subprocess.call('yum -y install kobo'.split(' ')): - result = 'FAILED' - summary = '%s - yum install kobo' % result - detail = check.CheckDetail('yum install', check.ReportType.KOJI_BUILD, result, summary) - tapdetail = check.export_TAP(detail) - return tapdetail - - compose=koji_build - retcode = subprocess.call(['./sync-fedora-snapshots-from-koji-to-beaker']) - - if retcode == 0: - result = 'PASSED' - else: - result = 'FAILED' - - summary = '%s - import distro for %s' % (result, compose) - detail = check.CheckDetail(compose, check.ReportType.KOJI_BUILD, result, summary) -# todo: ReportType needs to change but there's no other suitable value in libtaskotron yet - tapdetail = check.export_TAP(detail) - return tapdetail - -if __name__ == '__main__': - tapout = run() - - for result in tapout: - print result diff --git a/task-import-to-beaker/readme.rst b/task-import-to-beaker/readme.rst deleted file mode 100644 index de82863..0000000 --- a/task-import-to-beaker/readme.rst +++ /dev/null @@ -1,5 +0,0 @@ -Taskotron Task: import-to-beaker -============================== - -This is an example task for taskotron. It will import a Fedora snapshot distro -to Beaker. diff --git a/task-import-to-beaker/sync-fedora-snapshots-from-koji-to-beaker b/task-import-to-beaker/sync-fedora-snapshots-from-koji-to-beaker deleted file mode 100755 index e9724d7..0000000 --- a/task-import-to-beaker/sync-fedora-snapshots-from-koji-to-beaker +++ /dev/null @@ -1,194 +0,0 @@ -#!/usr/bin/env python - -################################################################################ -# -# Copyright (c) 2014, Alexander Todorov -# -################################################################################ - -import io -import os -import sys -import time -import urllib2 -import xmlrpclib -import kobo.xmlrpc -try: - import ConfigParser as configparser -except ImportError: - import configparser - -from optparse import OptionParser - -def _get_dirname_from_link(link): - if link.find('href=') > -1: - dirname = link.split('')[0].strip('"').strip('/') - if not dirname.startswith("?") and dirname!="mash": - return dirname - - return "" - -def get_snapshot_dirs(url): - result = [] - data = urllib2.urlopen(url).read() - for line in data.split('\n'): - dir = _get_dirname_from_link(line) - if dir and ((dir.find('rawhide-') > -1) or (dir.find('branched-') > -1)): - result.append(dir) - - return result - - -def get_versions(url): - result = [] - data = urllib2.urlopen(url).read() - for line in data.split('\n'): - version = _get_dirname_from_link(line) - if version and (version != "logs"): - result.append(version) - - return result - -def get_arches(url): - result = [] - data = urllib2.urlopen(url).read() - for line in data.split('\n'): - arch = _get_dirname_from_link(line) - if arch and (arch != "source"): - result.append(arch) - - return result - -def get_treeinfo(url): - try: - data = urllib2.urlopen("%s/os/.treeinfo" % url).read() - except urllib2.HTTPError: # network error or 404 - return None - - treeinfo = configparser.RawConfigParser() - treeinfo.readfp(io.BytesIO(data)) - return treeinfo - -def make_timestamp(s_timestamp): - ts = time.gmtime(float(s_timestamp)) - return "%d%d%02d" % (ts.tm_year, ts.tm_mon, ts.tm_mday) - -def make_variant(variant): - if variant: - return variant - - return "Fedora" - -if __name__ == "__main__": - config={} - - parser = OptionParser(description="Sync Fedora snapshots between Koji and Beaker") - parser.add_option("-b", "--beaker", dest="beaker", action="store", default="http://beaker01.qa.fedoraproject.org:8000/", - help="URL of Beaker proxy, default http://beaker01.qa.fedoraproject.org:8000/") - parser.add_option("-m", "--mash", dest="mash", action="store", default="http://koji.fedoraproject.org/mash/", - help="URL of Mash, default http://koji.fedoraproject.org/mash/") - (opt, args) = parser.parse_args() - - if not opt.beaker: - print "ERROR: Beaker URL is not specified." - sys.exit(1) - opt.beaker = opt.beaker.strip('/') - - if not opt.mash: - print "ERROR: Mash URL is not specified." - sys.exit(1) - # replace koji FQDN with internal IP address b/c (maybe) it doesn't resolve properly - # inside Beaker's environment - opt.mash = opt.mash.strip('/').replace('koji.fedoraproject.org', '10.5.125.63') - - # build a transport which supports cookies. - # cookies are used for authentication - if opt.beaker.startswith("https://"): - TransportClass = kobo.xmlrpc.retry_request_decorator(kobo.xmlrpc.SafeCookieTransport) - else: - TransportClass = kobo.xmlrpc.retry_request_decorator(kobo.xmlrpc.CookieTransport) - - # Build XML-RPC object (this is Beaker Proxy, not Beaker HTTP server) - bkr = xmlrpclib.ServerProxy(opt.beaker, transport=TransportClass()) - - # get a list of all Beaker distros - bkr_distros = bkr.get_distro_trees() - distros = {} - for d in bkr_distros: - name = d['distro_name'] - arch = d['arch'] - if distros.has_key(name): - distros[name].append(arch) - else: - distros[name] = [arch] - bkr_distros = distros - - # get a list of all Fedora snapshots in mash - mash_distros = [] - for dir in get_snapshot_dirs(opt.mash): - for version in get_versions("%s/%s" % (opt.mash, dir)): - for arch in get_arches("%s/%s/%s" % (opt.mash, dir, version)): - distro = {} - treeinfo = get_treeinfo("%s/%s/%s/%s" % (opt.mash, dir, version, arch)) - - if not treeinfo: - print "WARN: No .treeinfo found under %s/%s/%s ..." % (dir, version, arch) - continue - - timestamp = make_timestamp(treeinfo.get('general', 'timestamp')) - distro['tree_build_time'] = treeinfo.get('general', 'timestamp') - - family = treeinfo.get('general', 'family').replace(' ', '') - version = treeinfo.get('general', 'version') - - distro['osmajor'] = "%s%s" % (family, version) - distro['osminor'] = 0 - - distro['name'] = "%s-%s-%s" % (family, version, timestamp) - distro['arch'] = treeinfo.get('general', 'arch') - distro['variant'] = make_variant(treeinfo.get('general', 'variant')) - - # NB: trailing / after os/ is important. - # without it Beaker dies when trying to fetch install images - repo = "%s/%s/%s/%s/os/" % (opt.mash, dir, version, arch) - distro['urls'] = [repo] - distro['repos'] = [ - { - 'repoid' : 'Fedora', - 'type' : 'variant', - 'path' : '.', - }, - { - 'repoid' : 'Fedora-debuginfo', - 'type' : 'debuginfo', - 'path' : repo.replace('/os', '/debug'), - }, - ] - - distro['images'] = [] - for (img_type, img_path) in treeinfo.items('images-%s' % distro['arch']): - if img_type in ['kernel', 'initrd', 'uimage', 'uinitrd']: - distro['images'].append({ - 'type' : img_type, - 'path' : img_path, - }) - - mash_distros.append(distro) - print "INFO: Found %s-%s" % (distro['name'], distro['arch']) - - - if not mash_distros: - print "ERROR: No distros found on mash!" - sys.exit(2) - - # loop over all distros to search for new ones - # if distro is not known to Beaker => add it - for distro in mash_distros: - name = distro['name'] - arch = distro['arch'] - if bkr_distros.has_key(name) and (arch in bkr_distros[name]): - print "INFO: %s-%s is already in Beaker!" % (name, arch) - continue - - distro_tree_id = bkr.add_distro_tree(distro) - print "INFO: Added %s-%s as %d!" % (name, arch, distro_tree_id) diff --git a/task-rpmbuild/readme.rst b/task-rpmbuild/readme.rst deleted file mode 100644 index 5cbc8a6..0000000 --- a/task-rpmbuild/readme.rst +++ /dev/null @@ -1,10 +0,0 @@ -Taskotron Task: rpmbuild -======================= - -This is an example task for taskotron. It builds RPMs from given SRPM using -`mock http://fedoraproject.org/wiki/Projects/Mock`_ and formats the results -in TAP messages. - -While it can be run standalone, it is designed to be executed by the -`libtaskotron `_. -Please see the libtaskotron docs for details on execution. diff --git a/task-rpmbuild/run_rpmbuild.py b/task-rpmbuild/run_rpmbuild.py deleted file mode 100644 index 6aaadc3..0000000 --- a/task-rpmbuild/run_rpmbuild.py +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright 2010-2016, Red Hat, Inc. -# License: GNU General Public License version 2 or later - - -import subprocess as sub -import platform -import argparse -import logging - -from libtaskotron import check - -logger = logging.getLogger('rpmbuild') -logger.setLevel(logging.INFO) -logger.addHandler(logging.NullHandler()) - -def taskotron_get_srpm_filename(koji_directive_output): - return koji_directive_output['downloaded_rpms'][0] - - -def get_mock_root(release, arch): - buildarch = arch - if buildarch == 'noarch': - buildarch = platform.uname()[-1] - name = None - if release.startswith('fc'): - name = 'fedora' - elif release.startswith('el'): - name = 'epel' - return '%s-%s-%s' % (name, release[2:], buildarch) - - -def run(srpm_filename, arches, releases): - - details = [] - koji_build = srpm_filename.split('/')[-1][0:-8] - - for release in releases: - for arch in arches: - cmd = ['/usr/bin/mock', '-r', '%s' % get_mock_root(release, arch), '--rebuild', '%s' % srpm_filename] - - p = sub.Popen(cmd, stdout=sub.PIPE, stderr=sub.PIPE) - output, errors = p.communicate() - logger.debug(output) - logger.info(errors) - retcode = p.returncode - - result = 'FAILED' if retcode else 'PASSED' - note = 'RPMBUILD %s for SRPM %s on %s on %s' % (result, koji_build, release, arch) - details.append(check.CheckDetail(koji_build, check.ReportType.KOJI_BUILD, - result, note, output.split('\n'))) - - return check.export_YAML(details) - - -def parse_args(): - parser = argparse.ArgumentParser( - description='Task that builds rpm from srpm for taskotron testing purposes') - parser.add_argument('-s', '--srpm', required=True, - help='Source RPM to build') - parser.add_argument('-r', '--release', action='append', - required=True, help='Release to build for') - parser.add_argument('-a', '--arch', action='append', - required=True, help='Arch to build for') - - args = parser.parse_args() - - return args - - -if __name__ == '__main__': - logging.basicConfig() - args = parse_args() - print run(args.srpm, args.arch, args.release) diff --git a/task-rpmbuild/runtask.yml b/task-rpmbuild/runtask.yml deleted file mode 100644 index 8096f25..0000000 --- a/task-rpmbuild/runtask.yml +++ /dev/null @@ -1,35 +0,0 @@ ---- -name: rpmbuild -desc: download specified srpm and builds its rpms in mock -maintainer: mkrizek - -input: - args: - - koji_build - - arch - -actions: - - name: download srpm from koji - koji: - action: download - koji_build: ${koji_build} - arch: [] - src: True - export: koji_directive_output - - - name: get srpm filename - python: - file: run_rpmbuild.py - callable: taskotron_get_srpm_filename - koji_directive_output: ${koji_directive_output} - export: srpm_filename - - - name: run rpmbuild on downloaded srpm - python: - file: run_rpmbuild.py - callable: run - srpm_filename: ${srpm_filename} - arches: ${arch} - releases: - - fc24 - export: rpmbuild_output diff --git a/task-simpledocker/runtask.yml b/task-simpledocker/runtask.yml deleted file mode 100644 index 53473c0..0000000 --- a/task-simpledocker/runtask.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: test httpd docker image - -environment: - rpm: - - docker - -actions: - - shell: - - systemctl start docker - - - shell: - - docker pull ${item} - - - shell: - - docker run -d -p 80:80 --name docker_test httpd - - - shell: - - sh test.sh - export: test_output - - - shell: - - docker rm -f docker_test_httpd - - - name: report - resultsdb: - results: ${test_output} diff --git a/task-simpledocker/test.sh b/task-simpledocker/test.sh deleted file mode 100644 index f759194..0000000 --- a/task-simpledocker/test.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -{ - #wait for container to start - sleep 1s - #test it - curl localhost - outcome=$? - -} &> /dev/null - - -cat << EOF -results: - - item: httpd - type: docker_image - outcome: $([ "$outcome" == 0 ] && echo "PASSED" || echo "FAILED") -EOF