Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 601562 Details for
Bug 843608
lid test should not use HAL
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
lid test patch to use proc
lid.py (text/plain), 4.39 KB, created by
Greg Nichols
on 2012-07-31 18:28:12 UTC
(
hide
)
Description:
lid test patch to use proc
Filename:
MIME Type:
Creator:
Greg Nichols
Created:
2012-07-31 18:28:12 UTC
Size:
4.39 KB
patch
obsolete
>#!/usr/bin/python ># Copyright (c) 2006 Red Hat, Inc. All rights reserved. This copyrighted material ># is made available to anyone wishing to use, modify, copy, or ># redistribute it subject to the terms and conditions of the GNU General ># Public License v.2. ># ># This program is distributed in the hope that it will be useful, but WITHOUT ANY ># WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A ># PARTICULAR PURPOSE. See the GNU General Public License for more details. ># ># You should have received a copy of the GNU General Public License ># along with this program; if not, write to the Free Software ># Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ># ># Author: Greg Nichols ># >import os, sys, string, shutil, time > >from v7.test import Test >from v7.tags import Constants, DeviceClass, TestTag >from v7.procDeviceDetector import ProcDeviceDetector >from v7.command import Command, V7CommandException > >class LidTest(Test): > > def __init__(self): > Test.__init__(self, name="lid") > self.deviceClass = DeviceClass.display > > def tags(self): > return [TestTag.interactive, TestTag.certification, TestTag.portable] > > def plan(self, planner): > tests = list() > detector = planner.getProcDeviceDetector() > devices = detector.loadDevices(ProcDeviceDetector.inputBusPath) > detector.dump() > for device in devices: > if device.hasPropertyValue("Lid Switch"): > test = self.makeCopy() > test.setDevice(device) > tests.append(test) > return tests > > def getDevice(self): > """ get the lid switch device """ > detector = ProcDeviceDetector() > detector.loadDevices(ProcDeviceDetector.inputBusPath) > device = detector.getDevice(self.getUDI()) > if device: > self.setDevice(device) > else: > print "Error: could not find device udi %s" % self.getUDI() > > return device > > def checkLid(self, checkForOpen): > lidState = Command("cat /proc/acpi/button/lid/LID/state") > try: > lidState.getString("open") > return checkForOpen > except V7CommandException, e: > if self.debug != Constants.off: > print e > > return not checkForOpen > > > def run(self): > FAILED = 1 > PASSED = 0 > SLEEPLIMIT=20 # sleep cycles > SLEEPTIME=0.5 # sec > > if self.getMode() == Constants.auto: > print "Error: the lid test can not be run in auto mode." > return FAILED > > if not self.checkLid(checkForOpen=True): > print "Error: lid must be open for this test" > return FAILED > #otherwise > if not self.promptConfirm("Ready to begin the lid/backlight test?"): > return FAILED > > > print "Please close the lid, then re-open it." > print "Verify the backlight turns off when the lid is closed" > sys.stdout.flush() > > sleepLimit = SLEEPLIMIT > #wait while lid is open and limit has not expired > while self.checkLid(checkForOpen=True) and sleepLimit > 0: > sys.stdout.write("%d..." % sleepLimit) > sys.stdout.flush() > time.sleep(SLEEPTIME) > sleepLimit = sleepLimit -1 > print "" > > > if sleepLimit <= 0: > print "Error: did not detect the lid was closed within %d sec." % (SLEEPLIMIT*SLEEPTIME) > return FAILED > > sleepLimit = SLEEPLIMIT > # wait while lid is closed and time is not expired > while self.checkLid(checkForOpen=False) and sleepLimit > 0: > sys.stdout.write("%d..." % sleepLimit) > sys.stdout.flush() > time.sleep(SLEEPTIME) > sleepLimit = sleepLimit -1 > print "" > > if sleepLimit <= 0: > print "Error: did not detect the lid was re-opened within %d sec." % (SLEEPLIMIT*SLEEPTIME) > return FAILED > > if not self.promptConfirm("Did the display backlight turn off then the lid was closed?"): > print "Error: backlight must turn off when the lid is closed" > return FAILED > > return PASSED > > >if __name__ == "__main__": > test = LidTest() > returnValue = test.do(sys.argv) > sys.exit(returnValue) > > > > > > > > >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 843608
:
601561
| 601562