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 315669 Details for
Bug 460973
cdrom test fails on written media comparison
[?]
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]
cdrom.py patch to re-try mount command - 2nd attempt
cdrom.patch (text/plain), 9.61 KB, created by
Greg Nichols
on 2008-09-03 17:54:31 UTC
(
hide
)
Description:
cdrom.py patch to re-try mount command - 2nd attempt
Filename:
MIME Type:
Creator:
Greg Nichols
Created:
2008-09-03 17:54:31 UTC
Size:
9.61 KB
patch
obsolete
>Index: cdrom.py >=================================================================== >RCS file: /cvs/qa/hts/tests/cdrom/cdrom.py,v >retrieving revision 1.13 >diff -u -r1.13 cdrom.py >--- cdrom.py 19 Aug 2008 01:45:02 -0000 1.13 >+++ cdrom.py 3 Sep 2008 17:52:55 -0000 >@@ -351,94 +351,129 @@ > file sums""" > print "\n +++ Start writing ...\n" > sys.stdout.flush() >- try: #handle HTSCommandException >- if deviceType == "cdrom": >- fileDir = "/usr/bin" # ranges from 100MB-270MB >- elif deviceType == "dvd" or deviceType == "dvdplus": >- fileDir = "/usr/share" # ranges from 970MB-3.5GB >+ >+ if deviceType == "cdrom": >+ fileDir = "/usr/bin" # ranges from 100MB-270MB >+ elif deviceType == "dvd" or deviceType == "dvdplus": >+ fileDir = "/usr/share" # ranges from 970MB-3.5GB >+ else: >+ print "\n +++ Error: Un-supported media .\n" >+ return False >+ # Unmount the drive first in case it's mounted >+ os.system("umount /dev/%s 2>/dev/null" % cdromDevice) >+ >+ # to handle CD-R or DVD-R >+ if deviceType == "cdrom" or deviceType == "dvd": >+ # check the write mode >+ writeOpts = self.checkWriteMode(cdromDevice) >+ # support burnfree ? >+ if self.supportsBurnfree(cdromDevice): >+ writeOpts = writeOpts + " driveropts=burnfree" >+ try: >+ mkisofsSize = Command("mkisofs -quiet -R -print-size %s " % fileDir) >+ cdblocks= mkisofsSize.getInteger() >+ except HTSCommandException, exception: >+ # try work-around for RHEL/mkisofs bug 193916 >+ # remove the return character first >+ item = mkisofsSize.output.pop().replace('\n','') >+ if item.isdigit(): >+ cdblocks = string.atoi(item) >+ print "Warning: mkisofs had errors" >+ print exception >+ else: >+ print "Error: could not determine block size" >+ print exception >+ return 1 >+ >+ # write the directory to disk >+ (status,junk) = commands.getstatusoutput("mkisofs -quiet -R %s | cdrecord -v %s dev=/dev/%s fs=32M tsize=%ss -" % (fileDir,writeOpts,cdromDevice,cdblocks)) >+ print "\n +++ Write options : %s \n" % writeOpts >+ print junk >+ if status == 0: >+ print "\n +++ Write disk succeeded ! \n" > else: >- print "\n +++ Error: Un-supported media .\n" >+ print "\n +++ Error: Write disk failed !\n" > return False >- # Unmount the drive first in case it's mounted >- os.system("umount /dev/%s 2>/dev/null" % cdromDevice) >- >- # to handle CD-R or DVD-R >- if deviceType == "cdrom" or deviceType == "dvd": >- # check the write mode >- writeOpts = self.checkWriteMode(cdromDevice) >- # support burnfree ? >- if self.supportsBurnfree(cdromDevice): >- writeOpts = writeOpts + " driveropts=burnfree" >- try: >- mkisofsSize = Command("mkisofs -quiet -R -print-size %s " % fileDir) >- cdblocks= mkisofsSize.getInteger() >- except HTSCommandException, exception: >- # try work-around for RHEL/mkisofs bug 193916 >- # remove the return character first >- item = mkisofsSize.output.pop().replace('\n','') >- if item.isdigit(): >- cdblocks = string.atoi(item) >- print "Warning: mkisofs had errors" >- print exception >- else: >- print "Error: could not determine block size" >- print exception >- return 1 >- >- # write the directory to disk >- (status,junk) = commands.getstatusoutput("mkisofs -quiet -R %s | cdrecord -v %s dev=/dev/%s fs=32M tsize=%ss -" % (fileDir,writeOpts,cdromDevice,cdblocks)) >- print "\n +++ Write options : %s \n" % writeOpts >- print junk >- if status == 0: >- print "\n +++ Write disk succeeded ! \n" >- else: >- print "\n +++ Error: Write disk failed !\n" >- return False >- self.handleEject(cdromDevice) >- # DVD+R >- elif deviceType == "dvdplus": >- # check media >- if os.system("dvd+rw-mediainfo /dev/%s | grep 'Media' | grep 'DVD+'" % cdromDevice) is 0: >- print "\n +++ media match ! \n" >- else: >- print "\n +++ Error: The disk you inserted is not DVD+ media ! \n" >- return False >- # write the directory to disk >- sys.stdout.flush() >- (status,junk) = commands.getstatusoutput("growisofs -Z /dev/%s -quiet -R %s" % (cdromDevice,fileDir)) >- print junk >- if status == 0: >- print "\n +++ Write DVD+ disk succeeded ! \n" >- else: >- print "\n +++ Error: Write DVD+ disk failed !\n" >- return False >- self.handleEject(cdromDevice) >- sys.stdout.flush() >+ self.handleEject(cdromDevice) >+ # DVD+R >+ elif deviceType == "dvdplus": >+ # check media >+ if os.system("dvd+rw-mediainfo /dev/%s | grep 'Media' | grep 'DVD+'" % cdromDevice) is 0: >+ print "\n +++ media match ! \n" > else: >- print "\n +++ Error: Un-supported media .\n" >+ print "\n +++ Error: The disk you inserted is not DVD+ media ! \n" > return False >- >- # write done, start to compare >- os.system("umount /dev/%s 2>/dev/null" % cdromDevice) >- if os.path.exists("media"): >- shutil.rmtree("media") >- os.mkdir("media") >- os.system("mount /dev/%s ./media 2>/dev/null" % cdromDevice) >- print " Start to compare data, this may take some time, please be patient ... " >+ # write the directory to disk > sys.stdout.flush() >- if self.cmpTree(fileDir,"media"): >- print "\n +++ Compare data succeeded ! \n" >- returnValue = True >+ (status,junk) = commands.getstatusoutput("growisofs -Z /dev/%s -quiet -R %s" % (cdromDevice,fileDir)) >+ print junk >+ if status == 0: >+ print "\n +++ Write DVD+ disk succeeded ! \n" > else: >- print "\n +++ Compare data failed ! \n" >- returnValue = False >- os.system("umount ./media 2>/dev/null") >- os.rmdir("media") >- return returnValue >+ print "\n +++ Error: Write DVD+ disk failed !\n" >+ return False >+ self.handleEject(cdromDevice) >+ sys.stdout.flush() >+ else: >+ print "\n +++ Error: Un-supported media .\n" >+ return False > >+ # write done, start to compare >+ return self.compare(deviceType,cdromDevice, fileDir) >+ >+ def compare(self, deviceType, cdromDevice, fileDir): >+ try: >+ print "Un-mounting /dev/%s/" % cdromDevice >+ Command("umount /dev/%s/" % cdromDevice).echo() > except HTSCommandException, exception: >+ # continue whether or not unmount failed >+ pass >+ >+ try: >+ if os.path.exists("media"): >+ print "removing media tree" >+ shutil.rmtree("media") >+ os.mkdir("media") >+ except exception: > print exception >- return 1 >+ print "Error: could not create \"media\" mount point" >+ return False >+ >+ print "Mounting /dev/%s to ./media " % cdromDevice >+ sys.stdout.flush() >+ tries = 0 >+ maxTries = 10 >+ mounted = False >+ waitBeforeRetry = 5 # sec >+ mount = "mount -o ro /dev/%s ./media " % cdromDevice >+ while not mounted and (tries < maxTries): >+ try: >+ print mount >+ sys.stdout.flush() >+ Command(mount).echo() >+ mounted = True >+ except HTSCommandException, exception: >+ tries += 1 >+ time.sleep(waitBeforeRetry) >+ print "Mount failed, Retrying..." >+ sys.stdout.flush() >+ >+ if tries >= maxTries: >+ print "Error: could not mount media" >+ sys.stdout.flush() >+ return False >+ >+ print " Start to compare data, this may take some time, please be patient ... " >+ sys.stdout.flush() >+ if self.cmpTree(fileDir,"media"): >+ print "\n +++ Compare data succeeded ! \n" >+ returnValue = True >+ else: >+ print "\n +++ Compare data failed ! \n" >+ returnValue = False >+ os.system("umount ./media 2>/dev/null") >+ os.rmdir("media") >+ return returnValue > > def rewriter(self,deviceType,cdromDevice): > """handles CD-RW or DVD-RW or DVD+RW""" >@@ -461,6 +496,7 @@ > sys.stdout.flush() > # re-write now > returnValue = self.writer(deviceType,cdromDevice) >+ > # dvd+rw > elif deviceType == "dvdplus": > # check media
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 460973
:
315614
| 315669