From patchwork Thu Sep 19 17:55:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Terceiro X-Patchwork-Id: 20468 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f199.google.com (mail-ve0-f199.google.com [209.85.128.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3ABFA23906 for ; Thu, 19 Sep 2013 17:55:45 +0000 (UTC) Received: by mail-ve0-f199.google.com with SMTP id db12sf9179035veb.10 for ; Thu, 19 Sep 2013 10:55:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mime-version:to:from:subject :message-id:date:reply-to:sender:errors-to:precedence :x-original-sender:x-original-authentication-results:mailing-list :list-id:list-post:list-help:list-archive:list-unsubscribe :content-type; bh=WO+WFFK5z8w9zL/PGDpKRt3XbbxTemGsMoV/q8ZR4G8=; b=TZ4w2NHc/pLNFSddgzdrqIKuQKR1ORNGp9SgHpVcgr9cpEXcmtUftO7gHRmxQJv3Nh 4z4zZB4os+Hbd208+7V7xz5rK8S7bgL0KjMWX5SEMd7yocIChvKEd8RIk2FQeG90zbwQ O1EnIkXr5pt110NpBuPGOCT3KP92uMhMtMfhghNQmMXjZPb86j5Dn22h5F0P8/bWws4m 7wltaqu/NJLJ/qnTYaMiAy1/wLUbr75VVkdetH9j5W/X8lRyKEZHZRYfZvs/BNCE7xXg EluejCfOZkbcMVDa1OWpJyG0BD6lGXmsmseZZmkzMIc3qQc6UeU/kNS9Fm+HMd+Z8eAH oMZg== X-Gm-Message-State: ALoCoQmll4DiOzOYos45R5PPXy65tImiOoLHT1lnaLIWfjL1jp+nAQZCSuWMqfKo7D8yTE7f9GKD X-Received: by 10.236.19.225 with SMTP id n61mr1113673yhn.8.1379613345038; Thu, 19 Sep 2013 10:55:45 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.30.35 with SMTP id p3ls4144741qeh.97.gmail; Thu, 19 Sep 2013 10:55:44 -0700 (PDT) X-Received: by 10.221.24.70 with SMTP id rd6mr58382vcb.42.1379613344813; Thu, 19 Sep 2013 10:55:44 -0700 (PDT) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id cp3si2058333vcb.133.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 19 Sep 2013 10:55:44 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.178; Received: by mail-vc0-f178.google.com with SMTP id ha12so6673365vcb.37 for ; Thu, 19 Sep 2013 10:55:44 -0700 (PDT) X-Received: by 10.52.76.36 with SMTP id h4mr54280vdw.46.1379613344671; Thu, 19 Sep 2013 10:55:44 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp291377vcz; Thu, 19 Sep 2013 10:55:44 -0700 (PDT) X-Received: by 10.49.25.41 with SMTP id z9mr6159878qef.72.1379613343850; Thu, 19 Sep 2013 10:55:43 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id jt20si4140950qeb.7.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 19 Sep 2013 10:55:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1VMiS6-0002Ow-6z for ; Thu, 19 Sep 2013 17:55:42 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 225E4E0504 for ; Thu, 19 Sep 2013 17:55:42 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: lava-test X-Launchpad-Branch: ~linaro-validation/lava-test/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 194 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-test/trunk] Rev 194: This package is obsolete Message-Id: <20130919175542.25181.84111.launchpad@ackee.canonical.com> Date: Thu, 19 Sep 2013 17:55:42 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: list X-Generated-By: Launchpad (canonical.com); Revision="16765"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: b0b444f18a53d332298242b10aeb43c680c2995e X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: noreply@launchpad.net X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , ------------------------------------------------------------ revno: 194 committer: Antonio Terceiro branch nick: trunk timestamp: Thu 2013-09-19 14:47:44 -0300 message: This package is obsolete removed: COPYING MANIFEST.in README doc/ doc/changes.rst doc/conf.py doc/index.rst doc/installation.rst doc/reference.rst doc/tests.rst doc/todo.rst doc/usage.rst examples/ examples/power-management-tests.json examples/stream.json lava_test/ lava_test/__init__.py lava_test/api/ lava_test/api/__init__.py lava_test/api/core.py lava_test/api/delegates.py lava_test/api/observers.py lava_test/commands.py lava_test/core/ lava_test/core/__init__.py lava_test/core/artifacts.py lava_test/core/config.py lava_test/core/hwprofile.py lava_test/core/installers.py lava_test/core/loader.py lava_test/core/parsers.py lava_test/core/providers.py lava_test/core/runners.py lava_test/core/swprofile.py lava_test/core/tests.py lava_test/extcmd.py lava_test/main.py lava_test/test_definitions/ lava_test/test_definitions/__init__.py lava_test/test_definitions/bluetooth_enablement.py lava_test/test_definitions/bootchart.py lava_test/test_definitions/browser_benchmarks.py lava_test/test_definitions/device_tree.py lava_test/test_definitions/e2eaudiotest.py lava_test/test_definitions/firefox.py lava_test/test_definitions/gatortests.py lava_test/test_definitions/glmark2-es2.py lava_test/test_definitions/glmemperf.py lava_test/test_definitions/gmpbench.py lava_test/test_definitions/gtkperf.py lava_test/test_definitions/insanity.py lava_test/test_definitions/leb_basic_graphics.py lava_test/test_definitions/lt_ti_lava.py lava_test/test_definitions/ltp-snowball-tests.py lava_test/test_definitions/ltp.py lava_test/test_definitions/lttng.py lava_test/test_definitions/peacekeeper/ lava_test/test_definitions/peacekeeper.py lava_test/test_definitions/peacekeeper/peacekeeper_runner.py lava_test/test_definitions/perf.py lava_test/test_definitions/posixtestsuite.py lava_test/test_definitions/pwrmgmt.py lava_test/test_definitions/pybench.py lava_test/test_definitions/render-bench.py lava_test/test_definitions/smem.py lava_test/test_definitions/spandex-gles2.py lava_test/test_definitions/stream.py lava_test/test_definitions/tiobench.py lava_test/test_definitions/tjbench.py lava_test/test_definitions/wifi_enablement.py lava_test/test_definitions/x11perf.py lava_test/test_definitions/xrestop.py lava_test/utils.py setup.cfg setup.py tests/ tests/__init__.py tests/fixtures.py tests/imposters.py tests/test_hwprofile.py tests/test_lavatest_commands.py tests/test_lavatest_test.py tests/test_lavatest_testinstaller.py tests/test_lavatest_testparser.py tests/test_lavatest_testrunner.py tests/test_providers.py tests/test_swprofile.py added: README.obsolete.txt --- lp:lava-test https://code.launchpad.net/~linaro-validation/lava-test/trunk You are subscribed to branch lp:lava-test. To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-test/trunk/+edit-subscription === removed file 'COPYING' --- COPYING 2010-08-18 15:33:32 +0000 +++ COPYING 1970-01-01 00:00:00 +0000 @@ -1,676 +0,0 @@ - - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. 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 -them 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 prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. 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. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey 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; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If 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 convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU 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 that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - 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. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -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. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - 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 -state 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 3 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, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program 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, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU 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. But first, please read -. - === removed file 'MANIFEST.in' --- MANIFEST.in 2012-02-06 15:47:49 +0000 +++ MANIFEST.in 1970-01-01 00:00:00 +0000 @@ -1,2 +0,0 @@ -include COPYING -include README === removed file 'README' --- README 2011-09-12 09:19:10 +0000 +++ README 1970-01-01 00:00:00 +0000 @@ -1,42 +0,0 @@ -Lava-test is an automated testing framework with pre-defined tests and the -ability to define additional tests as needed. Tests can be -automatically installed, executed, and the results can be parsed and -uploaded to an external server. - -How to install from the source code -=================================== - -1. Run: ./setup.py install - -How to setup from the source code for development -================================================= - -1. Run: ./setup.py develop --user - -NOTE: You will get an error regarding "ImportError: No module named versiontools". It is a know error. The workaround is -run the setup.py again - -2. Run: ./setup.py develop --user - -This will put your development branch is in the python path and the scripts in /.local/bin - -3. Add /.local.bin in your PATH - - -To install built-in tests -========================= -1. Run: lava-test list-tests -2. Run: lava-test install - -To install tests inside a python package -======================================== -1. Get the test code from bzr branch lp:~linaro-graphics-wg/+junk/linaro-graphics-wg-tests -2. Install the tests into python packages manager. ./setup.py install -3. Run: lava-test list-tests - - -To install test define with a json file -======================================= -1. Run: lava-test register-test file://localhost/<..>/examples/stream.json -2. Run: lava-test list-tests - === added file 'README.obsolete.txt' --- README.obsolete.txt 1970-01-01 00:00:00 +0000 +++ README.obsolete.txt 2013-09-19 17:47:44 +0000 @@ -0,0 +1,3 @@ +This package is obsolete. + +See http://git.linaro.org/gitweb?p=lava/lava-test.git instead === removed directory 'doc' === removed file 'doc/changes.rst' --- doc/changes.rst 2013-01-30 04:27:59 +0000 +++ doc/changes.rst 1970-01-01 00:00:00 +0000 @@ -1,167 +0,0 @@ -Version History -*************** - -.. _version_0_14: - -Version 0.14 -============ -* bug fix to pwrmgmt test - -.. _version_0_13: - -Version 0.13 -============ -* Added browser_benchmarks test -* lt_ti_lava dependencies added for audio testing - -.. _version_0_12: - -Version 0.12 -============ -* added wget as a dependency to lt_ti_lava test - -.. _version_0_11: - -Version 0.11 -============ -* Add Validation test suite for TI ARM features on Linux (lt_ti_lava) -* Add support for BZR/Git VCS info in the software context -* Add test for device tree - -.. _version_0_10: - -Version 0.10 -============ - -* Fixed ltp-snowball-tests install steps -* Changed ltp-snowball-tests default test suite. -* Update to 20120614 version of LTP -* gatortest fixes -* pwrmgmt fixes -* perf fixes - -.. _version_0_9: - -Version 0.9 -=========== - -* Fix installation of pm-qa tests (bug #1004499). -* Add a simple setup.cfg to work around packaging problems. -* Changed ltp-snowball-tests default test suite. -* Fixed dependencies of ltp test. - -.. _version_0_8: - -Version 0.8 -=========== - -* Create dashboard bundles with the 1.3 format for simplified tag support - in the dispatcher (so that test results can carry tags) -* Fix pwrmgmt test dependencies. -* Set DEBIAN_FRONTEND=noninteractive when installing test dependencies (bug - #1002285) - -.. _version_0_7: - -Version 0.7 -=========== - -* Add perf test -* Add tjbench test - -.. _version_0_6: - -Version 0.6 -=========== - -* Merge two fix-annoyances branches with lots of changes: -* Add e2eaudio test from the multimedia wg -* Add spandex-gles2 test definition. -* Add render-bench test definition. -* Add test definition for the glmark2-es2 benchmark. -* Fix incorrect logging.debug() format message -* Added reset command -* Merge support for --vebose -* Fix and re-enable Cache class -* Make lava-test usable inside a virtualenv. -* Allow the user to pre-define analyzer_assigned_uuid -* Add gatortests from dmstubbs. These tests initially check the apt-get process - for installing the gator module and gatord used for DS-5 streamline support. - The tests also check the module is inserted and that gatord is running. - -.. _version_0_5: - -Version 0.5 -=========== - - * Allow users to override ``analyzer_assigned_uuid`` by passing - ``--analyzer-assigned-uuid`` to the run command. This change fixes - https://bugs.launchpad.net/lava-dispatcher/+bug/934164 - * Improved error output when running inside virtualenv where the apt and - lsb_release modules are not visible to python. - * Enabled URL cache used by the ``lava-test register`` command. - * Add command line switch ``--verbose`` that turns on lots of messages - * Add new GLMark2 ES2 test (glmark2-es2) - * Add new render-bench test - * Add spandex-gles2 test - * Add e2eaudiotest test - * Document :meth:`lava_test.api.core.ITest.run()` and - :attr:`lava_test.api.core.ITest.test_id`. This change fixes - https://bugs.launchpad.net/lava-test/+bug/919268 - * Remove a lot of PEP8 issues from the code - -.. _version_0_4: - -Version 0.4 -=========== -* new lttng test from Avik Sil -* Add wifi tests from rsalveti -* New bluetooth enablement tests from rsalveti -* New leb basic graphics tests from rsalveti -* change logging level default so that it is not so spammy - -.. _version_0_3_4: - -Version 0.3.4 -============= -* Fix exception handler for RegistryProvider._fill_cache() - https://launchpad.net/bugs/926867 - -.. _version_0_3_3: - -Version 0.3.3 -============= -* New perf test -* Fix dependencies for pwrmgmt and ltp tests -* Fix bug 898092 - More detail error messages when parsing the out of tree json file -* Added some documentation for many of the testsuites - -.. _version_0_3_2: - -Version 0.3.2 -============= -* Update parse function using in LTP test suite to fix 900694 -* fix a bug with tiobench - -.. _version_0_2: - -Version 0.2 -=========== - -* Rewrite most of the code and deprecate old Abrek interfaces. This allowed us - to clean up the API, rethink some of the design and integrate the code better - with other parts of LAVA. - -* Improved documentation and code reference. LAVA Test should now have - sufficient documentation to help new users and contributors alike. - -* Support for installing and running out-of-tree tests. - -* Ability to define parsers that add new attachments. - -* Unified command line interface with other lava tools thanks to lava-tool. - -Version 0.1 -=========== - -* Initial release (as Abrek) === removed file 'doc/conf.py' --- doc/conf.py 2011-09-12 09:19:10 +0000 +++ doc/conf.py 1970-01-01 00:00:00 +0000 @@ -1,211 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Linaro JSON documentation build configuration file, created by -# sphinx-quickstart on Mon Dec 27 16:39:47 2010. -# -# This file is execfile()d with the current directory set to its containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys -import os - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.append(os.path.abspath('..')) - -# -- General configuration ----------------------------------------------------- - -# Add any Sphinx extension module names here, as strings. They can be extensions -# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = [ - 'sphinx.ext.autodoc', - 'sphinx.ext.doctest', - 'sphinx.ext.intersphinx', - 'sphinx.ext.todo', - 'sphinx.ext.coverage', - 'sphinx.ext.viewcode'] - -# Configuration for sphinx.ext.todo - -todo_include_todos = True - -# Add any paths that contain templates here, relative to this directory. -templates_path = [] - -# The suffix of source filenames. -source_suffix = '.rst' - -# The encoding of source files. -#source_encoding = 'utf-8' - -# The master toctree document. -master_doc = 'index' - -# General information about the project. -project = u'LAVA Test' -copyright = u'2010-2011, Linaro Limited' - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The short X.Y version. -import versiontools -import lava_test -version = "%d.%d" % lava_test.__version__[0:2] -# The full version, including alpha/beta/rc tags. -release = versiontools.format_version(lava_test.__version__) - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -#language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -#today = '' -# Else, today_fmt is used as the format for a strftime call. -#today_fmt = '%B %d, %Y' - -# List of documents that shouldn't be included in the build. -#unused_docs = [] - -# List of directories, relative to source directory, that shouldn't be searched -# for source files. -exclude_trees = [] - -# The reST default role (used for this markup: `text`) to use for all documents. -#default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -#add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -#add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -#show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' - -# A list of ignored prefixes for module index sorting. -#modindex_common_prefix = [] - - -# -- Options for HTML output --------------------------------------------------- - -# The theme to use for HTML and HTML Help pages. Major themes that come with -# Sphinx are currently 'default' and 'sphinxdoc'. -html_theme = 'default' - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -#html_theme_options = {} - -# Add any paths that contain custom themes here, relative to this directory. -#html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -#html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -#html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -#html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -#html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -#html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -#html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -#html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -#html_additional_pages = {} - -# If false, no module index is generated. -#html_use_modindex = True - -# If false, no index is generated. -#html_use_index = True - -# If true, the index is split into individual pages for each letter. -#html_split_index = False - -# If true, links to the reST sources are added to the pages. -#html_show_sourcelink = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -#html_use_opensearch = '' - -# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). -#html_file_suffix = '' - -# Output file base name for HTML help builder. -htmlhelp_basename = 'LAVATestDocumentation' - - -# -- Options for LaTeX output -------------------------------------------------- - -# The paper size ('letter' or 'a4'). -#latex_paper_size = 'letter' - -# The font size ('10pt', '11pt' or '12pt'). -#latex_font_size = '10pt' - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, author, documentclass [howto/manual]). -latex_documents = [ - ('index', 'LAVA Test.tex', u'LAVA Test Documentation', - u'Zygmunt Krynicki', 'manual'), -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -#latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -#latex_use_parts = False - -# Additional stuff for the LaTeX preamble. -#latex_preamble = '' - -# Documents to append as an appendix to all manuals. -#latex_appendices = [] - -# If false, no module index is generated. -#latex_use_modindex = True - - -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = {'http://docs.python.org/': None} === removed file 'doc/index.rst' --- doc/index.rst 2012-01-19 00:11:33 +0000 +++ doc/index.rst 1970-01-01 00:00:00 +0000 @@ -1,79 +0,0 @@ -======================= -LAVA Test Documentation -======================= - -LAVA Test is a wrapper framework exposing unified API and command line -interface for running arbitrary tests and storing the results in a structured -manner. - -LAVA Test is a part of the LAVA stack and can be used with other LAVA -components, most notably the dispatcher (for setting up the test environment -and controlling execution of multiple tests) and the dashboard (for storing - -.. seealso:: To learn more about LAVA see https://launchpad.net/lava - -Indices and tables -================== - -.. toctree:: - :maxdepth: 2 - - installation.rst - usage.rst - tests.rst - reference.rst - changes.rst - todo.rst - -Features -======== - -* Ability to enumerate, install, run and remove tests on a Linux-based system. -* Support for benchmarks as well as pass/fail tests. -* Support for capturing environment information such as installed software and - hardware information and recording that in a machine-readable manner. -* Store results in raw form (log files) as well as Linaro Dashboard Bundle - format that can be uploaded to the LAVA Dashboard for archiving and analysis. -* Extensible API for adding new tests (:class:`~lava_test.api.core.ITest`) or even - collections of tests (:class:`~lava_test.api.core.ITestProvider`). -* Ever-growing collection of freely available and generic tests and benchmarks - -Quickstart -========== - -This example will run on Ubuntu Lucid and beyond:: - - $ sudo add-apt-repository ppa:linaro-validation/ppa - $ sudo apt-get update - $ sudo apt-get install lava-test - $ lava-test install stream - $ lava-test run stream - -.. seealso:: For a more thorough description see :ref:`usage` -.. seealso:: For detailed installation istructions see :ref:`installation` - -Latest documentation -==================== - -This documentation my be out of date, we try to make sure that all the latest -and greatest releases are always documented on http://lava-test.readthedocs.org/ - - -Source code, bugs and patches -============================= - -The project is maintained on Launchpad at http://launchpad.net/lava-test/. - -You can get the source code with bazaar using ``bzr branch lp:lava-test``. -Patches can be submitted using Launchpad merge proposals (for introduction to -this and topic see https://help.launchpad.net/Code/Review). - -Please report all bugs at https://bugs.launchpad.net/lava-test/+filebug. - -Most of the team is usually available in ``#linaro`` on ``irc.freenode.net``. -Feel free to drop by to chat and ask questions. - - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` === removed file 'doc/installation.rst' --- doc/installation.rst 2011-09-12 09:19:10 +0000 +++ doc/installation.rst 1970-01-01 00:00:00 +0000 @@ -1,66 +0,0 @@ - -.. _installation: - -Installation -============ - -Prerequisites -^^^^^^^^^^^^^ - -The following debian packages are needed to use LAVA Test: - -* python-setuptools -* python-apt -* usbutils -* python-testrepository - for running unit tests -* python-sphinx - for building documentation - - -Installation Options -^^^^^^^^^^^^^^^^^^^^ - -There are several installation options available: - - -Using Ubuntu PPAs ------------------ - -For Ubuntu 10.04 onward there is a stable PPA (personal package archive): - -* ppa:linaro-validation/ppa - -To add a ppa to an Ubuntu system use the add-apt-repository command:: - - sudo add-apt-repository ppa:linaro-validation/ppa - -After you add the PPA you need to update your package cache:: - - sudo apt-get update - -Finally you can install the package, it is called `lava-test`:: - - sudo apt-get install lava-test - - -Using Python Package Index --------------------------- - -This package is being actively maintained and published in the `Python Package -Index `_. You can install it if you have `pip -`_ tool using just one line:: - - pip install lava-test - - -Using source tarball --------------------- - -To install from source you must first obtain a source tarball from either pypi -or from `Launchpad `_. To install the package unpack the -tarball and run:: - - python setup.py install - -You can pass ``--user`` if you prefer to do a local (non system-wide) -installation. Note that executable programs are placed in ``~/.local/bin/`` and -this directory is not on ``PATH`` by default. === removed file 'doc/reference.rst' --- doc/reference.rst 2012-01-19 00:11:33 +0000 +++ doc/reference.rst 1970-01-01 00:00:00 +0000 @@ -1,101 +0,0 @@ -.. _reference: - -========= -Reference -========= - -.. _command_reference: - -Command Reference -================= - -.. automodule:: lava_test.commands - :members: - -.. todo:: - - * Describe basic commands - * Describe arguments and options to each command in detail - -Pathnames and files -=================== - -LAVA Test uses the following files: - -* ``$XDG_CONFIG_HOME/lava_test/`` -- configuration files -* ``$XDG_DATA_HOME/lava_test/installed-tests`` -- installed test programs -* ``$XDG_DATA_HOME/lava_test/results`` -- artifacts of running tests -* ``$XDG_CACHE_HOME/lava_test/`` -- download cache - -.. _code_reference: - -Code reference -============== - -.. todo:: - - * Describe general code layout - * Describe key API integration points (on a separate page if needed for clarity) - * Provide an example test and walk the reader through the meaning of each part - -Abstract Interfaces -^^^^^^^^^^^^^^^^^^^ - -.. automodule:: lava_test.api.core - :members: - -.. automodule:: lava_test.api.delegates - :members: - -.. automodule:: lava_test.api.observers - :members: - -Test definitions and test providers -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. automodule:: lava_test.core.providers - :members: - -.. automodule:: lava_test.core.tests - :members: - -Test components (installers, runners and parsers) -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. automodule:: lava_test.core.installers - :members: - -.. automodule:: lava_test.core.runners - :members: - -.. automodule:: lava_test.core.parsers - :members: - -Core Modules -^^^^^^^^^^^^ - -.. automodule:: lava_test.core.artifacts - :members: - -.. automodule:: lava_test.core.config - :members: - -Environment Scanners -^^^^^^^^^^^^^^^^^^^^ - -.. automodule:: lava_test.core.hwprofile - :members: - -.. automodule:: lava_test.core.swprofile - :members: - -Utilities -^^^^^^^^^ - -.. automodule:: lava_test.utils - :members: - -.. automodule:: lava_test.extcmd - :members: - - === removed file 'doc/tests.rst' --- doc/tests.rst 2012-10-24 20:22:57 +0000 +++ doc/tests.rst 1970-01-01 00:00:00 +0000 @@ -1,144 +0,0 @@ -.. _test: - -=============== -Supported Tests -=============== - -The following tests are currently supported in LAVA Test: - - * `bluetooth-enablement`_ - * `bootchart`_ - * `device-tree`_ - * `e2eaudiotest`_ - * `firefox`_ - * `gatortests`_ - * `glmemperf`_ - * `gmpbench`_ - * `gtkperf`_ - * `insanity`_ - * `leb-basic-graphics`_ - * `lt_ti_lava`_ - * `ltp`_ - * `ltp-snowball-tests`_ - * `lttng`_ - * `peacekeeper`_ - * `perf`_ - * `posixtestsuite`_ - * `pwrmgmt`_ - * `pybench`_ - * `smem`_ - * `stream`_ - * `tiobench`_ - * `x11perf`_ - * `xrestop`_ - * `wifi-enablement`_ - * `browser-benchmarks`_ - -bluetooth-enablement -++++++++++++++++++++ -.. automodule:: lava_test.test_definitions.bluetooth_enablement - -bootchart -+++++++++ -.. automodule:: lava_test.test_definitions.bootchart - -device-tree -+++++++++++ -.. automodule:: lava_test.test_definitions.device_tree - -e2eaudiotest -++++++++++++ -.. automodule:: lava_test.test_definitions.e2eaudiotest - -firefox -+++++++ -.. automodule:: lava_test.test_definitions.firefox - -gatortests -++++++++++ -.. automodule:: lava_test.test_definitions.gatortests - -glmemperf -+++++++++ -.. automodule:: lava_test.test_definitions.glmemperf - -gmpbench -++++++++ -.. automodule:: lava_test.test_definitions.gmpbench - -gtkperf -+++++++ -.. automodule:: lava_test.test_definitions.gtkperf - -insanity -++++++++ -.. automodule:: lava_test.test_definitions.insanity - -leb-basic-graphics -++++++++++++++++++ -.. automodule:: lava_test.test_definitions.leb_basic_graphics - -lt_ti_lava -+++++++++ -.. automodule:: lava_test.test_definitions.lt_ti_lava - -ltp -+++ -.. automodule:: lava_test.test_definitions.ltp - -ltp-snowball-tests -+++ -.. automodule:: lava_test.test_definitions.ltp-snowball-tests - -lttng -+++++ -.. automodule:: lava_test.test_definitions.lttng - -peacekeeper -+++++++++++ -.. automodule:: lava_test.test_definitions.peacekeeper - -perf -++++ -.. automodule:: lava_test.test_definitions.perf - -posixtestsuite -++++++++++++++ -.. automodule:: lava_test.test_definitions.posixtestsuite - -pwrmgmt -+++++++ -.. automodule:: lava_test.test_definitions.pwrmgmt - -pybench -+++++++ -.. automodule:: lava_test.test_definitions.pybench - -smem -++++ -.. automodule:: lava_test.test_definitions.smem - -stream -++++++ -.. automodule:: lava_test.test_definitions.stream - -tiobench -++++++++ -.. automodule:: lava_test.test_definitions.tiobench - -x11perf -+++++++ -.. automodule:: lava_test.test_definitions.x11perf - -xrestop -+++++++ -.. automodule:: lava_test.test_definitions.xrestop - -wifi-enablement -+++++++++++++++ -.. automodule:: lava_test.test_definitions.wifi_enablement - -browser-benchmarks -+++++++++++++++ -.. automodule:: lava_test.test_definitions.browser_benchmarks - === removed file 'doc/todo.rst' --- doc/todo.rst 2011-09-12 09:19:10 +0000 +++ doc/todo.rst 1970-01-01 00:00:00 +0000 @@ -1,4 +0,0 @@ -List of items that need work -============================ - -.. todolist:: === removed file 'doc/usage.rst' --- doc/usage.rst 2012-09-12 20:08:31 +0000 +++ doc/usage.rst 1970-01-01 00:00:00 +0000 @@ -1,342 +0,0 @@ -.. _usage: - -===== -Usage -===== - -Workflow Overview -================= - -LAVA Test can be used in several different ways. Most notably those are -standalone (without the LAVA dispatcher) and managed (when LAVA Test is -installed and controlled by the LAVA dispatcher). - -Standalone usage -^^^^^^^^^^^^^^^^ - -In standalone mode a human operator installs LAVA Test on some device -(development board, laptop or other computer or a virtual machine), installs -the tests that are to be executed and then executes them manually (by manually -running LAVA test, the actual tests are non-interactive). - -Using LAVA to develop and run new tests -+++++++++++++++++++++++++++++++++++++++ - -This mode is useful for test development (adding new tests, developing custom -tests especially tailored for LAVA, etc.). Here the typical cycle depends on -how the tests is wrapped for usage by LAVA and what the test developer is -focusing on. - -While developing the actual test the typical set of commands might look like -this:: - - $ lava-test install my-custom-test - $ lava-test run my-custom-test - $ lava-test uninstall my-custom-test - -Here the developer could observe changes to the test program (that is -presumably compiled and copied somewhere by the install stage). - -Using LAVA to analyze test results -++++++++++++++++++++++++++++++++++ - -Developing the test is only half of the story. The other half is developing -LAVA Test integration code, most importantly the artefact parser / analyzer. -This part has to be implemented in python (unlike the test program that can be -implemented in any language and technology). Here the developer is focusing on -refining the parser to see if the outcome is as indented. Assuming that earlier -the developer ran the test at least once and wrote down the result identifier -the set of commands one might use is:: - - $ lava-test parse my-custom-test my-custom-test.2011-08-19T23:53:21Z | pager - -Here the developer has to pass both the identifier of the test -(``my-custom-test``) as well as the identifier of the actual result. While -currently the result identifier starts with the test identifier we wanted to -avoid magic values like that so both are needed. The test defines which -artefact parser to use. The result id is used to locate leftovers from running -that specific test at some previous point in time. - -By default parse will print the bundle to standard output for inspection. It -should be redirected to a pager for easier verification. - -.. _wrapping_existing_test_or_benchmark: - -Wrapping existing test or benchmark -=================================== - -There are three different ways you can choose from to add a test: - - * in-tree test - * out-of-tree - * declarative test - -In-Tree Test -^^^^^^^^^^^^ - -The most direct way to add a new test is to contribute patches to LAVA Test -itself. This method will simply add a new test definition to the collection of -available tests. - -This method is recommended for generic tests that rarely change and are -suitable for wide variety of hardware and software. -The advantage is that those tests can be invoked out of the box and will be -maintained by the LAVA team. The disadvantage is that all changes to those -tests need to follow Linaro development work flow, get reviewed and finally -merged. Depending on your situation this may be undesired. - -Test definitions are simply a way of telling LAVA-Test how to install a test, -run it, and interpret the results. Tests definitions are in a simplified python -format, and can be as simple as a few lines. More advanced test definitions can -be written by deriving from the base classes. - -Defining a simple test -++++++++++++++++++++++ - -**Example 1** The simplest possible example might look something like this:: - - from lava_test.core.installers import TestInstaller - from lava_test.core.runners import TestRunner - from lava_test.core.tests import Test - - RUNSTEPS = ['echo "It works!"'] - runme = TestRunner(RUNSTEPS) - testobj = Test(test_id="example1", runner=runme) - -In this example, we simply give it a list of commands to run in a shell, -provided by RUNSTEPS. We pass RUNSTEPS to create an TestRunner instance. Then -that runner is passed to create an !Test instance called 'testobj'. If you were -to save this under the test_definitions directory as 'example1.py', then run -'./lava-test run example1' from the bin directory, you would have a test result -for it under your results directory, with output saying "It works!" - -**Example 2** Usually, you will want to do more than just interact with things -already on the system. Usually a test suite needs to be installed before running -it. For this example, let's say you have a test suite you can download from -http://www.linaro.org/linarotest-0.1.tgz. NOTE: This file does not actually -exist, but is used only for example purposes:: - - from lava_test.core.installers import TestInstaller - from lava_test.core.parsers import TestParser - from lava_test.core.runners import TestRunner - from lava_test.core.tests import Test - - INSTALLSTEPS = ['tar -xzf linarotest-0.1.tgz', - 'cd linarotest-0.1', - 'make install'] - RUNSTEPS = ['cd linarotest-0.1/bin', - './runall'] - installit = TestInstaller(INSTALLSTEPS, url='http://www.linaro.org/linarotest-0.1.tgz', md5='a9cb8a348e0d8b0a8247083d37392c89f' - runit = TestRunner(RUNSTEPS) - testobj = Test(test_id="LinaroTest", version="0.1", installer=installit, runner=runit) - -Before running the test in this example, an extra installation step will take -place. Since we provided a url and md5, the file specified by the url will first -be downloaded, and the md5sum will be checked. An md5 is recommended for -checking the integrity of the download, but if it is not provided then it will -simply skip it rather than fail. Next the steps specified in INSTALLSTEPS will -be executed, and finally the steps in RUNSTEPS will be executed. - -**Example 3** A slight variation on example 2 might be a case where you want to install a test that is already in the archive. Rather than specifying a url to download the test from, you can simply do something like this instead:: - - ... - DEPS = ['linarotest'] - installit = TestInstaller(deps=DEPS) - ... - -This is also how dependencies can be specified if you have, for instance, -libraries that need to be installed before attempting to compile a test you want -to run. Those dependencies will be installed before attempting to run any steps. -In this example though, there is no need to specify a url, and no need to -specify steps to run to build from a tarball. All that is needed is to specify a -dependency which will take care of installing the test. Again, this is a -fictitious example. - -Adding Results Parsing -++++++++++++++++++++++ - -Because every test has its own way of displaying results, there is no common, -enforced way of interpreting the results from any given test. That means that -every test definition also has to define a parser so that LAVA-Test can -understand how to pick out the most useful bits of information from the output. -What we've tried to do, is make this as simple as possible for the most common -cases, while providing the tools necessary to handle more complex output. - -To start off, there are some fields you are always going to want to either pull -from the results, or define. For all tests: - -* test_case_id - This is just a field that uniquely identifies the test. This can contain letters, numbers, underscores, dashes, or periods. If you use any illegal characters, they will automatically be dropped by the TestParser base class before parsing the results. Spaces will be automatically converted to underscores. If you wish to change this behaviour, make sure that you either handle fixing the test_case_id in your parser, or override the TestParser.fixids() method. -* result - result is simply the result of the test. This applies to both qualitative as well as quantitative tests, and the meaning is specific to the test itself. The valid values for result are: "pass", "fail", "skip", or "unknown". - -For performance tests, you will also want to have the following two fields: - -* measurement - the "score" or resulting measurement from the benchmark. -* units - a string defining the units represented by the measurement in some way that will be meaningful to someone looking at the results later. - -For results parsing, it's probably easier to look at some examples. Several -tests have already been defined in the lava-test test_definitions directory -that serve as useful examples. Here are some snippits to start off though: - -**Stream example** - -The stream test does several tests to measure memory bandwidth. The relevant -portion of the output looks something like this:: - - Function Rate (MB/s) Avg time Min time Max time - Copy: 3573.4219 0.0090 0.0090 0.0094 - Scale: 3519.1727 0.0092 0.0091 0.0095 - Add: 4351.7842 0.0112 0.0110 0.0113 - Triad: 4429.2382 0.0113 0.0108 0.0125 - -So we have 4 test_case_ids here: Copy, Scale, Add, and Triad. For the result, we -will just use pass for everything. Optionally though, if there were some -threshold under which we knew it would be considered a fail, we could detect -that and have it fail in that case. The number we really care about in the -results is the rate, which has a units of (MB/s). - -First we need a pattern to match the lines and yield the test_case_id and the -measurement:: - - PATTERN = "^(?P\w+):\W+(?P\d+\.\d+)" - -Passing this pattern when initializing an TestParser object will help it to find -the test_case_id and measurement from the lines that have it, while not matching -on any other lines. We also want to append the pass result, and units to each -test result found. There's a helper for that when creating the TestParser object -called appendall, that lets you give it a dict of values to append to all test -results found at parse time. The full line to create the parser would be:: - - streamparser = lava_test.core.parsers.TestParser(PATTERN, appendall={'units':'MB/s', 'result':'pass'}) - -For the complete code, see the stream test definition in LAVA-Test. - -**LTP** - -Another useful case to look at is LTP, because it is a qualitative test with -several possible result codes. The TestParser also supports being created with a -fixupdict, which takes a dict of result strings to match to the valid Lava-test -result strings. For instance, LTP has result strings such as "TPASS", "TFAIL", -"TCONF", "TBROK", which the dashboard will now accept:: - - FIXUPS = {"TBROK":"fail", - "TCONF":"skip", - "TFAIL":"fail", - "TINFO":"unknown", - "TPASS":"pass", - "TWARN":"unknown"} - -Now when creating the TestParser object, we can call it with fixupdict = FIXUPS -so that it knows how to properly translate the result strings. - -The full LTP test definition actually derives its own TestParser class to deal -with additional peculiarities of LTP output. This is sometimes necessary, but as -common features are found that would make it possible to eliminate or simplify -cases like this, they should be merged into the Lava-test libraries. - -Out-Of-Tree Test -^^^^^^^^^^^^^^^^ - -For some kinds of tests (proprietary, non-generic, in rapid development, fused -with application code) contributing their definition to upstream LAVA Test -project would be impractical. - -In such cases the test maintainer can still leverage LAVA to actually run and -process the test without being entangled in the review process or going through -any public channel. - -Because LAVA Test supports pluggable test providers it is easy to add a new -source of test definitions. Fortunately we ship with a very useful generic -out-of-tree test provider based on the python `pkg_resources` system. - -Any python package (that is a module or package and the corresponding setup.py -and .egg_info) can define LAVA Test extensions using the `pkg_resurces` entry -points system. - -To do this write your test program as you normally would, write the LAVA Test -integration code and put this into your integration package setup.py:: - - setup( - ..., - entry_points="""[lava_test.test_definitions] - my_test_id=my_package.my_module - """) - -Here we'd define an entry point in the ``lava_test.test_definitions`` namespace -that LAVA Test searches by default. In that namespace we define one object -``my_test_id`` which points at the module ``my_package.my_module``. LAVA Test -will discover this entry point, import the relevant module and make the test -definition available. - -Declarative Test -^^^^^^^^^^^^^^^^ - -As you can in the most simple example of an in-tree test, there is very little -python required of the user. Declarative tests allow you to define these bits -in a JSON format that LAVA can use. This can be a nice alternative to an -out-of-tree test. Some examples of declarative tests are: - -Pass/Fail -+++++++++ -If you have a test that prints out PASS/FAIL messages, your json could be:: - - { - "format": "Lava-Test Test Definition 1.0", - "test_id": "bigLITTLE", - "run": { - "steps": ["/bin/echo cache-coherency-switching : FAIL"] - }, - "parse": { - "pattern": "(?P.*-*)\\s+:\\s+(?P(PASS|FAIL))", - "fixupdict": { - "PASS": "pass", - "FAIL": "fail" - } - } - } - -Stream -++++++ -This does the equivalent of the in-tree stream test:: - - { - "format": "LAVA-Test Test Definition Format", - "test_id": "stream-json", - "install": { - "url": "http://www.cs.virginia.edu/stream/FTP/Code/stream.c", - "steps": ["cc stream.c -O2 -fopenmp -o stream"] - }, - "run": { - "steps": ["./stream"] - }, - "parse": { - "pattern": "^(?P\\w+):\\W+(?P\\d+\\.\\d+)", - "appendall": { - "units": "MB/s", - "result": "pass" - } - } - } - -Executing a Declarative Test -++++++++++++++++++++++++++++ - -The main difference with declarative tests is that you must register them with -lava-test so that it knows about it. You can do this with:: - - lava-test register-test $TEST_DEF_URL - -Then you do the standard:: - - lava-test install - lava-test run - -Writing new tests from scratch -============================== - -The thing to keep in mind with lava-test is that its not intended to be a -test framework itself. So the best advice is to build your test the best way -you see fit. Then make a thin wrapper for lava-test using one the three methods -described in the previous section. - -The most important thing is to make your tests output its results on a single -line. This makes declaring the parsing for lava-test much easier. === removed directory 'examples' === removed file 'examples/power-management-tests.json' --- examples/power-management-tests.json 2011-09-12 09:19:10 +0000 +++ examples/power-management-tests.json 1970-01-01 00:00:00 +0000 @@ -1,14 +0,0 @@ -{ - "format": "Lava-Test Test Definition 1.0", - "test_id": "linaro.pmwg", - "install": { - "steps": ["bzr get lp:~zkrynicki/+junk/linaro-pm-qa-tests"], - "deps": ["bzr"] - }, - "run": { - "steps": ["cd linaro-pm-qa-tests && bash testcases/cpufreq/avail_freq01.sh"] - }, - "parse": { - "native": true - } -} === removed file 'examples/stream.json' --- examples/stream.json 2011-09-12 09:19:10 +0000 +++ examples/stream.json 1970-01-01 00:00:00 +0000 @@ -1,18 +0,0 @@ -{ - "format": "LAVA-Test Test Definition Format", - "test_id": "stream-json", - "install": { - "url": "http://www.cs.virginia.edu/stream/FTP/Code/stream.c", - "steps": ["cc stream.c -O2 -fopenmp -o stream"] - }, - "run": { - "steps": ["./stream"] - }, - "parse": { - "pattern": "^(?P\\w+):\\W+(?P\\d+\\.\\d+)", - "appendall": { - "units": "MB/s", - "result": "pass" - } - } -} === removed directory 'lava_test' === removed file 'lava_test/__init__.py' --- lava_test/__init__.py 2013-01-30 04:27:59 +0000 +++ lava_test/__init__.py 1970-01-01 00:00:00 +0000 @@ -1,16 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . - -__version__ = (0, 14, 0, "final", 0) === removed directory 'lava_test/api' === removed file 'lava_test/api/__init__.py' --- lava_test/api/__init__.py 2011-09-12 09:19:10 +0000 +++ lava_test/api/__init__.py 1970-01-01 00:00:00 +0000 @@ -1,24 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . - -from abc import ABCMeta - - -class _Interface(object): - """ - Interface class for simplifying usage of interface meta-classes - """ - - __metaclass__ = ABCMeta === removed file 'lava_test/api/core.py' --- lava_test/api/core.py 2012-03-08 18:01:17 +0000 +++ lava_test/api/core.py 1970-01-01 00:00:00 +0000 @@ -1,178 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . - -""" -:mod:`lava_test.api.core` -- Interface classes for core LAVA Test features -========================================================================== - -.. module: lava_test.api.core - - :synopsis: Interface classes for core LAVA Test features -""" - -from abc import abstractmethod, abstractproperty - -from lava_test.api import _Interface - - -class ITest(_Interface): - """ - Abstract test definition. - - Test definitions allow lava-test to install, remove, run and parse log - files of automatic tests. While the interface can be implemented directly - you should use :class:`lava_test.core.tests.Test` that implements the core - logic and allow you to customize the parts that are needed by providing - delegates implementing :class:`~lava_test.api.delegates.ITestInstaller`, - :class:`~lava_test.api.delegates.ITestRunner` and - :class:`~lava_test.api.delegates.ITestParser`. - - .. seealso:: :ref:`wrapping_existing_test_or_benchmark` - """ - - @abstractproperty - def is_installed(self): - """ - True if this test is installed - - .. versionadded:: 0.2 - """ - - @abstractproperty - def test_id(self): - """ - The unique name of this test - """ - - @abstractmethod - def install(self, observer): - """ - Install the test program. - - This creates an install directory under the user's XDG_DATA_HOME - directory to mark that the test is installed. The installer's - install() method is then called from this directory to complete any - test specific install that may be needed. - - :param observer: - Observer object that makes it possible to monitor the actions - performed by the test installer. - :type observer: - :class:`~lava_test.api.observers.ITestInstallerObserver` - - .. versionadded:: 0.2 - """ - - @abstractmethod - def uninstall(self): - """ - Remove the test program - - Recursively remove test specific directory under the user's - ``XDG_DATA_HOME directory``. This will both mark the test as removed, - and clean up any files that were downloaded or installed under that - directory. Dependencies are intentionally not removed by this. - - .. versionadded:: 0.1 - """ - - @abstractmethod - def run(self, observer, test_options): - """ - Run the test program and store artifacts. - - :param observer: - Observer object that makes it possible to monitor the actions - performed by the test runner. - :type observer: :class:`~lava_test.api.observers.ITestRunnerObserver` - :param test_options: - Arbitrary string that was provided by the user. - :type options: :class:`str` - :return: Pair with test run artifacts and exit code - :rtype: - :class:`~lava_test.core.artifacts.TestArtifacts` and :class:`bool` - - .. versionadded:: 0.2 - .. versionchanged:: 0.3.1 - Added options argument and changed the return type to be a tuple - """ - - @abstractmethod - def parse(self, artifacts): - """ - Parse the artifacts of an earlier run. - - :param artifacts: Object that describes which files should be parsed. - :type artifacts: :class:`~lava_test.core.artifacts.TestArtifacts` - :return: - A dictionary with all the parsed data. In particular this is a - TestRun part of the dashboard bundle so it should have the - test_results list of all the results parsed from the artifacts. - :rtype: :class:`dict` - - .. versionadded:: 0.2 - """ - - -class ITestProvider(_Interface): - """ - Source of ITest instances. - - Test providers can be used to make lava-test aware of arbitrary collections - of tests that can be installed and invoked. Internally lava-test uses this - class to offer built-in tests (via the - :class:`~lava_test.providers.BuiltInProvider`), out-of-tree tests (via the - :class:`~lava_test.providers.PkgResourcesProvider`) and declarative tests - (via the :class:`~lava_test.providers.RegistryProvider`). - - Normally this is not something you would need to implement. If you have a - large collection of existing tests that can be somehow adapted in bulk, or - you have your own internal registry of tests that could be adapted this way - then you might use this interface to simplify test discovery. - - Test providers need to be registered using pkg-resources entry-point - feature and then added to the lava-test configuration file. See - :class:`lava_test.config.LavaTestConfig` for details. - - .. versionadded:: 0.2 - """ - - @abstractmethod - def __init__(self, config): - """ - Initialize test provider with the specified configuration object. The - configuration object is obtained from the test tool providers registry. - """ - - @abstractmethod - def __iter__(self): - """ - Iterates over instances of ITest exposed by this provider - """ - - @abstractmethod - def __getitem__(self, test_id): - """ - Return an instance of ITest with the specified id - """ - - @abstractproperty - def description(self): - """ - The description string used by `lava-test list-tests` - """ - - -__all__ = ['ITest', 'ITestProvider'] === removed file 'lava_test/api/delegates.py' --- lava_test/api/delegates.py 2012-03-08 18:04:02 +0000 +++ lava_test/api/delegates.py 1970-01-01 00:00:00 +0000 @@ -1,124 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . - - -""" -:mod:`lava_test.api.delegates` -- Interface classes for test delegates -====================================================================== - -.. module: lava_test.api.delegates - - :synopsis: Interface classes for test delegates -""" - -from abc import abstractmethod, abstractproperty - -from lava_test.api import _Interface - - -class ITestInstaller(_Interface): - """ - Test installer delegate class. - - Wraps the knowledge on how to install a test. It is most helpful with - :class:`~lava_test.core.tests.Test` that delegates actual actions to helper - classes. - - .. versionadded:: 0.2 - """ - - @abstractmethod - def install(self, observer): - """ - Install the test program. - - :param observer: - Observer object that makes it possible to monitor the actions - performed by the test installer. - :type observer: - :class:`~lava_test.api.observers.ITestInstallerObserver` - - .. versionadded:: 0.2 - """ - - -class ITestRunner(_Interface): - """ - Test runner delegate. - - Wraps the knowledge on how to run a test. It is most helpful with - :class:`lava_test.core.tests.Test` that delegates actual actions to - helper classes. - - .. versionadded:: 0.2 - """ - - @abstractmethod - def run(self, artifacts, observer, test_options): - """ - Run the test and create artifacts (typically log files). - - Artifacts must be created in the directory specified by various methods - and properties of of :class:`lava_test.core.TestArtifacts`. - - :param artifacts: - Object that describes where to store test run artifacts - :type artifacts: :class:`~lava_test.core.artifacts.TestArtifacts`. - :param observer: - Observer object that makes it possible to monitor the actions - performed by the test runner. - :type observer: :class:`~lava_test.api.observers.ITestRunnerObserver` - :param test_options: - A string with space separated options to pass to the test. - - :return true if any test step return none-zero return code - .. versionadded:: 0.2 - """ - - -class ITestParser(_Interface): - """ - Test artefact parser delegate. - - Wraps the knowledge on how to parse the artifacts of a previous test run. - It is most helpful with :class:`~lava_test.core.tests.Test` that delegates - actual actions to helper classes. - - .. versionadded:: 0.2 - """ - - @abstractmethod - def parse(self, artifacts): - """ - Parse the artifacts of a previous test run and return a dictionary with - a partial TestRun object. - - :param artifacts: - Object that describes where to find test run artifacts - :type artifacts: :class:`~lava_test.core.artifacts.TestArtifacts`. - - .. versionadded:: 0.2 - """ - - @abstractproperty - def results(self): - """ - Results dictionary to be merged with TestRun object inside the bundle. - - .. seealso:: - :meth:`~lava_test.core.artifacts.TestArtifacts.incorporate_parse_results` - - .. versionadded:: 0.1 - """ === removed file 'lava_test/api/observers.py' --- lava_test/api/observers.py 2011-09-12 09:19:10 +0000 +++ lava_test/api/observers.py 1970-01-01 00:00:00 +0000 @@ -1,120 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . - - -""" -:mod:`lava_test.api.observers` -- Interface classes for observer classes -======================================================================== - -.. module: lava_test.api.observers - :synopsis: Interface classes for observer classes -""" - -from abc import abstractmethod - -from lava_test.api import _Interface - - -class IShellCommandObserver(_Interface): - """ - Shell command runner observer class. - - Allows the caller to observe shell commands that occur during some - operation. It is used by the command line UI. - - .. versionadded:: 0.2 - """ - - @abstractmethod - def about_to_run_shell_command(self, cmd): - """ - Method called when a shell command is about to be invoked by the - observed object. - - .. versionadded:: 0.2 - """ - - @abstractmethod - def did_run_shell_command(self, cmd, returncode): - """ - Method called when a shell command has been invoked by the observed - object. - - .. versionadded:: 0.2 - """ - - @abstractmethod - def display_subprocess_output(self, stream_name, line): - """ - Method called for each line of stdout/stderr as obtained from a - subprocess. - - .. versionadded:: 0.2 - """ - - -class ITestInstallerObserver(IShellCommandObserver): - """ - Test installer observer class. - - Allows the caller to observe interesting actions that occur during - installation process. It is used by the command line UI. - - .. versionadded:: 0.2 - """ - - @abstractmethod - def about_to_install_packages(self, package_list): - """ - Method called when a list of packages is about to be installed by the - installer - - .. versionadded:: 0.2 - """ - - @abstractmethod - def did_install_packages(self, package_list): - """ - Method called when a package has been installed by the installer - - .. versionadded:: 0.2 - """ - - @abstractmethod - def about_to_download_file(self, url): - """ - Method called when a file is about to be downloaded - - .. versionadded:: 0.2 - """ - - @abstractmethod - def did_download_file(self, url): - """ - Method called when a file has been downloaded - - .. versionadded:: 0.2 - """ - - -class ITestRunnerObserver(IShellCommandObserver): - """ - Test runner observer class. - - Allows the caller to observe interesting actions that occur during testing - process. It is used by the command line UI. - - .. versionadded:: 0.2 - """ === removed file 'lava_test/commands.py' --- lava_test/commands.py 2012-09-19 04:40:25 +0000 +++ lava_test/commands.py 1970-01-01 00:00:00 +0000 @@ -1,471 +0,0 @@ -# Copyright (c) 2010, 2011, 2012 Linaro -# -# 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 3 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, see . -import logging - -import os -import shutil -import subprocess - -from lava_tool.interface import Command as LavaCommand -from lava_tool.interface import LavaCommandError -import versiontools - -from lava_test.api.observers import ( - ITestInstallerObserver, - ITestRunnerObserver) -from lava_test.core.artifacts import TestArtifacts -from lava_test.core.config import get_config -from lava_test.core.loader import TestLoader -from lava_test.utils import Cache - -class Command(LavaCommand, ITestInstallerObserver, ITestRunnerObserver): - - def __init__(self, parser, args): - super(Command, self).__init__(parser, args) - self._config = get_config() - self._test_loader = TestLoader(self._config) - - if self.args.verbose: - logging.root.setLevel(logging.DEBUG) - - @classmethod - def register_arguments(cls, parser): - parser.add_argument( - "-v", "--verbose", - action="store_true", - default=False, - help="Be verbose about undertaken actions") - parser.add_argument( - "-q", "--quiet", - action="store_true", - default=False, - help="Be less verbose about undertaken actions") - parser.add_argument( - "-Q", "--quiet-subcommands", - action="store_true", - default=False, - help="Hide the output of all sub-commands (including tests)") - - def say(self, text, *args, **kwargs): - print "LAVA:", text.format(*args, **kwargs) - - def about_to_install_packages(self, package_list): - if self.args.quiet: - return - self.say("Installing packages: {0}", ", ".join(package_list)) - - def about_to_run_shell_command(self, cmd): - if self.args.quiet: - return - self.say("Running shell command: {0!r}", cmd) - - def about_to_download_file(self, url): - if self.args.quiet: - return - self.say("Downloading file from: {0!r}", url) - - def did_install_packages(self, package_list): - pass - - def did_run_shell_command(self, cmd, returncode): - if returncode is None: - self.say("Command {0!r} was terminated prematurely", cmd) - elif returncode != 0: - self.say("Command {0!r} returned non-zero exit status {1}", - cmd, returncode) - - def did_download_file(self, url): - pass - - def display_subprocess_output(self, stream_name, line): - if self.args.quiet_subcommands: - return - if stream_name == 'stdout': - self.say('(stdout) {0}', line.rstrip()) - elif stream_name == 'stderr': - self.say('(stderr) {0}', line.rstrip()) - - -class list_tests(Command): - """ - List available tests - - .. program:: lava-test list-tests - - Lists all available tests, grouping them by provider. - """ - - def invoke(self): - for provider in self._test_loader.get_providers(): - test_list = [provider[test_id] for test_id in provider] - if not test_list: - continue - self.say("{0}", provider.description) - for test in test_list: - self.say(" - {test_id}", test_id=test.test_id) - - -class list_installed(Command): - """ - List installed tests - """ - - def invoke(self): - for provider in self._test_loader.get_providers(): - test_list = [provider[test_id] for test_id in provider] - if not test_list: - continue - self.say("{0}", provider.description) - count = 0 - for test in test_list: - if not test.is_installed: - continue - self.say(" - {test_id}", test_id=test.test_id) - count += 1 - if not count: - self.say("No tests installed") - - -class TestAffectingCommand(Command): - - INSTALL_REQUIRED = False - - @classmethod - def register_arguments(cls, parser): - super(TestAffectingCommand, cls).register_arguments(parser) - parser.add_argument("test_id", - help="Test or test suite identifier") - - def invoke(self): - try: - test = self._test_loader[self.args.test_id] - except KeyError: - try: - test = self._test_loader[self.args.test_id.replace('-', '_')] - except KeyError: - raise LavaCommandError("There is no test with the specified ID") - return self.invoke_with_test(test) - - -class install(TestAffectingCommand): - """ - Install a test program - """ - - def invoke_with_test(self, test): - if test.is_installed: - raise LavaCommandError("This test is already installed") - try: - test.install(self) - except (subprocess.CalledProcessError, RuntimeError) as ex: - raise LavaCommandError(str(ex)) - - -class uninstall(TestAffectingCommand): - """ - Uninstall a test program - """ - - def invoke_with_test(self, test): - if not test.is_installed: - raise LavaCommandError("This test is not installed") - test.uninstall() - - -class run(TestAffectingCommand): - """ - Run a previously installed test program - """ - - @classmethod - def register_arguments(cls, parser): - super(run, cls).register_arguments(parser) - group = parser.add_argument_group("initial bundle configuration") - group.add_argument( - "-S", "--skip-software-context", - default=False, - action="store_true", - help=("Do not store the software context in the" - " initial bundle. Typically this saves OS" - " image name and all the installed software" - " packages.")) - group.add_argument( - "-H", "--skip-hardware-context", - default=False, - action="store_true", - help=("Do not store the hardware context in the" - " initial bundle. Typically this saves CPU," - " memory and USB device information.")) - group.add_argument( - "--trusted-time", - default=False, - action="store_true", - help=("Indicate that the real time clock has" - " accurate data. This can differentiate" - " test results created on embedded devices" - " that often have inaccurate real time" - " clock settings.")) - group.add_argument( - "--analyzer-assigned-uuid", - default=None, - metavar="UUID", - help=("Set the analyzer_assigned_uuid to the specified value." - " This will prevent the test device from attempting" - " to generate an UUID by itself. This option may be" - " required if the test device has unreliable real" - " time clock (no battery backed, not ensure to be" - " up-to-date) and unreliable/random hardware ethernet " - " address.")) - - group = parser.add_argument_group("complete bundle configuration") - group.add_argument( - "-o", "--output", - default=None, - metavar="FILE", - help=("After running the test parse the result" - " artifacts, fuse them with the initial" - " bundle and finally save the complete bundle" - " to the specified FILE.")) - group.add_argument( - "-A", "--skip-attachments", - default=False, - action="store_true", - help=("Do not store standard output and standard" - " error log files as attachments. This" - " option is only affecting the bundle" - " created with --output, the initial bundle" - " is not affected as it never stores any" - " attachments.")) - - parser.add_argument( - "-t", "--test-options", - default=None, - help=( - "Override the default test options." - " The value is passed verbatim to test definition. Typically" - " this is simply used in shell commands by expanding the" - " string $(OPTIONS). Please refer to the built-in" - " peacekeeper.py for examples. Depending on your shell you" - " probably have to escape spaces and other special" - " characters if you wish to include them in your argument" - " options.")) - - def invoke_with_test(self, test): - # Validate analyzer_assigned_uuid - if self.args.analyzer_assigned_uuid: - import uuid - try: - self.analyzer_assigned_uuid = str( - uuid.UUID(self.args.analyzer_assigned_uuid)) - except ValueError as exc: - self.parser.error("--analyzer-assigned-uuid: %s" % exc) - if not test.is_installed: - raise LavaCommandError("The specified test is not installed") - try: - artifacts, run_fail = test.run( - self, test_options=self.args.test_options) - except subprocess.CalledProcessError as ex: - if ex.returncode is None: - raise LavaCommandError("Command %r was aborted" % ex.cmd) - else: - raise LavaCommandError(str(ex)) - except RuntimeError as ex: - raise LavaCommandError(str(ex)) - self.say("run complete, result_id is {0!r}", artifacts.result_id) - try: - artifacts.create_initial_bundle( - self.args.skip_software_context, - self.args.skip_hardware_context, - self.args.trusted_time, - self.args.analyzer_assigned_uuid, - test) - except ImportError as exc: - msg_template = ( - "Unable to probe for software context. Install the '%s'" - " package or invoke lava-test run with" - " '--skip-software-context'") - if exc.message == "No module named apt": - raise LavaCommandError(msg_template % "python-apt") - elif exc.message == "No module named lsb_release": - raise LavaCommandError(msg_template % "lsb-release") - else: - raise - artifacts.save_bundle() - if self.args.output: - parse_results = test.parse(artifacts) - artifacts.incorporate_parse_results(parse_results) - if not self.args.skip_attachments: - artifacts.attach_standard_files_to_bundle() - artifacts.save_bundle_as(self.args.output) - if run_fail: - raise LavaCommandError( - 'Some of test steps returned non-zero exit code') - - -class parse(TestAffectingCommand): - """ - Parse the results of previous test run - """ - - @classmethod - def register_arguments(cls, parser): - super(parse, cls).register_arguments(parser) - parser.add_argument("result_id", - help="Test run result identifier") - group = parser.add_argument_group("complete bundle configuration") - group.add_argument("-o", "--output", - default=None, - metavar="FILE", - help=("After running the test parse the result" - " artifacts, fuse them with the initial" - " bundle and finally save the complete bundle" - " to the specified FILE.")) - group.add_argument("-A", "--skip-attachments", - default=False, - action="store_true", - help=("Do not store standard output and standard" - " error log files as attachments. This" - " option is only affecting the bundle" - " created with --output, the initial bundle" - " is not affected as it never stores any" - " attachments.")) - - def invoke_with_test(self, test): - artifacts = TestArtifacts( - self.args.test_id, self.args.result_id, self._config) - if not os.path.exists(artifacts.bundle_pathname): - raise LavaCommandError("Specified result does not exist") - artifacts.load_bundle() - parse_results = test.parse(artifacts) - artifacts.incorporate_parse_results(parse_results) - self.say("Parsed {0} test results", - len(artifacts.bundle["test_runs"][0]["test_results"])) - logging.debug(artifacts.dumps_bundle()) - if self.args.output: - if not self.args.skip_attachments: - artifacts.attach_standard_files_to_bundle() - artifacts.save_bundle_as(self.args.output) - - -class show(Command): - """ - Display the output from a previous test run - """ - - @classmethod - def register_arguments(cls, parser): - super(show, cls).register_arguments(parser) - parser.add_argument("result_id", - help="Test run result identifier") - - def invoke(self): - artifacts = TestArtifacts(None, self.args.result_id, self._config) - if not os.path.exists(artifacts.results_dir): - raise LavaCommandError("Specified result does not exist") - if os.path.exists(artifacts.stdout_pathname): - with open(artifacts.stdout_pathname, "rt") as stream: - for line in iter(stream.readline, ''): - self.display_subprocess_output("stdout", line) - if os.path.exists(artifacts.stderr_pathname): - with open(artifacts.stderr_pathname, "rt") as stream: - for line in iter(stream.readline, ''): - self.display_subprocess_output("stderr", line) - - -class version(Command): - """ - Show LAVA Test version - """ - - def invoke(self): - self.say("version details:") - for framework in self._get_frameworks(): - self.say(" - {framework}: {version}", - framework=framework.__name__, - version=versiontools.format_version( - framework.__version__, framework)) - - def _get_frameworks(self): - import lava_tool - import lava_test - import linaro_dashboard_bundle - import linaro_json - return [ - lava_test, - lava_tool, - linaro_dashboard_bundle, - linaro_json] - - -class register_test(Command): - """ - Register remote test - """ - - @classmethod - def register_arguments(cls, parser): - super(register_test, cls).register_arguments(parser) - parser.add_argument("test_url", - help="Url for test definition file") - - def invoke(self): - try: - from lava_test.core.providers import RegistryProvider - RegistryProvider.register_remote_test(self.args.test_url) - except ValueError as exc: - raise LavaCommandError("Unable to register test: %s" % exc) - except KeyError: - raise LavaCommandError("There is no test_url") - - -class unregister_test(Command): - """ - Remove a declarative test from the registry - This command does the reverse of lava-test register. You need to pass the - same URL you've used in `lava-test register-test` - """ - - @classmethod - def register_arguments(cls, parser): - super(unregister_test, cls).register_arguments(parser) - parser.add_argument( - "url", - metavar="URL", - help="URL of the test definition file") - - def invoke(self): - from lava_test.core.providers import RegistryProvider - try: - RegistryProvider.unregister_remote_test(self.args.url) - except ValueError: - raise LavaCommandError("This test is not registered") - - -class reset(Command): - """ - Reset the lava-test environment by removing - cached items, all registerered simple declactive tests and configuration files - """ - - def invoke(self): - print "Delete " + self._config.configdir - shutil.rmtree(self._config.configdir, ignore_errors=True) - print "Delete " + self._config.installdir - shutil.rmtree(self._config.installdir, ignore_errors=True) - print "Delete " + self._config.resultsdir - shutil.rmtree(self._config.resultsdir, ignore_errors=True) - cache = Cache.get_instance() - print "Delete " + cache.cache_dir - shutil.rmtree(cache.cache_dir, ignore_errors=True) === removed directory 'lava_test/core' === removed file 'lava_test/core/__init__.py' === removed file 'lava_test/core/artifacts.py' --- lava_test/core/artifacts.py 2012-09-19 04:40:25 +0000 +++ lava_test/core/artifacts.py 1970-01-01 00:00:00 +0000 @@ -1,281 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . - -from __future__ import absolute_import - -import base64 -import datetime -import logging -import os -import uuid - -from linaro_dashboard_bundle.io import DocumentIO - -from lava_test.core import hwprofile, swprofile -from lava_test.utils import merge_dict, mkdir_p - - -class TestArtifacts(object): - """ - Class representing test run artifacts, that is, static leftovers - independent of the wrapper class that encapsulates test handling. - - .. versionadded:: 0.2 - """ - - def __init__(self, test_id, result_id, config): - self._test_id = test_id - self._result_id = result_id - self._config = config - self._bundle = None - - @classmethod - def allocate(cls, test_id, config): - """ - Allocate new test artifacts object that corresponds to the specified - test_id. This constructs a new result_id and creates the corresponding - filesystem directory that holds those artifacts. - - .. versionadded:: 0.2 - """ - result_id = ( - "{test_id}.{time.tm_year:04}-{time.tm_mon:02}-{time.tm_mday:02}T" - "{time.tm_hour:02}:{time.tm_min:02}:{time.tm_sec:02}Z").format( - test_id=test_id, - time=datetime.datetime.utcnow().timetuple()) - self = cls(test_id, result_id, config) - logging.debug("Creating result directory: %r", self.results_dir) - mkdir_p(self.results_dir) - return self - - @property - def test_id(self): - """ - The ID of the test this run is associated with - - .. versionadded:: 0.2 - """ - return self._test_id - - @property - def result_id(self): - """ - The ID of the test run. - - This field is different from analyzer_assigned_uuid at this time but - may change in the future. The purpose of this field is to identify the - test run and be able to locate attachments/log files/bundle on the file - system. - - .. versionadded:: 0.2 - """ - return self._result_id - - @property - def results_dir(self): - """ - Pathname of a directory with test run artifacts (log files, crash - dumps, etc). - - .. versionadded:: 0.2 - """ - return os.path.join(self._config.resultsdir, self.result_id) - - def load_bundle(self): - """ - Load the results bundle from disk. - - The bundle is also validated if linaro-dashboard-bundle library is - installed. - """ - with open(self.bundle_pathname, 'rt') as stream: - self._bundle = DocumentIO.load(stream)[1] - - def dumps_bundle(self): - return DocumentIO.dumps(self._bundle) - - def save_bundle(self): - """ - Save the results bundle to the disk - - The bundle is also validated if linaro-dashboard-bundle library is - installed. - """ - self.save_bundle_as(self.bundle_pathname) - - def save_bundle_as(self, pathname): - """ - Save the results bundle to the specified file on disk. - - The bundle should have been created or loaded earlier - """ - with open(pathname, 'wt') as stream: - DocumentIO.dump(stream, self._bundle) - - @property - def bundle(self): - """ - The deserialized bundle object. - - This can be either created with create_bundle() or loaded - from disk with load_bundle() - """ - return self._bundle - - def create_initial_bundle(self, - skip_software_context=False, - skip_hardware_context=False, - time_check_performed=False, - analyzer_assigned_uuid=None, - test=None): - """ - Create the bundle object. - - This creates a typical bundle structure. Optionally it can also add - software and hardware context information. - - For a complete bundle you may want to add attachments and incorporate - parse results by calling appropriate methods after loading or creating - the initial bundle. - """ - TIMEFORMAT = '%Y-%m-%dT%H:%M:%SZ' - # Generate UUID and analyzer_assigned_date for the test run - if analyzer_assigned_uuid is None: - analyzer_assigned_uuid = str(uuid.uuid1()) - analyzer_assigned_date = datetime.datetime.utcnow() - # Create basic test run structure - test_run = { - 'test_id': self.test_id, - 'analyzer_assigned_date': analyzer_assigned_date.strftime( - TIMEFORMAT), - 'analyzer_assigned_uuid': analyzer_assigned_uuid, - 'time_check_performed': time_check_performed, - "test_results": [], - "attachments": [], - } - # Store hardware and software context if requested - if not skip_software_context: - test_run['software_context'] = swprofile.get_software_context( - test=test) - if not skip_hardware_context: - test_run['hardware_context'] = hwprofile.get_hardware_context() - # Create the bundle object - self._bundle = { - 'format': 'Dashboard Bundle Format 1.3', - 'test_runs': [test_run]} - - @property - def test_run(self): - try: - return self._bundle["test_runs"][0] - except KeyError: - raise AttributeError("test_run can be accessed only after you load" - " or create an initial bundle") - - def attach_file(self, real_pathname, stored_pathname, mime_type): - """ - Append an attachment to the test run. - - The file is only attached if real_pathname designates an existing, - nonempty file. If the mime_type starts with 'text/' the file is opened - in text mode, otherwise binary mode is used. - """ - if not os.path.exists(real_pathname): - return - if mime_type.startswith('text/'): - mode = 'rt' - else: - mode = 'rb' - with open(real_pathname, mode) as stream: - data = stream.read() - if not data: - return - self.test_run['attachments'].append({ - "pathname": stored_pathname, - "mime_type": mime_type, - "content": base64.standard_b64encode(data)}) - - def incorporate_parse_results(self, parse_results): - """ - Merge the data returned by the test parser into the current test run. - - Non-overlapping data is simply added. Overlapping data is either merged - (lists are extended, dictionaries are recursively merged) or - overwritten (all other types). - """ - assert isinstance(parse_results, dict) - # Use whatever the parser gave us to improve the results - logging.debug("Using parser data to enrich test run details") - merge_dict(self.test_run, parse_results) - - def attach_standard_files_to_bundle(self): - """ - Attach standard output and standard error log files to the bundle. - - Both files are only attached if exist and non-empty. The attachments - are actually associated with a test run, not a bundle, but the - description is good enough for simplicity. - """ - self.attach_file(self.stdout_pathname, "testoutput.log", "text/plain") - self.attach_file(self.stderr_pathname, "testoutput.err", "text/plain") - - @property - def bundle_pathname(self): - """ - Pathname of the result bundle. - - The bundle contains the snapshot of environment information as well as - test identity and is created when you invoke ITest.run(). - - The bundle file name is always "testdata.json" - - .. versionadded:: 0.2 - """ - return self.get_artefact_pathname("testdata.json") - - @property - def stdout_pathname(self): - """ - Pathname of the log file of the standard output as returned by the test - program. - - The log file name is always "testoutput.log" - - .. versionadded:: 0.2 - """ - return self.get_artefact_pathname("testoutput.log") - - @property - def stderr_pathname(self): - """ - Pathname of the log file of the standard output as returned by the test - program. - - The log file name is always "testoutput.err" - - .. versionadded:: 0.2 - """ - return self.get_artefact_pathname("testoutput.err") - - def get_artefact_pathname(self, artefact_name): - """ - Return a pathname of a test run artefact file. - - This is more useful than hard-coding the path as it allows the test - runner not to worry about the location of the results directory. - - .. versionadded:: 0.2 - """ - return os.path.join(self.results_dir, artefact_name) === removed file 'lava_test/core/config.py' --- lava_test/core/config.py 2012-03-08 18:04:16 +0000 +++ lava_test/core/config.py 1970-01-01 00:00:00 +0000 @@ -1,91 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . - -import os -import json - - -class LavaTestConfig(object): - - def __init__(self): - home = os.environ.get('HOME', '/') - baseconfig = os.environ.get('XDG_CONFIG_HOME', - os.path.join(home, '.config')) - basedata = os.environ.get('XDG_DATA_HOME', - os.path.join(home, '.local', 'share')) - self.configdir = os.path.join(baseconfig, 'lava_test') - self.installdir = os.path.join( - basedata, 'lava_test', 'installed-tests') - self.resultsdir = os.path.join(basedata, 'lava_test', 'results') - self.registry = self._load_registry() - - @property - def _registry_pathname(self): - return os.path.join(self.configdir, "registry.json") - - def _load_registry(self): - try: - with open(self._registry_pathname) as stream: - return json.load(stream) - except (IOError, ValueError): - return self._get_default_registry() - - def _save_registry(self): - if not os.path.exists(self.configdir): - os.makedirs(self.configdir) - with open(self._registry_pathname, "wt") as stream: - json.dump(self.registry, stream, indent=2) - - def _get_default_registry(self): - return { - "format": "Lava-Test Test Registry 1.0", - "providers": [{ - "entry_point": "lava_test.core.providers:BuiltInProvider" - }, { - "entry_point": "lava_test.core.providers:PkgResourcesProvider", - "config": {"namespace": "lava_test.test_definitions"} - }, - { - "entry_point": "lava_test.core.providers:RegistryProvider", - "config": {"entries": []} - }] - } - - def get_provider_config(self, entry_point_name): - if "providers" not in self.registry: - self.registry["providers"] = [] - for provider_info in self.registry["providers"]: - if provider_info.get("entry_point") == entry_point_name: - break - else: - provider_info = {"entry_point": entry_point_name} - self.registry["providers"].append(provider_info) - if "config" not in provider_info: - provider_info["config"] = {} - return provider_info["config"] - -_config = None - - -def get_config(): - global _config - if _config is not None: - return _config - return LavaTestConfig() - - -def set_config(config): - global _config - _config = config === removed file 'lava_test/core/hwprofile.py' --- lava_test/core/hwprofile.py 2011-09-12 09:19:10 +0000 +++ lava_test/core/hwprofile.py 1970-01-01 00:00:00 +0000 @@ -1,223 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . - -import re -import sys -from subprocess import Popen, PIPE -from lava_test.utils import read_file, get_machine_type - - -INTEL_KEYMAP = { - 'vendor_id': 'cpu_vendor_name', - 'cpu family': 'cpu_family', - 'model': 'cpu_model', - 'model name': 'cpu_model_name', - 'stepping': 'cpu_stepping', - 'cpu MHz': 'cpu_mhz', - 'flags': 'cpu_features', -} - - -INTEL_VALMAP = { - 'cpu family': int, - 'model': int, - 'stepping': int, - 'cpu MHz': float, -} - - -ARM_KEYMAP = { - 'Processor': 'cpu_model_name', - 'Features': 'cpu_features', - 'CPU implementer': 'cpu_implementer', - 'CPU architecture': 'cpu_architecture', - 'CPU variant': 'cpu_variant', - 'CPU part': 'cpu_part', - 'CPU revision': 'cpu_revision', -} - - -ARM_VALMAP = { - 'CPU implementer': lambda value: int(value, 16), - 'CPU architecture': int, - 'CPU variant': lambda value: int(value, 16), - 'CPU part': lambda value: int(value, 16), - 'CPU revision': int, -} - - -def _translate_cpuinfo(keymap, valmap, key, value): - """ - Translate a key and value using keymap and valmap passed in - """ - newkey = keymap.get(key, key) - newval = valmap.get(key, lambda x: x)(value) - return newkey, newval - - -def get_cpu_devs(): - """ - Return a list of CPU devices - """ - pattern = re.compile('^(?P.+?)\s*:\s*(?P.*)$') - cpunum = 0 - devices = [] - cpudevs = [] - cpudevs.append({}) - machine = get_machine_type() - if machine in ('i686', 'x86_64'): - keymap, valmap = INTEL_KEYMAP, INTEL_VALMAP - elif machine.startswith('arm'): - keymap, valmap = ARM_KEYMAP, ARM_VALMAP - - try: - cpuinfo = read_file("/proc/cpuinfo") - for line in cpuinfo.splitlines(): - match = pattern.match(line) - if match: - key, value = match.groups() - key, value = _translate_cpuinfo(keymap, valmap, - key, value) - if cpudevs[cpunum].get(key): - cpunum += 1 - cpudevs.append({}) - cpudevs[cpunum][key] = value - for c in range(len(cpudevs)): - device = {} - device['device_type'] = 'device.cpu' - device['description'] = 'Processor #{0}'.format(c) - device['attributes'] = cpudevs[c] - devices.append(device) - except IOError: - print >> sys.stderr, "WARNING: Could not read cpu information" - return devices - - -def get_board_devs(): - """ - Return a list of board devices - """ - devices = [] - attributes = {} - device = {} - machine = get_machine_type() - if machine in ('i686', 'x86_64'): - try: - description = read_file('/sys/class/dmi/id/board_name') or None - vendor = read_file('/sys/class/dmi/id/board_vendor') or None - version = read_file('/sys/class/dmi/id/board_version') or None - if description: - device['description'] = description.strip() - if vendor: - attributes['vendor'] = vendor.strip() - if version: - attributes['version'] = version.strip() - except IOError: - print >> sys.stderr, "WARNING: Could not read board information" - return devices - elif machine.startswith('arm'): - try: - cpuinfo = read_file("/proc/cpuinfo") - if cpuinfo is None: - return devices - pattern = re.compile("^Hardware\s*:\s*(?P.+)$", re.M) - match = pattern.search(cpuinfo) - if match is None: - return devices - device['description'] = match.group('description') - except IOError: - print >> sys.stderr, "WARNING: Could not read board information" - return devices - else: - return devices - if attributes: - device['attributes'] = attributes - device['device_type'] = 'device.board' - devices.append(device) - return devices - - -def get_mem_devs(): - """ Return a list of memory devices - - This returns up to two items, one for physical RAM and another for swap - """ - pattern = re.compile('^(?P.+?)\s*:\s*(?P.+) kB$', re.M) - - devices = [] - try: - meminfo = read_file("/proc/meminfo") - for match in pattern.finditer(meminfo): - key, value = match.groups() - if key not in ('MemTotal', 'SwapTotal'): - continue - capacity = int(value) << 10 # Kernel reports in 2^10 units - if capacity == 0: - continue - if key == 'MemTotal': - kind = 'RAM' - else: - kind = 'swap' - description = "{capacity}MiB of {kind}".format( - capacity=capacity >> 20, kind=kind) - device = {} - device['description'] = description - device['attributes'] = {'capacity': str(capacity), 'kind': kind} - device['device_type'] = "device.mem" - devices.append(device) - except IOError: - print >> sys.stderr, "WARNING: Could not read memory information" - return devices - - -def get_usb_devs(): - """ - Return a list of usb devices - """ - pattern = re.compile( - "^Bus \d{3} Device \d{3}: ID (?P[0-9a-f]{4}):" - "(?P[0-9a-f]{4}) (?P.*)$") - devices = [] - try: - for line in Popen('lsusb', stdout=PIPE).communicate()[0].splitlines(): - match = pattern.match(line) - if match: - vendor_id, product_id, description = match.groups() - attributes = {} - device = {} - attributes['vendor_id'] = int(vendor_id, 16) - attributes['product_id'] = int(product_id, 16) - device['attributes'] = attributes - device['description'] = description - device['device_type'] = 'device.usb' - devices.append(device) - except OSError: - print >> sys.stderr, "WARNING: Could not read usb device information, \ -unable to run lsusb, please install usbutils package" - return devices - - -def get_hardware_context(): - """ - Return a dict with all of the hardware profile information gathered - """ - hardware_context = {} - devices = [] - devices.extend(get_cpu_devs()) - devices.extend(get_board_devs()) - devices.extend(get_mem_devs()) - devices.extend(get_usb_devs()) - hardware_context['devices'] = devices - return hardware_context === removed file 'lava_test/core/installers.py' --- lava_test/core/installers.py 2012-09-20 15:13:23 +0000 +++ lava_test/core/installers.py 1970-01-01 00:00:00 +0000 @@ -1,227 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . - -import hashlib -import os -import subprocess - -from lava_test.api.delegates import ITestInstaller -from lava_test.extcmd import ExternalCommandWithDelegate -from lava_test.utils import changed_directory, geturl - - -class TestInstaller(ITestInstaller): - """ - Base class for defining an installer object. - - This class can be used as-is for simple installers, or extended - for more advanced functionality. - - :ivar steps: - List of steps to be executed in a shell - - :ivar deps: - List of Debian or Ubuntu packages to apt-get install before running the - steps. - - :ivar url: - Location from which the test suite should be downloaded. - - :ivar md5: - The md5sum to check the integrety of the download - - :ivar git_repos: - A list of git urls to clone for the test definition. These will be - cloned befre the install steps are executed for the test definition. - The repo information will then be included in the bundle's source data - - :ivar bzr_repos: - A list of git urls to clone for the test definition. These will be - cloned befre the install steps are executed for the test definition. - The repo information will then be included in the bundle's source data - """ - def __init__(self, steps=None, deps=None, url=None, md5=None, - git_repos=None, bzr_repos=None, **kwargs): - self.steps = steps or [] - self.deps = deps or [] - self.url = url - self.md5 = md5 - self.git_repos = git_repos - self.bzr_repos = bzr_repos - - def __repr__(self): - return "<%s steps=%r deps=%r url=%r md5=%r>" % ( - self.__class__.__name__, - self.steps, self.deps, self.url, self.md5) - - def _run_shell_cmd(self, cmd, observer): - if observer: - observer.about_to_run_shell_command(cmd) - extcmd = ExternalCommandWithDelegate(observer) - returncode = extcmd.check_call(cmd, shell=True) - if observer: - observer.did_run_shell_command(cmd, returncode) - - def _installdeps(self, observer): - if self.deps: - if observer: - observer.about_to_install_packages(self.deps) - # XXX: Possible point of target-specific package installation - cmd = "sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --force-yes " + " ".join(self.deps) - self._run_shell_cmd(cmd, observer) - if observer: - observer.did_install_packages(self.deps) - - def _download(self, observer): - """ - Download the file specified by the url and check the md5. - - Returns the path and filename if successful, otherwise return None - """ - if not self.url: - return - if observer: - observer.about_to_download_file(self.url) - filename = geturl(self.url) - # If the file does not exist, then the download was not - # successful - if not os.path.exists(filename): - raise RuntimeError( - "Failed to download %r" % self.url) - if observer: - observer.did_download_file(self.url) - if self.md5: - checkmd5 = hashlib.md5() - with open(filename, 'rb') as fd: - data = fd.read(0x10000) - while data: - checkmd5.update(data) - data = fd.read(0x10000) - if checkmd5.hexdigest() != self.md5: - raise RuntimeError( - "md5sum mismatch of file %r, got %s expected %s" % ( - filename, checkmd5.hexdigest(), self.md5)) - return filename - - def _git_local(self, repo): - """ - convert git url into the local name, it git://foo.com/blah.git to blah - """ - return os.path.splitext(os.path.basename(repo))[0] - - def _git_clone(self, observer): - if not self.git_repos: - return - - for repo in self.git_repos: - if observer: - observer.about_to_download_file(repo) - - self._run_shell_cmd("git clone %s" % repo, observer) - - if not os.path.exists(self._git_local(repo)): - raise RuntimeError("Failed to clone %s" % repo) - if observer: - observer.did_download_file(repo) - - @staticmethod - def _git_source(testdir, dirname): - with changed_directory('%s/%s' % (testdir, dirname)): - commit_id = subprocess.check_output( - ['git', 'log', '-1', '--pretty=%H']).strip() - url = subprocess.check_output( - ['git', 'config', '--get', 'remote.origin.url']).strip() - return { - 'project_name': url.rsplit('/')[-1], - 'branch_vcs': 'git', - 'branch_revision': commit_id, - 'branch_url': url, - } - - def _git_sources(self, testdir): - """ - Pulls git information from the given local repositories and formats - them as needed by the software_context's "sources" attribute - """ - sources = [] - for d in self.git_repos: - d = self._git_local(d) - sources.append(self._git_source(testdir, d)) - return sources - - def _bzr_local(self, repo): - """ - convert bzr url into the local name, it lp:lava-test to lava-test - """ - repo = repo.replace('lp:', '') - return repo.split('/')[-1] - - @staticmethod - def _bzr_source(testdir, dirname): - with changed_directory('%s/%s' % (testdir, dirname)): - revno = subprocess.check_output(['bzr', 'revno']).strip() - url = subprocess.check_output( - ['bzr', 'config', 'parent_location']).strip() - return { - 'project_name': dirname, - 'branch_vcs': 'bzr', - 'branch_revision': revno, - 'branch_url': url, - } - - def _bzr_sources(self, testdir): - """ - Pulls bzr information from the given local repositories and formats - them as needed by the software_context's "sources" attribute - """ - sources = [] - for d in self.bzr_repos: - d = self._bzr_local(d) - sources.append(self._bzr_source(testdir, d)) - return sources - - def _bzr_branch(self, observer): - if not self.bzr_repos: - return - - for repo in self.bzr_repos: - if observer: - observer.about_to_download_file(repo) - - self._run_shell_cmd("bzr branch %s" % repo, observer) - - if not os.path.exists(self._bzr_local(repo)): - raise RuntimeError("Failed to clone %s" % repo) - if observer: - observer.did_download_file(repo) - - def get_software_sources(self, testdir): - sources = [] - if self.git_repos: - sources.extend(self._git_sources(testdir)) - if self.bzr_repos: - sources.extend(self._bzr_sources(testdir)) - return sources - - def _runsteps(self, observer): - for cmd in self.steps: - self._run_shell_cmd(cmd, observer) - - def install(self, observer=None): - self._installdeps(observer) - self._download(observer) - self._git_clone(observer) - self._bzr_branch(observer) - self._runsteps(observer) === removed file 'lava_test/core/loader.py' --- lava_test/core/loader.py 2012-03-08 18:08:15 +0000 +++ lava_test/core/loader.py 1970-01-01 00:00:00 +0000 @@ -1,86 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . - -from __future__ import absolute_import -from lava_test.core.config import get_config - -import logging - - -class TestLoader(object): - """ - Test loader. - - Encapsulates LAVA Test's knowledge of available tests. - - Test can be loaded by name with - :meth:`lava_test.core.loader.TestLoader.__getitem__()`. Test can also be - listed by :meth:`lava_test.core.loader.TestLoader.get_providers()` and then - iterating over tests returned by each provider. - """ - - def __init__(self, config): - self._config = config - - def get_providers(self): - """ - Return a generator of available providers - """ - import pkg_resources - for provider_info in self._config.registry.get("providers", []): - entry_point_name = provider_info.get("entry_point") - module_name, attrs = entry_point_name.split(':', 1) - attrs = attrs.split('.') - try: - entry_point = pkg_resources.EntryPoint( - entry_point_name, module_name, attrs, - dist=pkg_resources.get_distribution("lava-test")) - provider_cls = entry_point.load() - provider = provider_cls(provider_info.get("config", {})) - yield provider - except pkg_resources.DistributionNotFound: - raise RuntimeError( - "lava-test is not properly set up." - " Please read the README file") - except ImportError: - logging.warning("Couldn't load module: %s", module_name) - logging.warning( - "The configuration may need updating, it is stored in %r", - get_config().configdir) - - def __getitem__(self, test_id): - """ - Lookup a test with the specified test_id - """ - for provider in self.get_providers(): - try: - return provider[test_id] - except KeyError: - pass - raise KeyError(test_id) - - def get_test_by_name(self, test_id): - """ - Lookup a test with the specified name - - .. deprecated:: 0.2 - Use __getitem__ instead - """ - for provider in self.get_providers(): - try: - return provider[test_id] - except KeyError: - pass - raise ValueError("No such test %r" % test_id) === removed file 'lava_test/core/parsers.py' --- lava_test/core/parsers.py 2013-04-05 12:13:22 +0000 +++ lava_test/core/parsers.py 1970-01-01 00:00:00 +0000 @@ -1,147 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . - -import decimal -import os -import re - -from lava_test.api.delegates import ITestParser - - -class TestParser(ITestParser): - """ - Base class for defining a test parser - - This class can be used as-is for simple results parsers, but will likely - need to be extended slightly for many. If used as it is, the parse() - method should be called while already in the results directory and assumes - that a file for test output will exist called testoutput.log. - - :ivar pattern: - regexp pattern to identify important elements of test output For - example: If your testoutput had lines that look like: "test01: PASS" - then you could use a pattern like this: - "^(?P\w+):\W+(?P\w+)" This would result in - identifying "test01" as testid and "PASS" as result. Once parse() - has been called, self.results.test_results[] contains a list of - dicts of all the key,value pairs found for each test result. - - :ivar fixupdict: - Dict of strings to convert test results to standard strings For - example: if you want to standardize on having pass/fail results in - lower case, but your test outputs them in upper case, you could use a - fixupdict of something like: {'PASS':'pass','FAIL':'fail'} - - :ivar appendall: - Append a dict to the test_results entry for each result. - For example: if you would like to add units="MB/s" to each result: - appendall={'units':'MB/s'} - - :ivar results: - Dictionary of data that was scrubbed from the log file for this test - run. Most notably it contains the test_results array. - """ - def __init__(self, pattern=None, fixupdict=None, appendall={}): - if pattern is not None: - try: - re.compile(pattern) - except Exception as ex: - raise ValueError( - "Invalid regular expression %r: %s", pattern, ex) - self._results = {'test_results': []} - self.pattern = pattern - self.fixupdict = fixupdict - self.appendall = appendall - - def __repr__(self): - return "<%s pattern=%r fixupdict=%r appendall=%r>" % ( - self.__class__.__name__, - self.pattern, self.fixupdict, self.appendall) - - @property - def results(self): - return self._results - - def parse(self, artifacts): - if os.path.exists(artifacts.stdout_pathname): - return self.parse_pathname( - artifacts.stdout_pathname, - os.path.relpath(artifacts.stdout_pathname, - artifacts.results_dir)) - if os.path.exists(artifacts.stderr_pathname): - return self.parse_pathname( - artifacts.stderr_pathname, - os.path.relpath(artifacts.stderr_pathname, - artifacts.results_dir)) - - def parse_pathname(self, pathname, relative_pathname=None): - with open(pathname, 'rt') as stream: - for lineno, line in enumerate(stream, 1): - match = re.search(self.pattern, line) - if not match: - continue - data = match.groupdict() - data["log_filename"] = relative_pathname or pathname - data["log_lineno"] = lineno - self._results['test_results'].append( - self.analyze_test_result(data)) - return self.results - - @property - def badchars(self): - return "[^a-zA-Z0-9\._-]" - - def analyze_test_result(self, data): - """ - Analyze single match (typically single line) and convert it into a - proper test result object. - - Currently this method does the following transformations: - * measurement is converted to decimal if present - * test_case_id is rewritten to strip badchars - * test_case_id is rewritten to convert spaces to underscores - * result is transformed using fixuptdict, if defined - * appendall information is added, if defined - """ - if 'measurement' in data: - try: - data['measurement'] = decimal.Decimal(data['measurement']) - except decimal.InvalidOperation: - del data['measurement'] - if 'test_case_id' in data: - data['test_case_id'] = re.sub(self.badchars, "", - data['test_case_id']) - data['test_case_id'] = data['test_case_id'].replace(" ", "_") - if 'result' in data and self.fixupdict: - data['result'] = self.fixupdict[data['result']] - if self.appendall: - data.update(self.appendall) - return data - - -class NativeTestParser(ITestParser): - """ - Unfinished native test parser. - - This was meant to be a pass-through for tests that directly create bundles - """ - def __init__(self, test_def): - self.test_def = test_def - - def parse(self, artifacts): - raise NotImplementedError() - - def results(self): - raise NotImplementedError() === removed file 'lava_test/core/providers.py' --- lava_test/core/providers.py 2012-10-24 20:22:57 +0000 +++ lava_test/core/providers.py 1970-01-01 00:00:00 +0000 @@ -1,197 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . - -from lava_test.api.core import ITestProvider -from lava_test.core.config import get_config -from lava_test.core.tests import DeclarativeTest -from lava_test.utils import Cache - -import logging - - -class BuiltInProvider(ITestProvider): - """ - Test provider that provides tests shipped in the Lava-Test source tree - """ - - _builtin_tests = [ - 'bluetooth_enablement', - 'bootchart', - 'device_tree', - 'insanity', - 'e2eaudiotest', - 'firefox', - 'gatortests', - 'glmemperf', - 'gmpbench', - 'gtkperf', - 'leb_basic_graphics', - 'lt_ti_lava', - 'ltp', - 'ltp-snowball-tests', - 'lttng', - 'peacekeeper', - 'perf', - 'posixtestsuite', - 'pwrmgmt', - 'pybench', - 'smem', - 'stream', - 'tiobench', - 'tjbench', - 'x11perf', - 'xrestop', - 'wifi_enablement', - 'browser_benchmarks', - ] - - def __init__(self, config): - pass - - @property - def description(self): - return "Tests built directly into LAVA Test:" - - def __iter__(self): - return iter(self._builtin_tests) - - def __getitem__(self, test_id): - if test_id not in self._builtin_tests: - raise KeyError(test_id) - module = __import__("lava_test.test_definitions.%s" % test_id, - fromlist=['']) - return module.testobj - - -class PkgResourcesProvider(ITestProvider): - """ - Test provider that provides tests declared in pkg_resources working_set - - By default it looks at the 'lava_test.test_definitions' name space but it - can be changed with custom 'namespace' configuration entry. - """ - - def __init__(self, config): - self._config = config - - @property - def namespace(self): - return self._config.get("namespace", "lava_test.test_definitions") - - @property - def description(self): - return ("Tests provided by installed python packages" - " (from namespace {0}):").format(self.namespace) - - def __iter__(self): - from pkg_resources import working_set - for entry_point in working_set.iter_entry_points(self.namespace): - yield entry_point.name - - def __getitem__(self, test_name): - from pkg_resources import working_set - for entry_point in working_set.iter_entry_points(self.namespace, - test_name): - return entry_point.load().testobj - raise KeyError(test_name) - - -class RegistryProvider(ITestProvider): - """ - Test provider that provides declarative tests listed in the test registry. - """ - def __init__(self, config): - self._config = config - self._cache = None - - @property - def entries(self): - """ - List of URLs to DeclarativeTest description files - """ - return self._config.get("entries", []) - - @property - def description(self): - return "Tests provided by LAVA Test registry:" - - @classmethod - def register_remote_test(self, test_url): - config = get_config() # This is a different config object from - # self._config - provider_config = config.get_provider_config( - "lava_test.core.providers:RegistryProvider") - if "entries" not in provider_config: - provider_config["entries"] = [] - if test_url not in provider_config["entries"]: - provider_config["entries"].append(test_url) - config._save_registry() - else: - raise ValueError("This test is already registered") - - @classmethod - def unregister_remote_test(self, test_url): - # This is a different config object from self._config - config = get_config() - provider_config = config.get_provider_config( - "lava_test.core.providers:RegistryProvider") - provider_config.get("entries", []).remove(test_url) - config._save_registry() - - def _load_remote_test(self, test_url): - """ - Load DeclarativeTest from a (possibly cached copy of) test_url - """ - cache = Cache.get_instance() - with cache.open_cached_url(test_url) as stream: - return DeclarativeTest.load_from_stream(stream) - - def _fill_cache(self): - """ - Fill the cache of all remote tests - """ - if self._cache is not None: - return - self._cache = {} - for test_url in self.entries: - try: - test = self._load_remote_test(test_url) - if test.test_id in self._cache: - raise ValueError( - "Duplicate test %s declared" % test.test_id) - self._cache[test.test_id] = test - except IOError as exc: - logging.warning( - "Unable to load test definition from %r: %r", - test_url, exc) - if hasattr(exc, 'reason'): - logging.warning("Error reason: %r", exc.reason) - elif hasattr(exc, 'code'): - logging.warning('Error code: %r', exc.code) - except Exception as exc: - # This can be a number of things, including URL errors, JSON - # errors and validation errors - logging.warning( - 'Unable to load test definition from %r: %r', - test_url, exc) - - def __iter__(self): - self._fill_cache() - for test_id in self._cache.iterkeys(): - yield test_id - - def __getitem__(self, test_id): - self._fill_cache() - return self._cache[test_id] === removed file 'lava_test/core/runners.py' --- lava_test/core/runners.py 2012-03-08 18:27:42 +0000 +++ lava_test/core/runners.py 1970-01-01 00:00:00 +0000 @@ -1,85 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . - -import datetime - -from lava_test.api.delegates import ITestRunner -from lava_test.extcmd import (DisplayDelegate, ExternalCommandWithDelegate) - - -class TestRunner(ITestRunner): - """ - Base class for defining an test runner object. - - This class can be used as-is for simple execution with the expectation that - the run() method will be called from the directory where the test was - installed. Steps, if used, should handle changing directories from there to - the directory where the test was extracted if necessary. This class can - also be extended for more advanced functionality. - - :ivar steps: - list of shell commands to execute - """ - def __init__(self, steps=None, default_options=None): - self.steps = steps or [] - self.default_options = default_options - - def __repr__(self): - return "<%s steps=%r>" % (self.__class__.__name__, self.steps) - - def _run_lava_test_steps(self, artifacts, observer, test_options=None): - stdout = open(artifacts.stdout_pathname, 'at') - stderr = open(artifacts.stderr_pathname, 'at') - delegate = DisplayDelegate(stdout, stderr, observer) - extcmd = ExternalCommandWithDelegate(delegate) - run_failed = False - try: - for cmd in self.steps: - # should override the test options in the step ? - if cmd.find("$(OPTIONS)") > 0: - # check if test options is provided or use default options - if not test_options and self.default_options is None: - raise RuntimeError(( - "Test options is missing." - " No default value was provided.")) - if not test_options: - test_options = self.default_options - cmd = cmd.replace("$(OPTIONS)", test_options) - - if observer: - observer.about_to_run_shell_command(cmd) - returncode = extcmd.call(cmd, shell=True) - if observer: - observer.did_run_shell_command(cmd, returncode) - if returncode != 0: - run_failed = True - finally: - stdout.close() - stderr.close() - return run_failed - - def run(self, artifacts, observer=None, test_options=None): - """ - Run the test program by executing steps in sequence. - - .. seealso:: - - :meth:`~lava_test.api.delegates.TestRunner.run` - """ - self.starttime = datetime.datetime.utcnow() - run_failed = self._run_lava_test_steps( - artifacts, observer, test_options) - self.endtime = datetime.datetime.utcnow() - return run_failed === removed file 'lava_test/core/swprofile.py' --- lava_test/core/swprofile.py 2012-09-19 04:40:25 +0000 +++ lava_test/core/swprofile.py 1970-01-01 00:00:00 +0000 @@ -1,76 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . - -from lava_test.utils import read_file - - -def get_packages(apt_cache=None): - """ Get information about the packages installed - - apt_cache - if not provided, this will be read from the system - """ - import apt - if apt_cache == None: - apt_cache = apt.Cache() - packages = [] - for apt_pkg in apt_cache: - if hasattr(apt_pkg, 'is_installed'): - is_installed = apt_pkg.is_installed - else: - is_installed = apt_pkg.isInstalled # old style API - if is_installed: - pkg = { - "name": apt_pkg.name, - "version": apt_pkg.installed.version} - packages.append(pkg) - return packages - - -def get_software_context(apt_cache=None, lsb_information=None, test=None): - """ Return dict used for storing software_context information - - test_id - Unique identifier for this test - time_check - whether or not a check was performed to see if - the time on the system was synced with a time server - apt_cache - if not provided, this will be read from the system - lsb_information - if not provided, this will be read from the system - """ - software_context = {} - software_context['image'] = get_image(lsb_information) - software_context['packages'] = get_packages(apt_cache) - if test and test.installer: - sources = test.installer.get_software_sources(test.install_dir) - if sources: - software_context['sources'] = sources - return software_context - - -def get_image(lsb_information=None): - """ Get information about the image we are running - - If /etc/buildstamp exists, get the image id from that. Otherwise - just use the lsb-release description for a rough idea. - """ - try: - buildstamp = read_file("/etc/buildstamp") - name = buildstamp.splitlines()[1] - except IOError: - import lsb_release - - if lsb_information == None: - lsb_information = lsb_release.get_distro_information() - name = lsb_information['DESCRIPTION'] - return {"name": name} - === removed file 'lava_test/core/tests.py' --- lava_test/core/tests.py 2012-03-08 18:28:27 +0000 +++ lava_test/core/tests.py 1970-01-01 00:00:00 +0000 @@ -1,167 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . - -from __future__ import absolute_import - -import json -import logging -import os -import shutil - -from lava_test.api.core import ITest -from lava_test.core.artifacts import TestArtifacts -from lava_test.core.config import get_config -from lava_test.core.installers import TestInstaller -from lava_test.core.parsers import TestParser, NativeTestParser -from lava_test.core.runners import TestRunner -from lava_test.utils import changed_directory - - -class Test(ITest): - """ - Reusable class for defining tests. - - This class uses composition instead of inheritance. You should be able to - customize the parts you care about by providing delegate objects. This - class can be used by test definition files to create an object that - contains the building blocks for installing tests, running them, and - parsing the results. - - :ivar test_id: - Name of the test or test suite - :ivar test_version: - Version of the test or test suite - :ivar installer: - ITestInstaller instance to use - :ivar runner: - ITestRunner instance to use - :ivar parser: - ITestParser instance to use - """ - - def __init__(self, test_id, test_version=None, installer=None, runner=None, - parser=None, default_options=None): - self._test_id = test_id - self._test_version = test_version - # Delegate objects - self.installer = installer - self.runner = runner - self.parser = parser - self.default_options = default_options - - # Config instance - self._config = get_config() - - def __repr__(self): - return ("<%s test_id=%r test_version=%r installer=%r runner=%r" - " parser=%r>") % ( - self.__class__.__name__, self.test_id, self.test_version, - self.installer, self.runner, self.parser) - - @property - def test_id(self): - """ - Return the ID of the test. - """ - return self._test_id - - @property - def test_version(self): - """ - Return the version of the test - """ - return self._test_version - - @property - def install_dir(self): - """ - Pathname of a directory with binary and data files installed by the - test. - - .. versionadded:: 0.2 - """ - return os.path.join(self._config.installdir, self.test_id) - - @property - def is_installed(self): - return os.path.exists(self.install_dir) - - def install(self, observer=None): - if self.is_installed: - raise RuntimeError( - "%s is already installed" % self.test_id) - if not self.installer: - raise RuntimeError( - "no installer defined for '%s'" % self.test_id) - with changed_directory(self.install_dir): - try: - logging.debug( - "Invoking %r.install(...)", self.installer) - self.installer.install(observer) - except: - self.uninstall() - raise - - def uninstall(self): - logging.debug("Removing test %r", self.test_id) - if os.path.exists(self.install_dir): - shutil.rmtree(self.install_dir) - - def run(self, observer=None, test_options=None): - if not self.runner: - raise RuntimeError( - "no test runner defined for '%s'" % self.test_id) - artifacts = TestArtifacts.allocate(self.test_id, self._config) - with changed_directory(self.install_dir): - logging.debug("Invoking %r.run(...)", self.runner) - run_fail = self.runner.run(artifacts, observer, test_options) - - return artifacts, run_fail - - def parse(self, artifacts): - if self.parser: - logging.debug("Invoking %r.parse()", self.parser) - with changed_directory(artifacts.results_dir, False): - self.parser.parse(artifacts) - return self.parser.results - - -class DeclarativeTest(Test): - """ - Declaretive ITest implementation. - - Declarative test is like :class:`lava_test.core.tests.Test` but cannot - contain any python code and is completely encapsulated in a .json file. - - The idea is to write .json files that assemble a Test instance using - readily-available TestInstaller, TestRunner and TestParser subclasses. - """ - - def __init__(self, about): - self.about = about - super(DeclarativeTest, self).__init__(self.about.get('test_id')) - self.installer = TestInstaller(**self.about.get('install', {})) - self.runner = TestRunner(**self.about.get('run', {})) - if self.about.get('parse', {}).get('native', False) is True: - self.parser = NativeTestParser(self) - else: - self.parser = TestParser(**self.about.get('parse', {})) - - @classmethod - def load_from_stream(cls, stream): - return cls(json.load(stream)) - - def save_to_stream(self, stream): - json.dumps(self.about, stream, indent="2") === removed file 'lava_test/extcmd.py' --- lava_test/extcmd.py 2011-09-12 09:19:10 +0000 +++ lava_test/extcmd.py 1970-01-01 00:00:00 +0000 @@ -1,108 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . - -from Queue import Queue -import subprocess -import sys -import threading -try: - import posix -except ImportError: - posix = None - - -class ExternalCommand(object): - - def _popen(self, *args, **kwargs): - if posix: - kwargs['close_fds'] = True - return subprocess.Popen(*args, **kwargs) - - def call(self, *args, **kwargs): - proc = self._popen(*args, **kwargs) - proc.wait() - return proc.returncode - - def check_call(self, *args, **kwargs): - returncode = self.call(*args, **kwargs) - if returncode != 0: - raise subprocess.CalledProcessError( - returncode, kwargs.get("args") or args[0]) - return returncode - - -class ExternalCommandWithDelegate(ExternalCommand): - - def __init__(self, delegate): - self._queue = Queue() - self._delegate = delegate - - def _read_stream(self, stream, stream_name): - for line in iter(stream.readline, ''): - cmd = (stream_name, line) - self._queue.put(cmd) - - def _drain_queue(self): - while True: - args = self._queue.get() - if args is None: - break - self._delegate.display_subprocess_output(*args) - - def call(self, *args, **kwargs): - kwargs['stdout'] = subprocess.PIPE - kwargs['stderr'] = subprocess.PIPE - proc = self._popen(*args, **kwargs) - stdout_reader = threading.Thread( - target=self._read_stream, args=(proc.stdout, "stdout")) - stderr_reader = threading.Thread( - target=self._read_stream, args=(proc.stderr, "stderr")) - ui_printer = threading.Thread( - target=self._drain_queue) - - ui_printer.start() - stdout_reader.start() - stderr_reader.start() - try: - proc.wait() - except KeyboardInterrupt: - proc.kill() - finally: - stdout_reader.join() - stderr_reader.join() - self._queue.put(None) - ui_printer.join() - return proc.returncode - - -class DisplayDelegate(object): - """ - Delegate for displaying command output. - - Perfect companion for ExternalCommandWithDelegate. - """ - - def __init__(self, stdout=None, stderr=None, chain=None): - self.stdout = stdout or sys.stdout - self.stderr = stderr or sys.stderr - self.chain = chain - - def display_subprocess_output(self, stream_name, line): - if stream_name == 'stdout': - self.stdout.write(line) - elif stream_name == 'stderr': - self.stderr.write(line) - if self.chain: - self.chain.display_subprocess_output(stream_name, line) === removed file 'lava_test/main.py' --- lava_test/main.py 2012-03-08 17:59:01 +0000 +++ lava_test/main.py 1970-01-01 00:00:00 +0000 @@ -1,45 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . - -import logging -import logging.config - -from lava_tool.dispatcher import LavaDispatcher, run_with_dispatcher_class - - -class LAVATestDispatcher(LavaDispatcher): - - toolname = 'lava_test' - description = """ - LAVA Test wrapper framework - """ - epilog = """ - Please report all bugs using the Launchpad bug tracker: - http://bugs.launchpad.net/lava-test/+filebug - """ - - -def main(): - # default logging level is warning. -v or --verbose will change it to debug - # (in Command class). - FORMAT = '%(asctime)s %(levelname)s: %(message)s' - DATEFMT = '%Y-%m-%d %I:%M:%S %p' - logging.basicConfig(format=FORMAT, datefmt=DATEFMT) - logging.root.setLevel(logging.WARNING) - return run_with_dispatcher_class(LAVATestDispatcher) - - -if __name__ == '__main__': - raise SystemExit(main()) === removed directory 'lava_test/test_definitions' === removed file 'lava_test/test_definitions/__init__.py' === removed file 'lava_test/test_definitions/bluetooth_enablement.py' --- lava_test/test_definitions/bluetooth_enablement.py 2012-09-20 15:24:10 +0000 +++ lava_test/test_definitions/bluetooth_enablement.py 1970-01-01 00:00:00 +0000 @@ -1,51 +0,0 @@ -# Copyright (c) 2012 Linaro -# -# Author: Ricardo Salveti -# -# 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 3 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, see . - -""" -The Bluetooth Enablement test cases helps validating basic bluetooth -functionality, like if the adapter is available, able to scan, pair with -other device and such. - -**URL:** https://code.launchpad.net/~linaro-foundations/linaro-ubuntu/lava-test-bt-enablement - -**Default Options:** None -""" - -from lava_test.core.installers import TestInstaller -from lava_test.core.parsers import TestParser -from lava_test.core.runners import TestRunner -from lava_test.core.tests import Test - -DEFAULT_OPTIONS = "" -BZR_REPOS = ["lp:~linaro-foundations/linaro-ubuntu/lava-test-bt-enablement"] -DEPS = ["bzr", "bluez"] -RUNSTEPS = ["cd lava-test-bt-enablement; sudo bash -x ./run-test.sh"] -PATTERN = "(?P[a-zA-Z0-9_-]+):\s(?P\w+)" -FIXUPS = { - "PASS": "pass", - "FAIL": "fail" -} - -installer = TestInstaller(deps=DEPS, bzr_repos=BZR_REPOS) -runner = TestRunner(RUNSTEPS, default_options=DEFAULT_OPTIONS) -parser = TestParser(PATTERN, fixupdict=FIXUPS) - -testobj = Test( - test_id="bluetooth-enablement", - installer=installer, - runner=runner, - parser=parser) === removed file 'lava_test/test_definitions/bootchart.py' --- lava_test/test_definitions/bootchart.py 2012-09-20 15:24:10 +0000 +++ lava_test/test_definitions/bootchart.py 1970-01-01 00:00:00 +0000 @@ -1,45 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . - -""" -Bootchart is a benchmark for measuring the time it takes to boot the system -to a point where it hands over control to the user. - -**URL:** http://bootchart.org - -**Default options:** None -""" - - -from lava_test.core.installers import TestInstaller -from lava_test.core.parsers import TestParser -from lava_test.core.runners import TestRunner -from lava_test.core.tests import Test - -DEFAULT_OPTIONS = "" -BZR_REPOS = ['lp:~linaro-foundations/lava-test/bootchartscript'] -DEPS = ['bootchart', 'pybootchartgui', 'bzr'] -RUNSTEPS = ['./bootchartscript/bootchartscript.sh $(OPTIONS)'] -PATTERN = "^(?P\w+):\W+(?P\d+\.\d+)" - -installer = TestInstaller(deps=DEPS, bzr_repos=BZR_REPOS) -runner = TestRunner(RUNSTEPS, default_options=DEFAULT_OPTIONS) -parser = TestParser(PATTERN, appendall={'units': 'sec', 'result': 'pass'}) - -testobj = Test( - test_id="bootchart", - installer=installer, - runner=runner, - parser=parser) === removed file 'lava_test/test_definitions/browser_benchmarks.py' --- lava_test/test_definitions/browser_benchmarks.py 2012-10-26 20:04:00 +0000 +++ lava_test/test_definitions/browser_benchmarks.py 1970-01-01 00:00:00 +0000 @@ -1,47 +0,0 @@ -# Copyright (c) 2012 Linaro -# -# Author: John Rigby -# -# 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 3 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, see . - -""" -Use Selenium WebDriver to automatically run browser benchmarks -and scrape the results. - -**URL:** https://code.launchpad.net/~linaro-foundations/linaro-ubuntu/lava-test-browser-benchmarks - -**Default Options:** None -""" - -from lava_test.core.installers import TestInstaller -from lava_test.core.parsers import TestParser -from lava_test.core.runners import TestRunner -from lava_test.core.tests import Test - -DEFAULT_OPTIONS = "" -BZR_REPOS = ["lp:~linaro-foundations/linaro-ubuntu/lava-test-browser-benchmarks"] -DEPS = ["bzr", "python-pip", "chromium-browser", "firefox"] -INSTALLSTEPS = ['pip install selenium'] -RUNSTEPS = ["cd lava-test-browser-benchmarks; bash -x ./run-test.sh; pwd"] -PATTERN = "^(?P\w+):\W+(?P\d+)" - -installer = TestInstaller(INSTALLSTEPS, deps=DEPS, bzr_repos=BZR_REPOS) -runner = TestRunner(RUNSTEPS, default_options=DEFAULT_OPTIONS) -parser = TestParser(PATTERN, appendall={'units': 'score', 'result': 'pass'}) - -testobj = Test( - test_id="browser-benchmarks", - installer=installer, - runner=runner, - parser=parser) === removed file 'lava_test/test_definitions/device_tree.py' --- lava_test/test_definitions/device_tree.py 2012-09-20 15:24:10 +0000 +++ lava_test/test_definitions/device_tree.py 1970-01-01 00:00:00 +0000 @@ -1,49 +0,0 @@ -# Copyright (c) 2012 Linaro -# -# Author: Ricardo Salveti -# -# 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 3 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, see . - -""" -The Device Tree test cases helps validating basic device tree support. - -**URL:** https://code.launchpad.net/~linaro-foundations/linaro-ubuntu/lava-test-device-tree - -**Default Options:** None -""" - -from lava_test.core.installers import TestInstaller -from lava_test.core.parsers import TestParser -from lava_test.core.runners import TestRunner -from lava_test.core.tests import Test - -DEFAULT_OPTIONS = "" -BZR_REPOS = ["lp:~linaro-foundations/linaro-ubuntu/lava-test-device-tree"] -DEPS = ["bzr"] -RUNSTEPS = ["cd lava-test-device-tree; sudo bash -x ./run-test.sh"] -PATTERN = "(?P[a-zA-Z0-9_-]+):\s(?P\w+)" -FIXUPS = { - "PASS": "pass", - "FAIL": "fail" -} - -installer = TestInstaller(deps=DEPS, bzr_repos=BZR_REPOS) -runner = TestRunner(RUNSTEPS, default_options=DEFAULT_OPTIONS) -parser = TestParser(PATTERN, fixupdict=FIXUPS) - -testobj = Test( - test_id="device-tree", - installer=installer, - runner=runner, - parser=parser) === removed file 'lava_test/test_definitions/e2eaudiotest.py' --- lava_test/test_definitions/e2eaudiotest.py 2012-09-19 04:40:25 +0000 +++ lava_test/test_definitions/e2eaudiotest.py 1970-01-01 00:00:00 +0000 @@ -1,36 +0,0 @@ -# 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, see . - -from lava_test.core.installers import TestInstaller -from lava_test.core.parsers import TestParser -from lava_test.core.runners import TestRunner -from lava_test.core.tests import Test - -""" -This program is a simple test for testing the audio device on a linux host. -The application, testfreq, will test the audio device by playing a sine wave -at A440 and then sampling the input for that frequency - input is coupled to -output with a cable. - -**URL:** http://git.linaro.org/gitweb?p=people/kurt-r-taylor/e2eaudiotest.git;a=tree - -**Default options:** None -""" - -GIT_REPOS = ['git://git.linaro.org/people/kurt-r-taylor/e2eaudiotest.git'] - -INSTALLSTEPS = ['cd e2eaudiotest; gcc testfreq.c utils_alsa.c -lasound -lfftw3 -o testfreq '] -DEPS = ['git-core', 'libasound2-dev', 'libfftw3-dev', 'gcc'] -DEFAULT_OPTIONS = "" -RUNSTEPS = ['cd e2eaudiotest; ./e2eaudiotest.sh'] -PATTERN = "^(?P\w+):\W+(?P\w+)\W+(?P\d+)\W+sinewave" - -e2einst = TestInstaller(INSTALLSTEPS, deps=DEPS, git_repos=GIT_REPOS) -e2erun = TestRunner(RUNSTEPS,default_options=DEFAULT_OPTIONS) -e2eparser = TestParser(PATTERN, - appendall={'units':'Hz'}) -testobj = Test(test_id="e2eaudiotest", installer=e2einst, - runner=e2erun, parser=e2eparser) === removed file 'lava_test/test_definitions/firefox.py' --- lava_test/test_definitions/firefox.py 2012-09-20 15:24:10 +0000 +++ lava_test/test_definitions/firefox.py 1970-01-01 00:00:00 +0000 @@ -1,46 +0,0 @@ -# Copyright (c) 2010,2011 Linaro -# -# 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 3 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, see . - -""" -The firefox benchmark measure the startup time for the firefox browser. - -**URL:** https://github.com/janimo/firefox-startup-timing - -**Default Options:** None -""" - -from lava_test.core.installers import TestInstaller -from lava_test.core.parsers import TestParser -from lava_test.core.runners import TestRunner -from lava_test.core.tests import Test - -DEFAULT_OPTIONS = "" - -GIT_REPOS = ['git://github.com/janimo/firefox-startup-timing.git'] -DEPS = ['firefox', 'git-core', 'gcalctool'] -RUNSTEPS = [( - 'cd firefox-startup-timing;' - ' ./firefox_startup_timing.sh $(OPTIONS)')] -PATTERN = "^(?P\w+):(?P\d+)" - -installer = TestInstaller(deps=DEPS, git_repos=GIT_REPOS) -runner = TestRunner(RUNSTEPS, default_options=DEFAULT_OPTIONS) -parser = TestParser(PATTERN, appendall={'units': 'ms', 'result': 'pass'}) - -testobj = Test( - test_id="firefox", - installer=installer, - runner=runner, - parser=parser) === removed file 'lava_test/test_definitions/gatortests.py' --- lava_test/test_definitions/gatortests.py 2012-09-20 15:24:10 +0000 +++ lava_test/test_definitions/gatortests.py 1970-01-01 00:00:00 +0000 @@ -1,41 +0,0 @@ -# Copyright (c) 2010-2012 Linaro -# -# 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 3 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, see . - -""" -gatortests - tests for streamline gator driver and daemon - -""" - -from lava_test.core.installers import TestInstaller -from lava_test.core.parsers import TestParser -from lava_test.core.runners import TestRunner -from lava_test.core.tests import Test - -DEPS = ['gatortests'] - -RUNSTEPS = ["gatortests"] -DEFAULT_OPTIONS = "" - -PATTERN = "^\*\*\*(?P\w+):\s(?P\w+)\*\*\*" - -installer = TestInstaller(deps=DEPS) -runner = TestRunner(RUNSTEPS,default_options=DEFAULT_OPTIONS) -parser = TestParser(pattern=PATTERN) - -testobj = Test( - test_id="gatortests", - installer=installer, - runner=runner, - parser=parser) === removed file 'lava_test/test_definitions/glmark2-es2.py' --- lava_test/test_definitions/glmark2-es2.py 2010-10-01 12:44:34 +0000 +++ lava_test/test_definitions/glmark2-es2.py 1970-01-01 00:00:00 +0000 @@ -1,40 +0,0 @@ -import re -import abrek.testdef - -RUNSTEPS = ["glmark2-es2"] - -class Glmark2Parser(abrek.testdef.AbrekTestParser): - def parse(self): - PAT1 = "^\W+(?P.*?)\W+FPS:\W+(?P\d+)" - filename = "testoutput.log" - pat1 = re.compile(PAT1) - in_results = False - cur_test = "" - with open(filename, 'r') as fd: - for line in fd.readlines(): - if line.find("Precompilation") != -1: - in_results = True - if in_results == True: - match = pat1.search(line) - if match: - d = match.groupdict() - d['test_case_id'] = "%s.%s" % (cur_test, d['subtest']) - d.pop('subtest') - self.results['test_results'].append(d) - else: - if line.startswith("==="): - in_results = False - else: - cur_test = line.strip() - - if self.fixupdict: - self.fixresults(self.fixupdict) - if self.appendall: - self.appendtoall(self.appendall) - -parse = Glmark2Parser(appendall={'units':'fps', 'result':'pass'}) -inst = abrek.testdef.AbrekTestInstaller(deps=["glmark2-es2"]) -run = abrek.testdef.AbrekTestRunner(RUNSTEPS) - -testobj = abrek.testdef.AbrekTest(testname="glmark2-es2", installer=inst, - runner=run, parser=parse) === removed file 'lava_test/test_definitions/glmemperf.py' --- lava_test/test_definitions/glmemperf.py 2012-03-08 19:22:12 +0000 +++ lava_test/test_definitions/glmemperf.py 1970-01-01 00:00:00 +0000 @@ -1,46 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . - -""" -GLMemPerf is an OpenGL ES 2.0 performance estimation tool that aims to -measure the memory bandwidth characteristics of a graphics implementation. -It performs a number of blit style renders using different texture formats, -sizes, orientations and fragment shaders. The results are given as frames -per second numbers. - -**URL:** http://gitorious.org/meego-graphics/glmemperf - -**Default Options:** -e shimage -""" - - -from lava_test.core.installers import TestInstaller -from lava_test.core.parsers import TestParser -from lava_test.core.runners import TestRunner -from lava_test.core.tests import Test - -DEFAULT_OPTIONS = "-e shmimage" -RUNSTEPS = ["glmemperf $(OPTIONS)"] -PATTERN = "^(?P\w+):\W+(?P\d+) fps" - -installer = TestInstaller(deps=["glmemperf"]) -runner = TestRunner(RUNSTEPS, default_options=DEFAULT_OPTIONS) -parser = TestParser(PATTERN, appendall={'units': 'fps', 'result': 'pass'}) - -testobj = Test( - test_id="glmemperf", - installer=installer, - runner=runner, - parser=parser) === removed file 'lava_test/test_definitions/gmpbench.py' --- lava_test/test_definitions/gmpbench.py 2012-03-08 19:22:15 +0000 +++ lava_test/test_definitions/gmpbench.py 1970-01-01 00:00:00 +0000 @@ -1,59 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . -# -""" -This script automates the automate installation, execution, and -results parsing for the GMPbench test suite. -The GMPbench test Suite is an open source test suite with the goal of -comparing different processors performance against eachother. - -**URL:** http://gmplib.org/gmpbench.html - -**Default Options:** None - -""" - - -from lava_test.core.installers import TestInstaller -from lava_test.core.parsers import TestParser -from lava_test.core.runners import TestRunner -from lava_test.core.tests import Test - - -VERSION = '0.2' -URL = "ftp://ftp.gmplib.org/pub/misc/gmpbench-%s.tar.bz2" % VERSION -URL_gexpr = "http://www.gmplib.org/gexpr.c" -DEPS = ['gcc', 'libgmp3-dev', 'wget', 'bzip2'] - -DEFAULT_OPTIONS = "" -INSTALLSTEPS = ['tar -xjf gmpbench-0.2.tar.bz2', - 'wget -c %s' % URL_gexpr, - 'mv gexpr.c gmpbench-0.2', - 'cd gmpbench-0.2 && gcc -o gexpr gexpr.c -static -lm'] -RUNSTEPS = ['cd gmpbench-0.2 && PATH=$PATH:. ./runbench $(OPTIONS)'] -PATTERN = ( - "\s*(?PGMPbench\.*\w*\.*\w*):?\s*" - "(?P\d+.\d+)") - -installer = TestInstaller(INSTALLSTEPS, deps=DEPS, url=URL) -runner = TestRunner(RUNSTEPS, default_options=DEFAULT_OPTIONS) -parser = TestParser(PATTERN, appendall={ - 'units': 'operations/s', 'result': 'pass'}) - -testobj = Test( - test_id="gmpbench", - installer=installer, - runner=runner, - parser=parser) === removed file 'lava_test/test_definitions/gtkperf.py' --- lava_test/test_definitions/gtkperf.py 2012-03-08 19:22:16 +0000 +++ lava_test/test_definitions/gtkperf.py 1970-01-01 00:00:00 +0000 @@ -1,84 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . - -""" -GtkPerf is an application designed to test GTK+ performance using predefined -GTK+ widgets. - -**URL:** http://gtkperf.sourceforge.net/ - -**Default options:** -a -c 500 -""" - -import re - -from lava_test.core.installers import TestInstaller -from lava_test.core.parsers import TestParser -from lava_test.core.runners import TestRunner -from lava_test.core.tests import Test - - -# Run tests automatically, 500 repetitions each -DEFAULT_OPTIONS = "-a -c 500" - -RUNSTEPS = ["LANG=C gtkperf $(OPTIONS)"] - - -class GtkTestParser(TestParser): - - def parse(self, artifacts): - PAT1 = ( - "^(?P\w+)" - " - (?P\w*\W*\w*)" - " - time:\W+(?P\d+\.\d+)") - PAT2 = ( - "^(?P\w+)" - " - time:\W+(?P\d+\.\d+)") - filename = "testoutput.log" - pat1 = re.compile(PAT1) - pat2 = re.compile(PAT2) - with open(filename) as stream: - for lineno, line in enumerate(stream, 1): - match = pat1.search(line) - if match: - d = match.groupdict() - d['test_case_id'] = "%s.%s" % ( - d['test_case_id'], - d['subtest']) - d.pop('subtest') - d['test_case_id'] = d['test_case_id'].replace(" ", "_") - d["log_filename"] = filename - d["log_lineno"] = lineno - self.results['test_results'].append( - self.analyze_test_result(d)) - else: - match = pat2.search(line) - if match: - d = match.groupdict() - d["log_filename"] = filename - d["log_lineno"] = lineno - self.results['test_results'].append( - self.analyze_test_result(d)) - - -installer = TestInstaller(deps=["gtkperf"]) -runner = TestRunner(RUNSTEPS, default_options=DEFAULT_OPTIONS) -parser = GtkTestParser(appendall={'units': 'seconds', 'result': 'pass'}) - -testobj = Test( - test_id="gtkperf", - installer=installer, - runner=runner, - parser=parser) === removed file 'lava_test/test_definitions/insanity.py' --- lava_test/test_definitions/insanity.py 2012-03-08 19:22:18 +0000 +++ lava_test/test_definitions/insanity.py 1970-01-01 00:00:00 +0000 @@ -1,157 +0,0 @@ -# Copyright (c) 2010 Linaro -# -# 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 3 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, see . -# - -""" -GStreamer QA system - -**URL:** http://git.collabora.co.uk/?p=user/edward/gst-qa-system;a=summary - -**Default options:** None -""" - -import os -import simplejson -import gzip -import base64 - -from lava_test.core.installers import TestInstaller -from lava_test.core.parsers import TestParser -from lava_test.core.runners import TestRunner -from lava_test.core.tests import Test - - -MAX_TEST_CASE_ID_LEN = 100 -MAX_ATTR_KEY_LEN = 32 -MAX_ATTR_VAL_LEN = 512 - -MAX_ATTACHMENT_SIZE = 10 * 1024 * 1024 - -SETTINGS = "/usr/share/insanity/web/settings.py" - -# Re-running failing tests is expensive, as it produces very large log files. -# Only remove --no-reruns if you have a small number of failing tests. -RUNSTEPS = [ - "rm -f testrun.db", - "gst-media-test --no-reruns -t playbin-test --settings %s" % SETTINGS, - "gst-media-test --no-reruns -t full-gnlfilesource-scenario " \ - "--settings %s" % SETTINGS, - "gst-media-test --no-reruns -t simple-encoder-scenario", - "echo ////////////////////", - "insanity-dumpresults-json testrun.db --all", -] - - -class InsanityParser(TestParser): - - def parse(self, artifacts): - filename = "testoutput.log" - with open(filename) as stream: - while not stream.readline().startswith("//////////"): - pass - results = simplejson.load(stream) - - self._results = results - self.fixresults({"pass": "pass", "fail": "fail", - "skip": "skip", "expected-failure": "pass"}) - self.fixlengths() - self.attach_logfiles() - - def fixlengths(self): - for t in self.results['test_results']: - if "test_case_id" in t: - if len(t["test_case_id"]) > MAX_TEST_CASE_ID_LEN: - t["test_case_id"] = \ - t["test_case_id"][-MAX_TEST_CASE_ID_LEN:] - if "attributes" in t: - attributes = t["attributes"] - for k, v in attributes.items(): - if len(k) > MAX_ATTR_KEY_LEN: - attributes.pop(k) - # start includes namespace info - k = k[:MAX_ATTR_KEY_LEN] - attributes[k] = v - if len(v) > MAX_ATTR_VAL_LEN: - # end tends to be more useful than the start. - attributes[k] = v[-MAX_ATTR_VAL_LEN:] - - def attach_logfiles(self): - # FIXME: this should use artifacts.attach_file() - attachments = [] - mime_type = "text/plain" - total_attachment_size = 0 - - for test in self.results["test_results"]: - pathname = test.get("log_filename", "") - if not pathname: - continue - if not os.path.exists(pathname): - print "%r not found: skipping." % pathname - continue - - if pathname.endswith(".gz"): - stream = gzip.open(pathname, 'rb') - else: - stream = open(pathname) - - output_text = stream.read() - stream.close() - - total_attachment_size += len(output_text) - if total_attachment_size > MAX_ATTACHMENT_SIZE: - break - - attachments.append({ - "pathname": pathname, - "mime_type": mime_type, - "content": base64.standard_b64encode(output_text) - }) - - self.results.setdefault("attachments", []).extend(attachments) - - def fixresults(self, fixupdict): - """Convert results to a known, standard format - - pass it a dict of keys/values to replace - For instance: - {"TPASS":"pass", "TFAIL":"fail"} - This is really only used for qualitative tests - """ - for t in self.results['test_results']: - if "result" in t: - t['result'] = fixupdict[t['result']] - - -installer = TestInstaller( - deps=[ - "insanity-tools", - "samplemedia-minimal", - "gstreamer0.10-plugins-base", # videotestsrc et al - "gstreamer0.10-plugins-good", # matroskademux et al - "gstreamer0.10-plugins-bad", - "gstreamer0.10-plugins-ugly", # asfdemux et al - "gstreamer0.10-ffmpeg", # ffdec_h264 et al - "gstreamer0.10-gnonlin", # gnlfilesource - "gdb", # debugging backtraces - ] -) -runner = TestRunner(RUNSTEPS) -parser = InsanityParser() - -testobj = Test( - test_id="insanity", - installer=installer, - runner=runner, - parser=parser) === removed file 'lava_test/test_definitions/leb_basic_graphics.py' --- lava_test/test_definitions/leb_basic_graphics.py 2012-09-20 15:24:10 +0000 +++ lava_test/test_definitions/leb_basic_graphics.py 1970-01-01 00:00:00 +0000 @@ -1,50 +0,0 @@ -# Copyright (c) 2012 Linaro -# -# Author: Ricardo Salveti -# -# 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 3 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, see . - -""" -The LEB Basic Graphics validates that the board supports basic graphics -applications and UI environments, like X11, Unity 2D and Unity 3D. - -**URL:** https://code.launchpad.net/~linaro-foundations/linaro-ubuntu/lava-test-basic-graphics - -**Default Options:** None -""" - -from lava_test.core.installers import TestInstaller -from lava_test.core.parsers import TestParser -from lava_test.core.runners import TestRunner -from lava_test.core.tests import Test - -DEFAULT_OPTIONS = "" -BZR_REPOS = ["lp:~linaro-foundations/linaro-ubuntu/lava-test-basic-graphics"] -DEPS = ["bzr", "mesa-utils-extra", "ubuntu-desktop"] -RUNSTEPS = ["cd lava-test-basic-graphics; sudo bash -x ./run-test.sh"] -PATTERN = "(?P[a-zA-Z0-9_-]+):\s(?P\w+)" -FIXUPS = { - "PASS": "pass", - "FAIL": "fail" -} - -installer = TestInstaller(deps=DEPS, bzr_repos=BZR_REPOS) -runner = TestRunner(RUNSTEPS, default_options=DEFAULT_OPTIONS) -parser = TestParser(PATTERN, fixupdict=FIXUPS) - -testobj = Test( - test_id="leb-basic-graphics", - installer=installer, - runner=runner, - parser=parser) === removed file 'lava_test/test_definitions/lt_ti_lava.py' --- lava_test/test_definitions/lt_ti_lava.py 2012-11-13 18:33:35 +0000 +++ lava_test/test_definitions/lt_ti_lava.py 1970-01-01 00:00:00 +0000 @@ -1,65 +0,0 @@ -# Copyright (c) 2012 Linaro -# -# 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 3 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, see . - -""" -Validation test suite for TI ARM features on Linux - -**URL:** http://git.linaro.org/gitweb?p=people/davelong/lt_ti_lava.git;a=summary - -**Default options:** None -""" - -from lava_test.core.installers import TestInstaller -from lava_test.core.parsers import TestParser -from lava_test.core.runners import TestRunner -from lava_test.core.tests import Test - -# Continue the test run in case of failures -DEFAULT_OPTIONS = "-k" - -GIT_REPOS = ['git://git.linaro.org/people/davelong/lt_ti_lava.git'] - -INSTALLSTEPS = ['cd lt_ti_lava && make -C utils'] -RUNSTEPS = ['cd lt_ti_lava && make $(OPTIONS) check'] -DEPS = ['git-core', 'linux-libc-dev', 'build-essential', 'wget', - 'automake', 'libtool', 'libfftw3-dev', 'alsa-utils', - 'pulseaudio-utils'] - -# test case id is before ":" and the result is after -# Each test case is separated with a test description beginning with "#" -# -# Example: -# ### -# ### sd_01: -# ### Verify the system sees at least two partitions for SD device #0 -# ### ### -# sd_01.0: checking Verify... pass - -PATTERN = ( - "^(?P[\w/\.]+):" - "\s+" - "(?P.+)" - "\.\.\.\s+" - "(?P\w+)") - -installer = TestInstaller(INSTALLSTEPS, deps=DEPS, git_repos=GIT_REPOS) -runner = TestRunner(RUNSTEPS, default_options=DEFAULT_OPTIONS) -parser = TestParser(PATTERN) - -testobj = Test( - test_id="lt_ti_lava", - installer=installer, - runner=runner, - parser=parser) === removed file 'lava_test/test_definitions/ltp-snowball-tests.py' --- lava_test/test_definitions/ltp-snowball-tests.py 2012-09-19 04:40:25 +0000 +++ lava_test/test_definitions/ltp-snowball-tests.py 1970-01-01 00:00:00 +0000 @@ -1,80 +0,0 @@ -# Copyright (c) 2010-2012 Linaro -# -# 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 3 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, see . - -""" -Snowball specific kernel tests using LTP test framework. - -**URL:** http://www.igloocommunity.org/gitweb/?p=testing/snowball-ltp-tests.git;a=summary - -**Default options:** dma -""" - -import re - -from lava_test.core.installers import TestInstaller -from lava_test.core.parsers import TestParser -from lava_test.core.runners import TestRunner -from lava_test.core.tests import Test - -GIT_REPOS = ['git://igloocommunity.org/git/testing/snowball-ltp-tests.git'] -INSTALLSTEPS = ['cd snowball-ltp-tests; make config; make tests; make install'] - -DEPS = ['git-core', 'make', 'build-essential'] - -RUNSTEPS = ['cd snowball-ltp-tests/build/opt/ltp && sudo ./runltp -q -p -f $(OPTIONS)'] - -DEFAULT_OPTIONS = "snowball" - -PATTERN = ( - "^(?P\S+)" - "\s*(?P\d+)" - "\s*(?P\w+)" - "\s*:\s*(?P.+)") -FIXUPS = { - "TBROK": "fail", - "TCONF": "skip", - "TFAIL": "fail", - "TINFO": "unknown", - "TPASS": "pass", - "TWARN": "unknown"} - -class LTPParser(TestParser): - - def parse(self, artifacts): - filename = artifacts.stdout_pathname - pat = re.compile(self.pattern) - with open(filename, 'r') as fd: - for line in fd.readlines(): - match = pat.search(line) - if match: - results = match.groupdict() - subid = results.pop('subid') - #The .0 results in ltp are all TINFO, filtering them - #should help eliminate meaningless, duplicate results - if subid == '0': - continue - results['test_case_id'] += "." + subid - self.results['test_results'].append( - self.analyze_test_result(results)) - -installer = TestInstaller(INSTALLSTEPS, deps=DEPS, git_repos=GIT_REPOS) -runner = TestRunner(RUNSTEPS, default_options=DEFAULT_OPTIONS) -parser = LTPParser(PATTERN, fixupdict=FIXUPS) - -testobj = Test( - test_id="ltp-snowball-tests", - installer=installer, - runner=runner, - parser=parser) === removed file 'lava_test/test_definitions/ltp.py' --- lava_test/test_definitions/ltp.py 2012-06-26 09:13:17 +0000 +++ lava_test/test_definitions/ltp.py 1970-01-01 00:00:00 +0000 @@ -1,87 +0,0 @@ -# Copyright (c) 2010-2012 Linaro -# -# 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 3 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, see . - -""" -The Linux Test Project is a collection of tools for testing Linux with a focus -on the kernel. - -**URL:** http://ltp.sourceforge.net - -**Default options:** -f syscalls -p -q -""" - -import re - -from lava_test.core.installers import TestInstaller -from lava_test.core.parsers import TestParser -from lava_test.core.runners import TestRunner -from lava_test.core.tests import Test - -VERSION = "20120614" -INSTALLSTEPS = ['tar --strip-components=1 -jxf ltp-full-%s.bz2' % VERSION, - 'mkdir build', - './configure --prefix=$(readlink -f build)', - 'make all', - 'make SKIP_IDCHECK=1 install'] -DEPS = ['bzip2', 'flex', 'bison', 'build-essential'] -URL = ("http://downloads.sourceforge.net/project/ltp/LTP Source/" - "ltp-%s/ltp-full-%s.bz2") % (VERSION, VERSION) -MD5 = "1078160b1f962a22f1598edad17293c5" - -RUNSTEPS = ['cd build && sudo ./runltp $(OPTIONS)'] -DEFAULT_OPTIONS = "-f syscalls -p -q" - -PATTERN = ( - "^(?P\S+)" - " (?P\d+)" - " (?P\w+)" - " : (?P.+)") -FIXUPS = { - "TBROK": "fail", - "TCONF": "skip", - "TFAIL": "fail", - "TINFO": "unknown", - "TPASS": "pass", - "TWARN": "unknown"} - -class LTPParser(TestParser): - - def parse(self, artifacts): - filename = artifacts.stdout_pathname - pat = re.compile(self.pattern) - with open(filename, 'r') as fd: - for line in fd.readlines(): - match = pat.search(line) - if match: - results = match.groupdict() - subid = results.pop('subid') - #The .0 results in ltp are all TINFO, filtering them - #should help eliminate meaningless, duplicate results - if subid == '0': - continue - results['test_case_id'] += "." + subid - self.results['test_results'].append( - self.analyze_test_result(results)) - -installer = TestInstaller(INSTALLSTEPS, deps=DEPS, url=URL, md5=MD5) -runner = TestRunner(RUNSTEPS, default_options=DEFAULT_OPTIONS) -parser = LTPParser(PATTERN, fixupdict=FIXUPS) - -testobj = Test( - test_id="ltp", - test_version=VERSION, - installer=installer, - runner=runner, - parser=parser) === removed file 'lava_test/test_definitions/lttng.py' --- lava_test/test_definitions/lttng.py 2012-09-19 17:11:20 +0000 +++ lava_test/test_definitions/lttng.py 1970-01-01 00:00:00 +0000 @@ -1,45 +0,0 @@ -# Copyright (c) 2012 Linaro -# -# 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 3 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, see . - -""" -The lttng test executes lttng-tools test suite and reports the result. - -**URL:** https://code.launchpad.net/~linaro-foundations/linaro-ubuntu/lava-test-lttng - -**Default options:** None -""" - -from lava_test.core.installers import TestInstaller -from lava_test.core.parsers import TestParser -from lava_test.core.runners import TestRunner -from lava_test.core.tests import Test - -DEFAULT_OPTIONS = "" - -BZR_REPOS=["lp:~linaro-foundations/linaro-ubuntu/lava-test-lttng"] -INSTALLSTEPS = ["apt-get build-dep lttng-tools --yes"] -DEPS = ["bzr", "linux-headers-$(uname -r)", "lttng-modules-dkms"] -RUNSTEPS = ["cd lava-test-lttng; sudo bash -x ./run-test.sh"] -PATTERN = "^(?P[\w:()]+)\s+\-\s+(?P\w+$)" - -installer = TestInstaller(INSTALLSTEPS, deps=DEPS, bzr_repos=BZR_REPOS) -runner = TestRunner(RUNSTEPS, default_options=DEFAULT_OPTIONS) -parser = TestParser(PATTERN) - -testobj = Test( - test_id="lttng", - installer=installer, - runner=runner, - parser=parser) === removed directory 'lava_test/test_definitions/peacekeeper' === removed file 'lava_test/test_definitions/peacekeeper.py' --- lava_test/test_definitions/peacekeeper.py 2012-03-08 19:22:25 +0000 +++ lava_test/test_definitions/peacekeeper.py 1970-01-01 00:00:00 +0000 @@ -1,50 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . - -""" -This script automates the automate installation, execution, and -results parsing for the Peacekeeper browser benchmark. - -**URL:** http://clients.futuremark.com/peacekeeper/index.action - -**Default options:** firefox -""" - - -from lava_test.core.installers import TestInstaller -from lava_test.core.parsers import TestParser -from lava_test.core.runners import TestRunner -from lava_test.core.tests import Test - -import os - -curdir = os.path.realpath(os.path.dirname(__file__)) - -DEFAULT_OPTIONS = "firefox" -INSTALLSTEPS = ['cp -rf %s/peacekeeper/* .' % curdir] -RUNSTEPS = ['python peacekeeper_runner.py $(OPTIONS)'] -DEPS = ['python-ldtp', 'firefox'] - -PATTERN = "^(?P\w+): Score = (?P\d+)" - -installer = TestInstaller(INSTALLSTEPS, deps=DEPS) -runner = TestRunner(RUNSTEPS, default_options=DEFAULT_OPTIONS) -parser = TestParser(PATTERN, appendall={'units': 'point'}) - -testobj = Test( - test_id="peacekeeper", - installer=installer, - runner=runner, - parser=parser) === removed file 'lava_test/test_definitions/peacekeeper/peacekeeper_runner.py' --- lava_test/test_definitions/peacekeeper/peacekeeper_runner.py 2012-06-21 09:23:50 +0000 +++ lava_test/test_definitions/peacekeeper/peacekeeper_runner.py 1970-01-01 00:00:00 +0000 @@ -1,72 +0,0 @@ -#!/usr/bin/python - -import re -import sys -import time -# FIXME: convert to explicit import -from ldtp import * -from urllib import urlopen - -chromium_data = { - "cmd": "chromium-browser", - "title": "*Chromium", - "urlfield": "txt0" -} - -firefox_data = { - "cmd": "firefox", - "title": "*Firefox", - "urlfield": "txtGotoaWebSite" -} - -browser_data = { - "firefox": firefox_data, - "chromium": chromium_data -} - -site = "http://peacekeeper.futuremark.com/run.action" - -try: - browser = browser_data[sys.argv[1]] -except: - print "Usage: %s [%s]" % (sys.argv[0], '|'.join(browser_data.keys())) - sys.exit(1) - -closewindow(browser["title"]) - -launchapp(browser["cmd"], [site]) - -if not waittillguiexist(browser["title"], guiTimeOut=60): - print "Error: Program never started" - sys.exit(-1) - -result_url = gettextvalue(browser["title"], browser["urlfield"]) -wait_loop = 60 # 60 * 30 seconds = 15 minutes -time.sleep(10) - -while not re.search('results.action', result_url) and wait_loop > 0: - result_url = gettextvalue(browser["title"], browser["urlfield"]) - print "waiting %d ..." % wait_loop - time.sleep(30) - wait_loop = wait_loop - 1 - -closewindow(browser["title"]) - -print "result_url = %s" % result_url - -# if the url not start with http ? append http to it. - -if result_url.find("http") != 0: - result_url = "http://" + result_url - -if wait_loop > 0: - fd = urlopen(result_url) - data = fd.read() - fd.close() - - scoreline = re.search('
(\d+)
', data) - if scoreline: - score = scoreline.group(1) - print "pass: Score = %s" % score -else: - print "fail: Score = 0" === removed file 'lava_test/test_definitions/perf.py' --- lava_test/test_definitions/perf.py 2012-09-20 15:24:10 +0000 +++ lava_test/test_definitions/perf.py 1970-01-01 00:00:00 +0000 @@ -1,48 +0,0 @@ -# Copyright (c) 2010-2012 Linaro -# -# 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 3 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, see . - -""" -A simple test for the perf performance counters subsystem in Linux. This -currently executes various perf commands built into the perf tool - -**URL:** https://code.launchpad.net/~linaro-maintainers/lava-test/lava-test-perf - -**Default options:** None -""" - -from lava_test.core.installers import TestInstaller -from lava_test.core.parsers import TestParser -from lava_test.core.runners import TestRunner -from lava_test.core.tests import Test - -DEFAULT_OPTIONS = "" -DEPS = ["bzr", "linux-tools", "stress-dbgsym"] -BZR_REPOS = ["lp:~linaro-maintainers/lava-test/lava-test-perf"] -RUNSTEPS = ["./lava-test-perf/run-perf-test.sh"] -PATTERN = "^(?Pperf[\w\s-]+)\s+:\s+(?P\w+)" -FIXUPS = { - "PASS": "pass", - "FAIL": "fail" -} - -installer = TestInstaller(deps=DEPS, bzr_repos=BZR_REPOS) -runner = TestRunner(RUNSTEPS, default_options=DEFAULT_OPTIONS) -parser = TestParser(PATTERN, fixupdict=FIXUPS) - -testobj = Test( - test_id="perf", - installer=installer, - runner=runner, - parser=parser) === removed file 'lava_test/test_definitions/posixtestsuite.py' --- lava_test/test_definitions/posixtestsuite.py 2012-05-24 05:21:21 +0000 +++ lava_test/test_definitions/posixtestsuite.py 1970-01-01 00:00:00 +0000 @@ -1,87 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . - -""" -The POSIX Test Suite is an open source test suite with the goal of -performing conformance, functional, and stress testing of the IEEE -1003.1-2001 System Interfaces specification However the automation here -does not support the stress test runs. - -**URL:** http://sourceforge.net/projects/posixtest/ - -**Default options:** None -""" - -import re - -from lava_test.core.installers import TestInstaller -from lava_test.core.parsers import TestParser -from lava_test.core.runners import TestRunner -from lava_test.core.tests import Test - - -VERSION = "20100831" -URL = ("http://downloads.sourceforge.net/project/ltp/LTP Source/ltp-%s/" - "ltp-full-%s.bz2") % (VERSION, VERSION) -MD5 = "6982c72429a62f3917c13b2d529ad1ce" -DEFAULT_OPTIONS = "" -INSTALLSTEPS = ['tar -xjf ltp-full-20100831.bz2'] -DEPS = ['build-essential', 'bzip2'] -RUNSTEPS = [ - ('cd ltp-full-20100831/testcases/open_posix_testsuite/' - ' && make $(OPTIONS)')] - -PATTERN = ("((?P\A(\w+[/]+)+\w+[-]*\w*[-]*\w*)" - " .*? (?P\w+))") -FIXUPS = { - "FAILED": "fail", - "INTERRUPTED": "skip", - "PASSED": "pass", - "UNRESOLVED": "unknown", - "UNSUPPORTED": "skip", - "UNTESTED": "skip", - "SKIPPING": "skip" -} - - -class PosixParser(TestParser): - - def parse(self, artifacts): - filename = "testoutput.log" - pat = re.compile(self.pattern) - with open(filename) as fd: - for lineno, line in enumerate(fd, 1): - match = pat.match(line) - if not match: - continue - results = match.groupdict() - test_case_id = results['test_case_id'] - results['test_case_id'] = test_case_id.replace("/", ".") - results["log_filename"] = "testoutput.log" - results["log_lineno"] = lineno - self.results['test_results'].append( - self.analyze_test_result(results)) - - -installer = TestInstaller(INSTALLSTEPS, deps=DEPS, url=URL, md5=MD5) -runner = TestRunner(RUNSTEPS, default_options=DEFAULT_OPTIONS) -parser = PosixParser(PATTERN, fixupdict=FIXUPS) - -testobj = Test( - test_id="posixtestsuite", - test_version=VERSION, - installer=installer, - runner=runner, - parser=parser) === removed file 'lava_test/test_definitions/pwrmgmt.py' --- lava_test/test_definitions/pwrmgmt.py 2013-01-03 22:15:23 +0000 +++ lava_test/test_definitions/pwrmgmt.py 1970-01-01 00:00:00 +0000 @@ -1,66 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . - -""" -Linaro Power Management QA test suite - -**URL:** http://git.linaro.org/gitweb?p=tools/pm-qa.git;a=summary - -**Default options:** None -""" - -from lava_test.core.installers import TestInstaller -from lava_test.core.parsers import TestParser -from lava_test.core.runners import TestRunner -from lava_test.core.tests import Test - -# Continue the test run in case of failures -DEFAULT_OPTIONS = "-k" - -GIT_REPOS = ['git://git.linaro.org/tools/pm-qa.git'] -INSTALLSTEPS = ['cd pm-qa && make -C utils'] -RUNSTEPS = ['cd pm-qa && make $(OPTIONS) check'] -DEPS = ['git-core', 'linux-libc-dev', 'build-essential'] - -# test case name is before ":" , the test log is between ":" and "...", -# the result is after "..." -# Each test case is separated with a test description beginning with "#" - -# Example: -#### -#### cpufreq_02: -#### test the cpufreq framework is available for governor -#### -#cpufreq_02.0/cpu0: checking scaling_available_governors exists... pass -#cpufreq_02.1/cpu0: checking scaling_governor exists... pass -#cpufreq_02.0/cpu1: checking scaling_available_governors exists... pass -#cpufreq_02.1/cpu1: checking scaling_governor exists... pass - -PATTERN = ( - "^(?P[\w/\.]+):" - "\s+" - "(?P.+)" - "\.\.\.\s+" - "(?P\w+)") - -installer = TestInstaller(INSTALLSTEPS, deps=DEPS, git_repos=GIT_REPOS) -runner = TestRunner(RUNSTEPS, default_options=DEFAULT_OPTIONS) -parser = TestParser(PATTERN) - -testobj = Test( - test_id="pwrmgmt", - installer=installer, - runner=runner, - parser=parser) === removed file 'lava_test/test_definitions/pybench.py' --- lava_test/test_definitions/pybench.py 2012-03-17 11:02:42 +0000 +++ lava_test/test_definitions/pybench.py 1970-01-01 00:00:00 +0000 @@ -1,62 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . - -""" -The Pybench test Suite is an open source test suite that provides a -standardized way to measure the performance of Python implementations. - -**URL:** http://python.org - -**Default options:** None -""" - - -from lava_test.core.installers import TestInstaller -from lava_test.core.parsers import TestParser -from lava_test.core.runners import TestRunner -from lava_test.core.tests import Test - -VERSION = 'r27' -URL = "http://svn.python.org/projects/python/tags/%s/Tools/pybench/" % VERSION -DEFAULT_OPTIONS = "" -INSTALLSTEPS = ["svn export %s" % URL] -RUNSTEPS = ['python pybench/pybench.py $(OPTIONS)'] -DEPS = ['subversion'] - - -# test case name is first column and measurement is average column -# -#Test minimum average operation overhead -# BuiltinFunctionCalls: 85ms 151ms 0.30us 0.147ms -# BuiltinMethodLookup: 68ms 113ms 0.11us 0.171ms - -PATTERN = ( - "^\s+" - "(?P\w+)" - ":" - "\s+(\d+)ms" - "\s+" - "(?P\d+)ms") - - -installer = TestInstaller(INSTALLSTEPS, deps=DEPS) -runner = TestRunner(RUNSTEPS, default_options=DEFAULT_OPTIONS) -parser = TestParser(PATTERN, appendall={'units': 'ms', 'result': 'pass'}) - -testobj = Test( - test_id="pybench", - installer=installer, - runner=runner, - parser=parser) === removed file 'lava_test/test_definitions/render-bench.py' --- lava_test/test_definitions/render-bench.py 2012-03-17 11:02:42 +0000 +++ lava_test/test_definitions/render-bench.py 1970-01-01 00:00:00 +0000 @@ -1,59 +0,0 @@ -# Copyright (c) 2012 Linaro -# -# 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 3 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, see . - -""" -A program that performs a series of tests to benchmark the XRender X11 -extension. It also performs the same tests using the Imlib2 library to -provide a base for comparing performance. - -**URL:** None - -**Default options:** None -""" - - -import re -import abrek.testdef - -class RenderBenchParser(abrek.testdef.AbrekTestParser): - def parse(self): - PAT1 = "^Test: (?P.*)" - PAT2 = "^Time: (?P\d+\.\d+)" - filename = "testoutput.log" - pat1 = re.compile(PAT1) - pat2 = re.compile(PAT2) - cur_test = None - with open(filename, 'r') as fd: - for line in fd: - match = pat1.search(line) - if match: - cur_test = match.groupdict()['test_case_id'] - else: - match = pat2.search(line) - if match: - d = match.groupdict() - d['test_case_id'] = cur_test - self.results['test_results'].append(d) - - self.appendtoall({'units':'seconds', 'result':'pass'}) - -RUNSTEPS = ["render_bench"] - -inst = abrek.testdef.AbrekTestInstaller(deps=["render-bench"]) -run = abrek.testdef.AbrekTestRunner(RUNSTEPS) -parse = RenderBenchParser() - -testobj = abrek.testdef.AbrekTest(testname="render-bench", installer=inst, - runner=run, parser=parse) === removed file 'lava_test/test_definitions/smem.py' --- lava_test/test_definitions/smem.py 2012-03-17 11:02:42 +0000 +++ lava_test/test_definitions/smem.py 1970-01-01 00:00:00 +0000 @@ -1,43 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . - -""" -Simple test for smem that simply reports the memory usage with shared memory divided proportionally - -**URL:** None - -**Default options:** None -""" - - -from lava_test.core.installers import TestInstaller -from lava_test.core.parsers import TestParser -from lava_test.core.runners import TestRunner -from lava_test.core.tests import Test - -DEFAULT_OPTIONS = "" -RUNSTEPS = ['smem -w $(OPTIONS) | tail -n 3'] -PATTERN = "^(?P(\w+\s)+)\s\s+(?P\d+)" -DEPS = ['smem'] - -installer = TestInstaller(deps=DEPS) -runner = TestRunner(RUNSTEPS, default_options=DEFAULT_OPTIONS) -parser = TestParser(PATTERN, appendall={'units': 'KB', 'result': 'pass'}) - -testobj = Test( - test_id="smem", - installer=installer, - runner=runner, - parser=parser) === removed file 'lava_test/test_definitions/spandex-gles2.py' --- lava_test/test_definitions/spandex-gles2.py 2010-11-30 14:20:51 +0000 +++ lava_test/test_definitions/spandex-gles2.py 1970-01-01 00:00:00 +0000 @@ -1,41 +0,0 @@ -# Copyright (c) 2010 Linaro Limited -# -# 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 3 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, see . - -import abrek.testdef - -spandex_benchmark = "/usr/share/spandex/bd/benchmarks/opengles2/benchmark_smoke.txt" - -INSTALL_STEPS = [ - 'sudo add-apt-repository ppa:linaro-maintainers/user-platforms', - 'sudo apt-get update', - 'sudo apt-get install -y --force-yes spandex-gles2 spandex-benchmarks-gles2' - ] - -RUNSTEPS = [ - "spandex-gles2 %s > /dev/null" % spandex_benchmark, - "python /usr/share/spandex/bd/python/wikireport.py result.txt" - ] - -PATTERN = "^\|\s+(?P[^|]+?)\s+\|\s+(?P\d+(\.\d+)?)" - -inst = abrek.testdef.AbrekTestInstaller(INSTALL_STEPS, - deps=["python-software-properties"]) -run = abrek.testdef.AbrekTestRunner(RUNSTEPS) -parse = abrek.testdef.AbrekTestParser(PATTERN, - appendall={'units':'reps/s', - 'result':'pass'}) - -testobj = abrek.testdef.AbrekTest(testname="spandex-gles2", installer=inst, - runner=run, parser=parse) === removed file 'lava_test/test_definitions/stream.py' --- lava_test/test_definitions/stream.py 2012-03-17 11:02:42 +0000 +++ lava_test/test_definitions/stream.py 1970-01-01 00:00:00 +0000 @@ -1,45 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . - -""" -The Stream benchmark for measuring memory bandwidth - -**URL:** http://www.cs.virginia.edu/stream/ - -**Default options:** None -""" - - -from lava_test.core.installers import TestInstaller -from lava_test.core.parsers import TestParser -from lava_test.core.runners import TestRunner -from lava_test.core.tests import Test - -URL = "http://www.cs.virginia.edu/stream/FTP/Code/stream.c" -INSTALLSTEPS = ['cc stream.c -O2 -fopenmp -o stream'] -DEPS = ['gcc', 'build-essential'] -DEFAULT_OPTIONS = "" -RUNSTEPS = ['./stream $(OPTIONS)'] -PATTERN = "^(?P\w+):\W+(?P\d+\.\d+)" - -installer = TestInstaller(INSTALLSTEPS, deps=DEPS, url=URL) -runner = TestRunner(RUNSTEPS, default_options=DEFAULT_OPTIONS) -parser = TestParser(PATTERN, appendall={'units': 'MB/s', 'result': 'pass'}) - -testobj = Test( - test_id="stream", - installer=installer, - runner=runner, - parser=parser) === removed file 'lava_test/test_definitions/tiobench.py' --- lava_test/test_definitions/tiobench.py 2012-03-17 11:02:42 +0000 +++ lava_test/test_definitions/tiobench.py 1970-01-01 00:00:00 +0000 @@ -1,89 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . -# - -""" -Tiobench is a multi-threaded I/O benchmark. It is used to measure -system performance in four basic operations: sequential read, -random read, sequential write, and random write. - -**URL:** http://sourceforge.net/projects/tiobench/ - -**Default options:** --block=4096 --block=8192 --threads=2 --numruns=2 -""" - -""" -""" -import re - -from lava_test.core.installers import TestInstaller -from lava_test.core.parsers import TestParser -from lava_test.core.runners import TestRunner -from lava_test.core.tests import Test - - -VERSION = "0.3.3" -URL = ("http://prdownloads.sourceforge.net/tiobench/" - "tiobench-%s.tar.gz") % VERSION -MD5 = "bf485bf820e693c79e6bd2a38702a128" -DEFAULT_OPTIONS = "--block=4096 --block=8192 --threads=2 --numruns=2" -INSTALLSTEPS = [ - 'tar -zxvf tiobench-%s.tar.gz' % VERSION, - 'cd tiobench-%s && make' % VERSION] -RUNSTEPS = [( - "cd tiobench-%s && " - "./tiobench.pl $(OPTIONS)") % VERSION] - - -class TIObenchTestParser(TestParser): - - def parse(self, artifacts): - # Pattern to match the test case name - pattern1 = "(?P^(Sequential|Random) (Writes|Reads))" - # Pattern to match the parameter details and measurement - pattern2 = (".*?(?P\d+)\s+(?P\d+)\s+.*? " - "(?P((\d|#)+\.?\d*))") - filename = "testoutput.log" - pat1 = re.compile(pattern1) - pat2 = re.compile(pattern2) - tc_id = None - with open(filename) as stream: - for lineno, line in enumerate(stream, 1): - match1 = pat1.match(line) - match2 = pat2.search(line) - if match1: - tc_id = match1.group('test_id').replace(" ", "") - if match2 and tc_id != None: - results = match2.groupdict() - blks_size = results.pop('blks_size') - filesize = results.pop('file_size') - results['test_case_id'] = ( - '%s_%sMBfilesize_%sbytesblksize') % ( - tc_id, filesize, blks_size) - results["log_filename"] = "testoutput.log" - results["log_lineno"] = lineno - self.results['test_results'].append( - self.analyze_test_result(results)) - -installer = TestInstaller(INSTALLSTEPS, url=URL, md5=MD5) -runner = TestRunner(RUNSTEPS, default_options=DEFAULT_OPTIONS) -parser = TIObenchTestParser(appendall={'units': 'MB/s', 'result': 'pass'}) - -testobj = Test( - test_id="tiobench", - test_version=VERSION, - installer=installer, - runner=runner, - parser=parser) === removed file 'lava_test/test_definitions/tjbench.py' --- lava_test/test_definitions/tjbench.py 2012-09-19 17:11:20 +0000 +++ lava_test/test_definitions/tjbench.py 1970-01-01 00:00:00 +0000 @@ -1,79 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . -import re - -from lava_test.core.installers import TestInstaller -from lava_test.core.parsers import TestParser -from lava_test.core.runners import TestRunner -from lava_test.core.tests import Test - -ppm="nightshot_iso_100.ppm" -URL_ppm="http://people.linaro.org/~qzhang/streams/nightshot_iso_100.ppm" - -BZR_REPOS = ['lp:~qzhang/libjpeg-turbo/tjbench'] - -# For the url is from wiki, its name will be saved as with some extra characters -# so it doesn't pass as parameter but use a separate install step. -INSTALLSTEPS = ['wget --no-check-certificate -q "%s" -O %s' % (URL_ppm, ppm)] -DEPS = ['bzr', 'libjpeg-turbo-progs', 'libjpeg-turbo62', 'wget'] -DEFAULT_OPTIONS ="" -RUNSTEPS = ['./tjbench/tjbench.sh %s' % ppm] - -class TjbenchParser(TestParser): - def parse(self, artifacts): - filename = artifacts.stdout_pathname - pat = re.compile(self.pattern) - tc_id = None - # Add scale_half prefix or not, the first cmd is half scale, but it's - # somewhat hard coded - scale_half = {} - with open(filename, 'r') as fd: - for line in fd.readlines(): - match = pat.search(line) - if match: - match_results = match.groupdict() - format = match_results.pop('format') - bitorder = match_results.pop('bitorder') - subsamp = match_results.pop('subsamp') - qual = match_results.pop('qual') - - test_case_id_prefix = '%s_%s_%s_%s' % (format, bitorder, - subsamp, qual) - if not scale_half.get(test_case_id_prefix): - scale_half[test_case_id_prefix] = True - test_case_id_prefix = "%s_%s" % ( - test_case_id_prefix, "scale_half") - - for perf in ['comp_perf', 'comp_ratio', 'dcomp_perf']: - results = { } - results["log_filename"] = filename - results['test_case_id'] = '%s-%s' % ( - test_case_id_prefix, perf) - results['measurement'] = match_results.pop(perf) - if perf == 'comp_ratio': - results['units'] = '%' - else: - results['units'] = 'Mpixels/s' - self.results['test_results'].append( - self.analyze_test_result(results)) - -#RGB TD 4:2:0 95 3136 2352 19.45 15.53 23.30 -PATTERN = "^(?P\S+)\s+(?P\w+)\s+(?P[:\w]+)\s+(?P\d+)\s+\d+\s+\d+\s+(?P\d+\.\d+)\s+(?P\d+\.\d+)\s+(?P\d+\.\d+)" - -tjbench_inst = TestInstaller(INSTALLSTEPS, deps=DEPS, bzr_repos=BZR_REPOS) -tjbench_run = TestRunner(RUNSTEPS, default_options=DEFAULT_OPTIONS) -tjbench_parser = TjbenchParser(PATTERN, appendall={'result':'pass'}) -testobj = Test(test_id="tjbench", - installer=tjbench_inst, runner=tjbench_run, parser=tjbench_parser) === removed file 'lava_test/test_definitions/wifi_enablement.py' --- lava_test/test_definitions/wifi_enablement.py 2012-09-20 15:24:10 +0000 +++ lava_test/test_definitions/wifi_enablement.py 1970-01-01 00:00:00 +0000 @@ -1,56 +0,0 @@ -# Copyright (c) 2012 Linaro -# -# Author: Ricardo Salveti -# -# 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 3 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, see . - -""" -The WIFI Enablement test cases helps validating basic wireless -functionality, like if the adapter is available, able to scan, connect and -transfer a file over the network. - -**URL:** https://code.launchpad.net/~linaro-foundations/linaro-ubuntu/lava-test-wifi-enablement - -**Default Options:** None -""" - -from lava_test.core.installers import TestInstaller -from lava_test.core.parsers import TestParser -from lava_test.core.runners import TestRunner -from lava_test.core.tests import Test - -DEFAULT_OPTIONS = "" -BZR_REPOS = ["lp:~linaro-foundations/linaro-ubuntu/lava-test-wifi-enablement"] -DEPS = [ - "bzr", - "wpasupplicant", - "isc-dhcp-client", - "wireless-tools", - "net-tools"] -RUNSTEPS = ["cd lava-test-wifi-enablement; sudo bash -x ./run-test.sh"] -PATTERN = "(?P[a-zA-Z0-9_-]+):\s(?P\w+)" -FIXUPS = { - "PASS": "pass", - "FAIL": "fail" -} - -installer = TestInstaller(deps=DEPS, bzr_repos=BZR_REPOS) -runner = TestRunner(RUNSTEPS, default_options=DEFAULT_OPTIONS) -parser = TestParser(PATTERN, fixupdict=FIXUPS) - -testobj = Test( - test_id="wifi-enablement", - installer=installer, - runner=runner, - parser=parser) === removed file 'lava_test/test_definitions/x11perf.py' --- lava_test/test_definitions/x11perf.py 2012-03-17 11:02:42 +0000 +++ lava_test/test_definitions/x11perf.py 1970-01-01 00:00:00 +0000 @@ -1,70 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . -# - -""" -X11perf is an xlib based benchmark to see how fast an X server can execute various tests - -**URL:** http://cgit.freedesktop.org/xorg/app/x11perf/ - -**Default options:** -repeat 3 -aa10text -aa24text -aatrapezoid300 -aatrap2x300 -copypixwin500 -copypixpix500 -comppixwin500 -shmput500 -shmputxy500 -scroll500 -""" - - - -from lava_test.core.installers import TestInstaller -from lava_test.core.parsers import TestParser -from lava_test.core.runners import TestRunner -from lava_test.core.tests import Test - - -x11perf_options = "-repeat 3" - -x11perf_tests = [ - # Antialiased text (using XFT) - "-aa10text", - "-aa24text", - - # Antialiased drawing (using XRENDER) - "-aatrapezoid300", - "-aatrap2x300", - - # Normal blitting - "-copypixwin500", - "-copypixpix500", - - # Composited blitting - "-comppixwin500", - - # SHM put image - "-shmput500", - "-shmputxy500", - - "-scroll500", -] - -DEFAULT_OPTIONS = "%s %s" % (x11perf_options, " ".join(x11perf_tests)) -RUNSTEPS = ["x11perf $(OPTIONS)"] -PATTERN = "trep @.*\(\W*(?P\d+.\d+)/sec\):\W+(?P.+)" - -installer = TestInstaller(deps=["x11-apps"]) -runner = TestRunner(RUNSTEPS, default_options=DEFAULT_OPTIONS) -parser = TestParser(PATTERN, appendall={'units': 'reps/s', 'result': 'pass'}) - -testobj = Test( - test_id="x11perf", - installer=installer, - runner=runner, - parser=parser) === removed file 'lava_test/test_definitions/xrestop.py' --- lava_test/test_definitions/xrestop.py 2012-09-20 15:24:10 +0000 +++ lava_test/test_definitions/xrestop.py 1970-01-01 00:00:00 +0000 @@ -1,42 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . - -""" -xrestop - test for X11 server resource usage monitor - -**URL:** http://code.launchpad.net/~linaro-foundations/lava-test/xrestopscript - -**Default options:** None -""" - -from lava_test.core.installers import TestInstaller -from lava_test.core.parsers import TestParser -from lava_test.core.runners import TestRunner -from lava_test.core.tests import Test - -BZR_REPOS = ['lp:~linaro-foundations/lava-test/xrestopscript'] -RUNSTEPS = ["./xrestopscript/xrestop.sh $(OPTIONS)"] -PATTERN = "^(?P\w+):\W+(?P\d+)" -DEFAULT_OPTIONS = "" - -installer = TestInstaller(deps=["xrestop"], bzr_repos=BZR_REPOS) -runner = TestRunner(RUNSTEPS, default_options=DEFAULT_OPTIONS) -parser = TestParser(PATTERN, appendall={'units': 'KB', 'result': 'pass'}) - -testobj = Test( - test_id="xrestop", - installer=installer, - runner=runner, - parser=parser) === removed file 'lava_test/utils.py' --- lava_test/utils.py 2012-03-08 19:17:28 +0000 +++ lava_test/utils.py 1970-01-01 00:00:00 +0000 @@ -1,226 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . - -import contextlib -import hashlib -import logging -import os -import shutil -import urllib2 -import urlparse - -_fake_files = None -_fake_paths = None -_fake_machine = None - - -def geturl(url, path=""): - urlpath = urlparse.urlsplit(url).path - filename = os.path.basename(urlpath) - if path: - filename = os.path.join(path, filename) - fd = open(filename, "w") - try: - response = urllib2.urlopen(urllib2.quote(url, safe=":/")) - fd = open(filename, 'wb') - shutil.copyfileobj(response, fd, 0x10000) - fd.close() - response.close() - except: - raise RuntimeError("Could not retrieve %s" % url) - return filename - - -def write_file(data, path): - with open(path, "w") as fd: - fd.write(data) - - -def read_file(path): - global _fake_files - global _fake_paths - if _fake_files is not None: - if path in _fake_files: - return _fake_files[path] - if _fake_paths is not None: - if path in _fake_paths: - path = _fake_paths[path] - with open(path, 'rb') as stream: - return stream.read() - - -def fake_file(path, data=None, newpath=None): - """ - Set up a fake file to be read with read_file() in testing - If data is specified, the string passed as data will be returned instead - if newpath is specified, the file attempted to be read will be replaced - by newfile - """ - global _fake_files - global _fake_paths - if data is not None: - if _fake_files is None: - _fake_files = {} - _fake_files[path] = data - if newpath is not None: - if _fake_paths is None: - _fake_paths = {} - _fake_paths[path] = newpath - - -def fake_machine(type): - """ - Set up a fake machine type for testing - """ - global _fake_machine - _fake_machine = type - - -def clear_fakes(): - global _fake_files - global _fake_paths - _fake_files = {} - _fake_paths = {} - - -def clear_fake_machine(): - global _fake_machine - _fake_machine = None - - -def get_machine_type(): - """ - Return the machine type - """ - global _fake_machine - if _fake_machine is None: - return os.uname()[-1] - return _fake_machine - - -def mkdir_p(dirname): - if not os.path.exists(dirname): - os.makedirs(dirname) - - -@contextlib.contextmanager -def changed_directory(dirname, make_if_needed=True): - """ - A context manager for running a piece of code in another - directory. The directory is created if needed (by default, can - be changed with make_if_needed). - """ - orig_dir = os.getcwd() - if make_if_needed: - mkdir_p(dirname) - logging.info("Changing directory to %r", dirname) - os.chdir(dirname) - try: - yield - finally: - logging.info("Changing directory to %r", orig_dir) - os.chdir(orig_dir) - - -def merge_dict(merge_into, merge_from): - """ - Merge two dictionaries recursively: - - 1) Simple values are overwritten with a logging.warning() message - 2) Lists are appended - 3) Dictionaries are merged recursively - """ - assert isinstance(merge_into, dict) - assert isinstance(merge_from, dict) - for key in merge_from.iterkeys(): - if key in merge_into: - if (isinstance(merge_from[key], dict) - and isinstance(merge_into[key], dict)): - merge_dict(merge_into[key], merge_from[key]) - elif (isinstance(merge_from[key], list) - and isinstance(merge_into[key], list)): - merge_into[key].extend(merge_from[key]) - else: - logging.warning( - "Overwriting existing value of %r:" - "%r overwritten with %r", - key, merge_into[key], merge_from[key]) - merge_into[key] = merge_from[key] - else: - merge_into[key] = merge_from[key] - - -class Cache(object): - """ - Simple open-cached-URL class - """ - - _instance = None - - def __init__(self): - home = os.environ.get('HOME', '/') - basecache = os.environ.get('XDG_CACHE_HOME', - os.path.join(home, '.cache')) - self.cache_dir = os.path.join(basecache, 'lava_test') - - @classmethod - def get_instance(cls): - if cls._instance is None: - cls._instance = cls() - return cls._instance - - def _open_cached(self, key, mode="r"): - """ - Acts like open() but the pathname is relative to the - lava_test-specific cache directory. - """ - - if "w" in mode and not os.path.exists(self.cache_dir): - os.makedirs(self.cache_dir) - if os.path.isabs(key): - raise ValueError("key cannot be an absolute path") - - stream = open(os.path.join(self.cache_dir, key), mode) - return stream - - def _key_for_url(self, url): - return hashlib.sha1(url).hexdigest() - - def _refresh_url_cache(self, key, url): - with contextlib.nested( - contextlib.closing(urllib2.urlopen(url)), - self._open_cached(key, "wb")) as (in_stream, out_stream): - out_stream.write(in_stream.read()) - - @contextlib.contextmanager - def open_cached_url(self, url): - """ - Like urlopen.open() but the content may be cached. - """ - # Do not cache local files, this is not what users would expect - - if url.startswith("file://"): - stream = urllib2.urlopen(url) - else: - key = self._key_for_url(url) - try: - stream = self._open_cached(key, "rb") - except IOError: - self._refresh_url_cache(key, url) - stream = self._open_cached(key, "rb") - try: - yield stream - finally: - stream.close() === removed file 'setup.cfg' --- setup.cfg 2012-05-28 04:28:11 +0000 +++ setup.cfg 1970-01-01 00:00:00 +0000 @@ -1,2 +0,0 @@ -[upload] -sign=True === removed file 'setup.py' --- setup.py 2012-03-02 14:21:13 +0000 +++ setup.py 1970-01-01 00:00:00 +0000 @@ -1,69 +0,0 @@ -#!/usr/bin/env python - -# Copyright (c) 2010, 2011, 2012 Linaro -# -# 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 3 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, see . - -from setuptools import setup, find_packages - - -setup( - name='lava-test', - version=":versiontools:lava_test:", - author='Linaro Validation Team', - author_email='linaro-dev@lists.linaro.org', - url='https://launchpad.net/lava-test', - description='LAVA test execution framework', - long_description=open("README").read(), - packages=find_packages(exclude=['tests']), - license="GNU GPLv3", - test_suite='unittest2.collector', - entry_points=""" - [console_scripts] - lava-test=lava_test.main:main - [lava_test.commands] - version=lava_test.commands:version - list-tests=lava_test.commands:list_tests - list-installed=lava_test.commands:list_installed - install=lava_test.commands:install - uninstall=lava_test.commands:uninstall - run=lava_test.commands:run - parse=lava_test.commands:parse - show=lava_test.commands:show - register_test=lava_test.commands:register_test - unregister_test=lava_test.commands:unregister_test - reset=lava_test.commands:reset - """, - classifiers=[ - "Development Status :: 3 - Alpha", - "Intended Audience :: Developers", - "License :: OSI Approved :: GNU General Public License (GPL)", - "Operating System :: OS Independent", - "Programming Language :: Python :: 2.6", - "Topic :: Software Development :: Testing", - ], - install_requires=[ - 'lava-tool >= 0.2', - 'versiontools >= 1.4', - 'linaro_dashboard_bundle', - ], - setup_requires=[ - 'versiontools >= 1.4' - ], - tests_require=[ - 'unittest2', - 'mocker >= 1.1', - ], - zip_safe=False, - include_package_data=True) === removed directory 'tests' === removed file 'tests/__init__.py' --- tests/__init__.py 2012-02-04 20:50:16 +0000 +++ tests/__init__.py 1970-01-01 00:00:00 +0000 @@ -1,14 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . === removed file 'tests/fixtures.py' --- tests/fixtures.py 2011-09-12 09:19:10 +0000 +++ tests/fixtures.py 1970-01-01 00:00:00 +0000 @@ -1,37 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . - -import unittest - - -class TestCaseWithFixtures(unittest.TestCase): - """TestCase extended to allow adding fixtures - - Fixtures added should contain at least a setUp() method, and - optionally a tearDown method as well - """ - - def add_fixture(self, fixture): - if not hasattr(self, "_fixtures"): - self._fixtures = [] - fixture.setUp() - if hasattr(self, "tearDown"): - self._fixtures.append(fixture) - return fixture - - def tearDown(self): - for fixture in self._fixtures: - fixture.tearDown() - self._fixtures = [] === removed file 'tests/imposters.py' --- tests/imposters.py 2011-09-12 09:19:10 +0000 +++ tests/imposters.py 1970-01-01 00:00:00 +0000 @@ -1,82 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . - -import os -import shutil -import sys -import tempfile -import StringIO - -from lava_test.core.config import set_config - - -class OutputImposter(object): - def setUp(self): - self.origstdout = sys.stdout - self.origstderr = sys.stderr - sys.stdout = sys.stderr = self.fakestdout = StringIO.StringIO() - - def tearDown(self): - sys.stdout = self.origstdout - sys.stderr = self.origstderr - - def getvalue(self): - return self.fakestdout.getvalue() - -class ConfigImposter(object): - def setUp(self): - class fakeconfig: - def __init__(self, basedir): - self.configdir = os.path.join(basedir, "config") - self.installdir = os.path.join(basedir, "install") - self.resultsdir = os.path.join(basedir, "results") - self.registry = { - "format": "LAVA Test Test Registry 1.0", - "providers": [ - { - "entry_point": "lava_test.core.providers:BuiltInProvider" - }, - { - "entry_point": "lava_test.core.providers:PkgResourcesProvider", - "config": {"namespace": "lava_test.test_definitions" } - }, - { - "entry_point": "lava_test.core.providers:RegistryProvider", - "config": { - "entries": [] - } - } - ] - } - - self.tmpdir = tempfile.mkdtemp() - self.config = fakeconfig(self.tmpdir) - set_config(self.config) - - def tearDown(self): - shutil.rmtree(self.tmpdir) - - @property - def configdir(self): - return self.config.configdir - - @property - def installdir(self): - return self.config.installdir - - @property - def resultsdir(self): - return self.config.resultsdir - === removed file 'tests/test_hwprofile.py' --- tests/test_hwprofile.py 2011-09-12 09:19:10 +0000 +++ tests/test_hwprofile.py 1970-01-01 00:00:00 +0000 @@ -1,179 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . - -import os -import unittest - -import lava_test.core.hwprofile -from lava_test.utils import fake_file, clear_fakes, fake_machine, clear_fake_machine -from tests.imposters import OutputImposter -from tests.fixtures import TestCaseWithFixtures - - -class AptCache: - def __init__(self, packages=[]): - self.packages = packages - -ARM_CPUINFO_FILE = """Processor : ARMv7 Processor rev 3 (v7l) -BogoMIPS : 483.16 -Features : swp half thumb fastmult vfp edsp neon vfpv3* -CPU implementer : 0x41 -CPU architecture: 7 -CPU variant : 0x1 -CPU part : 0xc08 -CPU revision : 3 - -Hardware : OMAP3 Beagle Board -Revision : 0020 -Serial : 0000000000000000""" - -FAKE_BOARDNAME_FILE = "XXXXXXX" -FAKE_BOARDVENDOR_FILE = "YYYYYYY" -FAKE_BOARDVERSION_FILE = "ZZZZZZZ" - -FAKE_MEMINFO_FILE = """MemTotal: 238220 kB -MemFree: 45992 kB -Buffers: 4564 kB -Cached: 73220 kB -SwapCached: 15536 kB -Active: 48460 kB -Inactive: 122624 kB -Active(anon): 18788 kB -Inactive(anon): 75888 kB -Active(file): 29672 kB -Inactive(file): 46736 kB -Unevictable: 0 kB -Mlocked: 0 kB -SwapTotal: 524284 kB -SwapFree: 458436 kB -Dirty: 0 kB -Writeback: 0 kB -AnonPages: 81076 kB -Mapped: 9556 kB -Shmem: 1376 kB -Slab: 11072 kB -SReclaimable: 4408 kB -SUnreclaim: 6664 kB -KernelStack: 1656 kB -PageTables: 2748 kB -NFS_Unstable: 0 kB -Bounce: 0 kB -WritebackTmp: 0 kB -CommitLimit: 643392 kB -Committed_AS: 398812 kB -VmallocTotal: 647168 kB -VmallocUsed: 1936 kB -VmallocChunk: 643316 kB""" - -class HwprofileTests(unittest.TestCase): - def test_get_cpu_devs_arm(self): - fake_file('/proc/cpuinfo', ARM_CPUINFO_FILE) - fake_machine('arm') - devs = lava_test.core.hwprofile.get_cpu_devs() - clear_fake_machine() - cpuinfo = { - 'attributes': { - 'cpu_model_name': 'ARMv7 Processor rev 3 (v7l)', - 'cpu_features': 'swp half thumb fastmult vfp edsp neon vfpv3*', - 'cpu_variant': 1, - 'cpu_architecture': 7, - 'BogoMIPS': '483.16', - 'Hardware': 'OMAP3 Beagle Board', - 'cpu_implementer': 65, - 'cpu_part': 3080, - 'cpu_revision': 3, - 'Serial': '0000000000000000', - 'Revision': '0020'}, - 'description': 'Processor #0', - 'device_type': 'device.cpu'} - self.assertEqual(cpuinfo, devs[0]) - - def test_get_board_devs_x86(self): - fake_machine('x86_64') - fake_file('/sys/class/dmi/id/board_name', FAKE_BOARDNAME_FILE) - fake_file('/sys/class/dmi/id/board_vendor', - FAKE_BOARDVENDOR_FILE) - fake_file('/sys/class/dmi/id/board_version', - FAKE_BOARDVERSION_FILE) - boardinfo = { - 'attributes': { - 'version': 'ZZZZZZZ', - 'vendor': 'YYYYYYY'}, - 'description': 'XXXXXXX', - 'device_type': 'device.board'} - devs = lava_test.core.hwprofile.get_board_devs() - clear_fake_machine() - self.assertEqual(boardinfo, devs[0]) - - def test_get_board_devs_arm(self): - fake_machine('arm') - fake_file('/proc/cpuinfo', ARM_CPUINFO_FILE) - boardinfo = { - 'description': 'OMAP3 Beagle Board', - 'device_type': 'device.board'} - devs = lava_test.core.hwprofile.get_board_devs() - clear_fake_machine() - self.assertEqual(boardinfo, devs[0]) - - def test_get_mem_devs(self): - fake_file('/proc/meminfo', FAKE_MEMINFO_FILE) - devs = lava_test.core.hwprofile.get_mem_devs() - meminfo = { - 'attributes': { - 'kind': 'RAM', - 'capacity': '243937280'}, - 'description': '232MiB of RAM', - 'device_type': 'device.mem'} - self.assertEqual(meminfo, devs[0]) - - def test_get_usb_devs(self): - devs = lava_test.core.hwprofile.get_usb_devs() - self.assertEqual('device.usb', devs[0]['device_type']) - - -class MissingFiles(TestCaseWithFixtures): - """ - These are tests for situations where certain files used for gathering - hardware profile information may be missing - """ - def setUp(self): - super(MissingFiles, self).setUp() - clear_fakes() - self.out = self.add_fixture(OutputImposter()) - - def test_bad_cpuinfo(self): - errmsg = "WARNING: Could not read cpu information\n" - fake_file('/proc/cpuinfo', newpath='/foo/bar') - devs = lava_test.core.hwprofile.get_cpu_devs() - self.assertEqual([], devs) - self.assertEqual(errmsg, self.out.getvalue()) - - def test_bad_boardinfo(self): - fake_machine('x86_64') - errmsg = "WARNING: Could not read board information\n" - fake_file('/sys/class/dmi/id/board_name', newpath='/foo/bar') - fake_file('/proc/cpuinfo', newpath='/foo/bar') - devs = lava_test.core.hwprofile.get_board_devs() - clear_fake_machine() - self.assertEqual([], devs) - self.assertEqual(errmsg, self.out.getvalue()) - - def test_bad_meminfo(self): - errmsg = "WARNING: Could not read memory information\n" - fake_file('/proc/meminfo', newpath='/foo/bar') - devs = lava_test.core.hwprofile.get_mem_devs() - self.assertEqual([], devs) - self.assertEqual(errmsg, self.out.getvalue()) - === removed file 'tests/test_lavatest_commands.py' --- tests/test_lavatest_commands.py 2011-09-12 09:19:10 +0000 +++ tests/test_lavatest_commands.py 1970-01-01 00:00:00 +0000 @@ -1,62 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . - -import os, re - -from tests.imposters import ConfigImposter, OutputImposter -from tests.fixtures import TestCaseWithFixtures -from lava_test.main import LAVATestDispatcher - -class LavaTestCommandTestCase(TestCaseWithFixtures): - def setUp(self): - self.config = self.add_fixture(ConfigImposter()) - self.out = self.add_fixture(OutputImposter()) - - def _runLavaTest(self, cmds): - LAVATestDispatcher().dispatch(cmds) - -class BadCommand(LavaTestCommandTestCase): - def test_bad_cmd(self): - # Running an unknown command that does not exist of a command that does - # gives a nice error message. - errmsg = "invalid choice: 'results'" - - self.assertRaises(SystemExit, LAVATestDispatcher().dispatch, ['results', 'foo']) - self.assertNotEqual(None, re.search(errmsg, self.out.getvalue()), re.MULTILINE) - self.assertTrue(errmsg in self.out.getvalue()) - -class ListKnown(LavaTestCommandTestCase): - def test_list_tests(self): - self._runLavaTest(['list-tests']) - self.assertTrue("stream" in self.out.getvalue()) - -class ListInstalled(LavaTestCommandTestCase): - def test_list_installed(self): - # test_name must be in the BuiltInProvider._builtin_tests - test_name="ltp" - os.makedirs(os.path.join(self.config.installdir, test_name)) - self._runLavaTest(['list-installed']) - self.assertTrue(test_name in self.out.getvalue()) - - def test_run_command_test_not_exist(self): - self._runLavaTest(['run','abc']) - self.assertTrue("There is no test with the specified ID" in self.out.getvalue()) - -class TestHelp(LavaTestCommandTestCase): - - def test_command_help(self): - self.assertRaises(SystemExit, LAVATestDispatcher().dispatch, ['--help']) - self.assertTrue("--help" in self.out.getvalue()) - === removed file 'tests/test_lavatest_test.py' --- tests/test_lavatest_test.py 2011-10-06 22:13:51 +0000 +++ tests/test_lavatest_test.py 1970-01-01 00:00:00 +0000 @@ -1,55 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . - -import re - -from lava_test.core.installers import TestInstaller -from lava_test.core.tests import Test -from lava_test.core.runners import TestRunner -from tests.imposters import OutputImposter, ConfigImposter -from tests.fixtures import TestCaseWithFixtures - -def maketest(name="foo", version="", installer=None, runner=None, parser=None): - if installer is None: - installer = makeinstaller() - return Test(name, version, installer, runner, parser) - -def makerunner(**kwargs): - return TestRunner(**kwargs) - -def makeinstaller(**kwargs): - return TestInstaller(**kwargs) - -class TestConfigOutput(TestCaseWithFixtures): - def setUp(self): - super(TestConfigOutput, self).setUp() - self.config = self.add_fixture(ConfigImposter()) - - def test_run(self): - testrunner = makerunner(steps=["echo foo"]) - test = maketest(name="foo", runner=testrunner) - - self.assertFalse(test.is_installed) - test.install() - self.assertTrue(test.is_installed) - artifacts, fail_run = test.run() - std_out = open(artifacts.stdout_pathname).read() - self.assertTrue("foo" in std_out) - - result_id_pattern = "foo\.\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z" - self.assertTrue(re.match(result_id_pattern, artifacts.result_id)) - - test.uninstall() - self.assertFalse(test.is_installed) === removed file 'tests/test_lavatest_testinstaller.py' --- tests/test_lavatest_testinstaller.py 2011-09-12 09:19:10 +0000 +++ tests/test_lavatest_testinstaller.py 1970-01-01 00:00:00 +0000 @@ -1,63 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . - -import hashlib -import os -import shutil -import tempfile -import unittest - -from lava_test.core.installers import TestInstaller - - -class testTestInstaller(unittest.TestCase): - def setUp(self): - self.origdir = os.path.abspath(os.curdir) - self.tmpdir = tempfile.mkdtemp() - self.filename = os.path.abspath(__file__) - os.chdir(self.tmpdir) - - def tearDown(self): - os.chdir(self.origdir) - shutil.rmtree(self.tmpdir) - - def makeinstaller(self,**kwargs): - return TestInstaller(**kwargs) - - def test_bad_download(self): - url = "file:///xxxyyyzzz" - installer = self.makeinstaller(url=url) - self.assertRaises(RuntimeError, installer._download, None) - - def test_bad_md5(self): - url = "file://%s" % self.filename - installer = self.makeinstaller(url=url, md5='foo') - self.assertRaises(RuntimeError, installer._download, None) - - def test_good_md5(self): - url = "file://%s" % self.filename - md5 = hashlib.md5(file(self.filename).read()).hexdigest() - installer = self.makeinstaller(url=url, md5=md5) - location = installer._download(observer=None) - self.assertTrue(os.path.exists(location)) - - def test_runsteps(self): - self.assertFalse(os.path.exists("./foo")) - steps = ["echo test > foo"] - installer = self.makeinstaller(steps=steps) - installer._runsteps(observer=None) - self.assertTrue(os.path.exists("./foo")) - self.assertTrue("test" in open("./foo").read()) - === removed file 'tests/test_lavatest_testparser.py' --- tests/test_lavatest_testparser.py 2011-09-12 09:19:10 +0000 +++ tests/test_lavatest_testparser.py 1970-01-01 00:00:00 +0000 @@ -1,70 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . - -import os -import shutil -import tempfile -import unittest - -from lava_test.core.parsers import TestParser -from tests.fixtures import TestCaseWithFixtures -from lava_test.core.artifacts import TestArtifacts -from tests.imposters import OutputImposter, ConfigImposter - -class testTestParser(TestCaseWithFixtures): - def setUp(self): - self.config = self.add_fixture(ConfigImposter()) - self.out = self.add_fixture(OutputImposter()) - self.origdir = os.path.abspath(os.curdir) - self.filename = os.path.abspath(__file__) - self.test_id = "ABC" - self.artifacts = TestArtifacts.allocate(self.test_id, self.config) - os.chdir(self.artifacts.results_dir) - - def tearDown(self): - os.chdir(self.origdir) - shutil.rmtree(self.artifacts.results_dir) - - def makeparser(self, *args, **kwargs): - return TestParser(*args, **kwargs) - - def writeoutputlog(self, str): - with open("testoutput.log", "a") as fd: - fd.write(str) - - def test_parse(self): - pattern = "^(?P\w+):\W+(?P\w+)" - self.writeoutputlog("test001: pass") - parser = self.makeparser(pattern) - parser.parse(self.artifacts) - self.assertTrue(parser.results["test_results"][0]["testid"] == "test001" and - parser.results["test_results"][0]["result"] == "pass") - - def test_fixupdict(self): - pattern = "^(?P\w+):\W+(?P\w+)" - fixup = {"pass":"PASS"} - self.writeoutputlog("test001: pass") - parser = self.makeparser(pattern, fixupdict=fixup) - parser.parse(self.artifacts) - self.assertEquals("PASS", parser.results["test_results"][0]["result"]) - - def test_appendall(self): - pattern = "^(?P\w+):\W+(?P\w+)" - append = {"units":"foo/s"} - self.writeoutputlog("test001: pass") - parser = self.makeparser(pattern, appendall=append) - parser.parse(self.artifacts) - self.assertEqual("foo/s", parser.results["test_results"][0]["units"]) - === removed file 'tests/test_lavatest_testrunner.py' --- tests/test_lavatest_testrunner.py 2011-09-12 09:19:10 +0000 +++ tests/test_lavatest_testrunner.py 1970-01-01 00:00:00 +0000 @@ -1,73 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . - -import os -import shutil -import tempfile -import unittest -from datetime import datetime - -from lava_test.core.runners import TestRunner -from lava_test.core.artifacts import TestArtifacts -from tests.imposters import OutputImposter, ConfigImposter -from tests.fixtures import TestCaseWithFixtures - -def makerunner(**kwargs): - return TestRunner(**kwargs) - -class testTestRunner(TestCaseWithFixtures): - def setUp(self): - self.config = self.add_fixture(ConfigImposter()) - self.out = self.add_fixture(OutputImposter()) - self.origdir = os.path.abspath(os.curdir) - self.tmpdir = tempfile.mkdtemp() - self.filename = os.path.abspath(__file__) - os.chdir(self.tmpdir) - self.test_id = "ABC" - self.artifacts = TestArtifacts.allocate(self.test_id, self.config) - - def tearDown(self): - os.chdir(self.origdir) - shutil.rmtree(self.tmpdir) - - def test_starttime(self): - runner = makerunner() - runner.run(self.artifacts) - self.assertTrue(isinstance(runner.starttime, datetime)) - - def test_endtime(self): - runner = makerunner() - runner.run(self.artifacts) - self.assertTrue(isinstance(runner.endtime, datetime)) - - def test_timediff(self): - steps = ['sleep 2'] - runner = makerunner(steps=steps) - runner.run(self.artifacts) - self.assertNotEqual(runner.starttime, runner.endtime) - - def test_runsteps(self): - steps = ["echo test > foo"] - runner = makerunner(steps=steps) - runner._run_lava_test_steps(self.artifacts, observer = None) - self.assertTrue(os.path.exists("./foo")) - - def test_logoutput(self): - steps = ["echo test > foo"] - runner = makerunner(steps=steps) - runner._run_lava_test_steps(self.artifacts, observer = None) - self.assertTrue(os.path.exists(self.artifacts.stdout_pathname)) - self.assertTrue(os.path.exists(self.artifacts.stderr_pathname)) - === removed file 'tests/test_providers.py' --- tests/test_providers.py 2012-02-06 17:51:19 +0000 +++ tests/test_providers.py 1970-01-01 00:00:00 +0000 @@ -1,105 +0,0 @@ -# Copyright (c) 2012 Linaro Limited -# -# 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 3 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, see . - -from mocker import MockerTestCase - -from lava_test.core.providers import RegistryProvider - - -class RegistryProviderTests(MockerTestCase): - - # Helper values used in test methods - _code = 1 - _reason = "reason" - _test_id = 'test1' - _test_id_list = ['test1', 'test2'] - _url = "http://example.org/test.json" - - def _prepare_provider_that_crashes_with_error(self, error): - self.provider = self.mocker.patch( - RegistryProvider({'entries': [self._url]})) - self.expect(self.provider._fill_cache()).passthrough() - self.expect(self.provider._load_remote_test(self._url)).throw(error) - - def _test_fill_cache_response(self): - # Now onto testing: - self.mocker.replay() - # Call _fill_cache() - self.provider._fill_cache() - # the actual tests are validated as mocker expectation - - def test_fill_cache_IOError_handling_with_just_reason(self): - # We want to test resilience to IOError that has a 'reason' attribute - error = IOError() - error.reason = self._reason - self._prepare_provider_that_crashes_with_error(error) - # Now this ought to log a few warning messages - logging = self.mocker.replace("logging", passthrough=False) - logging.warning( - "Unable to load test definition from %r: %r", - self._url, error) - logging.warning("Error reason: %r", self._reason) - self._test_fill_cache_response() - - def test_fill_cache_IOError_handling_with_just_code(self): - # We want to test resilience to IOError that has a 'code' attribute - error = IOError() - error.code = self._code - provider = self._prepare_provider_that_crashes_with_error(error) - # Now this ought to log a few warning messages - logging = self.mocker.replace("logging", passthrough=False) - logging.warning( - "Unable to load test definition from %r: %r", - self._url, error) - logging.warning("Error code: %r", self._code) - self._test_fill_cache_response() - - def test_fill_cache_IOError_handling_without_anything(self): - # We want to test resilience to IOError that has no attributes - error = IOError() - provider = self._prepare_provider_that_crashes_with_error(error) - # Now this ought to log a few warning messages - logging = self.mocker.replace("logging", passthrough=False) - logging.warning( - "Unable to load test definition from %r: %r", - self._url, error) - self._test_fill_cache_response() - - def test_fill_cache_ValueError_handling(self): - # We want to test resilience to ValueError - error = ValueError() - provider = self._prepare_provider_that_crashes_with_error(error) - # Now this ought to log a few warning messages - logging = self.mocker.replace("logging", passthrough=False) - logging.warning( - "Unable to load test definition from %r: %r", - self._url, error) - self._test_fill_cache_response() - - def test_iter_calls_fill_cache(self): - provider = self.mocker.patch(RegistryProvider({})) - self.expect(iter(provider)).passthrough() - self.expect(provider._fill_cache()) - self.expect(provider._cache.iterkeys()).generate(self._test_id_list) - self.mocker.replay() - self.assertSequenceEqual(list(provider), self._test_id_list) - - def test_getitem_calls_fill_cache(self): - provider = self.mocker.patch(RegistryProvider({})) - self.expect(provider[self._test_id]).passthrough() - self.expect(provider._fill_cache()) - self.expect(provider._cache[self._test_id]) - self.mocker.replay() - provider[self._test_id] === removed file 'tests/test_swprofile.py' --- tests/test_swprofile.py 2011-09-12 09:19:10 +0000 +++ tests/test_swprofile.py 1970-01-01 00:00:00 +0000 @@ -1,79 +0,0 @@ -# Copyright (c) 2010, 2011 Linaro -# -# 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 3 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, see . - -import os -import unittest - -import lava_test.core.swprofile -from lava_test.utils import fake_file, clear_fakes - - -class Version: - def __init__(self, version): - self.version = version - -class Package: - def __init__(self, name, version, is_installed=True): - self.is_installed = is_installed - self.name = name - self.installed = Version(version) - -class AptCache: - def __init__(self, packages=[]): - self.packages = packages - - def __iter__(self): - return iter(self.packages) - -class SwprofileTests(unittest.TestCase): - def setUp(self): - self.lsb_desc = 'test description' - self.lsb_information = {'DESCRIPTION':self.lsb_desc} - self.testpackage = Package('testpkg', '7.77') - self.cache = AptCache([self.testpackage]) - - def make_profile(self, cache=None, info=None): - if cache == None: - cache = self.cache - if info == None: - info = self.lsb_information - return lava_test.core.swprofile.get_software_context(apt_cache=cache, - lsb_information=info) - - def test_pkg_name(self): - a = self.make_profile() - for pkg in a['packages']: - self.assertEqual(self.testpackage.name, pkg['name']) - - def test_pkg_version(self): - a = self.make_profile() - for pkg in a['packages']: - self.assertEqual(self.testpackage.installed.version, pkg['version']) - - def test_image_name_lsb(self): - a = self.make_profile() - if os.path.exists('/etc/buildstamp'): - return - self.assertEqual(self.lsb_desc, a['image']['name']) - - def test_image_name_buildstamp(self): - BUILDSTAMP = "linaro-m-headless-20101101-0" - BUILDSTAMPFILE = "lexbuild6 Mon, 01 Nov 2010 02:11:39 -0400\n%s" % ( - BUILDSTAMP) - fake_file('/etc/buildstamp', BUILDSTAMPFILE) - a = self.make_profile() - clear_fakes() - self.assertEqual(BUILDSTAMP, a['image']['name']) -