diff -Nru testdrive-3.26/bin/testdrive testdrive-3.27/bin/testdrive --- testdrive-3.26/bin/testdrive 2014-01-27 10:38:52.000000000 +0000 +++ testdrive-3.27/bin/testdrive 2015-08-06 20:16:20.000000000 +0000 @@ -74,8 +74,12 @@ logger.error(_("\nERROR: Invalid input\n")) continue if choice == i: - url = raw_input(_("\nEnter an ISO URL to testdrive: ")) - break + try: + url = raw_input(_("\nEnter an ISO URL to testdrive: ")) + break + except KeyboardInterrupt: + print("\n") + exit(0) elif choice in range(1, i): url = menu[choice-1]["url"] td.ISO_PATH_HEADER = menu[choice-1]["cat"] @@ -85,7 +89,7 @@ return(url) def error(str): - logger.error(_("\n%s\n") % str) + logger.error("\n%s\n" % str) sys.exit(1) def is_iso(file): @@ -264,7 +268,7 @@ logger.info(_("Using KVM for virtual machine hosting...")); elif td.VIRT == "virtualbox": logger.info(_("Using VirtualBox for virtual machine hosting...")) - elif td.VIRT == "paralels": + elif td.VIRT == "parallels": logger.info(_("Using Parallels Desktop for virtual machine hosting...")) ########################################## @@ -392,7 +396,7 @@ virt = kvm.KVM(td) if td.VIRT == "virtualbox": virt = virtualbox.VBox(td) - if td.VIRT == "paralels": + if td.VIRT == "parallels": virt = parallels.Parallels(td) ################### @@ -401,14 +405,15 @@ logger.info(_("Validating Virtualization Method....")) try: virt.validate_virt() - except: - error(_("Unable to validate Virtualization Method [%s]") % td.VIRT) + except Exception as exc: + error(_("Unable to validate Virtualization Method [%s] (%s)") % \ + (td.VIRT, exc)) logger.info(_("Setting up Virtual Machine...")) try: virt.setup_virt() - except: - error(_("Unable to setup Virtual Machine")) + except Exception as exc: + error(_("Unable to setup Virtual Machine (%s)") % exc) logger.info(_("Launching Virtual Machine...")) try: @@ -417,8 +422,8 @@ if td.VIRT == "kvm": logging.debug("%s:%s" % (time.strftime("%Y-%m-%d_%H:%M:%S"), cmd)) run_vm(cmd, td, cloud_curses) - except: - error(_("Unable to launch Virtual Machine")) + except Exception as exc: + error(_("Unable to launch Virtual Machine (%s)") % (exc)) rm_disk = td.delete_image() if rm_disk: diff -Nru testdrive-3.26/bin/testdrive-gtk testdrive-3.27/bin/testdrive-gtk --- testdrive-3.26/bin/testdrive-gtk 2014-01-27 10:38:52.000000000 +0000 +++ testdrive-3.27/bin/testdrive-gtk 2015-08-06 20:16:20.000000000 +0000 @@ -34,6 +34,9 @@ import random import re +import logging +logger = logging.getLogger("testdrive-gtk") + gtk.gdk.threads_init() TAB_LABEL = [] @@ -47,6 +50,8 @@ TAB_LABEL.append({"dist":"lubuntu", "label":"Lubuntu"}) TAB_LABEL.append({"dist":"ubuntukylin", "label":"UbuntuKylin"}) TAB_LABEL.append({"dist":"ubuntugnome", "label":"Ubuntu Gnome"}) +TAB_LABEL.append({"dist":"ubuntu-mate", "label":"Ubuntu MATE"}) +TAB_LABEL.append({"dist":"ubuntu-desktop-next", "label":"Ubuntu Desktop Next"}) TAB_LABEL.append({"dist":"other", "label":_("Other")}) global ISOLIST @@ -137,7 +142,7 @@ ######## Obtaining the settings from the Preferences Class ######## ################################################################### - logging.debug(_("Instancing Preferences...")) + logger.debug(_("Instancing Preferences...")) dlg = PreferencesTestdrivegtkDialog.PreferencesTestdrivegtkDialog() self.td = dlg.get_preferences() @@ -220,12 +225,12 @@ output = "" if self.notified is True: return False - logging.info(_("Checking available ISOs at the ISO tracker [http://iso.qa.ubuntu.com] every %s seconds") % time) + logger.info(_("Checking available ISOs at the ISO tracker [http://iso.qa.ubuntu.com] every %s seconds") % time) try: #(status, output) = commands.getstatusoutput("wget -q -O- http://iso.qa.ubuntu.com/qatracker/dllist") (status, output) = commands.getstatusoutput("wget -q -O- http://iso.qa.ubuntu.com/qatracker | egrep 'iso.qa.ubuntu.com/qatracker/test'") except: - logging.error(_("Unable to check the ISO tracker")) + logger.error(_("Unable to check the ISO tracker")) # If output is not empty, display the message if output != "": @@ -399,7 +404,7 @@ ################################################################### ### Obtains the command for the Sync process based on Protocol #### ################################################################### - logging.info(_("Obtaining the sync protocol for the specified ISO...")) + logger.info(_("Obtaining the sync protocol for the specified ISO...")) cmd = self.td.get_proto() if cmd == 1: self.on_error_dialog(_("Unsupported protocol [%s]") % self.td.PROTO) @@ -413,16 +418,16 @@ ################################################################### # Choose the virtualization engine - logging.info(_("Obtaining the virtualization method...")) + logger.info(_("Obtaining the virtualization method...")) if not self.td.VIRT: self.td.VIRT = self.td.get_virt() if self.td.VIRT == 1: - logging.error(_("Your CPU supports KVM acceleration; please install KVM")) + logger.error(_("Your CPU supports KVM acceleration; please install KVM")) self.on_warn_dialog( _("Your CPU supports KVM acceleration; please install KVM:" "\n\n" "sudo apt-get install qemu-kvm")) if self.td.VIRT == 0: - logging.error(_("Your CPU does not support acceleration; run kvm-ok for more information; then install VBox")) + logger.error(_("Your CPU does not support acceleration; run kvm-ok for more information; then install VBox")) self.on_warn_dialog( _("Your CPU does not support acceleration; run kvm-ok for more information;\n" "then please install VirtualBox" "\n\n" @@ -436,11 +441,11 @@ ################################################################### # Try to retrieve the ISO list from the cache - logging.info(_("Retrieving the Ubuntu ISO list from cache...")) + logger.info(_("Retrieving the Ubuntu ISO list from cache...")) try: isos = self.td.get_ubuntu_iso_list() except: - logging.error(_("Unable to retrieve the Ubuntu ISO list from cache...")) + logger.error(_("Unable to retrieve the Ubuntu ISO list from cache...")) self.on_error_dialog(_("Unable to retrieve the Ubuntu ISO list from cache...")) return [] return isos @@ -734,15 +739,14 @@ # Selecting virt method and Instancing VIRT object if self.td.VIRT == "kvm": - logging.info(_("Using KVM for virtual machine hosting...")) + logger.info(_("Using KVM for virtual machine hosting...")) virt = kvm.KVM(self.td) if self.td.VIRT == "virtualbox": - logging.info(_("Using VirtualBox for virtual machine hosting...")) + logger.info(_("Using VirtualBox for virtual machine hosting...")) virt = virtualbox.VBox(self.td) - if self.td.VIRT == "paralels": - logging.info(_("Using Parallels Desktop for virtual machine hosting...")) + if self.td.VIRT == "parallels": + logger.info(_("Using Parallels Desktop for virtual machine hosting...")) virt = parallels.Parallels(self.td) - # Passing VIRT object to ISOLIST ISOLIST[vm_id]["virt"] = virt ISOLIST[vm_id]["virt_type"] = self.td.VIRT @@ -794,7 +798,7 @@ except: pass else: - logging.debug(_("sync_iso: Thread is executing...")) + logger.debug(_("sync_iso: Thread is executing...")) def on_launch_button_clicked(self, widget, data=None): ################################################################### @@ -815,7 +819,7 @@ except: pass else: - logging.debug(_("launch_iso: Thread is executing or syncing...")) + logger.debug(_("launch_iso: Thread is executing or syncing...")) def on_create_iso_disk_clicked(self, widget, data=None): ################################################################### @@ -860,6 +864,7 @@ def run(self): cmd = self.command.split() + logger.debug("executing command `%s`", ' '.join(cmd)) self.p = subprocess.Popen(cmd, stdout=subprocess.PIPE, universal_newlines = True) percent = re.compile(r'(\d+)%') self.status_label.show() @@ -887,6 +892,14 @@ prev = match.group(1) text = _(" Downloading %s (%s%%)") % (os.path.basename(self.url).partition("_")[2], prev) self.status_label.set_markup("%s" % text) + if self.p and self.p.poll() and self.p.returncode > 0: + text = _(" Error downloading [%s]") % (' '.join(cmd)) + logger.error(text) + self.status_label.set_markup("%s" % text) + self.spin.stop() + self.spin.hide() + return + time.sleep(1) def stop(self): @@ -924,20 +937,24 @@ self.p = None def prepare_to_launch_vm(self): - ################################################################### - ######## Prepare the VM to launch and return launch command ####### - ################################################################### - # TODO TODO TODO - Re-add validation - self.ovirt.validate_virt() - self.ovirt.setup_virt() - return self.ovirt.launch_virt() - - def run(self): - if self.virt == "virtualbox": - text = _(" Configuring Virtual Machine...") + """Prepare the VM to launch and return launch command""" + try: + self.ovirt.validate_virt() + self.ovirt.setup_virt() + return self.ovirt.launch_virt() + except Exception as exc: + text = _("Error preparing virtualization: %s") % (exc) self.status_label.set_markup("%s" % text) self.status_label.show() + logger.error("%s", exc, exc_info=1) + + def run(self): + text = _(" Configuring Virtual Machine...") + self.status_label.set_markup("%s" % text) + self.status_label.show() command = self.prepare_to_launch_vm() + if not command: return + logger.info("Running VM command %s", command) cmd = command.split() self.p = subprocess.Popen(cmd, stdout=subprocess.PIPE) text = _(" Running Virtual Machine...") @@ -948,6 +965,7 @@ while not self.stopthread.isSet(): if self.p.poll() != None: self.status_label.set_markup("%s" % self.previous_text) + self.status_label.show() self.p = None break time.sleep(0.1) @@ -969,6 +987,7 @@ break time.sleep(2) + def stop(self): try: if self.p.poll() is None: @@ -984,10 +1003,8 @@ if __name__ == "__main__": # Support for command line options. - import logging import optparse - logger = logging.getLogger("testdrive") logger.setLevel(logging.INFO) # Logging to the console diff -Nru testdrive-3.26/ChangeLog testdrive-3.27/ChangeLog --- testdrive-3.26/ChangeLog 2014-02-03 12:47:29.000000000 +0000 +++ testdrive-3.27/ChangeLog 2015-08-06 20:20:41.000000000 +0000 @@ -1,10 +1,21 @@ -testdrive (3.26) released; urgency=low +testdrive (3.27) released; urgency=low + + [ Jackson Doak ] + * Bump default disk size to 8gb so we support ubuntu again + + [ Bryan Quigley ] + * testdriverc, testdrive/testdrive.py: + - add mouse cursor to kvm + + -- Dustin Kirkland Mon, 03 Feb 2014 15:35:26 +0200 + +testdrive (3.26-0ubuntu1) trusty; urgency=low * testdriverc: - we really need to enable kvm when launching qemu, if we expect to be able to do anything useful - -- Dustin Kirkland Mon, 27 Jan 2014 10:59:00 +0000 + -- Dustin Kirkland Mon, 03 Feb 2014 15:35:23 +0200 testdrive (3.25-0ubuntu1) trusty; urgency=low diff -Nru testdrive-3.26/data/ui/PreferencesTestdrivegtkDialog.ui testdrive-3.27/data/ui/PreferencesTestdrivegtkDialog.ui --- testdrive-3.26/data/ui/PreferencesTestdrivegtkDialog.ui 2014-01-27 10:38:52.000000000 +0000 +++ testdrive-3.27/data/ui/PreferencesTestdrivegtkDialog.ui 2015-08-06 20:16:20.000000000 +0000 @@ -1003,6 +1003,36 @@ 8 + + + Ubuntu MATE + True + True + False + False + True + + + False + False + 9 + + + + + Ubuntu Desktop Next + True + True + False + False + True + + + False + False + 10 + + Other @@ -1015,7 +1045,7 @@ False False - 9 + 11 diff -Nru testdrive-3.26/debian/changelog testdrive-3.27/debian/changelog --- testdrive-3.26/debian/changelog 2014-02-03 12:48:17.000000000 +0000 +++ testdrive-3.27/debian/changelog 2015-08-06 20:20:54.000000000 +0000 @@ -1,10 +1,21 @@ +testdrive (3.27-0ubuntu1) wily; urgency=low + + [ Jackson Doak ] + * Bump default disk size to 8gb so we support ubuntu again + + [ Bryan Quigley ] + * testdriverc, testdrive/testdrive.py: + - add mouse cursor to kvm + + -- Dustin Kirkland Mon, 03 Feb 2014 15:35:26 +0200 + testdrive (3.26-0ubuntu1) trusty; urgency=low * testdriverc: - we really need to enable kvm when launching qemu, if we expect to be able to do anything useful - -- Dustin Kirkland Mon, 27 Jan 2014 10:59:00 +0000 + -- Dustin Kirkland Mon, 03 Feb 2014 15:35:23 +0200 testdrive (3.25-0ubuntu1) trusty; urgency=low diff -Nru testdrive-3.26/po/testdrive.pot testdrive-3.27/po/testdrive.pot --- testdrive-3.26/po/testdrive.pot 2014-02-03 12:48:23.000000000 +0000 +++ testdrive-3.27/po/testdrive.pot 2015-08-06 20:20:57.000000000 +0000 @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-02-03 14:48+0200\n" +"POT-Creation-Date: 2015-08-06 15:20-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -29,43 +29,43 @@ msgid "ISO;Testing;Ubuntu;Daily;VM;Virtual Machine;zsync;rsync;Testdrive" msgstr "" -#: ../bin/testdrive-gtk.py:50 +#: ../bin/testdrive-gtk.py:55 msgid "Other" msgstr "" #. ################################################################## #. ####### Obtaining the settings from the Preferences Class ######## #. ################################################################## -#: ../bin/testdrive-gtk.py:140 +#: ../bin/testdrive-gtk.py:145 msgid "Instancing Preferences..." msgstr "" -#: ../bin/testdrive-gtk.py:223 +#: ../bin/testdrive-gtk.py:228 #, python-format msgid "" "Checking available ISOs at the ISO tracker [http://iso.qa.ubuntu.com] every " "%s seconds" msgstr "" -#: ../bin/testdrive-gtk.py:228 +#: ../bin/testdrive-gtk.py:233 msgid "Unable to check the ISO tracker" msgstr "" -#: ../bin/testdrive-gtk.py:266 +#: ../bin/testdrive-gtk.py:271 #, python-format msgid "Release: %s" msgstr "" -#: ../bin/testdrive-gtk.py:267 +#: ../bin/testdrive-gtk.py:272 #, python-format msgid "ISO Repository: http://%s.ubuntu.com/" msgstr "" -#: ../bin/testdrive-gtk.py:307 +#: ../bin/testdrive-gtk.py:312 msgid "Add an ISO to TestDrive" msgstr "" -#: ../bin/testdrive-gtk.py:323 +#: ../bin/testdrive-gtk.py:328 msgid "" "Unable to open because 'testdrive' is not installed.\n" "Please install testdrive: \n" @@ -73,18 +73,18 @@ "sudo apt-get install testdrive-cli" msgstr "" -#: ../bin/testdrive-gtk.py:327 +#: ../bin/testdrive-gtk.py:332 msgid "TestDrive an ISO or Disk Image" msgstr "" #. ################################################################## #. ## Obtains the command for the Sync process based on Protocol #### #. ################################################################## -#: ../bin/testdrive-gtk.py:402 +#: ../bin/testdrive-gtk.py:407 msgid "Obtaining the sync protocol for the specified ISO..." msgstr "" -#: ../bin/testdrive-gtk.py:405 ../bin/testdrive.py:375 +#: ../bin/testdrive-gtk.py:410 ../bin/testdrive.py:379 #, python-format msgid "Unsupported protocol [%s]" msgstr "" @@ -93,28 +93,28 @@ #. #### Obtains the Virtualization Method, if not shows warnings #### #. ################################################################## #. Choose the virtualization engine -#: ../bin/testdrive-gtk.py:416 +#: ../bin/testdrive-gtk.py:421 msgid "Obtaining the virtualization method..." msgstr "" -#: ../bin/testdrive-gtk.py:420 +#: ../bin/testdrive-gtk.py:425 msgid "Your CPU supports KVM acceleration; please install KVM" msgstr "" -#: ../bin/testdrive-gtk.py:421 +#: ../bin/testdrive-gtk.py:426 msgid "" "Your CPU supports KVM acceleration; please install KVM:\n" "\n" "sudo apt-get install qemu-kvm" msgstr "" -#: ../bin/testdrive-gtk.py:425 +#: ../bin/testdrive-gtk.py:430 msgid "" "Your CPU does not support acceleration; run kvm-ok for more information; " "then install VBox" msgstr "" -#: ../bin/testdrive-gtk.py:426 +#: ../bin/testdrive-gtk.py:431 msgid "" "Your CPU does not support acceleration; run kvm-ok for more information;\n" "then please install VirtualBox\n" @@ -127,124 +127,134 @@ #. ### Obtains the list of ISO available from the iso list cache #### #. ################################################################## #. Try to retrieve the ISO list from the cache -#: ../bin/testdrive-gtk.py:439 ../bin/testdrive.py:348 +#: ../bin/testdrive-gtk.py:444 ../bin/testdrive.py:352 msgid "Retrieving the Ubuntu ISO list from cache..." msgstr "" -#: ../bin/testdrive-gtk.py:443 ../bin/testdrive-gtk.py:444 -#: ../bin/testdrive.py:352 +#: ../bin/testdrive-gtk.py:448 ../bin/testdrive-gtk.py:449 +#: ../bin/testdrive.py:356 msgid "Unable to retrieve the Ubuntu ISO list from cache..." msgstr "" -#: ../bin/testdrive-gtk.py:564 ../bin/testdrive-gtk.py:599 -#: ../bin/testdrive-gtk.py:906 +#: ../bin/testdrive-gtk.py:569 ../bin/testdrive-gtk.py:604 +#: ../bin/testdrive-gtk.py:919 #, python-format msgid " CACHE: [%s]" msgstr "" -#: ../bin/testdrive-gtk.py:566 ../bin/testdrive-gtk.py:601 -#: ../bin/testdrive-gtk.py:908 +#: ../bin/testdrive-gtk.py:571 ../bin/testdrive-gtk.py:606 +#: ../bin/testdrive-gtk.py:921 msgid " CACHE: [empty]" msgstr "" -#: ../bin/testdrive-gtk.py:629 +#: ../bin/testdrive-gtk.py:634 msgid "There are no Other ISOs yet..." msgstr "" -#: ../bin/testdrive-gtk.py:632 +#: ../bin/testdrive-gtk.py:637 msgid "There are no ISOs for this architecture yet..." msgstr "" #. Add Button -#: ../bin/testdrive-gtk.py:666 +#: ../bin/testdrive-gtk.py:671 msgid "Add ISO" msgstr "" #. Create Buttons -#: ../bin/testdrive-gtk.py:673 +#: ../bin/testdrive-gtk.py:678 msgid "Create USB Disk" msgstr "" -#: ../bin/testdrive-gtk.py:678 +#: ../bin/testdrive-gtk.py:683 msgid "Sync" msgstr "" -#: ../bin/testdrive-gtk.py:683 +#: ../bin/testdrive-gtk.py:688 msgid "Launch" msgstr "" -#: ../bin/testdrive-gtk.py:737 ../bin/testdrive.py:264 +#: ../bin/testdrive-gtk.py:742 ../bin/testdrive.py:268 msgid "Using KVM for virtual machine hosting..." msgstr "" -#: ../bin/testdrive-gtk.py:740 ../bin/testdrive.py:266 +#: ../bin/testdrive-gtk.py:745 ../bin/testdrive.py:270 msgid "Using VirtualBox for virtual machine hosting..." msgstr "" -#: ../bin/testdrive-gtk.py:743 ../bin/testdrive.py:268 +#: ../bin/testdrive-gtk.py:748 ../bin/testdrive.py:272 msgid "Using Parallels Desktop for virtual machine hosting..." msgstr "" -#: ../bin/testdrive-gtk.py:797 +#: ../bin/testdrive-gtk.py:801 msgid "sync_iso: Thread is executing..." msgstr "" -#: ../bin/testdrive-gtk.py:818 +#: ../bin/testdrive-gtk.py:822 msgid "launch_iso: Thread is executing or syncing..." msgstr "" -#: ../bin/testdrive-gtk.py:825 +#: ../bin/testdrive-gtk.py:829 msgid "" "No ISO has been selected.\n" "\n" "Please select an ISO to create an USB Startup Disk." msgstr "" -#: ../bin/testdrive-gtk.py:830 +#: ../bin/testdrive-gtk.py:834 msgid "" "More than 1 ISO has been selected.\n" "\n" "Please select only 1 ISO to continue!" msgstr "" -#: ../bin/testdrive-gtk.py:835 +#: ../bin/testdrive-gtk.py:839 msgid "" "The specified ISO does not exist!\n" "\n" "Please, synchronize the ISO to continue." msgstr "" -#: ../bin/testdrive-gtk.py:842 +#: ../bin/testdrive-gtk.py:846 msgid "Unable to launch USB Creator!" msgstr "" -#: ../bin/testdrive-gtk.py:868 +#: ../bin/testdrive-gtk.py:873 #, python-format msgid " Downloading %s (0%%)" msgstr "" -#: ../bin/testdrive-gtk.py:888 +#: ../bin/testdrive-gtk.py:893 #, python-format msgid " Downloading %s (%s%%)" msgstr "" -#: ../bin/testdrive-gtk.py:937 +#: ../bin/testdrive-gtk.py:896 +#, python-format +msgid " Error downloading [%s]" +msgstr "" + +#: ../bin/testdrive-gtk.py:946 +#, python-format +msgid "Error preparing virtualization: %s" +msgstr "" + +#: ../bin/testdrive-gtk.py:952 msgid " Configuring Virtual Machine..." msgstr "" -#: ../bin/testdrive-gtk.py:943 +#: ../bin/testdrive-gtk.py:960 msgid " Running Virtual Machine..." msgstr "" -#: ../bin/testdrive-gtk.py:1007 +#: ../bin/testdrive-gtk.py:1024 msgid "Show debug messages" msgstr "" -#: ../bin/testdrive-gtk.py:1011 ../bin/testdrive.py:198 +#: ../bin/testdrive-gtk.py:1028 ../bin/testdrive.py:202 msgid "print version and system data, and exit" msgstr "" -#: ../bin/testdrive-gtk.py:1016 +#: ../bin/testdrive-gtk.py:1033 #, python-format msgid "testdrive-gtk %s" msgstr "" @@ -277,111 +287,104 @@ "ERROR: Invalid input\n" msgstr "" -#: ../bin/testdrive.py:77 +#: ../bin/testdrive.py:78 msgid "" "\n" "Enter an ISO URL to testdrive: " msgstr "" -#: ../bin/testdrive.py:84 -msgid "" -"\n" -"ERROR: Invalid selection\n" -msgstr "" - #: ../bin/testdrive.py:88 -#, python-format msgid "" "\n" -"%s\n" +"ERROR: Invalid selection\n" msgstr "" -#: ../bin/testdrive.py:102 ../testdrivegtk/AddOtherTestdrivegtkDialog.py:155 +#: ../bin/testdrive.py:106 ../testdrivegtk/AddOtherTestdrivegtkDialog.py:155 #, python-format msgid "Invalid ISO URL [%s]" msgstr "" -#: ../bin/testdrive.py:144 +#: ../bin/testdrive.py:148 #, python-format msgid "" "Command failed\n" " `%s`" msgstr "" -#: ../bin/testdrive.py:151 +#: ../bin/testdrive.py:155 msgid "Launching Virtual Machine using CURSES as screen mode" msgstr "" -#: ../bin/testdrive.py:196 +#: ../bin/testdrive.py:200 msgid "user configuration file (overriding default values" msgstr "" -#: ../bin/testdrive.py:200 +#: ../bin/testdrive.py:204 msgid "get ISO image from this URL location" msgstr "" -#: ../bin/testdrive.py:202 +#: ../bin/testdrive.py:206 msgid "try to launch usb-creator for further testing" msgstr "" -#: ../bin/testdrive.py:204 +#: ../bin/testdrive.py:208 msgid "hardcode Ubuntu RELEASE codename" msgstr "" -#: ../bin/testdrive.py:206 +#: ../bin/testdrive.py:210 msgid "" "hardcode Ubuntu flavor. Available Flavors:\n" " ubuntu/kubuntu/xubuntu/edubuntu/mythbuntu/ubuntustudio/lubuntu/" "ubuntukylin/ubuntugnome" msgstr "" -#: ../bin/testdrive.py:209 +#: ../bin/testdrive.py:213 msgid "" "hardcode Ubuntu repository from where to obtain ISOs:\n" " releases/cdimage/cloud-daily/cloud-releases" msgstr "" -#: ../bin/testdrive.py:212 +#: ../bin/testdrive.py:216 msgid "displays the Virtual Machine in the shell. Only valid for Cloud images." msgstr "" -#: ../bin/testdrive.py:217 +#: ../bin/testdrive.py:221 #, python-format msgid "version passed: %s" msgstr "" -#: ../bin/testdrive.py:221 +#: ../bin/testdrive.py:225 #, python-format msgid "testdrive %s" msgstr "" -#: ../bin/testdrive.py:233 +#: ../bin/testdrive.py:237 #, python-format msgid "config passed: %s" msgstr "" -#: ../bin/testdrive.py:243 +#: ../bin/testdrive.py:247 #, python-format msgid "Trying config in %s" msgstr "" -#: ../bin/testdrive.py:247 +#: ../bin/testdrive.py:251 #, python-format msgid "Using configuration in %s" msgstr "" -#: ../bin/testdrive.py:249 +#: ../bin/testdrive.py:253 #, python-format msgid "Invalid configuration [%s]" msgstr "" -#: ../bin/testdrive.py:257 +#: ../bin/testdrive.py:261 msgid "" "Your CPU supports KVM acceleration; please install KVM:\n" " sudo apt-get install qemu-kvm" msgstr "" -#: ../bin/testdrive.py:260 +#: ../bin/testdrive.py:264 msgid "" "Your CPU does not support acceleration; run kvm-ok for more information; " "then please install VirtualBox:\n" @@ -389,35 +392,35 @@ " sudo apt-get install virtualbox" msgstr "" -#: ../bin/testdrive.py:284 +#: ../bin/testdrive.py:288 msgid "" "Launching Cloud images only works with KVM. Please switch your " "virtualization method..." msgstr "" -#: ../bin/testdrive.py:335 -#: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:343 +#: ../bin/testdrive.py:339 +#: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:351 #, python-format msgid "Obtaining Ubuntu ISO list from %s..." msgstr "" -#: ../bin/testdrive.py:339 +#: ../bin/testdrive.py:343 #, python-format msgid "ERROR: Could not obtain the Ubuntu ISO list from %s..." msgstr "" -#: ../bin/testdrive.py:345 -#: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:355 +#: ../bin/testdrive.py:349 +#: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:363 msgid "Unable to update the Ubuntu ISO list cache..." msgstr "" #. BUG: should check disk space availability in CACHE dir #. Update the cache -#: ../bin/testdrive.py:371 +#: ../bin/testdrive.py:375 msgid "Syncing the specified ISO..." msgstr "" -#: ../bin/testdrive.py:378 ../testdrivegtk/AddOtherTestdrivegtkDialog.py:167 +#: ../bin/testdrive.py:382 ../testdrivegtk/AddOtherTestdrivegtkDialog.py:167 #, python-format msgid "ISO not found at [%s]" msgstr "" @@ -425,53 +428,55 @@ #. ################## #. # Launch the VM ## #. ################## -#: ../bin/testdrive.py:401 +#: ../bin/testdrive.py:405 msgid "Validating Virtualization Method...." msgstr "" -#: ../bin/testdrive.py:405 +#: ../bin/testdrive.py:409 #, python-format -msgid "Unable to validate Virtualization Method [%s]" +msgid "Unable to validate Virtualization Method [%s] (%s)" msgstr "" -#: ../bin/testdrive.py:407 +#: ../bin/testdrive.py:412 msgid "Setting up Virtual Machine..." msgstr "" -#: ../bin/testdrive.py:411 -msgid "Unable to setup Virtual Machine" +#: ../bin/testdrive.py:416 +#, python-format +msgid "Unable to setup Virtual Machine (%s)" msgstr "" -#: ../bin/testdrive.py:413 +#: ../bin/testdrive.py:418 msgid "Launching Virtual Machine..." msgstr "" -#: ../bin/testdrive.py:421 -msgid "Unable to launch Virtual Machine" +#: ../bin/testdrive.py:426 +#, python-format +msgid "Unable to launch Virtual Machine (%s)" msgstr "" -#: ../bin/testdrive.py:425 +#: ../bin/testdrive.py:430 #, python-format msgid "Cleaning up disk image [%s]..." msgstr "" #. Remind about cache cleanup -#: ../bin/testdrive.py:428 +#: ../bin/testdrive.py:433 msgid "You may wish to clean up the cache directory..." msgstr "" -#: ../bin/testdrive.py:429 +#: ../bin/testdrive.py:434 #, python-format msgid " %s and %s" msgstr "" -#: ../bin/testdrive.py:436 +#: ../bin/testdrive.py:441 msgid "" "\n" "Launch USB Startup Disk Creator for further testing of this ISO? [y/N] " msgstr "" -#: ../bin/testdrive.py:440 +#: ../bin/testdrive.py:445 msgid "" "\n" "Press to exit..." @@ -515,41 +520,41 @@ msgstr "" #: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:149 -#: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:502 +#: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:514 msgid "Select Release:" msgstr "" #. Load config files for local variables #. self.load_config_files(file) -#: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:219 +#: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:223 #, python-format msgid "Reading config file: [%s]" msgstr "" -#: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:221 +#: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:225 #, python-format msgid "Unable to load config file [%s]" msgstr "" -#: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:284 +#: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:288 #, python-format msgid " of %s available." msgstr "" -#: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:347 +#: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:355 #, python-format msgid "Could not obtain the Ubuntu ISO list from %s..." msgstr "" -#: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:351 +#: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:359 msgid "Updating the Ubuntu ISO list cache..." msgstr "" -#: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:359 +#: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:367 msgid "get_preferences()" msgstr "" -#: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:484 +#: ../testdrivegtk/PreferencesTestdrivegtkDialog.py:496 #, python-format msgid "Unable to clean up files from [%s]" msgstr "" diff -Nru testdrive-3.26/setup.py testdrive-3.27/setup.py --- testdrive-3.26/setup.py 2014-01-27 10:59:00.000000000 +0000 +++ testdrive-3.27/setup.py 2014-02-03 13:35:26.000000000 +0000 @@ -93,7 +93,7 @@ DistUtilsExtra.auto.setup( name='testdrive', - version='3.26', + version='3.27', license='GPL-3', author='Andres Rodriguez', author_email='andreserl@ubuntu.com', diff -Nru testdrive-3.26/testdrive/testdrive.py testdrive-3.27/testdrive/testdrive.py --- testdrive-3.26/testdrive/testdrive.py 2014-01-27 10:38:52.000000000 +0000 +++ testdrive-3.27/testdrive/testdrive.py 2015-08-06 20:19:47.000000000 +0000 @@ -31,6 +31,8 @@ "kubuntu-active":"kubuntu", "ubuntukylin":"ubuntukylin", "ubuntu-gnome":"ubuntugnome", + "ubuntu-mate":"ubuntumate", + "ubuntu-desktop-next":"ubuntudesktopnext", } @@ -44,6 +46,8 @@ "ubuntu-server":"Ubuntu", "ubuntukylin":"UbuntuKylin", "ubuntu-gnome":"Ubuntu Gnome", + "ubuntu-mate":"Ubuntu MATE", + "ubuntu-desktop-next":"Ubuntu Desktop Next", "cloud-server":"Cloud Server", "cloud-desktop":"Cloud Desktop", } @@ -210,7 +214,7 @@ self.SMP = commands.getoutput("grep -c ^processor /proc/cpuinfo") if len(self.DISK_SIZE) == 0: - self.DISK_SIZE = "6G" + self.DISK_SIZE = "8G" if len(self.MEM) == 0: total = commands.getoutput("grep ^MemTotal /proc/meminfo | awk '{print $2}'") @@ -226,7 +230,7 @@ self.MEM = "256" if len(self.KVM_ARGS) == 0: - self.KVM_ARGS = "-usb -usbdevice tablet -net nic,model=virtio -net user -soundhw es1370" + self.KVM_ARGS = "-usb -usbdevice mouse -usbdevice tablet -net nic,model=virtio -net user -soundhw es1370 -vga cirrus -show-cursor -enable-kvm" if len(self.VBOX_NAME) == 0: self.VBOX_NAME = self.PKG @@ -260,7 +264,7 @@ def get_proto(self): if self.PROTO == "rsync": - cmd = "rsync -azPL %s %s" % (self.ISO_URL, self.PATH_TO_ISO) + cmd = "rsync --contimeout=5 --timeout=10 -azPL %s %s" % (self.ISO_URL, self.PATH_TO_ISO) return cmd elif self.PROTO == "zsync" or self.PROTO == "http" or self.PROTO == "ftp": if commands.getstatusoutput("which zsync")[0] == 0: diff -Nru testdrive-3.26/testdrive/virt/base.py testdrive-3.27/testdrive/virt/base.py --- testdrive-3.26/testdrive/virt/base.py 1970-01-01 00:00:00.000000000 +0000 +++ testdrive-3.27/testdrive/virt/base.py 2015-08-06 20:16:20.000000000 +0000 @@ -0,0 +1,16 @@ + +import os + + +class VirtException(Exception): + pass + + +class VirtBase(object): + + def run(self, cmd): + return(os.system(cmd)) + + def run_or_die(self, cmd): + if self.run(cmd) != 0: + raise VirtException("Failed executing command: `%s`" % cmd) diff -Nru testdrive-3.26/testdrive/virt/kvm.py testdrive-3.27/testdrive/virt/kvm.py --- testdrive-3.26/testdrive/virt/kvm.py 2013-08-27 16:12:15.000000000 +0000 +++ testdrive-3.27/testdrive/virt/kvm.py 2015-08-06 20:16:20.000000000 +0000 @@ -19,11 +19,16 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +import sys import commands, os, uuid, logging +from .base import VirtException, VirtBase + + logger = logging.getLogger("testdrive.virt.kvm") -class KVM: + +class KVM(VirtBase): def __init__(self, td): self.p = td.p @@ -45,19 +50,35 @@ def validate_virt(self): (status, output) = commands.getstatusoutput("kvm-ok") if status != 0: - logger.info(output) + logger.warn("kvm-ok failed: %s", output) + (status, output) = commands.getstatusoutput("dpkg -l qemu-utils") + if status != 0: + raise VirtException("Package qemu-utils is not installed.") + + def get_kvm_img_path(self): + """Get kvm-img or qemu-img path and return it. + + Fall back to deprecated kvm-img. It may appear to be better + to call just `which qemu-img kvm-img` but this way is cleaner. + """ + for cmd in ['qemu-img', 'kvm-img']: + status, output = commands.getstatusoutput('which %s' % (cmd)) + if status == 0 and output: + return output.strip() + raise VirtException("Can not find qemu-img nor kvm-img!") # Code to setup virtual machine def setup_virt(self): + kvm_img = self.get_kvm_img_path() if self.p == 'cloud-daily' or self.p == 'cloud-releases': #path = "%s/%s" % (self.CACHE_ISO, self.PATH_TO_ISO.split(".tar.gz")[0].split("_")[-1]) path = "%s/%s" % (self.CACHE_ISO, os.path.basename(self.PATH_TO_ISO).split(".tar.gz")[0]) self.ORIG_DISK = "%s.img" % path self.FLOPPY_FILE = "%s-floppy" % path - self.run_or_die("kvm-img create -f qcow2 -b %s %s" % (self.ORIG_DISK, self.DISK_FILE)) + self.run_or_die("%s create -f qcow2 -b %s %s" % (kvm_img, self.ORIG_DISK, self.DISK_FILE)) elif not os.path.exists(self.DISK_FILE) or self.is_disk_empty(): - logger.info("Creating disk image [%s]..." % self.DISK_FILE) - self.run_or_die("kvm-img create -f qcow2 %s %s" % (self.DISK_FILE, self.DISK_SIZE)) + logger.info("Creating disk image [%s] with [size:%s]..." % (self.DISK_FILE, self.DISK_SIZE)) + self.run_or_die("%s create -f qcow2 %s %s" % (kvm_img, self.DISK_FILE, self.DISK_SIZE)) # Code launch virtual machine def launch_virt(self): @@ -69,9 +90,3 @@ cmd = "qemu-system-x86_64 -uuid %s -m %s -smp %s -cdrom %s -drive file=%s,if=virtio,cache=writeback,index=0 %s" % (UUID, self.MEM, self.SMP, self.PATH_TO_ISO, self.DISK_FILE, self.KVM_ARGS) return cmd - def run(self, cmd): - return(os.system(cmd)) - - def run_or_die(self, cmd): - if self.run(cmd) != 0: - logger.error("Command failed\n `%s`" % cmd) diff -Nru testdrive-3.26/testdrive/virt/parallels.py testdrive-3.27/testdrive/virt/parallels.py --- testdrive-3.26/testdrive/virt/parallels.py 2013-08-27 16:12:15.000000000 +0000 +++ testdrive-3.27/testdrive/virt/parallels.py 2015-08-06 20:16:20.000000000 +0000 @@ -19,9 +19,16 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +import logging import commands, os, time -class Parallels: +from .base import VirtBase, VirtException + + +logger = logging.getLogger(__name__) + + +class Parallels(VirtBase): def __init__(self, td): self.HOME = td.HOME @@ -32,8 +39,11 @@ self.DISK_SIZE = td.DISK_SIZE self.VBOX_NAME = td.VBOX_NAME - # Code to validate if virtualization is installed/supported def validate_virt(self): + """validate if virtualization is installed/supported""" + if commands.getstatusoutput("which prlctl")[0] != 0: + raise VirtException("prlctl not found") + if commands.getstatusoutput("prlctl list %s | grep -qsv \"UUID\"" % self.VBOX_NAME)[0] == 0: self.run_or_die("prlctl delete %s" % self.VBOX_NAME) @@ -55,11 +65,3 @@ # Loop as long as this VM is running #while commands.getstatusoutput("prlctl list %s | grep -qs stopped" % self.td.VBOX_NAME)[0] != 0: # time.sleep(2) - - def run(self, cmd): - return(os.system(cmd)) - - def run_or_die(self, cmd): - if self.run(cmd) != 0: - #error("Command failed\n `%s`" % cmd) - print "Command failed\n `%s`" % cmd diff -Nru testdrive-3.26/testdrive/virt/virtualbox.py testdrive-3.27/testdrive/virt/virtualbox.py --- testdrive-3.26/testdrive/virt/virtualbox.py 2014-01-27 10:38:52.000000000 +0000 +++ testdrive-3.27/testdrive/virt/virtualbox.py 2015-08-06 20:16:20.000000000 +0000 @@ -21,9 +21,13 @@ import commands, os, time, logging +from .base import VirtException, VirtBase + + logger = logging.getLogger("testdrive.virt.vbox") -class VBox: + +class VBox(VirtBase): def __init__(self, td): self.vboxversion = None @@ -42,19 +46,32 @@ return True return False + def get_vboxversion(self): + status, verstr = commands.getstatusoutput("VBoxManage --version") + if status != 0: + raise VirtException("No VirtualBox found") + try: + self.vboxversion = (int(verstr.split(".")[0]), + int(verstr.split(".")[1])) + except (IndexError, ValueError) as exc: + raise VirtException("Can not extract version " + "[VBoxManage --version]") + + # Code to validate if virtualization is installed/supported def validate_virt(self): # Determine which version of VirtualBox we have installed. What is returned is # typically a string such as '4.1.0r55467', lets assume that the command line # is consistent within 4.x.x versions extract this part of the # version string for comparison later - self.vboxversion = commands.getoutput("VBoxManage --version") - self.vboxversion = ( int(self.vboxversion.split(".")[0]), int(self.vboxversion.split(".")[1]) ) - if self.vboxversion == (4,0) or self.vboxversion == (4,1) or self.vboxversion == (4,2) or self.vboxversion == (4,3): + self.vboxversion = self.get_vboxversion() + supported_versions = ((4,0), (4,1), (4,2), (4,3)) + if self.vboxversion in supported_versions: logger.info("VirtualBox %s.%s detected." % self.vboxversion) else: - logger.error("ERROR: Unsupported version (%s.%s) of VirtualBox; please install v4.0 or newer." % self.vboxversion) - exit(0) + err_text = ("Unsupported version (%s.%s) of VirtualBox; " + "please install v4.0 or newer.") % self.vboxversion + raise VirtException(err_text) # Code to setup virtual machine def setup_virt(self): @@ -104,10 +121,3 @@ # Loop as long as this VM is running #while commands.getstatusoutput("VBoxManage list runningvms | grep -qs %s" % self.td.VBOX_NAME)[0] == 0: # time.sleep(2) - - def run(self, cmd): - return(os.system(cmd)) - - def run_or_die(self, cmd): - if self.run(cmd) != 0: - logger.error("Command failed\n `%s`" % cmd) diff -Nru testdrive-3.26/testdrivegtk/PreferencesTestdrivegtkDialog.py testdrive-3.27/testdrivegtk/PreferencesTestdrivegtkDialog.py --- testdrive-3.26/testdrivegtk/PreferencesTestdrivegtkDialog.py 2014-01-27 10:38:52.000000000 +0000 +++ testdrive-3.27/testdrivegtk/PreferencesTestdrivegtkDialog.py 2015-08-06 20:16:20.000000000 +0000 @@ -201,6 +201,10 @@ self.chk_flavor_ubuntukylin.connect("clicked", self.on_select_flavors) self.chk_flavor_ubuntugnome = self.builder.get_object("chk_flavor_ubuntugnome") self.chk_flavor_ubuntugnome.connect("clicked", self.on_select_flavors) + self.chk_flavor_ubuntumate = self.builder.get_object("chk_flavor_ubuntumate") + self.chk_flavor_ubuntumate.connect("clicked", self.on_select_flavors) + self.chk_flavor_ubuntudesktopnext = self.builder.get_object("chk_flavor_ubuntudesktopnext") + self.chk_flavor_ubuntudesktopnext.connect("clicked", self.on_select_flavors) self.chk_flavor_other = self.builder.get_object("chk_flavor_other") self.chk_flavor_other.connect("clicked", self.on_select_flavors) @@ -306,6 +310,10 @@ self.chk_flavor_ubuntukylin.set_active(True) elif flavor == 'ubuntugnome': self.chk_flavor_ubuntugnome.set_active(True) + elif flavor == 'ubuntu-mate': + self.chk_flavor_ubuntumate.set_active(True) + elif flavor == 'ubuntu-desktop-next': + self.chk_flavor_ubuntudesktopnext.set_active(True) elif flavor == 'other': self.chk_flavor_other.set_active(True) else: @@ -453,6 +461,10 @@ self.flavors = self.flavors + "ubuntukylin, " if self.chk_flavor_ubuntugnome.get_active(): self.flavors = self.flavors + "ubuntugnome, " + if self.chk_flavor_ubuntumate.get_active(): + self.flavors = self.flavors + "ubuntu-mate, " + if self.chk_flavor_ubuntudesktopnext.get_active(): + self.flavors = self.flavors + "ubuntu-desktop-next, " if self.chk_flavor_other.get_active(): self.flavors = self.flavors + "other, " @@ -481,7 +493,7 @@ path = "%s/%s" % (cache_path, file) os.unlink(path) except: - on_error_dlg(_("Unable to clean up files from [%s]") % cache_path) + self.on_error_dlg(_("Unable to clean up files from [%s]") % cache_path) def on_select_iso_image_repo(self, widget): ################################################################## diff -Nru testdrive-3.26/testdriverc testdrive-3.27/testdriverc --- testdrive-3.26/testdriverc 2014-02-03 12:46:52.000000000 +0000 +++ testdrive-3.27/testdriverc 2015-08-06 20:19:47.000000000 +0000 @@ -41,16 +41,16 @@ # DISK_SIZE is the size of the disk image # Note that this will be a sparse, qcow2 file, so it should not actually # take that much space on the filesystem. -# Default: 6G +# Default: 8G #DISK_Size = 4G -DISK_SIZE = 6G -#DISK_SIZE = 8G +#DISK_SIZE = 6G +DISK_SIZE = 8G #DISK_SIZE = 10G #Disk_SIZE = 16G # KVM_ARGS is a string of arbitrary KVM_ARGS to use when launching the VM # See kvm(1) for a comprehensive list of arguments -KVM_ARGS = -usb -usbdevice tablet -net nic,model=virtio -net user -soundhw es1370 -vga cirrus -enable-kvm +KVM_ARGS = -usb -usbdevice mouse -usbdevice tablet -net nic,model=virtio -net user -soundhw es1370 -vga cirrus -show-cursor -enable-kvm # Uncomment the following line if you want to hardcode the Ubuntu Repository # from where the ISO's are going to be retrieved; otherwise, they will be