Esempio n. 1
0
    def run(self, args):
        # Enable root logger as some Avocado-vt libraries use that
        handler = logging.StreamHandler()
        handler.setLevel(logging.DEBUG)
        logging.getLogger("").addHandler(handler)

        try:
            bootstrap.bootstrap(options=args, interactive=True)
            sys.exit(0)
        except process.CmdError as ce:
            if ce.result.interrupted:
                logging.info('Bootstrap command interrupted by user')
                logging.info('Command: %s', ce.command)
            else:
                logging.error('Bootstrap command failed')
                logging.error('Command: %s', ce.command)
                stderr = results_stderr_52lts(ce.result)
                if stderr:
                    logging.error('stderr output:')
                    logging.error(stderr)
                stdout = results_stdout_52lts(ce.result)
                if stdout:
                    logging.error('stdout output:')
                    logging.error(stdout)
            sys.exit(1)
        except KeyboardInterrupt:
            logging.info('Bootstrap interrupted by user')
            sys.exit(1)
Esempio n. 2
0
    def run(self, args):
        args.vt_config = None
        args.vt_verbose = True
        args.vt_log_level = 'debug'
        args.vt_console_level = 'debug'
        args.vt_config = None
        args.vt_arch = None
        args.vt_machine_type = None
        args.vt_keep_image = False
        args.vt_keep_guest_running = False
        args.vt_keep_image_between_tests = False
        args.vt_mem = 1024
        args.vt_no_filter = ''
        args.vt_qemu_bin = None
        args.vt_dst_qemu_bin = None
        args.vt_nettype = 'user'
        args.vt_only_type_specific = False
        args.vt_tests = ''
        args.vt_connect_uri = 'qemu:///system'
        args.vt_accel = 'kvm'
        args.vt_monitor = 'human'
        args.vt_smp = 1
        args.vt_image_type = 'qcow2'
        args.vt_nic_model = 'virtio_net'
        args.vt_disk_bus = 'virtio_blk'
        args.vt_vhost = 'off'
        args.vt_malloc_perturb = 'yes'
        args.vt_qemu_sandbox = 'on'
        args.vt_tests = ''
        args.show_job_log = False
        args.test_lister = True

        bootstrap.bootstrap(options=args, interactive=True)
        sys.exit(0)
Esempio n. 3
0
    def run(self, args):
        args.vt_config = None
        args.vt_verbose = True
        args.vt_log_level = 'debug'
        args.vt_console_level = 'debug'
        args.vt_arch = None
        args.vt_machine_type = None
        args.vt_keep_image = False
        args.vt_keep_guest_running = False
        args.vt_keep_image_between_tests = False
        args.vt_mem = 1024
        args.vt_no_filter = ''
        args.vt_qemu_bin = None
        args.vt_dst_qemu_bin = None
        args.vt_nettype = 'user'
        args.vt_only_type_specific = False
        args.vt_tests = ''
        args.vt_connect_uri = 'qemu:///system'
        args.vt_accel = 'kvm'
        args.vt_monitor = 'human'
        args.vt_smp = 1
        args.vt_image_type = 'qcow2'
        args.vt_nic_model = 'virtio_net'
        args.vt_disk_bus = 'virtio_blk'
        args.vt_vhost = 'off'
        args.vt_malloc_perturb = 'yes'
        args.vt_qemu_sandbox = 'on'
        args.vt_tests = ''
        args.show_job_log = False
        args.test_lister = True

        bootstrap.bootstrap(options=args, interactive=True)
        sys.exit(0)
