Merge lp:~cr3/checkbox/floppy_test into lp:checkbox

Proposed by Marc Tardif
Status: Merged
Merged at revision: 1454
Proposed branch: lp:~cr3/checkbox/floppy_test
Merge into: lp:checkbox
Diff against target: 99 lines (+19/-18)
2 files modified
debian/changelog (+2/-1)
scripts/floppy_test (+17/-17)
To merge this branch: bzr merge lp:~cr3/checkbox/floppy_test
Reviewer Review Type Date Requested Status
Daniel Manrique (community) Approve
Review via email: mp+111475@code.launchpad.net

Description of the change

The changes in this merge request were not tested because nobody can find a freaking floppy drive and the only floppies we can find are under bladernr's washing machine.

To post a comment you must log in.
Revision history for this message
Daniel Manrique (roadmr) wrote :

The code looks fine, it at least doesn't crash, and since we were unable to test this further I guess I'll merge it. Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2012-06-21 16:03:50 +0000
+++ debian/changelog 2012-06-21 18:47:18 +0000
@@ -27,8 +27,9 @@
27 * [FEATURE] Added new interactive and auto-verifying touchpad scrolling27 * [FEATURE] Added new interactive and auto-verifying touchpad scrolling
28 test.28 test.
29 * [FEATURE] Python 2 to 3 conversion:29 * [FEATURE] Python 2 to 3 conversion:
30 * scripts/ansi_parser
30 * scripts/cking_suite31 * scripts/cking_suite
31 * scripts/ansi_parser32 * scripts/floppy_test
32 * scripts/network_bandwidth_test33 * scripts/network_bandwidth_test
33 * Removed sleep_test script no longer used by any test definition.34 * Removed sleep_test script no longer used by any test definition.
3435
3536
=== modified file 'scripts/floppy_test'
--- scripts/floppy_test 2012-05-22 18:01:21 +0000
+++ scripts/floppy_test 2012-06-21 18:47:18 +0000
@@ -1,9 +1,9 @@
1#!/usr/bin/python1#!/usr/bin/env python3
22
3import os3import os
4import sys4import sys
5import filecmp5import filecmp
6import commands6import subprocess
7import posixpath7import posixpath
88
9DEFAULT_DIR = "/tmp/checkbox.floppy"9DEFAULT_DIR = "/tmp/checkbox.floppy"
@@ -28,9 +28,9 @@
28 def run(self):28 def run(self):
29 floppyDevice = self.device29 floppyDevice = self.device
30 if floppyDevice:30 if floppyDevice:
31 print " Testing on floppy drive %s " % floppyDevice31 print(" Testing on floppy drive %s " % floppyDevice)
32 else:32 else:
33 print " Error ! No floppy drive found !"33 print(" Error ! No floppy drive found !")
34 return 134 return 1
35 # remove temp files if they exist35 # remove temp files if they exist
36 os.system("umount /media/floppy 2>/dev/null")36 os.system("umount /media/floppy 2>/dev/null")
@@ -51,45 +51,45 @@
51 os.system("umount %s" % self.image_dir)51 os.system("umount %s" % self.image_dir)
52 # start testing52 # start testing
53 (noFloppyDisk, junkOutput1) = \53 (noFloppyDisk, junkOutput1) = \
54 commands.getstatusoutput("dd bs=1c if=%s count=0 2>/dev/null"54 subprocess.getstatusoutput("dd bs=1c if=%s count=0 2>/dev/null"
55 % floppyDevice)55 % floppyDevice)
56 if noFloppyDisk != 0:56 if noFloppyDisk != 0:
57 print "Error ! No floppy disc or bad media in %s !" % floppyDevice57 print("Error ! No floppy disc or bad media in %s !" % floppyDevice)
58 return 158 return 1
59 else:59 else:
60 # writing files60 # writing files
61 print " Writing data to floppy disc ... "61 print(" Writing data to floppy disc ... ")
62 (ddStatus, ddOutput) = \62 (ddStatus, ddOutput) = \
63 commands.getstatusoutput("dd if=%s of=%s bs=1k count=1440"63 subprocess.getstatusoutput("dd if=%s of=%s bs=1k count=1440"
64 % (self.image, floppyDevice))64 % (self.image, floppyDevice))
65 if ddStatus == 0:65 if ddStatus == 0:
66 print " Write data to floppy disc done ! "66 print(" Write data to floppy disc done ! ")
67 else:67 else:
68 print " Error ! Write data to floppy disc error ! "68 print(" Error ! Write data to floppy disc error ! ")
69 print " Please check if your floppy disc is write-protected !"69 print(" Please check if your floppy disc is write-protected !")
70 return 170 return 1
71 # comparing files71 # comparing files
72 os.system("mount %s %s" % (floppyDevice, self.device_dir))72 os.system("mount %s %s" % (floppyDevice, self.device_dir))
73 os.system("mount -o loop %s %s" % (self.image, self.image_dir))73 os.system("mount -o loop %s %s" % (self.image, self.image_dir))
74 print " Comparing files ... "74 print(" Comparing files ... ")
75 fileList = os.listdir(self.image_dir)75 fileList = os.listdir(self.image_dir)
76 returnValue = 076 returnValue = 0
77 for textFile in fileList:77 for textFile in fileList:
78 file1 = os.path.join(self.device_dir, textFile)78 file1 = os.path.join(self.device_dir, textFile)
79 file2 = os.path.join(self.image_dir, textFile)79 file2 = os.path.join(self.image_dir, textFile)
80 if filecmp.cmp(file1, file2):80 if filecmp.cmp(file1, file2):
81 print " comparing file %s" % textFile81 print(" comparing file %s" % textFile)
82 else:82 else:
83 print (" -- Error ! File %s comparison failed ! -- "83 print(" -- Error ! File %s comparison failed ! -- "
84 % textFile)84 % textFile)
85 returnValue = 185 returnValue = 1
86 print " File comparison done ! "86 print(" File comparison done ! ")
87 # remove temp files87 # remove temp files
88 os.system("umount /media/floppy 2>/dev/null")88 os.system("umount /media/floppy 2>/dev/null")
89 os.system("umount %s %s " % (self.image_dir, self.device_dir))89 os.system("umount %s %s " % (self.image_dir, self.device_dir))
90 os.system("rm -rf %s %s %s"90 os.system("rm -rf %s %s %s"
91 % (self.device_dir, self.image_dir, self.image))91 % (self.device_dir, self.image_dir, self.image))
92 print "Done !"92 print("Done !")
93 return returnValue93 return returnValue
9494
9595

Subscribers

People subscribed via source and target branches