예제 #1
0
 def setUp(self):
     self.conf = "cloud.conf"
     self.bucket = "test-bucket"
     self.imgName = "bfebs-centos-vmwaretools-i386.img"
     self.imgUrl =  "http://mirror.qa.eucalyptus-systems.com/bfebs-image/vmware/"     
     self.tester  = Eucaops( config_file=self.conf, password="******" )
     self.source  = "source " + self.tester.credpath + "/eucarc && "
     self.iu = ImageUtils(tester=self.tester, config_file=self.conf )
     self.doAuth()
예제 #2
0
 def setUp(self):
     self.conf = "cloud.conf"
     self.tester = Eucaops(config_file=self.conf, password="******")
     self.iu = ImageUtils(tester=self.tester, config_file=self.conf)
     self.imgName = "bfebs-centos-vmwaretools-i386.img"
     self.imgUrl = "http://mirror.qa.eucalyptus-systems.com/bfebs-image/vmware/"
     self.errorMsg = "all associated instances must be in the terminated state."
     self.count = 0
     self.doAuth()
예제 #3
0
    def setUp(self):

        self.conf = "cloud.conf"       
        self.imgName = "windowsserver2003r2_ent_x64.kvm.img"
        self.tester  = Eucaops( config_file=self.conf, password="******" )
        self.source  = "source " + self.tester.credpath + "/eucarc && "
        self.clc1 = self.tester.service_manager.get_enabled_clc() 
        self.iu = ImageUtils(tester=self.tester, config_file=self.conf )
        self.iu.create_emi_from_url( "http://192.168.7.65/windows_images/" + self.imgName )
        self.doAuth()
예제 #4
0
 def get_windows_image(self):
     # Check for windows image if there is not one get it.
     try:
         self.emi = self.tester.get_emi(location='windows')
     except:
         self.iu = ImageUtils(tester=self.tester, config_file=self.conf)
         self.iu.create_emi_from_url(
             "http://mirror.eucalyptus-systems.com/images/windows_images/" +
             self.imgName)
         self.emi = self.tester.get_emi(location='windows')
예제 #5
0
 def create_image_from_url(self, url=None):
     """
     Definition: Attempts to create a windows image from a provided URL
     """
     url = url or self.args.image_url
     if not url:
         raise ValueError('No url provided to "create_image_from_url"')
     self.debug('Attempting to create image from:' + str(url))
     image_utils = ImageUtils(tester=self.tester)
     image = image_utils.create_emi(url=url,
                                    platform='windows',
                                    kernel='windows')
     self.status('Setting launch permissions to "all" on image:' +
                 str(image.id))
     image.set_launch_permissions(group_names=['all'])
     self.debug('created image:' + str(image.id))
     self.image = image
     return image
예제 #6
0
 def __init__(self, 
              #setup eutester and test environment...
              tester=None, 
              config_file=None, 
              cred_path=None,
              password=None, 
              credpath=None, 
              eof=True,
              #Information on where to do image bundle work, and related timeouts
              destpath=None,  
              time_per_gig = 300,
              inter_bundle_timeout=120, 
              upload_timeout=0,
              work_component=None,
              component_credpath=None,
              bucketname = None,
              #Test env resources...
              group = None,
              testvolumes = [],
              testvolcount = 2,
              keypair=None, 
              zone = None,
              url=None,
              user_data=None,
              emi=None,
              private_addressing=False,
              instance_password = None,
              instance_keypath = None,
              vmtype='m1.xlarge',
              emi_location=None,
              image_path=None, #note this must be available on the work_component
              instance=None,
              win_proxy_hostname = None, 
              win_proxy_username = '******',
              win_proxy_password = None, 
              win_proxy_keypath = None,
              authports=['tcp:3389','tcp:80','tcp:443', 'tcp:5985', 'tcp:5986']
              ):
     if tester is None:
         self.tester = Eucaops( config_file=config_file,password=password,credpath=credpath)
     else:
         self.tester = tester
     self.tester.exit_on_fail = eof
     self.instance = instance
     if self.instance:
         self.instance = self.tester.get_instances(idstring=str(instance))[0]
     self.instance_keypath = instance_keypath
     self.destpath = destpath or '/tmp'
     self.bucketname = bucketname
     self.component = work_component 
     self.component_credpath = component_credpath
     self.time_per_gig = time_per_gig
     self.credpath=credpath or self.tester.credpath
     self.url = url
     self.upload_timeout = upload_timeout
     self.inter_bundle_timeout = inter_bundle_timeout
     self.iu = ImageUtils(tester=self.tester, destpath=self.destpath, time_per_gig=self.time_per_gig, work_component=self.component)
     self.group = group 
     self.keypair = keypair
     self.zonelist = []
     self.emi = self.tester.get_emi(emi)
     self.image_path = image_path
     self.emi_location = emi_location
     if zone is not None:
         self.zonelist.append(zone)
     self.testvolcount = testvolcount
     self.testvolumes = testvolumes
     self.authports=authports
     self.instance_password = instance_password
     self.vmtype= vmtype 
     self.user_data = user_data
     self.private_addressing = private_addressing
     #timeout for run instance command/test
     self.run_timeout=780 
     #setup zone list
     self.setupWindowsZones()
     #setup windows proxy 
     self.win_proxy_hostname = win_proxy_hostname
     self.proxy = None
     if win_proxy_hostname is not None:
         self.setup_proxy(win_proxy_hostname,
                          proxy_keypath = win_proxy_keypath,
                          proxy_username = win_proxy_username,
                          proxy_password = win_proxy_password,
                          debugmethod = lambda msg: self.debug(msg, traceback=2)
                          )
     self.setup_test_env()
     if self.instance and self.proxy:
             self.update_proxy_instance_data()