Esempio n. 4
0
    def run(self, args):
        args.vt_config = None
        args.vt_verbose = True
        args.vt_log_level = "debug"
        args.vt_console_level = "debug"
        args.vt_arch = None
        args.vt_machine_type = None
        args.vt_keep_image = False
        args.vt_keep_guest_running = False
        args.vt_keep_image_between_tests = False
        args.vt_mem = 1024
        args.vt_no_filter = ""
        args.vt_qemu_bin = None
        args.vt_dst_qemu_bin = None
        args.vt_nettype = "user"
        args.vt_only_type_specific = False
        args.vt_tests = ""
        args.vt_connect_uri = "qemu:///system"
        args.vt_accel = "kvm"
        args.vt_monitor = "human"
        args.vt_smp = 1
        args.vt_image_type = "qcow2"
        args.vt_nic_model = "virtio_net"
        args.vt_disk_bus = "virtio_blk"
        args.vt_vhost = "off"
        args.vt_malloc_perturb = "yes"
        args.vt_qemu_sandbox = "on"
        args.vt_tests = ""
        args.show_job_log = False
        args.test_lister = True

        bootstrap.bootstrap(options=args, interactive=True)
        sys.exit(0)
    def run(self, args):
        # Enable root logger as some Avocado-vt libraries use that
        handler = logging.StreamHandler()
        handler.setLevel(logging.DEBUG)
        logging.getLogger("").addHandler(handler)

        try:
            bootstrap.bootstrap(options=args, interactive=True)
            sys.exit(0)
        except process.CmdError as ce:
            if ce.result.interrupted:
                logging.info('Bootstrap command interrupted by user')
                logging.info('Command: %s', ce.command)
            else:
                logging.error('Bootstrap command failed')
                logging.error('Command: %s', ce.command)
                stderr = results_stderr_52lts(ce.result)
                if stderr:
                    logging.error('stderr output:')
                    logging.error(stderr)
                stdout = results_stdout_52lts(ce.result)
                if stdout:
                    logging.error('stdout output:')
                    logging.error(stdout)
            sys.exit(1)
        except KeyboardInterrupt:
            logging.info('Bootstrap interrupted by user')
            sys.exit(1)
Esempio n. 6
0
    def run(self, args):
        args.vt_config = None
        args.vt_verbose = True
        args.vt_log_level = 'debug'
        args.vt_console_level = 'debug'
        args.vt_arch = None
        args.vt_machine_type = None
        args.vt_keep_image = False
        args.vt_keep_guest_running = False
        args.vt_keep_image_between_tests = False
        args.vt_mem = 1024
        args.vt_no_filter = ''
        args.vt_qemu_bin = None
        args.vt_dst_qemu_bin = None
        args.vt_nettype = 'user'
        args.vt_only_type_specific = False
        args.vt_tests = ''
        args.vt_connect_uri = 'qemu:///system'
        args.vt_accel = 'kvm'
        args.vt_monitor = 'human'
        args.vt_smp = 1
        args.vt_image_type = 'qcow2'
        args.vt_nic_model = 'virtio_net'
        args.vt_disk_bus = 'virtio_blk'
        args.vt_vhost = 'off'
        args.vt_malloc_perturb = 'yes'
        args.vt_qemu_sandbox = 'on'
        args.show_job_log = False
        args.test_lister = True

        # Enable root logger as some Avocado-vt libraries use that
        handler = logging.StreamHandler()
        handler.setLevel(logging.DEBUG)
        logging.getLogger("").addHandler(handler)

        try:
            bootstrap.bootstrap(options=args, interactive=True)
            sys.exit(0)
        except process.CmdError, ce:
            if ce.result.interrupted:
                logging.info('Bootstrap command interrupted by user')
                logging.info('Command: %s', ce.command)
            else:
                logging.error('Bootstrap command failed')
                logging.error('Command: %s', ce.command)
                if ce.result.stderr:
                    logging.error('stderr output:')
                    logging.error(ce.result.stderr)
                if ce.result.stdout:
                    logging.error('stdout output:')
                    logging.error(ce.result.stdout)
            sys.exit(1)
Esempio n. 7
0
    def run(self, args):
        args.vt_config = None
        args.vt_verbose = True
        args.vt_log_level = 'debug'
        args.vt_console_level = 'debug'
        args.vt_arch = None
        args.vt_machine_type = None
        args.vt_keep_image = False
        args.vt_keep_guest_running = False
        args.vt_keep_image_between_tests = False
        args.vt_mem = 1024
        args.vt_no_filter = ''
        args.vt_qemu_bin = None
        args.vt_dst_qemu_bin = None
        args.vt_nettype = 'user'
        args.vt_only_type_specific = False
        args.vt_tests = ''
        args.vt_connect_uri = 'qemu:///system'
        args.vt_accel = 'kvm'
        args.vt_monitor = 'human'
        args.vt_smp = 1
        args.vt_image_type = 'qcow2'
        args.vt_nic_model = 'virtio_net'
        args.vt_disk_bus = 'virtio_blk'
        args.vt_vhost = 'off'
        args.vt_malloc_perturb = 'yes'
        args.vt_qemu_sandbox = 'on'
        args.vt_tests = ''
        args.show_job_log = False
        args.test_lister = True

        try:
            bootstrap.bootstrap(options=args, interactive=True)
            sys.exit(0)
        except process.CmdError, ce:
            if ce.result.interrupted:
                logging.info('Bootstrap command interrupted by user')
                logging.info('Command: %s', ce.command)
            else:
                logging.error('Bootstrap command failed')
                logging.error('Command: %s', ce.command)
                if ce.result.stderr:
                    logging.error('stderr output:')
                    logging.error(ce.result.stderr)
                if ce.result.stdout:
                    logging.error('stdout output:')
                    logging.error(ce.result.stdout)
            sys.exit(1)
