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 318032 Details for
Bug 462349
FEAT: cdrom test should be split into multiple tests by media-type
[?]
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.
cdrom.py re-write to use new OpticalDiskTest class
cdrom.py (text/x-python), 3.37 KB, created by
Greg Nichols
on 2008-09-30 01:35:19 UTC
(
hide
)
Description:
cdrom.py re-write to use new OpticalDiskTest class
Filename:
MIME Type:
Creator:
Greg Nichols
Created:
2008-09-30 01:35:19 UTC
Size:
3.37 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 ># YangKun <ykun@redhat.com> ># > >import os >import sys >import commands >import string >import shutil >import curses >import time >import filecmp > >from hts.test import Test >from hts.opticalDiskTest import OpticalDiskTest >from hts.tags import Constants >from hts.hal import Hal >from hts.device import Device >from hts.command import Command, HTSCommandException > >PASSED = 0 >FAILED = 1 > >class CDRomTest(OpticalDiskTest): > > def __init__(self): > OpticalDiskTest.__init__(self, name="cdrom") > self.mediaTypes = [ "cdrw", "cdr", "cdrom"] # in order of preference > > def askForDisk(self, mediaType): > """echo CD info""" > if mediaType == "cdrom": > print " --- one CD data disk(e.g. one RHEL5 install CD disk) " > elif mediaType == "cdr": > print " --- one blank CD-R disk " > elif mediaType == "cdrw": > print " --- one good CD-RW disk " > else: > print "Error: unknown media type %s" % mediaType > return False > sys.stdout.flush() > return True > > def checkMediaSize(self, size): > if size > 800000 : > print "Error: +++ %s appears to be a DVD !\n" % self.getLogicalDeviceName() > return False > > # otherwise > return True > > > def run(self): > """main function""" > if not self.initializeDeviceInfo(): > return FAILED > > print "\n Your CD/DVD device /dev/%s supports %s " % (self.getLogicalDeviceName(), self.showSupportedMedia()) > print " We will check these features. " > print " You need to prepare following media(disks) for this test: \n" > self.askForDisk(self.supportedMedia[0]) > > # if auto or self-test mode > if self.getMode() != Constants.normal: > print "Warning: Auto test mode - TESTS NOT RUN" > return 0 > > # otherwise, normal test mode > self.prompt("\n Press ENTER when you are ready ! Or press Ctrl-C to quit !") > > > # test cdrom/cd-r/cd-rw > if self.supportedMedia[0] == "cdrom" and self.testDisk(message="data CD", readWriteMode="read", type="cdrom"): > return PASSED > > if self.supportedMedia[0] == "cdr" and self.testDisk(message="blank CD-R", readWriteMode="write", type="cdrom"): > return PASSED > > if self.supportedMedia[0] == "cdrw" and self.testDisk(message="good CD-RW", readWriteMode="rewrite", type="cdrom"): > return PASSED > > # OTHERWISE > return FAILED > >if __name__ == "__main__": > test = CDRomTest() > 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 Raw
Actions:
View
Attachments on
bug 462349
:
318031
| 318032 |
318033