예제 #7
0
    def __init__(
            self,
            #setup eutester and test environment...
            tester=None,
            config_file=None,
            password=None,
            credpath=None,
            eof=True,
            #Information on where to do image bundle work, and related timeouts
            destpath=None,
            time_per_gig=300,
            inter_bundle_timeout=120,
            upload_timeout=0,
            work_component=None,
            component_credpath=None,
            bucketname=None,
            #Test env resources...
            group=None,
            testvolumes=[],
            testvolcount=2,
            keypair=None,
            zone=None,
            url=None,
            user_data=None,
            emi=None,
            private_addressing=False,
            instance_password=None,
            instance_keypath=None,
            vmtype='m1.xlarge',
            emi_location=None,
            image_path=None,  #note this must be available on the work_component
            instance=None,
            clean_on_exit=False,
            authports=[
                'tcp:3389', 'tcp:80', 'tcp:443', 'tcp:5985', 'tcp:5986'
            ]):
        """
        Definition:
        This class is intended to hold most of the methods and state(s) needed to run an array of Windows Instance
        related tests. Most TestUnits will use a subset of these methods to define a testcase/operation. See sample
        testcases scripts which reference this class for examples and use cases.

        :param tester: eutester object
        :param config_file: eutester config file
        :param credpath: path to cloud credentials/eucarc
        :param password: password used to access remote components
        :param eof: boolean, end on failure
        :param destpath: path on 'work component' in which to peform work. ie: where to download and bundle an img.
        :param time_per_gig: Time in seconds to be used for image related timeouts
        :param inter_bundle_timeout: Time to wait between bundle operation. Mainly used to detect hung operations
        :param upload_timeout: Time to wait for the upload portion of image operation
        :param work_component: The component or machine in which work is to be executed on, ie download, bundles, etc.
        :param component_credpath: The path on the 'work_component' in which to find creds. ie for tools exectuted remotely
        :param bucketname: Bucketname to be used as a global for operations in this test.
        :param group: Security group to use for this test
        :param testvolumes: List of volumes that are intended to be used in by this obj's test(s)
        :param testvolcount: Number of volumes to be used for ebs related tests defined in this test obj
        :param keypair: keypair ot be used for this test(s)
        :param zone: zone/cluster to be used to executue these tests
        :param url: url to use for fetching remote images to be built into EMI(s) for this test
        :param user_data: Any (instance) user data to be used for in this test
        :param emi: emi to be used for this test
        :param private_addressing: boolean, used to run instances w/o a public ip
        :param instance_password: password used for accessing instance(s) within this test
        :param instance_keypath: keypath used to access instance(s) within this test
        :param vmtype: type of vm to use when running instance(s) in this test, ie m1.xlarge
        :param emi_location: string used to find an existing EMI by the EMI's location-string
        :param image_path: path to an image on the local machine or work component
        :param instance: existing instance to use within this test
        :param win_proxy_hostname: The ip or FQDN of the machine used to proxy powershell and ldap tests against
        :param win_proxy_username: The user name for ssh login on the machine used to  proxy powershell and ldap tests against
        :param win_proxy_password: The password for ssh login on the machine used to  proxy powershell and ldap tests against
        :param win_proxy_keypath: The keypath for ssh login on the machine used to  proxy powershell and ldap tests against
        :param authports: What ports should be authorized within security group for testing
        """
        self.setuptestcase()
        if tester is None:
            self.tester = Eucaops(config_file=config_file,
                                  password=password,
                                  credpath=credpath)
        else:
            self.tester = tester
        self.tester.exit_on_fail = eof
        self.instance = instance
        if self.instance:
            self.instance = self.tester.get_instances(
                idstring=str(instance))[0]
        self.instance_keypath = instance_keypath
        self.destpath = destpath or '/tmp'
        self.bucketname = bucketname
        self.component = work_component
        self.component_credpath = component_credpath
        self.time_per_gig = time_per_gig
        self.credpath = credpath or self.tester.credpath
        self.url = url
        self.upload_timeout = upload_timeout
        self.inter_bundle_timeout = inter_bundle_timeout
        self.iu = ImageUtils(tester=self.tester,
                             destpath=self.destpath,
                             time_per_gig=self.time_per_gig,
                             work_component=self.component)
        self.group = group
        self.keypair = keypair
        self.zonelist = []
        self.emi = self.tester.get_emi(emi)
        self.image_path = image_path
        self.emi_location = emi_location
        if zone is not None:
            self.zonelist.append(zone)
        self.testvolcount = testvolcount
        self.testvolumes = testvolumes
        self.authports = authports
        self.instance_password = instance_password
        self.vmtype = vmtype
        self.user_data = user_data
        self.private_addressing = private_addressing
        #timeout for run instance command/test
        self.run_timeout = 780
        #setup zone list
        self.setupWindowsZones()
        #setup windows proxy
        self.setup_test_env()