options.username = utils.get_config_option( config, options.username, "username", "nokia" ) options.password = utils.get_config_option( config, options.password, "password", "nokia" ) options.script = utils.get_config_option( config, options.script, "script", "guest.py" ) options.python = utils.get_config_option( config, options.python, "python", "c:/python26/python.exe" ) options.snapshot = utils.get_config_option( config, options.snapshot, "snapshot", "base" ) options.vmrun = utils.get_config_option( config, options.vmrun, "vmrun" ) options.vmx = utils.get_config_option( config, options.vmx, "vmx" ) options.guestTempDir = utils.get_config_option( config, options.guestTempDir, "tempDir", "c:\\windows\\temp" ) options.ostype = utils.get_config_option( config, options.ostype, "os", "windows" ) check_option( options.vmx, "vmx-file" ) # Search the PATH and the a few extra locations for 'vmrun' if not options.vmrun: options.vmrun = utils.findVMRun() check_option( options.vmrun, "VMRUN" ) check_option( options.installer, "INSTALLER" ) check_option( options.installscript, "INSTALLSCRIPT" ) # # VM actions # vm = virtualmachine.VirtualMachine( options.vmrun, options.vmx, options.username, options.password, options.guestTempDir, options.ostype ) snapshotExists = vm.snapshotExists( options.snapshot ) if not snapshotExists: die("Could not find '{0}' snapshot, please create it in the VM.".format( options.snapshot ) )
optionParser.add_option("-c", "--checkerInstallation", dest="checkerInstallation", help="checker installation to use for post-installation checks", metavar="CHECKERINSTALLATION" ) (options, args) = optionParser.parse_args() try: configpath = utils.makeAbsolutePath( args[0], os.getcwd() ) except IndexError: optionParser.print_usage( sys.stderr ) sys.exit( 1 ) config = ConfigParser.SafeConfigParser() config.read( configpath ) #make an unary functor to create absolute paths abspath = partial( utils.makeAbsolutePath, relativeTo=os.path.dirname( configpath ) ) vmrun = utils.get_config_option( config, options.vmrun, "vmrun", utils.findVMRun() ) useGui = utils.get_config_option( config, None, "gui", "true" ).lower() == "true" createErrorSnapshots = utils.get_config_option( config, None, "createErrorSnapshots", "true" ).lower() == "true" hostType = utils.get_config_option( config, None, "type", "", "Host" ) hostLocation = utils.get_config_option( config, None, "location", "", "Host" ) hostUsername = utils.get_config_option( config, None, "username", "", "Host" ) hostPassword = utils.get_config_option( config, None, "password", "", "Host" ) cdashHost = utils.get_config_option( config, None, "host", "", "CDash" ) cdashLocation = utils.get_config_option( config, None, "location", "", "CDash" ) cdashProject = utils.get_config_option( config, None, "project", "", "CDash" ) if vmrun == None: die( "Could not find vmrun executable. Please specify it in the config file (vmrun=...) or via the --vmrun option" ) checkerInstallation = utils.get_config_option( config, options.checkerInstallation, "checkerInstallation" )
try: configpath = utils.makeAbsolutePath(args[0], os.getcwd()) except IndexError: optionParser.print_usage(sys.stderr) sys.exit(1) config = ConfigParser.SafeConfigParser() config.read(configpath) #make an unary functor to create absolute paths abspath = partial(utils.makeAbsolutePath, relativeTo=os.path.dirname(configpath)) vmrun = utils.get_config_option(config, options.vmrun, "vmrun", utils.findVMRun()) useGui = utils.get_config_option(config, None, "gui", "true").lower() == "true" createErrorSnapshots = utils.get_config_option(config, None, "createErrorSnapshots", "true").lower() == "true" hostType = utils.get_config_option(config, None, "type", "", "Host") hostLocation = utils.get_config_option(config, None, "location", "", "Host") hostUsername = utils.get_config_option(config, None, "username", "", "Host") hostPassword = utils.get_config_option(config, None, "password", "", "Host") cdashHost = utils.get_config_option(config, None, "host", "", "CDash") cdashLocation = utils.get_config_option(config, None, "location", "", "CDash") cdashProject = utils.get_config_option(config, None, "project", "", "CDash") if vmrun == None: die("Could not find vmrun executable. Please specify it in the config file (vmrun=...) or via the --vmrun option"