Esempio n. 8
0
    def bootstrap(self):
        from virttest import bootstrap

        test_dir = data_dir.get_backend_dir('libvirt')
        default_userspace_paths = ["/usr/bin/qemu-kvm", "/usr/bin/qemu-img"]
        bootstrap.bootstrap(test_name='libvirt', test_dir=test_dir,
                            base_dir=data_dir.get_data_dir(),
                            default_userspace_paths=default_userspace_paths,
                            check_modules=[],
                            online_docs_url=None,
                            interactive=False,
                            download_image=False,
                            selinux=True,
                            restore_image=False,
                            verbose=True,
                            update_providers=False)
        os.chdir(data_dir.get_root_dir())
Esempio n. 9
0
 def run(self, config):
     try:
         bootstrap.bootstrap(options=config, interactive=True)
         sys.exit(0)
     except process.CmdError as ce:
         if ce.result.interrupted:
             LOG.info('Bootstrap command interrupted by user')
             LOG.info('Command: %s', ce.command)
         else:
             LOG.error('Bootstrap command failed')
             LOG.error('Command: %s', ce.command)
             if ce.result.stderr_text:
                 LOG.error('stderr output:')
                 LOG.error(ce.result.stderr_text)
             if ce.result.stdout_text:
                 LOG.error('stdout output:')
                 LOG.error(ce.result.stdout_text)
         sys.exit(1)
     except KeyboardInterrupt:
         LOG.info('Bootstrap interrupted by user')
         sys.exit(1)
Esempio n. 10
0
base_dir = data_dir.get_data_dir()
default_userspace_paths = ["/usr/bin/qemu-kvm", "/usr/bin/qemu-img"]
check_modules = ["openvswitch"]
online_docs_url = "https://github.com/autotest/autotest/wiki/OpenVSwitch"
interactive = True

if __name__ == "__main__":
    import optparse
    option_parser = optparse.OptionParser()
    option_parser.add_option("-v", "--verbose",
                      action="store_true", dest="verbose",
                      help="Exhibit debug messages")
    option_parser.add_option("-r", "--restore-image",
                  action="store_true", dest="restore",
                  help="Restore image from pristine image")
    option_parser.add_option("--data-dir", action="store", dest="datadir",
                      help="Path to a data dir (that locates ISOS and images)")
    options, args = option_parser.parse_args()

    if options.datadir:
        data_dir.set_backing_data_dir(options.datadir)

    try:
        bootstrap.bootstrap(test_name, test_dir, base_dir,
                                       default_userspace_paths, check_modules,
                                       online_docs_url, interactive=interactive,
                                       restore_image=options.restore,
                                       verbose=options.verbose)
    except Exception, details:
        logging.error("Setup error: %s", details)
Esempio n. 11
0
                             action="store_true",
                             dest="verbose",
                             help="Exhibit debug messages")
    option_parser.add_option("-r",
                             "--restore-image",
                             action="store_true",
                             dest="restore",
                             help="Restore image from pristine image")
    option_parser.add_option(
        "--data-dir",
        action="store",
        dest="datadir",
        help="Path to a data dir (that locates ISOS and images)")
    options, args = option_parser.parse_args()

    if options.datadir:
        data_dir.set_backing_data_dir(options.datadir)

    try:
        bootstrap.bootstrap(test_name,
                            test_dir,
                            base_dir,
                            default_userspace_paths,
                            check_modules,
                            online_docs_url,
                            interactive=interactive,
                            restore_image=options.restore,
                            verbose=options.verbose)
    except Exception, details:
        logging.error("Setup error: %s", details)