Example #1
0
    def _createCreator(self, image, script_file=""):
        Util.generateSshKeyPair(self.sshKey)
        options = {}

        options["marketplaceEndpointNewimage"] = getattr(self, "marketplaceEndpointUpload", "")

        options["authorEmail"] = self.authorEmailCreateImage
        options["saveDisk"] = True

        options["instanceType"] = "c1.medium"

        options["verboseLevel"] = self.verboseLevel

        options["author"] = "Jane Tester"
        options["comment"] = "NB! Test image."
        options["newImageGroupVersion"] = "1.99"
        options["newImageGroupName"] = "base"
        options["newInstalledSoftwareName"] = "Linux"
        options["newInstalledSoftwareVersion"] = "0.0"
        options["excludeFromCreatedImage"] = "/etc/resolve.conf,/usr/sbin/pppdump"
        options["scripts"] = script_file
        options["packages"] = "python-dirq"
        # python-dirq is in Fedora base repo
        # options['extraOsReposUrls'] = 'http://download.fedora.redhat.com/pub/epel/5/i386/'

        options["installer"] = "yum"
        options["os"] = "linux"

        options["endpoint"] = self.endpoint
        options["username"] = self.testUsername
        options["password"] = self.testPassword

        options["userPublicKeyFile"] = self.sshKeyPub
        options["userPrivateKeyFile"] = self.sshKey

        options["shutdownVm"] = True

        options["marketplaceEndpoint"] = Downloader.ENDPOINT

        configHolder = ConfigHolder(options)

        return Creator(image, configHolder)
Example #2
0
    def _createRunner(self, withLocalNetwork=False, requestedIpAddress=None, persistentDiskUUID=None, image=None):
        Util.generateSshKeyPair(self.sshKey)

        if not image:
            image = self.image

        options = VmManagerInstance.defaultRunOptions()
        options["username"] = self.testUsername
        options["password"] = self.testPassword
        options["userPublicKeyFile"] = self.sshKeyPub
        options["verboseLevel"] = self.verboseLevel
        options["specificAddressRequest"] = requestedIpAddress
        options["persistentDiskUUID"] = persistentDiskUUID
        options["pdiskEndpoint"] = self.pdiskEndpoint
        options["marketplaceEndpoint"] = self.marketplaceEndpoint

        if withLocalNetwork:
            options["isLocalIp"] = True

        configHolder = ConfigHolder(options)
        return VmManagerFactory.create(image, configHolder)